From a010f94390422eefa366a5f390c1f9e3ccc66fd5 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sat, 24 May 2008 10:10:37 +0000 Subject: text_length functions, improved lighting, r_bbox draws bounding boxes --- src/client/view.cc | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'src/client') 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 -- cgit v1.2.3