I am using a state engine for my game and currently my main loop is:
while(engine.isRunning()){
while(engine.getWindow()->isOpen()){
while(engine.getWindow()->pollEvent(event)){
engine.Handling(event);
}
engine.Update();
engine.Paint();
}
}
But I am wondering if that is an effective way of doing this. The problem I foresee is when the character has to move it won't happen until the person let's go of the movement and therefore the character will just jump across the screen. Would it be alright to copy and paste
engine.Update()
and
engine.Paint()
into the the loop so that it occurs right after the Handling call and outside the loop as well? or is that some form of bad coding practice?