Skip to content
This repository has been archived by the owner on Feb 7, 2020. It is now read-only.

destroyGame() should not call exit() #42

Closed
crankycyclops opened this issue Dec 2, 2012 · 1 comment
Closed

destroyGame() should not call exit() #42

crankycyclops opened this issue Dec 2, 2012 · 1 comment
Assignees
Milestone

Comments

@crankycyclops
Copy link
Owner

Right now, core is functioning as a library that an application (like standalone) wraps around. Since this is the case, core should not call exit() unless there's an unrecoverable error (like memory allocation failure), which means that destroyGame() should not call exit(). Should alter the main game loop in standalone/main.c so that it says something like:

while (inGame()) {
...
}

And then implement inGame() so that it returns TRUE if the game is running and FALSE if the game has ended. Then, initGame() will set the variable this function returns to TRUE and destroyGame(), when we're done tearing down, will set this value to FALSE.

DO EET!

@ghost ghost assigned crankycyclops Dec 2, 2012
@crankycyclops
Copy link
Owner Author

After while(inGame()) is done executing, the application can do whatever it needs to do before exiting.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant