diff options
author | Vasily <danilka.pro@gmail.com> | 2015-12-10 00:54:50 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-12-10 01:33:59 +0300 |
commit | 70700509ee969b58c6110310f5a962dcff854d6e (patch) | |
tree | bec778155783fcf7e2a38ec11c81202a6a2c1849 /src/gui | |
parent | 7d3ef8d375defc9fb7efb4e48b72a6f4f9b98c16 (diff) | |
download | manaverse-70700509ee969b58c6110310f5a962dcff854d6e.tar.gz manaverse-70700509ee969b58c6110310f5a962dcff854d6e.tar.bz2 manaverse-70700509ee969b58c6110310f5a962dcff854d6e.tar.xz manaverse-70700509ee969b58c6110310f5a962dcff854d6e.zip |
Implemented NaCl cursor hiding, custom cursor is supported now
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/gui.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index ea527e3ef..f7878a55f 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -98,6 +98,13 @@ #include "net/ipc.h" +#ifdef __native_client__ +#include <ppapi/c/ppb_mouse_cursor.h> +#include <ppapi/cpp/instance.h> +#include <ppapi/cpp/mouse_cursor.h> +#include <ppapi_simple/ps.h> +#endif + #include "debug.h" Gui *gui = nullptr; @@ -533,6 +540,18 @@ void Gui::setUseCustomCursor(const bool customCursor) { mCustomCursor = customCursor; +#ifdef __native_client__ + PP_MouseCursor_Type cursor; + if (mCustomCursor) + cursor = PP_MOUSECURSOR_TYPE_NONE; // hide cursor + else + cursor = PP_MOUSECURSOR_TYPE_POINTER; // show default cursor + + pp::MouseCursor::SetCursor( + pp::InstanceHandle(PSGetInstanceId()), + cursor); +#endif + if (mCustomCursor) { // Hide the SDL mouse cursor |