So I've started to write a Game Engine to write my game with.
I'll post some code sometimes with some explanation to keep you all updated.
The following code is from the WndProc, how I handle on some interesting events:
I can handle double mouse-clicks too. For this you need to add a style into the WndClass.
WNDCLASS wndClass; WndClass.style = CS_HREDRAW | CS_VREDRAW | CS_DBLCLKS;
I'm controlling whole my game with 1 object. The GameEngine object
But Instead of writing hundreds lines of code into 1 class I wrote some extra classes:
class GameEngine: public ResourceLoader, public InputState, public Painter
I don't like to overload the processor and I would like to work with a framerate so in the ProcessMessages method I'll let the application sleep for (1000 / framerate) if there are no messages.
So if there are any questions about my code, how I go to fullscreen and back to windowed mode, just ask.
And if there are some suggestions about some code, just tell.
pm: this topic should not be closed till my game is finished, what will take some months. I would love to keep posting all my progress here if that's ok.