cleaned up callback registering code in One demo, now its best practice
git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1467 7f0cb862-5218-0410-a997-914c9d46530a
This commit is contained in:
parent
79f3a0d64d
commit
d07f4255be
@ -307,6 +307,8 @@ int main( int argc, char** argv )
|
|||||||
glutInit( &argc, argv );
|
glutInit( &argc, argv );
|
||||||
|
|
||||||
glutSetOption(GLUT_ACTION_ON_WINDOW_CLOSE,GLUT_ACTION_GLUTMAINLOOP_RETURNS);
|
glutSetOption(GLUT_ACTION_ON_WINDOW_CLOSE,GLUT_ACTION_GLUTMAINLOOP_RETURNS);
|
||||||
|
glutMenuStatusFunc( SampleMenuStatus );
|
||||||
|
glutIdleFunc( SampleIdle );
|
||||||
|
|
||||||
subMenuA = glutCreateMenu( SampleMenu );
|
subMenuA = glutCreateMenu( SampleMenu );
|
||||||
glutAddMenuEntry( "Sub menu A1 (01)", 1 );
|
glutAddMenuEntry( "Sub menu A1 (01)", 1 );
|
||||||
@ -333,9 +335,7 @@ int main( int argc, char** argv )
|
|||||||
glutReshapeFunc( SampleReshape );
|
glutReshapeFunc( SampleReshape );
|
||||||
glutKeyboardFunc( SampleKeyboard );
|
glutKeyboardFunc( SampleKeyboard );
|
||||||
glutSpecialFunc( SampleSpecial );
|
glutSpecialFunc( SampleSpecial );
|
||||||
glutIdleFunc( SampleIdle );
|
|
||||||
glutEntryFunc( SampleEntry );
|
glutEntryFunc( SampleEntry );
|
||||||
glutMenuStatusFunc( SampleMenuStatus );
|
|
||||||
glutAttachMenu( GLUT_LEFT_BUTTON );
|
glutAttachMenu( GLUT_LEFT_BUTTON );
|
||||||
|
|
||||||
glutInitWindowPosition( 200, 200 );
|
glutInitWindowPosition( 200, 200 );
|
||||||
@ -344,9 +344,7 @@ int main( int argc, char** argv )
|
|||||||
glutReshapeFunc( SampleReshape );
|
glutReshapeFunc( SampleReshape );
|
||||||
glutKeyboardFunc( SampleKeyboard );
|
glutKeyboardFunc( SampleKeyboard );
|
||||||
glutSpecialFunc( SampleSpecial );
|
glutSpecialFunc( SampleSpecial );
|
||||||
glutIdleFunc( SampleIdle );
|
|
||||||
glutEntryFunc( SampleEntry );
|
glutEntryFunc( SampleEntry );
|
||||||
glutMenuStatusFunc( SampleMenuStatus );
|
|
||||||
glutAttachMenu( GLUT_LEFT_BUTTON );
|
glutAttachMenu( GLUT_LEFT_BUTTON );
|
||||||
glutSetMenu(subMenuA);
|
glutSetMenu(subMenuA);
|
||||||
glutAttachMenu( GLUT_RIGHT_BUTTON );
|
glutAttachMenu( GLUT_RIGHT_BUTTON );
|
||||||
@ -379,9 +377,7 @@ int main( int argc, char** argv )
|
|||||||
glutDisplayFunc( SampleDisplay );
|
glutDisplayFunc( SampleDisplay );
|
||||||
glutReshapeFunc( SampleReshape );
|
glutReshapeFunc( SampleReshape );
|
||||||
glutKeyboardFunc( SampleGameModeKeyboard );
|
glutKeyboardFunc( SampleGameModeKeyboard );
|
||||||
glutIdleFunc( SampleIdle );
|
|
||||||
glutEntryFunc( SampleEntry );
|
glutEntryFunc( SampleEntry );
|
||||||
glutMenuStatusFunc( SampleMenuStatus );
|
|
||||||
glutSetMenu(menuID);
|
glutSetMenu(menuID);
|
||||||
glutAttachMenu( GLUT_LEFT_BUTTON );
|
glutAttachMenu( GLUT_LEFT_BUTTON );
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user