Original Post
Hello! Up to today I thought I mastered basic window creation with winapi but it looks like I was wrong. I'm currently building a library to simplify the use of windows. Using it, I can have my main loop code as easy as this : Now I'm having a window but it is unresponsive and I have to close it using CTRL-ALT-DELETE. Do I need to do more than what I currently do for my window to be responsive? Thanks for your help! (If I didn't post enough code, please tell me)
// Sample of simplified code
while(_Running)
{
if(_Window.HandleMessages()) continue;
_Timer.FrameUpdate();
if(!_Window.IsActive()) continue;
Update(_Timer.GetTimeDelta());
Render();
}
// Implementation of CWindow::HandleMessages()
bool CWindow::HandleMessages()
{
MSG msg;
if(PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
return true;
}
return false; // No messages were treaten
}