Hello everybody,
I have a straightforward question: Would you advise to keep reactions to key and mouse events in the same loop as the rendering or should it use it’s own loop?
Keeping it in the rendering loop makes it simpler to implement and prevents you from introducing concurrency problems because the rendering takes place before/after e.g. the player movement is done. However, if the rendering performance goes down for many possible reasons, the user controls would become wonky and unreliable. I know from some older 3D games that you couldn’t even reach the normal exit execution because the graphics went crazy.
To be more specific about what key/mouse controls should be possible: 1) simply holding the key for continuing effects (e.g. move forward), 2) detect how long an event was performed, 3) detect very short events. I yet have to have a deeper look into synchronzied methods/blocks/variables which might make stable concurrent programming less of a untouchable ghost :). None the less I am interested in more experienced opinions.