Making a demo program that uses "glutMainLoopEvent"
git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@736 7f0cb862-5218-0410-a997-914c9d46530a
This commit is contained in:
parent
7f75464b6f
commit
872dbbc4ad
@ -39,6 +39,9 @@ static int num_levels = 0 ;
|
|||||||
static int num_trans ;
|
static int num_trans ;
|
||||||
static AffineTrans *affine ;
|
static AffineTrans *affine ;
|
||||||
|
|
||||||
|
/* Flag telling us to keep executing the main loop */
|
||||||
|
static int continue_in_main_loop = 1;
|
||||||
|
|
||||||
/* the window title */
|
/* the window title */
|
||||||
char window_title [ 80 ] ;
|
char window_title [ 80 ] ;
|
||||||
|
|
||||||
@ -125,7 +128,7 @@ Key(unsigned char key, int x, int y)
|
|||||||
|
|
||||||
switch (key) {
|
switch (key) {
|
||||||
case 27: /* Escape key */
|
case 27: /* Escape key */
|
||||||
glutLeaveMainLoop () ;
|
continue_in_main_loop = 0 ;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case '+' :
|
case '+' :
|
||||||
@ -321,7 +324,11 @@ main(int argc, char *argv[])
|
|||||||
glutSpecialFunc(Special);
|
glutSpecialFunc(Special);
|
||||||
glutDisplayFunc(Display);
|
glutDisplayFunc(Display);
|
||||||
|
|
||||||
glutMainLoop();
|
#ifdef WIN32
|
||||||
|
#endif
|
||||||
|
|
||||||
|
while ( continue_in_main_loop )
|
||||||
|
glutMainLoopEvent();
|
||||||
|
|
||||||
printf ( "Back from the 'freeglut' main loop\n" ) ;
|
printf ( "Back from the 'freeglut' main loop\n" ) ;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user