/* ======= WndProc ======= */ LRESULT CALLBACK WndProc( HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam ) { switch( message ) { case WM_CREATE: break; case WM_SIZE: /* Resize the OpenGL window when the window is resized */ ResizeGLWindow( LOWORD( lParam ), HIWORD( lParam ) ); /* Adjust camera mouse controls */ mCamera.AdjustScreenSize( LOWORD( lParam ), HIWORD( lParam ) ); GetClientRect( hwnd, &gRect ); break; case WM_KEYDOWN: /* Set key bool as true */ mInput.mKeys[ wParam ] = true; break; case WM_KEYUP: /* Set key bool as false */ mInput.mKeys[ wParam ] = false; break; case WM_MOUSEMOVE: /* Update Mouse Position */ mInput.mMouseX = LOWORD( lParam ); mInput.mMouseY = HIWORD( lParam ); break; case WM_PAINT: break; case WM_DESTROY: PostQuitMessage( 0 ); break; } return DefWindowProc( hwnd, message, wParam, lParam ); }