Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- LRESULT CALLBACK WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
- {
- switch( msg )
- {
- case WM_DESTROY:
- PostQuitMessage(0);
- break;
- case WM_SETCURSOR:
- // Turn off window cursor.
- if(g_window.showCursor == false)
- SetCursor( NULL );
- //m_pd3dDevice->ShowCursor( TRUE );
- return TRUE; // Prevent Windows from setting cursor to window class cursor.
- break;
- case WM_LBUTTONDOWN:
- g_window.mouseButtons[0] = true;
- break;
- case WM_LBUTTONUP:
- g_window.mouseButtons[0] = false;
- break;
- case WM_MBUTTONDOWN:
- g_window.mouseButtons[1] = true;
- break;
- case WM_MBUTTONUP:
- g_window.mouseButtons[1] = false;
- break;
- case WM_RBUTTONDOWN:
- g_window.mouseButtons[2] = true;
- break;
- case WM_RBUTTONUP:
- g_window.mouseButtons[2] = false;
- break;
- /* case WM_MOUSEWHEEL:
- g_window.scrollmove=true;
- g_window.scroll=GET_WHEEL_DELTA_WPARAM(wParam);
- break;
- */
- case WM_MOUSEMOVE:
- {
- g_window.mouseX = (int)(lParam & 0x0000FFFF);
- g_window.mouseY = (int)(lParam >> 16);
- }
- break;
- }
- return DefWindowProc(hWnd, msg, wParam, lParam);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement