From: <fa...@us...> - 2007-11-26 08:09:42
|
Revision: 736 http://freeglut.svn.sourceforge.net/freeglut/?rev=736&view=rev Author: fayjf Date: 2007-11-26 00:09:45 -0800 (Mon, 26 Nov 2007) Log Message: ----------- Making a demo program that uses "glutMainLoopEvent" Modified Paths: -------------- trunk/freeglut/freeglut/progs/demos/Fractals/fractals.c Modified: trunk/freeglut/freeglut/progs/demos/Fractals/fractals.c =================================================================== --- trunk/freeglut/freeglut/progs/demos/Fractals/fractals.c 2007-11-12 04:06:19 UTC (rev 735) +++ trunk/freeglut/freeglut/progs/demos/Fractals/fractals.c 2007-11-26 08:09:45 UTC (rev 736) @@ -39,6 +39,9 @@ static int num_trans ; static AffineTrans *affine ; +/* Flag telling us to keep executing the main loop */ +static int continue_in_main_loop = 1; + /* the window title */ char window_title [ 80 ] ; @@ -125,7 +128,7 @@ switch (key) { case 27: /* Escape key */ - glutLeaveMainLoop () ; + continue_in_main_loop = 0 ; break; case '+' : @@ -321,8 +324,12 @@ glutSpecialFunc(Special); glutDisplayFunc(Display); - glutMainLoop(); +#ifdef WIN32 +#endif + while ( continue_in_main_loop ) + glutMainLoopEvent(); + printf ( "Back from the 'freeglut' main loop\n" ) ; return 0; /* ANSI C requires main to return int. */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |