mouse works on windows

This commit is contained in:
NishiOwO 2025-04-20 16:50:44 +09:00
parent 432874d09b
commit a9cfcbef2b
No known key found for this signature in database
GPG Key ID: 27EF69B208EB9343
2 changed files with 16 additions and 0 deletions

View File

@ -1,5 +1,6 @@
#define GF_EXPOSE_DRAW_PLATFORM
#define GF_EXPOSE_DRAW
#define GF_EXPOSE_INPUT
#include <gf_pre.h>
@ -13,6 +14,7 @@
#include <gf_draw_driver.h>
#include <gf_log.h>
#include <gf_draw.h>
#include <gf_input.h>
/* Standard */
#include <string.h>
@ -40,6 +42,12 @@ LRESULT CALLBACK gf_draw_platform_proc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp
gf_draw_reshape(draw);
}
break;
case WM_MOUSEMOVE:
if(draw->input != NULL) {
draw->input->mouse_x = LOWORD(lp);
draw->input->mouse_y = HIWORD(lp);
}
break;
case WM_CLOSE:
draw->close = 1;
break;

View File

@ -1,5 +1,6 @@
#define GF_EXPOSE_DRAW_PLATFORM
#define GF_EXPOSE_DRAW
#define GF_EXPOSE_INPUT
#include <gf_pre.h>
@ -13,6 +14,7 @@
#include <gf_draw_driver.h>
#include <gf_log.h>
#include <gf_draw.h>
#include <gf_input.h>
/* Standard */
#include <string.h>
@ -46,6 +48,12 @@ LRESULT CALLBACK gf_draw_platform_proc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp
gf_draw_reshape(draw);
}
break;
case WM_MOUSEMOVE:
if(draw->input != NULL) {
draw->input->mouse_x = LOWORD(lp);
draw->input->mouse_y = HIWORD(lp);
}
break;
case WM_CLOSE:
draw->close = 1;
break;