diff options
author | chai <chaifix@163.com> | 2020-02-24 10:28:41 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2020-02-24 10:28:41 +0800 |
commit | 538cb1cd010a3323ad61239a12a4134ef4dceca6 (patch) | |
tree | 0a2c492ce5d27c77da039aa5189b67aa3070aa20 /src/extern/wog.c | |
parent | b656c9415a8e7e3b5b7d8bf1f3c8a5444f830c79 (diff) |
*camera
Diffstat (limited to 'src/extern/wog.c')
-rw-r--r-- | src/extern/wog.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/extern/wog.c b/src/extern/wog.c index 6cdfb6f..28d4dd1 100644 --- a/src/extern/wog.c +++ b/src/extern/wog.c @@ -131,6 +131,8 @@ void wog_handleEvent(wog_Window* window, MSG* msg, wog_Event* e) zero_mem(e, sizeof(wog_Event)); e->type = WOG_EMOUSEBUTTONDOWN; e->button = WOG_MOUSE_LBUTTON; + wog_getMouse(window, &e->pos.x, &e->pos.y); + SetCapture(hWnd); return ; } @@ -139,6 +141,8 @@ void wog_handleEvent(wog_Window* window, MSG* msg, wog_Event* e) zero_mem(e, sizeof(wog_Event)); e->type = WOG_EMOUSEBUTTONDOWN; e->button = WOG_MOUSE_RBUTTON; + wog_getMouse(window, &e->pos.x, &e->pos.y); + SetCapture(hWnd); return ; } @@ -147,6 +151,8 @@ void wog_handleEvent(wog_Window* window, MSG* msg, wog_Event* e) zero_mem(e, sizeof(wog_Event)); e->type = WOG_EMOUSEBUTTONDOWN; e->button = WOG_MOUSE_MIDDLE; + wog_getMouse(window, &e->pos.x, &e->pos.y); + SetCapture(hWnd); return ; } @@ -155,6 +161,8 @@ void wog_handleEvent(wog_Window* window, MSG* msg, wog_Event* e) zero_mem(e, sizeof(wog_Event)); e->type = WOG_EMOUSEBUTTONUP; e->button = WOG_MOUSE_LBUTTON; + wog_getMouse(window, &e->pos.x, &e->pos.y); + ReleaseCapture(); return ; } @@ -163,6 +171,8 @@ void wog_handleEvent(wog_Window* window, MSG* msg, wog_Event* e) zero_mem(e, sizeof(wog_Event)); e->type = WOG_EMOUSEBUTTONUP; e->button = WOG_MOUSE_RBUTTON; + wog_getMouse(window, &e->pos.x, &e->pos.y); + ReleaseCapture(); return ; } @@ -171,6 +181,8 @@ void wog_handleEvent(wog_Window* window, MSG* msg, wog_Event* e) zero_mem(e, sizeof(wog_Event)); e->type = WOG_EMOUSEBUTTONUP; e->button = WOG_MOUSE_MIDDLE; + wog_getMouse(window, &e->pos.x, &e->pos.y); + ReleaseCapture(); return ; } @@ -626,8 +638,10 @@ void wog_getMouse(wog_Window* wnd, int *x, int *y) ScreenToClient(wnd->hwnd, &p); int w, h; wog_getwindowsize(wnd, &w, &h); - *x = clamp(p.x, 0, w); - *y = clamp(p.y, 0, h); + //*x = clamp(p.x, 0, w); + //*y = clamp(p.y, 0, h); + *x = p.x; + *y = p.y; } |