okay, so im writing a super basic engine, with a statemanager.
this is basically what happends right now:
void CEngine::Update()
{
// Code for event loop, ( close application )
CStateMachine::GetInstance().Update();
Draw();
}
in GameStateGame, lets say i have a character, i need to do keyboard check for movement.
i can't just make a event loop in GameStateGame. tried it.
Any tips?
there are some solutions i've come up with but i would like some pointers...
solution 1:
Have the loop in GameStateGame , and when a close call happends, tell CEngine.
It surley would work, but imagine having resize calls and more... every gamestate would be filled with code that "doesn't have with the state to do".
solution 2:
Have the Event loop in CEngine. Take all the events, store them in a vector and send it to the gamestate.
this one seems to be the least painfull...
Thankyou