summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorVasily <danilka.pro@gmail.com>2015-12-10 00:54:50 +0300
committerAndrei Karas <akaras@inbox.ru>2015-12-10 01:33:59 +0300
commit70700509ee969b58c6110310f5a962dcff854d6e (patch)
treebec778155783fcf7e2a38ec11c81202a6a2c1849 /src/gui
parent7d3ef8d375defc9fb7efb4e48b72a6f4f9b98c16 (diff)
downloadmanaplus-70700509ee969b58c6110310f5a962dcff854d6e.tar.gz
manaplus-70700509ee969b58c6110310f5a962dcff854d6e.tar.bz2
manaplus-70700509ee969b58c6110310f5a962dcff854d6e.tar.xz
manaplus-70700509ee969b58c6110310f5a962dcff854d6e.zip
Implemented NaCl cursor hiding, custom cursor is supported now
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/gui.cpp19
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