diff options
author | chai <chaifix@163.com> | 2020-07-28 00:30:33 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2020-07-28 00:30:33 +0800 |
commit | 5dfdb6b58b2dc7bbd3348004c1fcd17e23fea48b (patch) | |
tree | a03f1a01382595ed50cc4780a728b22013f6d5a0 /src/extend/camera.c | |
parent | 690f20cdbe8dad3fce7a547934a5a8322303342d (diff) |
Diffstat (limited to 'src/extend/camera.c')
-rw-r--r-- | src/extend/camera.c | 30 |
1 files changed, 9 insertions, 21 deletions
diff --git a/src/extend/camera.c b/src/extend/camera.c index d148cd8..e481831 100644 --- a/src/extend/camera.c +++ b/src/extend/camera.c @@ -1,6 +1,7 @@ #include "../shaders/common/core.h" #include "../core/device.h" #include "camera.h" +#include "../platform/win.h" //#define USE_CURSOR_WHEEL_ICON @@ -8,14 +9,10 @@ typedef enum { CursorType_Arrow = 0, CursorType_Hand, CursorType_Eye, - CursorType_ZoomIn, - CursorType_ZoomOut, }CursorType; static Wog_Cursor cursor_hand; static Wog_Cursor cursor_eye; -static Wog_Cursor cursor_zoomIn; -static Wog_Cursor cursor_zoomOut; // A unity editor style camera typedef struct Camera { @@ -71,10 +68,14 @@ Camera* camera_create(wog_Window* wnd, CameraConfig* config) { cam->wheel_scroll = 0; - cursor_hand = LoadImageA(NULL, "PanView.ico", IMAGE_ICON, 0, 0, LR_DEFAULTCOLOR | LR_CREATEDIBSECTION | LR_LOADFROMFILE); - cursor_eye = LoadImageA(NULL, "OrbitView.ico", IMAGE_ICON, 0, 0, LR_DEFAULTCOLOR | LR_CREATEDIBSECTION | LR_LOADFROMFILE); - cursor_zoomIn = LoadImageA(NULL, "ZoomIn.ico", IMAGE_ICON, 0, 0, LR_DEFAULTCOLOR | LR_CREATEDIBSECTION | LR_LOADFROMFILE); - cursor_zoomOut = LoadImageA(NULL, "ZoomOut.ico", IMAGE_ICON, 0, 0, LR_DEFAULTCOLOR | LR_CREATEDIBSECTION | LR_LOADFROMFILE); + HINSTANCE hInstance = wog_get_instance(); + +// cursor_hand = LoadImage(hInstance, "icon.ico", IMAGE_ICON, 0, 0, LR_LOADFROMFILE | LR_DEFAULTSIZE | LR_SHARED); + cursor_hand = LoadIcon(hInstance, "pan_view.ico"); + cursor_eye = LoadIcon(hInstance, "orbit_view.ico"); + + //int size; + //void *p = resource_get("pan_view.ico", &size); return cam; } @@ -173,19 +174,6 @@ void camera_onevent(Camera* cam, wog_Event* e, float dt) { return ; //printf("%d\n",e->type); if (e->type == WOG_EMOUSEWHEEL) { -#if defined(USE_CURSOR_WHEEL_ICON) - if (e->wheel > 0) - { - setMouseCursor(CursorType_ZoomIn, cursor_zoomIn); - } - else if (e->wheel < 0) - { - setMouseCursor(CursorType_ZoomOut, cursor_zoomOut); - } - if(cam->wheel_scroll <= 0) - wog_setMouseCapture(cam->wnd); - cam->wheel_scroll = 0.3; -#endif _onwheelscroll(cam, e->wheel, dt); } else if (e->type == WOG_EMOUSEBUTTONDOWN) { |