From f691ba36ca8d02d1763d592843ed01921edb8979 Mon Sep 17 00:00:00 2001 From: Diederick Niehorster Date: Thu, 22 Nov 2012 05:49:53 +0000 Subject: [PATCH] cleaned up callback registering code in One demo, now its best practice git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@1467 7f0cb862-5218-0410-a997-914c9d46530a --- progs/demos/One/one.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/progs/demos/One/one.c b/progs/demos/One/one.c index 811efbf..6509c3b 100644 --- a/progs/demos/One/one.c +++ b/progs/demos/One/one.c @@ -307,6 +307,8 @@ int main( int argc, char** argv ) glutInit( &argc, argv ); glutSetOption(GLUT_ACTION_ON_WINDOW_CLOSE,GLUT_ACTION_GLUTMAINLOOP_RETURNS); + glutMenuStatusFunc( SampleMenuStatus ); + glutIdleFunc( SampleIdle ); subMenuA = glutCreateMenu( SampleMenu ); glutAddMenuEntry( "Sub menu A1 (01)", 1 ); @@ -333,9 +335,7 @@ int main( int argc, char** argv ) glutReshapeFunc( SampleReshape ); glutKeyboardFunc( SampleKeyboard ); glutSpecialFunc( SampleSpecial ); - glutIdleFunc( SampleIdle ); glutEntryFunc( SampleEntry ); - glutMenuStatusFunc( SampleMenuStatus ); glutAttachMenu( GLUT_LEFT_BUTTON ); glutInitWindowPosition( 200, 200 ); @@ -344,9 +344,7 @@ int main( int argc, char** argv ) glutReshapeFunc( SampleReshape ); glutKeyboardFunc( SampleKeyboard ); glutSpecialFunc( SampleSpecial ); - glutIdleFunc( SampleIdle ); glutEntryFunc( SampleEntry ); - glutMenuStatusFunc( SampleMenuStatus ); glutAttachMenu( GLUT_LEFT_BUTTON ); glutSetMenu(subMenuA); glutAttachMenu( GLUT_RIGHT_BUTTON ); @@ -379,9 +377,7 @@ int main( int argc, char** argv ) glutDisplayFunc( SampleDisplay ); glutReshapeFunc( SampleReshape ); glutKeyboardFunc( SampleGameModeKeyboard ); - glutIdleFunc( SampleIdle ); glutEntryFunc( SampleEntry ); - glutMenuStatusFunc( SampleMenuStatus ); glutSetMenu(menuID); glutAttachMenu( GLUT_LEFT_BUTTON ); -- 1.7.10.4