From 6e18d018f6f927a2a1ecab2cc5e423d427d0d5db Mon Sep 17 00:00:00 2001 From: Diederick Niehorster Date: Wed, 21 Nov 2012 08:30:47 +0000 Subject: [PATCH] nicely lining up the two windows for the callbackmaker demo, small other edit git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@1464 7f0cb862-5218-0410-a997-914c9d46530a --- progs/demos/CallbackMaker/CallbackMaker.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/progs/demos/CallbackMaker/CallbackMaker.c b/progs/demos/CallbackMaker/CallbackMaker.c index 9c0d58b..1b12e5f 100644 --- a/progs/demos/CallbackMaker/CallbackMaker.c +++ b/progs/demos/CallbackMaker/CallbackMaker.c @@ -11,6 +11,8 @@ static int sequence_number = 0 ; +int windows[2] = {0}; + int reshape_called = 0, key_called = 0, special_called = 0, visibility_called = 0, keyup_called = 0, specialup_called = 0, joystick_called = 0, mouse_called = 0, mousewheel_called = 0, motion_called = 0, passivemotion_called = 0, entry_called = 0, @@ -461,7 +463,6 @@ static void Idle ( void ) int main(int argc, char *argv[]) { - int freeglut_window, aux_window ; char dummy_string[STRING_LENGTH]; int menuID, subMenuA, subMenuB; @@ -474,8 +475,8 @@ main(int argc, char *argv[]) glutInit(&argc, argv); glutSetOption(GLUT_ACTION_ON_WINDOW_CLOSE,GLUT_ACTION_CONTINUE_EXECUTION); - freeglut_window = glutCreateWindow( "Callback Demo" ); - printf ( "Creating window %d as 'Callback Demo'\n", freeglut_window ) ; + windows[0] = glutCreateWindow( "Callback Demo" ); + printf ( "Creating window %d as 'Callback Demo'\n", windows[0] ) ; glClearColor(1.0, 1.0, 1.0, 1.0); @@ -530,8 +531,10 @@ main(int argc, char *argv[]) glutAttachMenu( GLUT_LEFT_BUTTON ); - aux_window = glutCreateWindow( "Second Window" ); - printf ( "Creating window %d as 'Second Window'\n", aux_window ) ; + glutInitWindowPosition ( 140+500+2*glutGet(GLUT_WINDOW_BORDER_WIDTH), 140 ); + /* Position second window right next to the first */ + windows[1] = glutCreateWindow( "Second Window" ); + printf ( "Creating window %d as 'Second Window'\n", windows[1] ) ; glClearColor(1.0, 1.0, 1.0, 1.0); -- 1.7.10.4