Mouse pointer works a bit better

SDL2 showed native and MG mouse pointer at the same time. Attempt to fix it.
This commit is contained in:
titiger
2015-10-07 02:14:07 +02:00
parent d80ca9e0b2
commit 8991507526
5 changed files with 9 additions and 22 deletions

View File

@@ -124,7 +124,6 @@ private:
protected:
//int w, h;
static bool isActive;
static bool no2DMouseRendering;
static bool allowAltEnterFullscreenToggle;
static int lastShowMouseState;
@@ -187,9 +186,6 @@ public:
void destroy();
void minimize();
static void setUseDefaultCursorOnly(bool value) { no2DMouseRendering = value; }
static bool getUseDefaultCursorOnly() { return no2DMouseRendering; }
static void setAllowAltEnterFullscreenToggle(bool value) { allowAltEnterFullscreenToggle = value; }
static bool getAllowAltEnterFullscreenToggle() { return allowAltEnterFullscreenToggle; }

View File

@@ -1685,7 +1685,7 @@ void showCursor(bool b) {
if(isCursorShowing() == b) {
return;
}
//printf("showCursor(bool b) b=%d\n",b);
SDL_ShowCursor(b == true ? SDL_ENABLE : SDL_DISABLE);
}

View File

@@ -50,7 +50,6 @@ bool Window::isFullScreen = false;
SDL_keysym Window::keystate;
bool Window::isActive = false;
bool Window::no2DMouseRendering = false;
#ifdef WIN32
bool Window::allowAltEnterFullscreenToggle = false;
#else
@@ -428,7 +427,7 @@ bool Window::handleEvent() {
// bool willShowCursor = (!Window::isActive || (Window::lastShowMouseState == SDL_ENABLE) || Window::getUseDefaultCursorOnly());
// showCursor(willShowCursor);
// }
showCursor(true);
showCursor(false);
}
break;
}