X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=progs%2Fdemos%2FOne%2Fone.c;h=1b35f43b73c2e3cb525837d960490c4d34da8810;hb=21c71cd089968b28ebdbbb9bf1ff4c089a03f5ca;hp=93e51447030ea62fb548a26a69b3311154e11dd6;hpb=0a2aab2b7a6b7551c718922876d89db1c23520e0;p=freeglut diff --git a/progs/demos/One/one.c b/progs/demos/One/one.c index 93e5144..1b35f43 100644 --- a/progs/demos/One/one.c +++ b/progs/demos/One/one.c @@ -22,7 +22,7 @@ #include int g_LeaveGameMode = 0; -int g_InGameMode = 1; +int g_InGameMode = 0; /* * Call this function to have some text drawn at given coordinates @@ -117,12 +117,12 @@ void SampleDisplay( void ) * And then drawn... */ glColor3f( 1, 1, 0 ); - //glutWireCube( 20.0 ); + /* glutWireCube( 20.0 ); */ glutWireTeapot( 20.0 ); - //glutWireSpher( 15.0, 15, 15 ); - //glColor3f( 0, 1, 0 ); - //glutWireCube( 30.0 ); - //glutSolidCone( 10, 20, 10, 2 ); + /* glutWireSpher( 15.0, 15, 15 ); */ + /* glColor3f( 0, 1, 0 ); */ + /* glutWireCube( 30.0 ); */ + /* glutSolidCone( 10, 20, 10, 2 ); */ /* * Don't forget about the model-view matrix @@ -258,6 +258,8 @@ int main( int argc, char** argv ) glutInit( &argc, argv ); + glutSetOption(GLUT_ACTION_ON_WINDOW_CLOSE,GLUT_ACTION_GLUTMAINLOOP_RETURNS); + subMenuA = glutCreateMenu( SampleMenu ); glutAddMenuEntry( "Sub menu A1 (01)", 1 ); glutAddMenuEntry( "Sub menu A2 (02)", 2 ); @@ -301,18 +303,24 @@ int main( int argc, char** argv ) glutGameModeString( "1024x768" ); glutGameModeString( ":32@120" ); glutGameModeString( "Toudi glupcze, Danwin bedzie moj!" ); - glutGameModeString( "640x480:16@72" ); + + glutGameModeString( "640x480:37@300" ); /* this one should fail */ + glutEnterGameMode(); + glutGameModeString( "800x600" ); /* this one is likely to succeed */ glutEnterGameMode(); + + if (glutGameModeGet(GLUT_GAME_MODE_ACTIVE)) + g_InGameMode = 1; glutDisplayFunc( SampleDisplay ); glutReshapeFunc( SampleReshape ); glutKeyboardFunc( SampleGameModeKeyboard ); glutIdleFunc( SampleIdle ); glutAttachMenu( GLUT_LEFT_BUTTON ); - printf( "current window is %ix%i+%i+%i", - glutGet( GLUT_WINDOW_X ), glutGet( GLUT_WINDOW_Y ), - glutGet( GLUT_WINDOW_WIDTH ), glutGet( GLUT_WINDOW_HEIGHT ) + printf( "current window is %ix%i at (%i,%i)\n", + glutGet( GLUT_WINDOW_WIDTH ), glutGet( GLUT_WINDOW_HEIGHT ), + glutGet( GLUT_WINDOW_X ), glutGet( GLUT_WINDOW_Y ) ); /* @@ -328,4 +336,4 @@ int main( int argc, char** argv ) return EXIT_SUCCESS; } -/*** END OF FILE ***/ +/*** END OF FILE ***/ \ No newline at end of file