I ask me the question how the input managment is best implemented in an ecs system. Especially how to stop the program, when ESC is pressed.
The architecture is like this:
A core game class, which initializes the renderer, different systems (placement system, physics system, ...) and the entity manager, which only stores many maps of components, with an entity id. All systems take their components from the system manager, so every system has access to all components it needs. The input low level class will be initialized by the input system. On the update cycle of the input system if an ESC click occurs, the input system, sets the game isRunning property to false.
Or should I initialize the input low level also in the game class and then message direct from the low level input to the game class? I don't think so because I break the layers in this way.
Are there any advantages in the second method? Or is my first approach ok?