hi
my cpu usage for MS Windows application is too high ( about 50%)
how can i decrease it?
my code for handling events it: ( i belive problem is in this code)
#ifdef _WIN32
MSG msg;
HWND m_hw = (HWND)m_Window->getHandle();
while(!m_bDone)
{
if ( PeekMessage(&msg, m_hw, NULL, NULL, PM_REMOVE))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
else
{
// clearing screen
m_Renderer->clear();
// draw functions
if ( m_Timer->getMilliSeconds() > 1000 )
{
m_uFps = m_uFrameCount ;
m_uFrameCount = 0;
m_Timer->Reset();
std::cout << m_uFps << std::endl;
}
else
{
m_uFrameCount++;
}
// changing frame buffer
m_Renderer->swapFramebuffer();
}
}
#endif