Disable/enable lighting in the "one.c" demo (John Fay)
[freeglut] / progs / demos / One / one.c
index 20349df..627630e 100644 (file)
@@ -35,6 +35,7 @@ void PrintText( int nX, int nY, char* pszText )
     /*
      * Prepare the OpenGL state
      */
+    glDisable( GL_LIGHTING );
     glDisable( GL_DEPTH_TEST );   
     glMatrixMode( GL_PROJECTION );
     glPushMatrix();
@@ -56,14 +57,14 @@ void PrintText( int nX, int nY, char* pszText )
     glLoadIdentity();
     
     /*
-     * Now the main text       
+     * Now the main text        
      */
     glColor3ub( 0, 0, 0 ); 
     glRasterPos2i( nX, nY ); 
 
     for( p=pszText, lines=0; *p; p++ )
     {
-       if( *p == '\n' )
+        if( *p == '\n' )
         {
             lines++;
             glRasterPos2i( nX, nY-(lines*18) );
@@ -71,7 +72,7 @@ void PrintText( int nX, int nY, char* pszText )
         
         glutBitmapCharacter( GLUT_BITMAP_HELVETICA_18,  *p );
     }
-       
+        
     /*
      * Revert to the old matrix modes
      */   
@@ -86,6 +87,7 @@ void PrintText( int nX, int nY, char* pszText )
      */
     glColor4f( 1.0f, 1.0f, 1.0f, 1.0f );
     glEnable( GL_DEPTH_TEST );
+    glEnable( GL_LIGHTING );
 }     
 
 /*
@@ -250,12 +252,12 @@ int main( int argc, char** argv )
 {
     int menuID, subMenuA, subMenuB;
 
-    glutInit( &argc, argv );
-
     glutInitDisplayString( "stencil~2 rgb double depth>=16 samples" );
     glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
     glutInitWindowPosition( 100, 100 );
 
+    glutInit( &argc, argv );
+
     subMenuA = glutCreateMenu( SampleMenu );
     glutAddMenuEntry( "Sub menu A1 (01)", 1 );
     glutAddMenuEntry( "Sub menu A2 (02)", 2 );
@@ -311,7 +313,7 @@ int main( int argc, char** argv )
     printf( "current window is %ix%i+%i+%i",
             glutGet( GLUT_WINDOW_X ), glutGet( GLUT_WINDOW_Y ),
             glutGet( GLUT_WINDOW_WIDTH ), glutGet( GLUT_WINDOW_HEIGHT )
-    ); 
+    );        
 
     /*
      * Enter the main FreeGLUT processing loop