File tree Expand file tree Collapse file tree 3 files changed +18
-3
lines changed
Expand file tree Collapse file tree 3 files changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -23,8 +23,13 @@ void init(GLvoid) // Create Some Everyday Functions
2323 glClearDepth (1 .0f ); // Depth Buffer Setup
2424 glEnable (GL_DEPTH_TEST); // Enables Depth Testing
2525 glDepthFunc (GL_LEQUAL); // The Type Of Depth Testing To Do
26- // glEnable(GL_COLOR_MATERIAL);
2726 glHint (GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);
27+
28+ // ps2gl needs lighting + color_material for per-vertex colors
29+ glEnable (GL_COLOR_MATERIAL);
30+ glColorMaterial (GL_FRONT_AND_BACK, GL_DIFFUSE);
31+ glEnable (GL_LIGHTING);
32+ glEnable (GL_LIGHT0);
2833}
2934
3035void display (void ) // Create The Display Function
Original file line number Diff line number Diff line change @@ -26,8 +26,13 @@ void init(GLvoid) // Create Some Everyday Functions
2626 glClearDepth (1 .0f ); // Depth Buffer Setup
2727 glEnable (GL_DEPTH_TEST); // Enables Depth Testing
2828 glDepthFunc (GL_LEQUAL); // The Type Of Depth Testing To Do
29- // glEnable(GL_COLOR_MATERIAL);
3029 glHint (GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);
30+
31+ // ps2gl needs lighting + color_material for per-vertex colors
32+ glEnable (GL_COLOR_MATERIAL);
33+ glColorMaterial (GL_FRONT_AND_BACK, GL_DIFFUSE);
34+ glEnable (GL_LIGHTING);
35+ glEnable (GL_LIGHT0);
3136}
3237
3338void display (void ) // Create The Display Function
Original file line number Diff line number Diff line change @@ -26,8 +26,13 @@ void InitGL(GLvoid) // Create Some Everyday Functions
2626 glClearDepth (1 .0f ); // Depth Buffer Setup
2727 glEnable (GL_DEPTH_TEST); // Enables Depth Testing
2828 glDepthFunc (GL_LEQUAL); // The Type Of Depth Testing To Do
29- // glEnable(GL_COLOR_MATERIAL);
3029 glHint (GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);
30+
31+ // ps2gl needs lighting + color_material for per-vertex colors
32+ glEnable (GL_COLOR_MATERIAL);
33+ glColorMaterial (GL_FRONT_AND_BACK, GL_DIFFUSE);
34+ glEnable (GL_LIGHTING);
35+ glEnable (GL_LIGHT0);
3136}
3237
3338void display (void ) // Create The Display Function
You can’t perform that action at this time.
0 commit comments