summaryrefslogtreecommitdiff
path: root/cubedbus.c
diff options
context:
space:
mode:
authorDavid Mikos <david@FAMILYCOMPUTER.(none)>2008-02-16 23:48:03 +1030
committerDavid Mikos <david@FAMILYCOMPUTER.(none)>2008-02-16 23:48:03 +1030
commit57816c4ddc1c993db786d2cadb492c327d4e9b5c (patch)
treefe6be227454566102781a9787e7360caa49ef9b4 /cubedbus.c
parent76dd910e9cacd62899348ebc927b734ef7e061a9 (diff)
downloadcubedbus-57816c4ddc1c993db786d2cadb492c327d4e9b5c.tar.gz
cubedbus-57816c4ddc1c993db786d2cadb492c327d4e9b5c.tar.bz2
More settings for obj loader. Animation off by default.
Diffstat (limited to 'cubedbus.c')
-rw-r--r--cubedbus.c23
1 files changed, 20 insertions, 3 deletions
diff --git a/cubedbus.c b/cubedbus.c
index fc63b2c..849ed8e 100644
--- a/cubedbus.c
+++ b/cubedbus.c
@@ -347,7 +347,11 @@ cubedbusPaintInside (CompScreen *s,
CUBEDBUS_SCREEN (s);
CUBE_SCREEN (s);
- Bool enabled;
+ static const float lmodel_ambient[] = { 0.4, 0.4, 0.4, 0.4 };
+ static const float lmodel_localviewer[] = { 0.0 };
+
+
+ Bool enabled;
ScreenPaintAttrib sA = *sAttrib;
@@ -366,6 +370,8 @@ cubedbusPaintInside (CompScreen *s,
glPushAttrib (GL_COLOR_BUFFER_BIT | GL_TEXTURE_BIT | GL_LIGHTING_BIT);
+ glEnable (GL_BLEND);
+
enabled = glIsEnabled (GL_CULL_FACE);
glDisable(GL_CULL_FACE);
@@ -373,10 +379,21 @@ cubedbusPaintInside (CompScreen *s,
glPushMatrix();
- glDisable (GL_LIGHTING);
- glDisable (GL_COLOR_MATERIAL);
+
+ glLightModelfv (GL_LIGHT_MODEL_AMBIENT, lmodel_ambient);
+ glLightModelfv (GL_LIGHT_MODEL_LOCAL_VIEWER, lmodel_localviewer);
+
+ glEnable (GL_NORMALIZE);
+ glEnable (GL_COLOR_MATERIAL);
glEnable (GL_DEPTH_TEST);
+ glEnable (GL_LIGHTING);
+ glEnable (GL_LIGHT1);
+ glDisable (GL_LIGHT0);
+
glColor4usv (defaultColor);
+
+ glTexEnvi (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
+
/*********************************************/
CubedbusObject *obj=gs->head;