Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2009-08-18 09:24:15 +0000
committerStijn Buys <ingar@osirion.org>2009-08-18 09:24:15 +0000
commitf030154fe727e25a2afe1f78b3998c2d2dba95e4 (patch)
treecd92baf9e4fa8a136523b9eb570e9811846c9250 /src/render/state.cc
parent5636fad174f0bcff857c357c394c4cc8d424b302 (diff)
astyle cleanup, corrects not loading of material textures
Diffstat (limited to 'src/render/state.cc')
-rw-r--r--src/render/state.cc23
1 files changed, 12 insertions, 11 deletions
diff --git a/src/render/state.cc b/src/render/state.cc
index 96c7c0a..1a345c7 100644
--- a/src/render/state.cc
+++ b/src/render/state.cc
@@ -1,7 +1,7 @@
/*
render/state.cc
- This file is part of the Osirion project and is distributed under
- the terms of the GNU General Public License version 2
+ This file is part of the Osirion project and is distributed under
+ the terms of the GNU General Public License version 2
*/
#include <string>
@@ -11,7 +11,8 @@
#include "render/gl.h"
#include "render/render.h"
-namespace render {
+namespace render
+{
int State::render_width = 0;
int State::render_height = 0;
@@ -23,9 +24,9 @@ void State::init(int width, int height)
resize(width, height);
render_has_generate_mipmaps = false;
-
+
std::string version(gl::version());
- for (size_t i =0; i < version.size(); i++) {
+ for (size_t i = 0; i < version.size(); i++) {
if (version[i] == '.')
version[i] = ' ';
}
@@ -54,12 +55,12 @@ void State::resize(int width, int height)
{
render_width = width;
render_height = height;
-
+
render_aspect = (float) width / (float) height;
-
+
clear();
}
-
+
void State::clear()
{
// set viewport
@@ -80,9 +81,9 @@ void State::clear()
//gl::shademodel(GL_FLAT);
// color tracking
- glColorMaterial(GL_FRONT, GL_AMBIENT_AND_DIFFUSE);
+ glColorMaterial(GL_FRONT, GL_AMBIENT_AND_DIFFUSE);
- // material settings
+ // material settings
GLfloat specular_reflectance[] = { 0.2f, 0.2f, 0.2f, 1.0f };
glMaterialfv(GL_FRONT, GL_SPECULAR, specular_reflectance);
glMateriali(GL_FRONT, GL_SHININESS, 128); // shininess 1-128
@@ -97,7 +98,7 @@ void State::clear()
gl::frontface(GL_CCW);
gl::disable(GL_CULL_FACE);
gl::disable(GL_DEPTH_TEST);
- gl::disable(GL_BLEND);
+ gl::disable(GL_BLEND);
gl::disable(GL_TEXTURE_2D);
}