Cross-Platform OpenGL Windowing Library
リビジョン | 0a26d6e1874912b667116c8cca95542fa285ba55 (tree) |
---|---|
日時 | 2018-12-12 17:34:24 |
作者 | AlaskanEmily <emily@alas...> |
コミッター | AlaskanEmily |
Add mouse movement event type
@@ -39,6 +39,7 @@ extern "C" { | ||
39 | 39 | enum Glow_EventType { |
40 | 40 | eGlowKeyboardPressed, |
41 | 41 | eGlowKeyboardReleased, |
42 | + eGlowMouseMoved, | |
42 | 43 | eGlowMousePressed, |
43 | 44 | eGlowMouseReleased, |
44 | 45 | eGlowResized, |
@@ -402,6 +402,11 @@ static BOOL glow_translate_event(const MSG *msg, struct Glow_Window *window, | ||
402 | 402 | out_event->type = pressed ? |
403 | 403 | eGlowMousePressed : eGlowMouseReleased; |
404 | 404 | return TRUE; |
405 | + case WM_MOUSEMOVE: | |
406 | + glow_translate_local_mouse_pos(&msg->pt, | |
407 | + window, out_event->value.mouse.xy); | |
408 | + out_event->type = eGlowMouseMoved; | |
409 | + return TRUE; | |
405 | 410 | case WM_DESTROY: |
406 | 411 | case WM_CLOSE: |
407 | 412 | case WM_QUIT: |
@@ -318,6 +318,11 @@ glow_get_event_start: | ||
318 | 318 | return 0; |
319 | 319 | } |
320 | 320 | return 1; |
321 | + case MotionNotify: | |
322 | + out->type = eGlowMouseMoved; | |
323 | + out->value.mouse.xy[0] = event.xmotion.x; | |
324 | + out->value.mouse.xy[1] = event.xmotion.y; | |
325 | + return 1; | |
321 | 326 | case UnmapNotify: |
322 | 327 | case DestroyNotify: |
323 | 328 | out->type = eGlowQuit; |