From bce1c9d7ee5d3516a9e195dc875c39fcba99479f Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Fri, 6 Aug 2010 13:38:49 +0000 Subject: [PATCH] * Fix using fullscreen mode with a tablet. git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1553 416bcca6-2ee7-4201-b75f-2eb2f807beb1 --- src/sdlscreen.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) 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)