summaryrefslogtreecommitdiffstatshomepage
path: root/src/osd/sdl/window.cpp
diff options
context:
space:
mode:
author Brad Hughes <bradhugh@outlook.com>2016-01-29 15:02:27 -0500
committer Brad Hughes <bradhugh@outlook.com>2016-02-28 14:25:10 -0500
commit7dfb5785594a359ce9886ef6eebf564ea73af729 (patch)
tree21da5ec12cc680192e9ceaa1e4d1080b9b8a95b3 /src/osd/sdl/window.cpp
parenta9f2f5ba4aca2a1fddd54fb7fc8cc6e17c8cac10 (diff)
Refactor OSD input into modules
Diffstat (limited to 'src/osd/sdl/window.cpp')
-rw-r--r--src/osd/sdl/window.cpp28
1 files changed, 24 insertions, 4 deletions
diff --git a/src/osd/sdl/window.cpp b/src/osd/sdl/window.cpp
index 47ab3cdd162..08bd3c33988 100644
--- a/src/osd/sdl/window.cpp
+++ b/src/osd/sdl/window.cpp
@@ -38,7 +38,6 @@
// OSD headers
#include "window.h"
-#include "input.h"
#include "osdsdl.h"
//============================================================
@@ -580,8 +579,11 @@ OSDWORK_CALLBACK( sdl_window_info::sdlwindow_toggle_full_screen_wt )
}
#endif
-
+#ifdef USE_OLD_SDL_INPUT
sdlinput_release_keys();
+#else
+ downcast<sdl_osd_interface &>(window->machine().osd()).release_keys();
+#endif
window->set_renderer(draw.create(window));
@@ -654,7 +656,12 @@ void sdl_window_info::update_cursor_state()
{
//FIXME: SDL1.3: really broken: the whole SDL code
// will only work correct with relative mouse movements ...
- if (!fullscreen() && !sdlinput_should_hide_mouse())
+#ifdef USE_OLD_SDL_INPUT
+ bool should_hide_mouse = sdlinput_should_hide_mouse();
+#else
+ bool should_hide_mouse = downcast<sdl_osd_interface&>(machine().osd()).should_hide_mouse();
+#endif
+ if (!fullscreen() && !should_hide_mouse)
{
SDL_ShowCursor(SDL_ENABLE);
if (SDL_GetWindowGrab(sdl_window() ))
@@ -676,7 +683,12 @@ void sdl_window_info::update_cursor_state()
// the possibility of losing control
if (!(machine().debug_flags & DEBUG_FLAG_OSD_ENABLED))
{
- if ( fullscreen() || sdlinput_should_hide_mouse() )
+#ifdef USE_OLD_SDL_INPUT
+ bool should_hide_mouse = sdlinput_should_hide_mouse();
+#else
+ bool should_hide_mouse = downcast<sdl_osd_interface&>(machine().osd()).should_hide_mouse();
+#endif
+ if ( fullscreen() || should_hide_mouse )
{
SDL_ShowCursor(SDL_DISABLE);
if (!SDL_WM_GrabInput(SDL_GRAB_QUERY))
@@ -810,7 +822,11 @@ OSDWORK_CALLBACK( sdl_window_info::sdlwindow_video_window_destroy_wt )
#endif
// release all keys ...
+#ifdef USE_OLD_SDL_INPUT
sdlinput_release_keys();
+#else
+ downcast<sdl_osd_interface &>(window->machine().osd()).release_keys();
+#endif
osd_free(wp);
@@ -1338,7 +1354,11 @@ OSDWORK_CALLBACK( sdl_window_info::draw_video_contents_wt )
ASSERT_REDRAW_THREAD();
// Some configurations require events to be polled in the worker thread
+#ifdef USE_OLD_SDL_INPUT
sdlinput_process_events_buf();
+#else
+ downcast< sdl_osd_interface& >(window->machine().osd()).process_events_buf();
+#endif
// Check whether window has vector screens