1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
| LRESULT clWindow::ProcessWindow(HWND _hWnd, UINT _message, WPARAM _wParam, LPARAM _lParam)
{
switch(_message)
{
case WM_CLOSE:
{
//We destroy the windows
Destroy();
//We delete the window from the engine,
// if window count is 0 so we destroy the engine and exit the run loop
m_engine.DestroyWindow(this);
}
break;
case WM_ENTERSIZEMOVE:
{
}
break;
case WM_EXITSIZEMOVE:
{
if(m_renderSystem->RenderWindowRelative())
{
RECT rect;
GetClientScreenRect(&rect);
int newHeight = static_cast<int>(rect.bottom - rect.top);
int newWidth = static_cast<int>(rect.right - rect.left);
if(static_cast<int>(m_clientSize.m_height) != newHeight ||
static_cast<int>(m_clientSize.m_width) != newWidth)
{
m_renderSystem->ResizeRelative(static_cast<int>(m_clientSize.m_height),static_cast<int>(m_clientSize.m_width),newHeight,newWidth);
SaveClientSize();
}
}
}
break;
case WM_SETCURSOR:
{
if(m_cursor.IsVisible())
m_cursor.Visible(clTrue);
else
m_cursor.Visible(clFalse);
}
break;
}
return DefWindowProc(_hWnd, _message, _wParam, _lParam);
} |
Partager