X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=progs%2Fdemos%2FFractals%2Ffractals.c;h=12d89894b145a0e66039d3e9103fb0992cfd73e0;hb=21c71cd089968b28ebdbbb9bf1ff4c089a03f5ca;hp=0852f1a9372c09d1404f5ad6e5881505b930bea2;hpb=a2e6f82b127ee038ef1994e65c25f24148c56a60;p=freeglut diff --git a/progs/demos/Fractals/fractals.c b/progs/demos/Fractals/fractals.c index 0852f1a..12d8989 100644 --- a/progs/demos/Fractals/fractals.c +++ b/progs/demos/Fractals/fractals.c @@ -33,12 +33,15 @@ typedef struct AffineTrans ; /* Number of levels to draw the fractal */ -static int num_levels = 0 ; +static int num_levels = 4 ; /* The definition of the fractal */ 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 @@ Key(unsigned char key, int x, int y) switch (key) { case 27: /* Escape key */ - glutLeaveMainLoop () ; + continue_in_main_loop = 0 ; break; case '+' : @@ -321,7 +324,11 @@ main(int argc, char *argv[]) glutSpecialFunc(Special); glutDisplayFunc(Display); - glutMainLoop(); +#ifdef WIN32 +#endif + + while ( continue_in_main_loop ) + glutMainLoopEvent(); printf ( "Back from the 'freeglut' main loop\n" ) ;