Advertisement
Guest User

Untitled

a guest
May 26th, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.13 KB | None | 0 0
  1. LRESULT CALLBACK WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
  2. {
  3.     switch( msg )
  4.     {
  5.         case WM_DESTROY:
  6.             PostQuitMessage(0);
  7.             break;
  8.         case WM_SETCURSOR:
  9.         // Turn off window cursor.
  10.             if(g_window.showCursor == false)
  11.                 SetCursor( NULL );
  12.             //m_pd3dDevice->ShowCursor( TRUE );
  13.             return TRUE; // Prevent Windows from setting cursor to window class cursor.
  14.             break;
  15.  
  16.  
  17.         case WM_LBUTTONDOWN:
  18.             g_window.mouseButtons[0] = true;
  19.             break;
  20.         case WM_LBUTTONUP:
  21.             g_window.mouseButtons[0] = false;
  22.             break;
  23.  
  24.         case WM_MBUTTONDOWN:
  25.             g_window.mouseButtons[1] = true;
  26.             break;
  27.         case WM_MBUTTONUP:
  28.             g_window.mouseButtons[1] = false;
  29.             break;
  30.  
  31.         case WM_RBUTTONDOWN:
  32.             g_window.mouseButtons[2] = true;
  33.             break;
  34.         case WM_RBUTTONUP:
  35.             g_window.mouseButtons[2] = false;
  36.             break;
  37.  
  38. /*      case WM_MOUSEWHEEL:
  39.             g_window.scrollmove=true;
  40.             g_window.scroll=GET_WHEEL_DELTA_WPARAM(wParam);
  41.             break;
  42. */
  43.         case WM_MOUSEMOVE:
  44.         {
  45.             g_window.mouseX = (int)(lParam & 0x0000FFFF);
  46.             g_window.mouseY = (int)(lParam >> 16);
  47.         }
  48.         break;
  49.  
  50.            
  51.     }
  52.     return DefWindowProc(hWnd, msg, wParam, lParam);
  53. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement