Hi there, I'm new to gamedev.net and to game programming in general.
I am a C# developer by way of a day job and decided that my first foray into game programming should be with this language that I am familiar with. Starting with the basics (and having read many articles and forum posts) I decided to tackle my own implementation of a game loop and settled on Tom Miller's Application.Idle/PeekMessage method.
I have this all pluimbed-in and all seems to work really well for updating and drawing. I have however, encountered a problem. My 'game' uses GDI+ graphics to do all of the rendering to a Windows Form. My problem lies in the fact that the application seems to 'hang' while events are taking place i.e. moving the mouse over the screen or holding down a key on the keyboard halts the update/draw cycle. I can only assume that this is a result of the Application.Idle game loop exiting/not running because the PeekMessage has found messages/events that need to be processed.
It seems to me that the Application.Idle/PeekMessage method of implementing the game loop is well regarded so I am obviously missing something here... has anyone else come across this problem?
In the event that I have not missed something here (and I am new to this style of programming) does anyone know of a workaround for this problem? Is there a way to prevent the mouse/keyboard events from interfering with the game loop? I assume that when DirectX is involved that it takes care of the input from keyboard/mouse and so the events never actually reach the form. With my GDI+ only method however, the events do seem to cause a problem.
Hopefully someone can help!