TolTol
03-20-2003, 12:41 AM
Hello all,
I need to allow the user to exit from a game I'm designing for college. I want to let them press Esc on the keyboard and then the game ends. I was using the exit() function to exit from the game but my supervisor wont allow this because its unstructured code.
I'm using the glutTimerFunc(...) to loop through the code and I also have a glutMainLoop(...) (although I'm not sure what this does). I'm also using Borland Builder C++ 4
I tried bypassing the glutTimerFunc(...) when the user presses Esc but the game just stops looping and is still open.
Any ideas how to exit properly???
Thanks in advance.
I need to allow the user to exit from a game I'm designing for college. I want to let them press Esc on the keyboard and then the game ends. I was using the exit() function to exit from the game but my supervisor wont allow this because its unstructured code.
I'm using the glutTimerFunc(...) to loop through the code and I also have a glutMainLoop(...) (although I'm not sure what this does). I'm also using Borland Builder C++ 4
I tried bypassing the glutTimerFunc(...) when the user presses Esc but the game just stops looping and is still open.
Any ideas how to exit properly???
Thanks in advance.