summaryrefslogtreecommitdiffstatshomepage
path: root/src/osd/sdl/window.c
diff options
context:
space:
mode:
author Couriersud <couriersud@users.noreply.github.com>2012-02-12 20:59:24 +0000
committer Couriersud <couriersud@users.noreply.github.com>2012-02-12 20:59:24 +0000
commit534416655539c77a6817cc3a3fd5352389997b39 (patch)
treea7d68c4a45c9530ee293ab14578243a0b131dc4e /src/osd/sdl/window.c
parentd75dbab0de7da33196f08f0cf7992d906ffbb832 (diff)
updated sdl os-core to compile against stock SDL-2.0 [couriersud].
- The SDL team has moved from 1.3 to 2.0. At the same time, changes were made to allow SDL1.2 and SDL2.0 to coexist. All SDL2.0 include files are now in /usr/include/SDL2. - Added sdlinc.h to avoid having tons of #ifdef .. #include in the code. - Scalemode is no longer a per-window setting - Fixed a bug in YUV rendering. - Use SDL_GetClipboard (SDL2.0) - Updated README_SDL20.txt Currently, SDL 2.0 is only supported on *nix. Volunteers welcome.
Diffstat (limited to 'src/osd/sdl/window.c')
-rw-r--r--src/osd/sdl/window.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/osd/sdl/window.c b/src/osd/sdl/window.c
index 85428699668..037f5bec2d3 100644
--- a/src/osd/sdl/window.c
+++ b/src/osd/sdl/window.c
@@ -10,9 +10,13 @@
//============================================================
// standard SDL headers
-#include <SDL/SDL.h>
-#include <SDL/SDL_syswm.h>
+#include "sdlinc.h"
+
+#if (SDLMAME_SDL2)
+#include <SDL2/SDL_thread.h>
+#else
#include <SDL/SDL_thread.h>
+#endif
// standard C headers
#include <math.h>
@@ -84,7 +88,7 @@ static sdl_window_info **last_window_ptr;
static int multithreading_enabled;
static osd_work_queue *work_queue;
-#if !(SDL_VERSION_ATLEAST(1,3,0))
+#if !(SDLMAME_SDL2)
typedef int SDL_threadID;
#endif
@@ -184,7 +188,7 @@ static OSDWORK_CALLBACK(sdlwindow_thread_id)
if (SDLMAME_INIT_IN_WORKER_THREAD)
{
-#if (SDL_VERSION_ATLEAST(1,3,0))
+#if (SDLMAME_SDL2)
if (SDL_InitSubSystem(SDL_INIT_TIMER|SDL_INIT_AUDIO| SDL_INIT_VIDEO| SDL_INIT_JOYSTICK|SDL_INIT_NOPARACHUTE))
#else
if (SDL_Init(SDL_INIT_TIMER|SDL_INIT_AUDIO| SDL_INIT_VIDEO| SDL_INIT_JOYSTICK|SDL_INIT_NOPARACHUTE))
@@ -239,7 +243,7 @@ int sdlwindow_init(running_machine &machine)
video_config.mode = VIDEO_MODE_SOFT;
}
#endif
-#if SDL_VERSION_ATLEAST(1,3,0)
+#if SDLMAME_SDL2
if (video_config.mode == VIDEO_MODE_SDL13)
{
if (draw13_init(machine, &draw))
@@ -408,7 +412,7 @@ void sdlwindow_blit_surface_size(sdl_window_info *window, int window_width, int
//FIXME: really necessary to distinguish for yuv_modes ?
if (window->target->zoom_to_screen()
- && (window->scale_mode == VIDEO_SCALE_MODE_NONE ))
+ && (video_config.scale_mode == VIDEO_SCALE_MODE_NONE ))
newwidth = window_width;
if ((window->blitwidth != newwidth) || (window->blitheight != newheight))
@@ -595,7 +599,7 @@ void sdlwindow_modify_prescale(running_machine &machine, sdl_window_info *window
static void sdlwindow_update_cursor_state(running_machine &machine, sdl_window_info *window)
{
-#if (SDL_VERSION_ATLEAST(1,3,0))
+#if (SDLMAME_SDL2)
// do not do mouse capture if the debugger's enabled to avoid
// the possibility of losing control
if (!(machine.debug_flags & DEBUG_FLAG_OSD_ENABLED))
@@ -672,7 +676,6 @@ int sdlwindow_video_window_create(running_machine &machine, int index, sdl_monit
//FIXME: these should be per_window in config-> or even better a bit set
window->fullscreen = !video_config.windowed;
window->prescale = video_config.prescale;
- window->scale_mode = video_config.scale_mode;
// set the initial maximized state
// FIXME: Does not belong here
@@ -798,7 +801,7 @@ static void sdlwindow_video_window_destroy(running_machine &machine, sdl_window_
// pick_best_mode
//============================================================
-#if SDL_VERSION_ATLEAST(1,3,0)
+#if SDLMAME_SDL2
static void pick_best_mode(sdl_window_info *window, int *fswidth, int *fsheight)
{
int minimum_width, minimum_height, target_width, target_height;