diff render_sdl.c @ 915:9e882eca717e

Initial support for relative mouse mode and skeleton of support for capture mode. Avoid mouse position overflow in absolute mode. Allow absolute mode to be set by ROM DB.
author Michael Pavone <pavone@retrodev.com>
date Tue, 15 Dec 2015 20:01:50 -0800
parents 28ec32e720b2
children 9364dad5561a
line wrap: on
line diff
--- a/render_sdl.c	Mon Dec 14 19:36:01 2015 -0800
+++ b/render_sdl.c	Tue Dec 15 20:01:50 2015 -0800
@@ -22,7 +22,7 @@
 SDL_Rect      main_clip;
 SDL_GLContext *main_context;
 
-int main_width, main_height;
+int main_width, main_height, is_fullscreen;
 
 uint8_t render_dbg = 0;
 uint8_t debug_pal = 0;
@@ -108,6 +108,11 @@
 	return main_height;
 }
 
+int render_fullscreen()
+{
+	return is_fullscreen;
+}
+
 uint32_t render_map_color(uint8_t r, uint8_t g, uint8_t b)
 {
 	return 255 << 24 | r << 16 | g << 8 | b;
@@ -265,6 +270,7 @@
 	}
 	main_width = width;
 	main_height = height;
+	is_fullscreen = fullscreen;
 
 	render_gl = 0;
 
@@ -559,7 +565,7 @@
 		handle_joy_dpad(event->jbutton.which, event->jhat.hat, event->jhat.value);
 		break;
 	case SDL_MOUSEMOTION:
-		handle_mouse_moved(event->motion.which, event->motion.x, event->motion.y);
+		handle_mouse_moved(event->motion.which, event->motion.x, event->motion.y, event->motion.xrel, event->motion.yrel);
 		break;
 	case SDL_MOUSEBUTTONDOWN:
 		handle_mousedown(event->button.which, event->button.button);