changeset 49:2e2c3fe311da

Just glEnable(GL_COLOR_MATERIAL) globally.
author Matti Hamalainen <ccr@tnsp.org>
date Fri, 06 Dec 2019 01:12:46 +0200
parents 0ae1ff609626
children d4232c89145f
files gldragon.cpp
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/gldragon.cpp	Fri Dec 06 01:12:23 2019 +0200
+++ b/gldragon.cpp	Fri Dec 06 01:12:46 2019 +0200
@@ -216,6 +216,8 @@
     // Enable normal rescaling
     glEnable(GL_RESCALE_NORMAL);
 
+    glEnable(GL_COLOR_MATERIAL);
+
     // Setup depth buffer
     glClearDepth(1.0f);
 
@@ -245,7 +247,6 @@
     }
 
     // Set the material of the model
-    glEnable(GL_COLOR_MATERIAL);
     glColorMaterial(GL_FRONT, GL_AMBIENT_AND_DIFFUSE);
     glMateriali(GL_FRONT, GL_SHININESS, model.material.shininess);
     glMaterialfv(GL_FRONT, GL_SPECULAR, model.material.specular.values);