Hi,
I've always wondered what's the best way to make a tight game loop for PocketPC games.
eg:
I have a WinMain like so:
Where the game.Process clears the screen, checks input, does all game related things, and returns.
However, making it all OOP based, I have a GFX baseclass, with a GDI and GAPI class that you can swap out and pick whichever one you want.
I create the Window in the GAPI.Create() function, and have the WndProc in the GAPI.cpp file to handle input etc, with it having a pointer to the main game object, so in the WndProc on LBUTTON_DOWN I do game->GetInput()->AddMouse(x,y, button) kind of thing.
Is this correct? How do make sure that nothing starves ? All I want is a game loop that is as tight as it can be, but still gets mouse and key input.
This seems like a silly question, but it's just a concept I can't seem to get, how to most people do their loops and window message handling?
And if I'm speaking nonsense, just say, and I'll try explain it again.
Thanks in advance.
I've always wondered what's the best way to make a tight game loop for PocketPC games.
eg:
I have a WinMain like so:
- Code:
WinMain()
{
while (game.Running())
{
game.Process();
}
}
Where the game.Process clears the screen, checks input, does all game related things, and returns.
However, making it all OOP based, I have a GFX baseclass, with a GDI and GAPI class that you can swap out and pick whichever one you want.
I create the Window in the GAPI.Create() function, and have the WndProc in the GAPI.cpp file to handle input etc, with it having a pointer to the main game object, so in the WndProc on LBUTTON_DOWN I do game->GetInput()->AddMouse(x,y, button) kind of thing.
Is this correct? How do make sure that nothing starves ? All I want is a game loop that is as tight as it can be, but still gets mouse and key input.
This seems like a silly question, but it's just a concept I can't seem to get, how to most people do their loops and window message handling?
And if I'm speaking nonsense, just say, and I'll try explain it again.
Thanks in advance.