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>2008-05-24 10:10:37 +0000
committerStijn Buys <ingar@osirion.org>2008-05-24 10:10:37 +0000
commita010f94390422eefa366a5f390c1f9e3ccc66fd5 (patch)
tree798f63addb6931fb08208927afff509185709c7c /src/client
parent4a4a5473b82d1f5b6f654cabac99272bce89854b (diff)
text_length functions, improved lighting, r_bbox draws bounding boxes
Diffstat (limited to 'src/client')
-rw-r--r--src/client/view.cc19
1 files changed, 13 insertions, 6 deletions
diff --git a/src/client/view.cc b/src/client/view.cc
index 5c12710..1fcedb3 100644
--- a/src/client/view.cc
+++ b/src/client/view.cc
@@ -63,13 +63,19 @@ void reset()
gl::shademodel(GL_SMOOTH);
//gl::shademodel(GL_FLAT);
+ // load identity matrices
+ gl::matrixmode(GL_MODELVIEW);
+ gl::loadidentity();
+
+ gl::matrixmode(GL_MODELVIEW);
+ gl::loadidentity();
+
// lighting
GLfloat light_position[] = { 0.0, 0.0, 0.0, 1.0 };
- GLfloat ambient_light[] = { 0.2f, 0.2f, 0.2f, 1.0f };
- GLfloat diffuse_light[] = { 0.4f, 0.4f, 0.4f, 1.0f };
- GLfloat specular_light[] = { 0.4f, 0.4f, 0.4f, 1.0f };
- GLfloat specular_reflectance[] = { 0.2f, 0.2f, 0.2f, 1.0f };
-
+ GLfloat ambient_light[] = { 0.01f, 0.01f, 0.01f, 1.0f };
+ GLfloat diffuse_light[] = { 0.2f, 0.2f, 0.2f, 1.0f };
+ GLfloat specular_light[] = { 0.2f, 0.2f, 0.2f, 1.0f };
+
glLightfv(GL_LIGHT0, GL_POSITION, light_position);
glLightfv(GL_LIGHT0, GL_AMBIENT, ambient_light);
glLightfv(GL_LIGHT0, GL_DIFFUSE, diffuse_light);
@@ -78,6 +84,7 @@ void reset()
// color tracking
glColorMaterial(GL_FRONT, GL_AMBIENT_AND_DIFFUSE);
+ 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
@@ -237,7 +244,7 @@ void frame(float seconds)
const float frustumsize = 0.25f;
gl::frustum(-frustumsize*video::aspect, frustumsize*video::aspect, -frustumsize, frustumsize, 1.0f, 1024.0f);
- gl::matrixmode(GL_MODELVIEW); // map world to screen coordinates
+ gl::matrixmode(GL_MODELVIEW);
gl::loadidentity();
camera::draw(seconds); // draw the current camera transformation