This thread sort of belongs in game programming but it's mostly a win32 problem so I put it here.
I don't want to add my code unless I have to because it's alot to copy any paste; 100+ lines of code.
Okay so I'm making a 2D game this is how it works:
- Bitmaps are bitblt-ed to the window using it's device context.
- My game loop uses PeekMessage for the windows message pump.
- I use the timeGetTime() function to throttle the frame rate to 60 FPS.
The problem is this:
For some strange reason, every so often when I start the game the frame rate gets REALLY slow. I can't understand why? No other processes are running when I open the game. I know games can run using the windows GDI without any problem but for some reason my game gets super slow sometimes.
I've tried running it on other computers and the same thing happens. Every so often it will just run super slow for no reason at all. Am I causing some kind of memory leak or something? Sooo lost. I should have stuck with Console applications... :-(