diff options
author | Michael Pavone <pavone@retrodev.com> | 2015-12-15 20:01:50 -0800 |
---|---|---|
committer | Michael Pavone <pavone@retrodev.com> | 2015-12-15 20:01:50 -0800 |
commit | 1d3342fd0952c57a737cf90794f20905bd48d5f1 (patch) | |
tree | b0dcc2a9f41f538ddd3581a3d32158a9d7bc0748 /render_sdl.c | |
parent | 9596af4ac4d0c8dcde83334889f60d6687940b12 (diff) |
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.
Diffstat (limited to 'render_sdl.c')
-rwxr-xr-x | render_sdl.c | 10 |
1 files changed, 8 insertions, 2 deletions
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); |