diff --git a/src/sdlscreen.c b/src/sdlscreen.c index 34ca890b..35a1bb28 100644 --- a/src/sdlscreen.c +++ b/src/sdlscreen.c @@ -50,6 +50,7 @@ /// Sets the new screen/window dimensions. void Set_mode_SDL(int *width, int *height, int fullscreen) { + static SDL_Cursor* cur = NULL; Screen_SDL=SDL_SetVideoMode(*width,*height,8,(fullscreen?SDL_FULLSCREEN:0)|SDL_RESIZABLE); if(Screen_SDL != NULL) { @@ -66,7 +67,16 @@ void Set_mode_SDL(int *width, int *height, int fullscreen) { DEBUG("Error: Unable to change video mode!",0); } - SDL_ShowCursor(0); // Hide the SDL mouse cursor, we use our own + + // Trick borrowed to Barrage (http://www.mail-archive.com/debian-bugs-dist@lists.debian.org/msg737265.html) : + // Showing the cursor but setting it to fully transparent allows us to get absolute mouse coordinates, + // this means we canuse tablet in fullscreen mode. + SDL_ShowCursor(1); // Hide the SDL mouse cursor, we use our own + + SDL_FreeCursor(cur); + static byte cursorData = 0; + cur = SDL_CreateCursor(&cursorData, &cursorData, 1,1,0,0); + SDL_SetCursor(cur); } #if (UPDATE_METHOD == UPDATE_METHOD_CUMULATED)