X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=progs%2Fdemos%2FOne%2Fone.c;h=cf2cb1483fd017e9c7aea5e4e7e80fcebde16ab2;hb=d9b0989056a1c2267b68f01317d4641c70e48719;hp=330921e17522374941fab1494ce776dd88017ffe;hpb=1b70bc46879fc5d61f992dcf68e14c44083934da;p=freeglut diff --git a/progs/demos/One/one.c b/progs/demos/One/one.c index 330921e..cf2cb14 100644 --- a/progs/demos/One/one.c +++ b/progs/demos/One/one.c @@ -23,7 +23,7 @@ int g_LeaveGameMode = 0; int g_InGameMode = 0; -int g_mainwin, g_sw1; +int g_mainwin, g_sw1, g_sw2; /* * Call this function to have some text drawn at given coordinates @@ -109,6 +109,15 @@ void SampleDisplay( void ) glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT ); glutPostWindowRedisplay(g_mainwin); } + else if (win==g_sw2) + { + /* + * Clear the screen + */ + glClearColor(0.3f,0.3f,0.3f,1); + glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT ); + glutPostWindowRedisplay(g_mainwin); + } else { /* @@ -178,7 +187,6 @@ void SampleEntry(int state) { int window = glutGetWindow () ; printf ( "Window %d Entry Callback: %d\n", window, state ) ; - glutPostRedisplay () ; } /* @@ -321,13 +329,18 @@ int main( int argc, char** argv ) glutIdleFunc( SampleIdle ); glutAttachMenu( GLUT_LEFT_BUTTON ); glutSetMenu(subMenuA); - glutAttachMenu( GLUT_RIGHT_BUTTON); + glutAttachMenu( GLUT_RIGHT_BUTTON ); g_sw1=glutCreateSubWindow(g_mainwin,200,0,100,100); glutDisplayFunc( SampleDisplay ); glutSetMenu(subMenuB); glutAttachMenu( GLUT_LEFT_BUTTON); + g_sw2=glutCreateSubWindow(g_sw1,50,0,50,50); + glutDisplayFunc( SampleDisplay ); + glutSetMenu(menuID); + glutAttachMenu( GLUT_RIGHT_BUTTON ); + printf( "Testing game mode string parsing, don't panic!\n" ); glutGameModeString( "320x240:32@100" ); glutGameModeString( "640x480:16@72" );