Advertisement
assviolator9001

Untitled

Mar 27th, 2017
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.35 KB | None | 0 0
  1.  
  2. IMGUI_API LRESULT ImGui_ImplDX9_WndProcHandler(HWND, UINT msg, WPARAM wParam, LPARAM lParam)
  3. {
  4. ImGuiIO& io = ImGui::GetIO();
  5. switch (msg)
  6. {
  7. case WM_LBUTTONDOWN:
  8. io.MouseDown[0] = true;
  9. return true;
  10. case WM_LBUTTONUP:
  11. io.MouseDown[0] = false;
  12. return true;
  13. case WM_RBUTTONDOWN:
  14. io.MouseDown[1] = true;
  15. return true;
  16. case WM_RBUTTONUP:
  17. io.MouseDown[1] = false;
  18. return true;
  19. case WM_MBUTTONDOWN:
  20. io.MouseDown[2] = true;
  21. return true;
  22. case WM_MBUTTONUP:
  23. io.MouseDown[2] = false;
  24. return true;
  25. case WM_MOUSEWHEEL:
  26. io.MouseWheel += GET_WHEEL_DELTA_WPARAM(wParam) > 0 ? +1.0f : -1.0f;
  27. return true;
  28. case WM_MOUSEMOVE:
  29. io.MousePos.x = (signed short)(lParam);
  30. io.MousePos.y = (signed short)(lParam >> 16);
  31. return true;
  32. case WM_KEYDOWN:
  33. if (wParam < 256)
  34. io.KeysDown[wParam] = 1;
  35. return true;
  36. case WM_KEYUP:
  37. if (wParam < 256)
  38. io.KeysDown[wParam] = 0;
  39. return true;
  40. case WM_CHAR:
  41. // You can also use ToAscii()+GetKeyboardState() to retrieve characters.
  42. if (wParam > 0 && wParam < 0x10000)
  43. io.AddInputCharacter((unsigned short)wParam);
  44. return true;
  45. }
  46. return 0;
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement