Linux: change configure defaults to SDL2

MinGW: change SDL1 to SDL2
This commit is contained in:
kanjitalk755 2018-06-26 21:00:52 +09:00
parent 01a375eefc
commit 52fe2290fe
8 changed files with 46 additions and 30 deletions

View File

@ -700,7 +700,11 @@ static SDL_Surface * init_sdl_video(int width, int height, int bpp, Uint32 flags
shutdown_sdl_video();
return NULL;
}
#ifdef __MACOSX__
window_flags |= SDL_WINDOW_FULLSCREEN_DESKTOP;
#else
window_flags |= SDL_WINDOW_FULLSCREEN;
#endif
window_width = desktop_mode.w;
window_height = desktop_mode.h;
}
@ -748,15 +752,11 @@ static SDL_Surface * init_sdl_video(int width, int height, int bpp, Uint32 flags
}
if (!sdl_renderer) {
const char *render_driver = PrefsFindString("sdlrender");
if (render_driver) {
if (SDL_strcmp(render_driver, "auto") == 0) {
SDL_SetHint(SDL_HINT_RENDER_DRIVER, "");
} else {
SDL_SetHint(SDL_HINT_RENDER_DRIVER, render_driver);
}
}
#ifdef WIN32
SDL_SetHint(SDL_HINT_RENDER_DRIVER, "software");
#else
SDL_SetHint(SDL_HINT_RENDER_DRIVER, "");
#endif
sdl_renderer = SDL_CreateRenderer(sdl_window, -1, 0);
if (!sdl_renderer) {
shutdown_sdl_video();
@ -1543,7 +1543,11 @@ static void do_toggle_fullscreen(void)
SDL_SetWindowGrab(sdl_window, SDL_FALSE);
} else {
display_type = DISPLAY_SCREEN;
#ifdef __MACOSX__
SDL_SetWindowFullscreen(sdl_window, SDL_WINDOW_FULLSCREEN_DESKTOP);
#else
SDL_SetWindowFullscreen(sdl_window, SDL_WINDOW_FULLSCREEN);
#endif
SDL_SetWindowGrab(sdl_window, SDL_TRUE);
}
}

6
BasiliskII/src/Unix/configure.ac Normal file → Executable file
View File

