diff options
author | Juan Linietsky <reduzio@gmail.com> | 2015-09-24 18:06:15 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2015-09-24 18:06:15 -0300 |
commit | 82a3304458738b410a5aff8994ce587413aeb464 (patch) | |
tree | b54672bc649a80ebbe1e11b0488c7dfdc6c109e7 /platform/osx | |
parent | 59e1ad27731e66c58a3d5ee9d783eac74a1d48d9 (diff) |
Added ability to set custom mouse cursors. Not hardware accelerated yet.
Diffstat (limited to 'platform/osx')
-rw-r--r-- | platform/osx/os_osx.h | 2 | ||||
-rw-r--r-- | platform/osx/os_osx.mm | 14 |
2 files changed, 15 insertions, 1 deletions
diff --git a/platform/osx/os_osx.h b/platform/osx/os_osx.h index 869997f190..49fa6c0862 100644 --- a/platform/osx/os_osx.h +++ b/platform/osx/os_osx.h @@ -32,7 +32,7 @@ #include "os/input.h" #include "drivers/unix/os_unix.h" - +#include "main/input_default.h" #include "servers/visual_server.h" #include "servers/visual/visual_server_wrap_mt.h" #include "servers/visual/rasterizer.h" diff --git a/platform/osx/os_osx.mm b/platform/osx/os_osx.mm index abfe42beda..b0ce37cecf 100644 --- a/platform/osx/os_osx.mm +++ b/platform/osx/os_osx.mm @@ -512,12 +512,26 @@ static int button_mask=0; - (void)mouseExited:(NSEvent *)event { + if (!OS_OSX::singleton) + return; + + if (OS_OSX::singleton->main_loop && OS_OSX::singleton->mouse_mode!=OS::MOUSE_MODE_CAPTURED) + OS_OSX::singleton->main_loop->notification(MainLoop::NOTIFICATION_WM_MOUSE_EXIT); + if (OS_OSX::singleton->input) + OS_OSX::singleton->input->set_mouse_in_window(false); // _glfwInputCursorEnter(window, GL_FALSE); } - (void)mouseEntered:(NSEvent *)event { // _glfwInputCursorEnter(window, GL_TRUE); + if (!OS_OSX::singleton) + return; + if (OS_OSX::singleton->main_loop && OS_OSX::singleton->mouse_mode!=OS::MOUSE_MODE_CAPTURED) + OS_OSX::singleton->main_loop->notification(MainLoop::NOTIFICATION_WM_MOUSE_ENTER); + if (OS_OSX::singleton->input) + OS_OSX::singleton->input->set_mouse_in_window(true); + } - (void)viewDidChangeBackingProperties |