From 1d3342fd0952c57a737cf90794f20905bd48d5f1 Mon Sep 17 00:00:00 2001 From: Michael Pavone Date: Tue, 15 Dec 2015 20:01:50 -0800 Subject: 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. --- render_sdl.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'render_sdl.c') diff --git a/render_sdl.c b/render_sdl.c index dbd7389..b60fc62 100755 --- a/render_sdl.c +++ b/render_sdl.c @@ -22,7 +22,7 @@ SDL_Texture *main_texture; 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 @@ int render_height() 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 @@ void render_init(int width, int height, char * title, uint32_t fps, uint8_t full } main_width = width; main_height = height; + is_fullscreen = fullscreen; render_gl = 0; @@ -559,7 +565,7 @@ int32_t handle_event(SDL_Event *event) 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); -- cgit v1.2.3