@ -32,14 +32,14 @@ AC_ARG_ENABLE(vosf, [ --enable-vosf enable video on SEGV sig
dnl SDL options.
AC_ARG_ENABLE(sdl-static, [ --enable-sdl-static use SDL static libraries for linking [default=no]], [WANT_SDL_STATIC=$enableval], [WANT_SDL_STATIC=no])
AC_ARG_ENABLE(sdl-video, [ --enable-sdl-video use SDL for video graphics [default=no]], [WANT_SDL_VIDEO=$enableval], [WANT_SDL_VIDEO=no])
AC_ARG_ENABLE(sdl-audio, [ --enable-sdl-audio use SDL for audio [default=no]], [WANT_SDL_AUDIO=$enableval], [WANT_SDL_AUDIO=no])
AC_ARG_ENABLE(sdl-video, [ --enable-sdl-video use SDL for video graphics [default=no]], [WANT_SDL_VIDEO=$enableval], [WANT_SDL_VIDEO=yes])
AC_ARG_ENABLE(sdl-audio, [ --enable-sdl-audio use SDL for audio [default=no]], [WANT_SDL_AUDIO=$enableval], [WANT_SDL_AUDIO=yes])
AC_ARG_ENABLE(sdl-framework, [ --enable-sdl-framework use SDL framework [default=no]], [WANT_SDL_FRAMEWORK=$enableval], [WANT_SDL_FRAMEWORK=no])
AC_ARG_ENABLE(sdl-framework-prefix, [ --enable-sdl-framework-prefix=PFX default=/Library/Frameworks], [SDL_FRAMEWORK="$enableval"], [SDL_FRAMEWORK=/Library/Frameworks])
AC_ARG_WITH(sdl1, [ --with-sdl1 use SDL 1.x, rather than SDL 2.x [default=no]], [WANT_SDL_VERSION_MAJOR=1], [])
dnl JIT compiler options.
AC_ARG_ENABLE(jit-compiler, [ --enable-jit-compiler enable JIT compiler [default=no]], [WANT_JIT=$enableval], [WANT_JIT=no])
AC_ARG_ENABLE(jit-compiler, [ --enable-jit-compiler enable JIT compiler [default=no]], [WANT_JIT=$enableval], [WANT_JIT=yes])
AC_ARG_ENABLE(jit-debug, [ --enable-jit-debug activate native code disassemblers [default=no]], [WANT_JIT_DEBUG=$enableval], [WANT_JIT_DEBUG=no])
dnl FPU emulation core.

View File

@ -524,7 +524,7 @@ CPUINCLUDES="-I../uae_cpu"
CPUSRCS="../uae_cpu/basilisk_glue.cpp ../uae_cpu/memory.cpp ../uae_cpu/newcpu.cpp ../uae_cpu/readcpu.cpp $FPUSRCS cpustbl.cpp cpudefs.cpp $CPUSRCS $JITSRCS"
dnl We really want SDL for now
AC_CHECK_TOOL(sdl_config, sdl-config, [AC_MSG_ERROR([Sorry, you currently need SDL for this port])])
AC_CHECK_TOOL(sdl_config, sdl2-config, [AC_MSG_ERROR([Sorry, you currently need SDL for this port])])
SDL_CFLAGS=`$sdl_config --cflags`
AC_SUBST(SDL_CFLAGS)
if [[ "x$WANT_SDL_STATIC" = "xyes" ]]; then

View File

@ -283,10 +283,6 @@ int main(int argc, char **argv)
QuitEmulator();
#endif
// FIXME: default to DIB driver
if (getenv("SDL_VIDEODRIVER") == NULL)
putenv("SDL_VIDEODRIVER=windib");
// Initialize SDL system
int sdl_flags = 0;
#ifdef USE_SDL_VIDEO
@ -400,7 +396,7 @@ int main(int argc, char **argv)
emul_thread = GetCurrentThread();
// SDL threads available, start 60Hz thread
tick_thread_active = ((tick_thread = SDL_CreateThread(tick_func, NULL)) != NULL);
tick_thread_active = ((tick_thread = SDL_CreateThread(tick_func, "Redraw Thread", NULL)) != NULL);
if (!tick_thread_active) {
sprintf(str, GetString(STR_TICK_THREAD_ERR), strerror(errno));
ErrorAlert(str);
@ -410,7 +406,7 @@ int main(int argc, char **argv)
// Start XPRAM watchdog thread
memcpy(last_xpram, XPRAM, XPRAM_SIZE);
xpram_thread_active = ((xpram_thread = SDL_CreateThread(xpram_func, NULL)) != NULL);
xpram_thread_active = ((xpram_thread = SDL_CreateThread(xpram_func, "XPRAM Thread", NULL)) != NULL);
D(bug("XPRAM thread started\n"));
// Start 68k and jump to ROM boot routine
@ -625,11 +621,21 @@ static int tick_func(void *arg)
#ifdef USE_SDL_VIDEO
#include <SDL_syswm.h>
extern SDL_Window *sdl_window;
HWND GetMainWindowHandle(void)
{
SDL_SysWMinfo wmInfo;
SDL_VERSION(&wmInfo.version);
return SDL_GetWMInfo(&wmInfo) ? wmInfo.window : NULL;
if (!sdl_window) {
return NULL;
}
if (!SDL_GetWindowWMInfo(sdl_window, &wmInfo)) {
return NULL;
}
if (wmInfo.subsystem != SDL_SYSWM_WINDOWS) {
return NULL;
}
return wmInfo.info.win.window;
}
#endif

4
SheepShaver/src/Unix/configure.ac Normal file → Executable file
View File

@ -68,8 +68,8 @@ AC_ARG_ENABLE(addressing,
dnl SDL options.
AC_ARG_ENABLE(sdl-static, [ --enable-sdl-static use SDL static libraries for linking [default=no]], [WANT_SDL_STATIC=$enableval], [WANT_SDL_STATIC=no])
AC_ARG_ENABLE(sdl-video, [ --enable-sdl-video use SDL for video graphics [default=no]], [WANT_SDL_VIDEO=$enableval], [WANT_SDL_VIDEO=no])
AC_ARG_ENABLE(sdl-audio, [ --enable-sdl-audio use SDL for audio [default=no]], [WANT_SDL_AUDIO=$enableval], [WANT_SDL_AUDIO=no])
AC_ARG_ENABLE(sdl-video, [ --enable-sdl-video use SDL for video graphics [default=no]], [WANT_SDL_VIDEO=$enableval], [WANT_SDL_VIDEO=yes])
AC_ARG_ENABLE(sdl-audio, [ --enable-sdl-audio use SDL for audio [default=no]], [WANT_SDL_AUDIO=$enableval], [WANT_SDL_AUDIO=yes])
AC_ARG_ENABLE(sdl-framework, [ --enable-sdl-framework use SDL framework [default=no]], [WANT_SDL_FRAMEWORK=$enableval], [WANT_SDL_FRAMEWORK=no])
AC_ARG_ENABLE(sdl-framework-prefix, [ --enable-sdl-framework-prefix=PFX default=/Library/Frameworks], [SDL_FRAMEWORK="$enableval"], [SDL_FRAMEWORK=/Library/Frameworks])
AC_ARG_WITH(sdl1, [ --with-sdl1 use SDL 1.x, rather than SDL 2.x [default=no]], [WANT_SDL_VERSION_MAJOR=1], [])

4
SheepShaver/src/Windows/configure.ac Executable file → Normal file
View File

@ -12,7 +12,7 @@ AC_CANONICAL_HOST
AC_CANONICAL_TARGET
dnl Options.
AC_ARG_ENABLE(jit, [ --enable-jit enable JIT compiler [default=yes]], [WANT_JIT=$enableval], [WANT_JIT=yes])
AC_ARG_ENABLE(jit, [ --enable-jit enable JIT compiler [default=yes]], [WANT_JIT=$enableval], [WANT_JIT=no])
AC_ARG_WITH(gtk, [ --with-gtk use GTK user interface [default=yes]], [WANT_GTK=$withval], [WANT_GTK=yes])
AC_ARG_ENABLE(vosf, [ --enable-vosf enable video on SEGV signals [default=yes]], [WANT_VOSF=$enableval], [WANT_VOSF=yes])
@ -238,7 +238,7 @@ dnl Use the dummy prefs file.
CPUSRCS="$CPUSRCS ../dummy/prefs_dummy.cpp"
dnl We really want SDL for now
AC_CHECK_TOOL(sdl_config, sdl-config, [AC_MSG_ERROR([Sorry, you currently need SDL for this port])])
AC_CHECK_TOOL(sdl_config, sdl2-config, [AC_MSG_ERROR([Sorry, you currently need SDL for this port])])
SDL_CFLAGS=`$sdl_config --cflags`
AC_SUBST(SDL_CFLAGS)
SDL_LIBS=`$sdl_config --libs`

View File

@ -210,10 +210,6 @@ int main(int argc, char **argv)
// // Load win32 libraries
// KernelInit();
// FIXME: default to DIB driver
if (getenv("SDL_VIDEODRIVER") == NULL)
putenv("SDL_VIDEODRIVER=windib");
// Initialize SDL system
int sdl_flags = 0;
#ifdef USE_SDL_VIDEO
@ -770,11 +766,21 @@ void SheepMem::Exit(void)
#ifdef USE_SDL_VIDEO
#include <SDL_syswm.h>
extern SDL_Window *sdl_window;
HWND GetMainWindowHandle(void)
{
SDL_SysWMinfo wmInfo;
SDL_VERSION(&wmInfo.version);
return SDL_GetWMInfo(&wmInfo) ? wmInfo.window : NULL;
if (!sdl_window) {
return NULL;
}
if (!SDL_GetWindowWMInfo(sdl_window, &wmInfo)) {
return NULL;
}
if (wmInfo.subsystem != SDL_SYSWM_WINDOWS) {
return NULL;
}
return wmInfo.info.win.window;
}
#endif

View File

@ -22,6 +22,6 @@
#define VERSION_H
const int VERSION_MAJOR = 2;
const int VERSION_MINOR = 4;
const int VERSION_MINOR = 5;
#endif