X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=course%2Fsemester2%2Fpprog%2Fassignment1%2Fsingle-thread%2Fgraphics.c;fp=course%2Fsemester2%2Fpprog%2Fassignment1%2Fsingle-thread%2Fgraphics.c;h=7a7d21341e765e130a09f6900e5ecd71f6922bad;hb=19e590cc4f7dbc186cad9418bf5a2321bfa3fe1a;hp=1b4fcb31f03ff1fc0cfc4f619178b2fdeb6ab9d1;hpb=f012817dee17e24eee2e8951d138dab40b808ad3;p=matches%2Fhonours.git diff --git a/course/semester2/pprog/assignment1/single-thread/graphics.c b/course/semester2/pprog/assignment1/single-thread/graphics.c index 1b4fcb31..7a7d2134 100644 --- a/course/semester2/pprog/assignment1/single-thread/graphics.c +++ b/course/semester2/pprog/assignment1/single-thread/graphics.c @@ -110,34 +110,17 @@ void Graphics_Display() //Check whether the program should quit due to steps being computed, or a timeout if (ExitCondition()) { - glutLeaveMainLoop(); + //printf("Leave graphics loop\n"); + glutLeaveMainLoop(); return; } - #ifdef SINGLE_THREADED if (options.verbosity != 0 && universe.steps % options.verbosity == 1) DisplayStatistics(); System_Compute(&universe); #endif - - - //Check whether the runstate has been set to quit the program - switch (runstate) - { - case RUN: - break; - case QUIT: - glutLeaveMainLoop(); - return; - break; - case QUIT_ERROR: - glutLeaveMainLoop(); - return; - break; - } - if (options.draw_graphics == false) return; @@ -170,7 +153,7 @@ void Graphics_Keyboard(unsigned char theKey, int mouseX, int mouseY) { if (theKey == 'x' || theKey == 'X') { - glutLeaveMainLoop(); + QuitProgram(false); return; }