Parallel Programming - Finished OpenMP
[matches/honours.git] / course / semester2 / pprog / assignment1 / single-thread / graphics.c
index c3d55f5..e960ffe 100644 (file)
@@ -109,8 +109,10 @@ void Graphics_Run(int argc, char ** argv)
        //This option must be set, or when glut leaves the main loop. the exit(3) function is called... annoying
        glutSetOption(GLUT_ACTION_ON_WINDOW_CLOSE, GLUT_ACTION_CONTINUE_EXECUTION);
 
-       glutMainLoop();
-       
+
+       #ifndef OMP_THREADED
+               glutMainLoop(); 
+       #endif //OMP_THREADED
 }
 
 /**
@@ -184,7 +186,9 @@ void Graphics_Keyboard(unsigned char theKey, int mouseX, int mouseY)
 {
        if (theKey == 'x' || theKey == 'X') 
        {
+               
                QuitProgram(false);
+               glutLeaveMainLoop();
                return;
        }
 

UCC git Repository :: git.ucc.asn.au