From 4a2f0ca6020179e7eaddf8ef8da8c5f3ca93cd70 Mon Sep 17 00:00:00 2001 From: fayjf Date: Thu, 17 Mar 2011 04:22:55 +0000 Subject: [PATCH] Adding more examples to 'one.c' to test the game mode string per e-mail from Diedrick Niehorster dated 3/16/11 11:06 PM. git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@904 7f0cb862-5218-0410-a997-914c9d46530a --- freeglut/freeglut/progs/demos/One/one.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/freeglut/freeglut/progs/demos/One/one.c b/freeglut/freeglut/progs/demos/One/one.c index c0f3017..dd98f99 100644 --- a/freeglut/freeglut/progs/demos/One/one.c +++ b/freeglut/freeglut/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 @@ -301,18 +301,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)", + glutGet( GLUT_WINDOW_WIDTH ), glutGet( GLUT_WINDOW_HEIGHT ), + glutGet( GLUT_WINDOW_X ), glutGet( GLUT_WINDOW_Y ) ); /*