Original Post
Hello, I've recently been stuck on writing a good, clean, and reusable application entry point for my program.
Basically, what I've been doing is have a class called Game that is extended by a class called [GameNameHere]Game, which overrides Init, Loop, and Cleanup methods as needed. I also have a class called StateManager which holds a list of states and updates the top state. It also provides an interface for changing game states. I feel like this is a mess. The class game also holds an SFML window instance, but I want a Game instance to represent a single viewport and you should be able to create multiple of them for something like a level editor, etc.
I could really use a code example for a good entry point, so if anyone has any please let me know. It's the part of my project I'm really stuck on.
Basically, what I've been doing is have a class called Game that is extended by a class called [GameNameHere]Game, which overrides Init, Loop, and Cleanup methods as needed. I also have a class called StateManager which holds a list of states and updates the top state. It also provides an interface for changing game states. I feel like this is a mess. The class game also holds an SFML window instance, but I want a Game instance to represent a single viewport and you should be able to create multiple of them for something like a level editor, etc.
I could really use a code example for a good entry point, so if anyone has any please let me know. It's the part of my project I'm really stuck on.