Simple High-Level State patterns in C.
The Bash Script make_states creates a compiling statepattern.
./make_states > foo.c
$ make foo
An example with Makefile is enclosed.
Press left MouseButton to goto next State. The Window Title reflects the State. In Playing State right MouseButton triggers Game Over!
See: This Post
Get in touch on SDL-Discourse.
For more Informations on Gamestates see Videos:
A warning about OOP:
But if you insist:
Implementing a Main-Game-Loop in C++.
Game States and Game Loops in Python.