Theres some reason for this code not reach the first else? I got it exactly the same from vairous sources. Than I did my own encapsulation. Everything goes fine. Window is created, messages are treated, events are generated to keyborad input in the client area, the gl canvas works fine (when I force it to draw).
The only problem is that message loop never leaves the first if. :/ I'm really stuck.
while (!done)
{
if (::PeekMessage (&msg, NULL, 0, 0, PM_REMOVE))
{
if (msg.message == WM_QUIT)
{
done = TRUE;
}
else
{
::TranslateMessage (&msg);
::DispatchMessage (&msg);
}
}
else
{
// Code is never reaching this!
draw ();
::SwapBuffers(hDC);
idle ();
}
}
return msg.wParam;