From eebbf3457ccb7ebca9a83cd77e8673a5f822e772 Mon Sep 17 00:00:00 2001 From: Charlie Birks Date: Fri, 25 Feb 2022 17:19:25 +0000 Subject: [PATCH 001/153] emscripten: Use emscripten_webgl_ API directly --- src/video/emscripten/SDL_emscriptenopengles.c | 148 +++++++++++------- src/video/emscripten/SDL_emscriptenopengles.h | 16 +- src/video/emscripten/SDL_emscriptenvideo.c | 24 --- src/video/emscripten/SDL_emscriptenvideo.h | 7 - 4 files changed, 101 insertions(+), 94 deletions(-) diff --git a/src/video/emscripten/SDL_emscriptenopengles.c b/src/video/emscripten/SDL_emscriptenopengles.c index 10c6285cf3..a3219372c1 100644 --- a/src/video/emscripten/SDL_emscriptenopengles.c +++ b/src/video/emscripten/SDL_emscriptenopengles.c @@ -20,83 +20,123 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_EMSCRIPTEN && SDL_VIDEO_OPENGL_EGL +#if SDL_VIDEO_DRIVER_EMSCRIPTEN #include +#include #include #include "SDL_emscriptenvideo.h" #include "SDL_emscriptenopengles.h" #include "SDL_hints.h" -#define LOAD_FUNC(NAME) _this->egl_data->NAME = NAME; - -/* EGL implementation of SDL OpenGL support */ int -Emscripten_GLES_LoadLibrary(_THIS, const char *path) { - /*we can't load EGL dynamically*/ - _this->egl_data = (struct SDL_EGL_VideoData *) SDL_calloc(1, sizeof(SDL_EGL_VideoData)); - if (!_this->egl_data) { - return SDL_OutOfMemory(); - } - - /* Emscripten forces you to manually cast eglGetProcAddress to the real - function type; grep for "__eglMustCastToProperFunctionPointerType" in - Emscripten's egl.h for details. */ - _this->egl_data->eglGetProcAddress = (void *(EGLAPIENTRY *)(const char *)) eglGetProcAddress; - - LOAD_FUNC(eglGetDisplay); - LOAD_FUNC(eglInitialize); - LOAD_FUNC(eglTerminate); - LOAD_FUNC(eglChooseConfig); - LOAD_FUNC(eglGetConfigAttrib); - LOAD_FUNC(eglCreateContext); - LOAD_FUNC(eglDestroyContext); - LOAD_FUNC(eglCreateWindowSurface); - LOAD_FUNC(eglDestroySurface); - LOAD_FUNC(eglMakeCurrent); - LOAD_FUNC(eglSwapBuffers); - LOAD_FUNC(eglSwapInterval); - LOAD_FUNC(eglWaitNative); - LOAD_FUNC(eglWaitGL); - LOAD_FUNC(eglBindAPI); - LOAD_FUNC(eglQueryString); - LOAD_FUNC(eglGetError); - - _this->egl_data->egl_display = _this->egl_data->eglGetDisplay(EGL_DEFAULT_DISPLAY); - if (!_this->egl_data->egl_display) { - return SDL_SetError("Could not get EGL display"); - } - - if (_this->egl_data->eglInitialize(_this->egl_data->egl_display, NULL, NULL) != EGL_TRUE) { - return SDL_SetError("Could not initialize EGL"); - } - - if (path) { - SDL_strlcpy(_this->gl_config.driver_path, path, sizeof(_this->gl_config.driver_path) - 1); - } else { - *_this->gl_config.driver_path = '\0'; - } - +Emscripten_GLES_LoadLibrary(_THIS, const char *path) +{ return 0; } -SDL_EGL_CreateContext_impl(Emscripten) -SDL_EGL_MakeCurrent_impl(Emscripten) +void +Emscripten_GLES_UnloadLibrary(_THIS) +{ +} + +void * +Emscripten_GLES_GetProcAddress(_THIS, const char *proc) +{ + return emscripten_webgl_get_proc_address(proc); +} + +int +Emscripten_GLES_SetSwapInterval(_THIS, int interval) +{ + if (interval < 0) { + return SDL_SetError("Late swap tearing currently unsupported"); + } else if(interval == 0) { + emscripten_set_main_loop_timing(EM_TIMING_SETTIMEOUT, 0); + } else { + emscripten_set_main_loop_timing(EM_TIMING_RAF, interval); + } + + return 0; +} + +int +Emscripten_GLES_GetSwapInterval(_THIS) +{ + int mode, value; + + emscripten_get_main_loop_timing(&mode, &value); + + if(mode == EM_TIMING_RAF) + return value; + + return 0; +} + +SDL_GLContext +Emscripten_GLES_CreateContext(_THIS, SDL_Window * window) +{ + SDL_WindowData *window_data; + + EmscriptenWebGLContextAttributes attribs; + EMSCRIPTEN_WEBGL_CONTEXT_HANDLE context; + + emscripten_webgl_init_context_attributes(&attribs); + + attribs.alpha = _this->gl_config.alpha_size > 0; + attribs.depth = _this->gl_config.depth_size > 0; + attribs.stencil = _this->gl_config.stencil_size > 0; + attribs.antialias = _this->gl_config.multisamplebuffers == 1; + + if(_this->gl_config.major_version == 3) + attribs.majorVersion = 2; /* WebGL 2.0 ~= GLES 3.0 */ + + window_data = (SDL_WindowData *) window->driverdata; + context = emscripten_webgl_create_context(window_data->canvas_id, &attribs); + + if (context < 0) { + SDL_SetError("Could not create webgl context"); + return NULL; + } + + if (emscripten_webgl_make_context_current(context) != EMSCRIPTEN_RESULT_SUCCESS) { + emscripten_webgl_destroy_context(context); + return NULL; + } + + + return (SDL_GLContext)context; +} + +void +Emscripten_GLES_DeleteContext(_THIS, SDL_GLContext context) +{ + emscripten_webgl_destroy_context((EMSCRIPTEN_WEBGL_CONTEXT_HANDLE)context); +} int Emscripten_GLES_SwapWindow(_THIS, SDL_Window * window) { - EGLBoolean ret = SDL_EGL_SwapBuffers(_this, ((SDL_WindowData *) window->driverdata)->egl_surface); if (emscripten_has_asyncify() && SDL_GetHintBoolean(SDL_HINT_EMSCRIPTEN_ASYNCIFY, SDL_TRUE)) { /* give back control to browser for screen refresh */ emscripten_sleep(0); } - return ret; + return 0; } -#endif /* SDL_VIDEO_DRIVER_EMSCRIPTEN && SDL_VIDEO_OPENGL_EGL */ +int +Emscripten_GLES_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context) +{ + /* ignores window, as it isn't possible to reuse contexts across canvases */ + if (emscripten_webgl_make_context_current((EMSCRIPTEN_WEBGL_CONTEXT_HANDLE)context) != EMSCRIPTEN_RESULT_SUCCESS) { + return SDL_SetError("Unable to make context current"); + } + return 0; +} + +#endif /* SDL_VIDEO_DRIVER_EMSCRIPTEN */ /* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/video/emscripten/SDL_emscriptenopengles.h b/src/video/emscripten/SDL_emscriptenopengles.h index 9d178f6902..6d58ac10df 100644 --- a/src/video/emscripten/SDL_emscriptenopengles.h +++ b/src/video/emscripten/SDL_emscriptenopengles.h @@ -23,25 +23,23 @@ #ifndef SDL_emscriptenopengles_h_ #define SDL_emscriptenopengles_h_ -#if SDL_VIDEO_DRIVER_EMSCRIPTEN && SDL_VIDEO_OPENGL_EGL +#if SDL_VIDEO_DRIVER_EMSCRIPTEN #include "../SDL_sysvideo.h" -#include "../SDL_egl_c.h" /* OpenGLES functions */ -#define Emscripten_GLES_GetAttribute SDL_EGL_GetAttribute -#define Emscripten_GLES_GetProcAddress SDL_EGL_GetProcAddress -#define Emscripten_GLES_UnloadLibrary SDL_EGL_UnloadLibrary -#define Emscripten_GLES_SetSwapInterval SDL_EGL_SetSwapInterval -#define Emscripten_GLES_GetSwapInterval SDL_EGL_GetSwapInterval -#define Emscripten_GLES_DeleteContext SDL_EGL_DeleteContext extern int Emscripten_GLES_LoadLibrary(_THIS, const char *path); +extern void Emscripten_GLES_UnloadLibrary(_THIS); +extern void * Emscripten_GLES_GetProcAddress(_THIS, const char *proc); +extern int Emscripten_GLES_SetSwapInterval(_THIS, int interval); +extern int Emscripten_GLES_GetSwapInterval(_THIS); extern SDL_GLContext Emscripten_GLES_CreateContext(_THIS, SDL_Window * window); +extern void Emscripten_GLES_DeleteContext(_THIS, SDL_GLContext context); extern int Emscripten_GLES_SwapWindow(_THIS, SDL_Window * window); extern int Emscripten_GLES_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context); -#endif /* SDL_VIDEO_DRIVER_EMSCRIPTEN && SDL_VIDEO_OPENGL_EGL */ +#endif /* SDL_VIDEO_DRIVER_EMSCRIPTEN */ #endif /* SDL_emscriptenopengles_h_ */ diff --git a/src/video/emscripten/SDL_emscriptenvideo.c b/src/video/emscripten/SDL_emscriptenvideo.c index 550031d3fb..46813a7217 100644 --- a/src/video/emscripten/SDL_emscriptenvideo.c +++ b/src/video/emscripten/SDL_emscriptenvideo.c @@ -27,7 +27,6 @@ #include "SDL_hints.h" #include "../SDL_sysvideo.h" #include "../SDL_pixels_c.h" -#include "../SDL_egl_c.h" #include "../../events/SDL_events_c.h" #include "SDL_emscriptenvideo.h" @@ -110,7 +109,6 @@ Emscripten_CreateDevice(void) device->UpdateWindowFramebuffer = Emscripten_UpdateWindowFramebuffer; device->DestroyWindowFramebuffer = Emscripten_DestroyWindowFramebuffer; -#if SDL_VIDEO_OPENGL_EGL device->GL_LoadLibrary = Emscripten_GLES_LoadLibrary; device->GL_GetProcAddress = Emscripten_GLES_GetProcAddress; device->GL_UnloadLibrary = Emscripten_GLES_UnloadLibrary; @@ -120,7 +118,6 @@ Emscripten_CreateDevice(void) device->GL_GetSwapInterval = Emscripten_GLES_GetSwapInterval; device->GL_SwapWindow = Emscripten_GLES_SwapWindow; device->GL_DeleteContext = Emscripten_GLES_DeleteContext; -#endif device->free = Emscripten_DeleteDevice; @@ -259,21 +256,6 @@ Emscripten_CreateWindow(_THIS, SDL_Window * window) } } -#if SDL_VIDEO_OPENGL_EGL - if (window->flags & SDL_WINDOW_OPENGL) { - if (!_this->egl_data) { - if (SDL_GL_LoadLibrary(NULL) < 0) { - return -1; - } - } - wdata->egl_surface = SDL_EGL_CreateSurface(_this, 0); - - if (wdata->egl_surface == EGL_NO_SURFACE) { - return SDL_SetError("Could not create GLES window surface"); - } - } -#endif - wdata->window = window; /* Setup driver data for this window */ @@ -329,12 +311,6 @@ Emscripten_DestroyWindow(_THIS, SDL_Window * window) data = (SDL_WindowData *) window->driverdata; Emscripten_UnregisterEventHandlers(data); -#if SDL_VIDEO_OPENGL_EGL - if (data->egl_surface != EGL_NO_SURFACE) { - SDL_EGL_DestroySurface(_this, data->egl_surface); - data->egl_surface = EGL_NO_SURFACE; - } -#endif /* We can't destroy the canvas, so resize it to zero instead */ emscripten_set_canvas_element_size(data->canvas_id, 0, 0); diff --git a/src/video/emscripten/SDL_emscriptenvideo.h b/src/video/emscripten/SDL_emscriptenvideo.h index e87788d3f8..20481235e5 100644 --- a/src/video/emscripten/SDL_emscriptenvideo.h +++ b/src/video/emscripten/SDL_emscriptenvideo.h @@ -28,15 +28,8 @@ #include #include -#if SDL_VIDEO_OPENGL_EGL -#include -#endif - typedef struct SDL_WindowData { -#if SDL_VIDEO_OPENGL_EGL - EGLSurface egl_surface; -#endif SDL_Window *window; SDL_Surface *surface; From 539efc1bbaec197cb0d6663824fd29fd71060785 Mon Sep 17 00:00:00 2001 From: Charlie Birks Date: Sat, 26 Feb 2022 12:24:32 +0000 Subject: [PATCH 002/153] emscripten: Return an error for webgl context limitations --- src/video/emscripten/SDL_emscriptenopengles.c | 30 ++++++++++++++++++- src/video/emscripten/SDL_emscriptenvideo.h | 2 ++ 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/src/video/emscripten/SDL_emscriptenopengles.c b/src/video/emscripten/SDL_emscriptenopengles.c index a3219372c1..ccec124ce2 100644 --- a/src/video/emscripten/SDL_emscriptenopengles.c +++ b/src/video/emscripten/SDL_emscriptenopengles.c @@ -94,6 +94,12 @@ Emscripten_GLES_CreateContext(_THIS, SDL_Window * window) attribs.majorVersion = 2; /* WebGL 2.0 ~= GLES 3.0 */ window_data = (SDL_WindowData *) window->driverdata; + + if (window_data->gl_context) { + SDL_SetError("Cannot create multiple webgl contexts per window"); + return NULL; + } + context = emscripten_webgl_create_context(window_data->canvas_id, &attribs); if (context < 0) { @@ -106,6 +112,7 @@ Emscripten_GLES_CreateContext(_THIS, SDL_Window * window) return NULL; } + window_data->gl_context = (SDL_GLContext)context; return (SDL_GLContext)context; } @@ -113,6 +120,18 @@ Emscripten_GLES_CreateContext(_THIS, SDL_Window * window) void Emscripten_GLES_DeleteContext(_THIS, SDL_GLContext context) { + SDL_Window *window; + + /* remove the context from its window */ + for (window = _this->windows; window != NULL; window = window->next) { + SDL_WindowData *window_data; + window_data = (SDL_WindowData *) window->driverdata; + + if (window_data->gl_context == context) { + window_data->gl_context = NULL; + } + } + emscripten_webgl_destroy_context((EMSCRIPTEN_WEBGL_CONTEXT_HANDLE)context); } @@ -129,7 +148,16 @@ Emscripten_GLES_SwapWindow(_THIS, SDL_Window * window) int Emscripten_GLES_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context) { - /* ignores window, as it isn't possible to reuse contexts across canvases */ + /* it isn't possible to reuse contexts across canvases */ + if (window && context) { + SDL_WindowData *window_data; + window_data = (SDL_WindowData *) window->driverdata; + + if (context != window_data->gl_context) { + return SDL_SetError("Cannot make context current to another window"); + } + } + if (emscripten_webgl_make_context_current((EMSCRIPTEN_WEBGL_CONTEXT_HANDLE)context) != EMSCRIPTEN_RESULT_SUCCESS) { return SDL_SetError("Unable to make context current"); } diff --git a/src/video/emscripten/SDL_emscriptenvideo.h b/src/video/emscripten/SDL_emscriptenvideo.h index 20481235e5..4cd0a5ce59 100644 --- a/src/video/emscripten/SDL_emscriptenvideo.h +++ b/src/video/emscripten/SDL_emscriptenvideo.h @@ -33,6 +33,8 @@ typedef struct SDL_WindowData SDL_Window *window; SDL_Surface *surface; + SDL_GLContext gl_context; + char *canvas_id; float pixel_ratio; From b5aedaad5923edd88ca33e6dab4b86503e8cb0f3 Mon Sep 17 00:00:00 2001 From: Charlie Birks Date: Sun, 8 Apr 2018 16:54:29 +0100 Subject: [PATCH 003/153] emscripten: Modify UpdateWindowFramebuffer To work with multiple canvases --- src/video/emscripten/SDL_emscriptenframebuffer.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/video/emscripten/SDL_emscriptenframebuffer.c b/src/video/emscripten/SDL_emscriptenframebuffer.c index 03fea04efa..05e4aa7453 100644 --- a/src/video/emscripten/SDL_emscriptenframebuffer.c +++ b/src/video/emscripten/SDL_emscriptenframebuffer.c @@ -75,12 +75,15 @@ int Emscripten_UpdateWindowFramebuffer(_THIS, SDL_Window * window, const SDL_Rec var w = $0; var h = $1; var pixels = $2; + var canvasId = UTF8ToString($3); + var canvas = document.querySelector(canvasId); + //TODO: this should store a context per canvas if (!Module['SDL2']) Module['SDL2'] = {}; var SDL2 = Module['SDL2']; - if (SDL2.ctxCanvas !== Module['canvas']) { - SDL2.ctx = Module['createContext'](Module['canvas'], false, true); - SDL2.ctxCanvas = Module['canvas']; + if (SDL2.ctxCanvas !== canvas) { + SDL2.ctx = Module['createContext'](canvas, false, true); + SDL2.ctxCanvas = canvas; } if (SDL2.w !== w || SDL2.h !== h || SDL2.imageCtx !== SDL2.ctx) { SDL2.image = SDL2.ctx.createImageData(w, h); @@ -156,7 +159,7 @@ int Emscripten_UpdateWindowFramebuffer(_THIS, SDL_Window * window, const SDL_Rec } SDL2.ctx.putImageData(SDL2.image, 0, 0); - }, surface->w, surface->h, surface->pixels); + }, surface->w, surface->h, surface->pixels, data->canvas_id); if (emscripten_has_asyncify() && SDL_GetHintBoolean(SDL_HINT_EMSCRIPTEN_ASYNCIFY, SDL_TRUE)) { /* give back control to browser for screen refresh */ From d75fb0995dcf533bbc03bdac1c7d41caad678d68 Mon Sep 17 00:00:00 2001 From: Charlie Birks Date: Sat, 26 Feb 2022 14:52:08 +0000 Subject: [PATCH 004/153] emscripten: Add a hint for specifying the canvas selector Now that we're not going through EGL, this is easy --- include/SDL_hints.h | 9 +++++++++ src/video/emscripten/SDL_emscriptenvideo.c | 8 +++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/include/SDL_hints.h b/include/SDL_hints.h index 48f4f3689a..6fee3e5fce 100644 --- a/include/SDL_hints.h +++ b/include/SDL_hints.h @@ -366,6 +366,15 @@ extern "C" { */ #define SDL_HINT_EMSCRIPTEN_ASYNCIFY "SDL_EMSCRIPTEN_ASYNCIFY" +/** + * \brief Specify the CSS selector used for the "default" window/canvas + * + * This hint only applies to the emscripten platform + * + * The default value is "#canvas" + */ +#define SDL_HINT_EMSCRIPTEN_CANVAS_SELECTOR "SDL_EMSCRIPTEN_CANVAS_SELECTOR" + /** * \brief override the binding element for keyboard inputs for Emscripten builds * diff --git a/src/video/emscripten/SDL_emscriptenvideo.c b/src/video/emscripten/SDL_emscriptenvideo.c index 46813a7217..c8efac48f8 100644 --- a/src/video/emscripten/SDL_emscriptenvideo.c +++ b/src/video/emscripten/SDL_emscriptenvideo.c @@ -215,6 +215,7 @@ Emscripten_CreateWindow(_THIS, SDL_Window * window) SDL_WindowData *wdata; double scaled_w, scaled_h; double css_w, css_h; + const char *selector; /* Allocate window internal data */ wdata = (SDL_WindowData *) SDL_calloc(1, sizeof(SDL_WindowData)); @@ -222,7 +223,12 @@ Emscripten_CreateWindow(_THIS, SDL_Window * window) return SDL_OutOfMemory(); } - wdata->canvas_id = SDL_strdup("#canvas"); + selector = SDL_GetHint(SDL_HINT_EMSCRIPTEN_CANVAS_SELECTOR); + if (!selector) { + selector = "#canvas"; + } + + wdata->canvas_id = SDL_strdup(selector); if (window->flags & SDL_WINDOW_ALLOW_HIGHDPI) { wdata->pixel_ratio = emscripten_get_device_pixel_ratio(); From 0dfc829a6b75b5a3c4c1d49fb943b622c12d67bc Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Thu, 10 Nov 2022 19:16:53 -0800 Subject: [PATCH 005/153] Added simple BLE Steam Controller support on all platforms This is still disabled by default via the hint SDL_HINT_JOYSTICK_HIDAPI_STEAM --- Makefile.os2 | 2 +- Makefile.w32 | 2 +- VisualC-GDK/SDL/SDL.vcxproj | 1 + VisualC-GDK/SDL/SDL.vcxproj.filters | 3 ++ VisualC/SDL/SDL.vcxproj | 1 + VisualC/SDL/SDL.vcxproj.filters | 3 ++ Xcode/SDL/SDL.xcodeproj/project.pbxproj | 6 +++ include/SDL_hints.h | 2 +- src/joystick/hidapi/SDL_hidapi_steam.c | 48 +++++++++++++++------- src/joystick/hidapi/SDL_hidapijoystick_c.h | 6 +-- test/testgamecontroller.c | 1 + 11 files changed, 53 insertions(+), 22 deletions(-) diff --git a/Makefile.os2 b/Makefile.os2 index 76b2b398df..6ec172b37d 100644 --- a/Makefile.os2 +++ b/Makefile.os2 @@ -94,7 +94,7 @@ SRCS+= SDL_systimer.c SRCS+= SDL_sysloadso.c SRCS+= SDL_sysfilesystem.c SRCS+= SDL_os2joystick.c SDL_syshaptic.c SDL_sysjoystick.c SDL_virtualjoystick.c -SRCS+= SDL_hidapijoystick.c SDL_hidapi_rumble.c SDL_hidapi_combined.c SDL_hidapi_gamecube.c SDL_hidapi_luna.c SDL_hidapi_ps3.c SDL_hidapi_ps4.c SDL_hidapi_ps5.c SDL_hidapi_shield.c SDL_hidapi_stadia.c SDL_hidapi_switch.c SDL_hidapi_wii.c SDL_hidapi_xbox360.c SDL_hidapi_xbox360w.c SDL_hidapi_xboxone.c SDL_hidapi_steam.c +SRCS+= SDL_hidapijoystick.c SDL_hidapi_rumble.c SDL_hidapi_combined.c SDL_hidapi_gamecube.c SDL_hidapi_luna.c SDL_hidapi_ps3.c SDL_hidapi_ps4.c SDL_hidapi_ps5.c SDL_hidapi_shield.c SDL_hidapi_stadia.c SDL_hidapi_steam.c SDL_hidapi_switch.c SDL_hidapi_wii.c SDL_hidapi_xbox360.c SDL_hidapi_xbox360w.c SDL_hidapi_xboxone.c SDL_hidapi_steam.c SRCS+= SDL_dummyaudio.c SDL_diskaudio.c SRCS+= SDL_nullvideo.c SDL_nullframebuffer.c SDL_nullevents.c SRCS+= SDL_dummysensor.c diff --git a/Makefile.w32 b/Makefile.w32 index 68c3a37315..407bfd2a01 100644 --- a/Makefile.w32 +++ b/Makefile.w32 @@ -73,7 +73,7 @@ SRCS+= SDL_systimer.c SRCS+= SDL_sysloadso.c SRCS+= SDL_sysfilesystem.c SRCS+= SDL_syshaptic.c SDL_sysjoystick.c SDL_virtualjoystick.c -SRCS+= SDL_hidapijoystick.c SDL_hidapi_rumble.c SDL_hidapi_combined.c SDL_hidapi_gamecube.c SDL_hidapi_luna.c SDL_hidapi_ps3.c SDL_hidapi_ps4.c SDL_hidapi_ps5.c SDL_hidapi_shield.c SDL_hidapi_stadia.c SDL_hidapi_switch.c SDL_hidapi_wii.c SDL_hidapi_xbox360.c SDL_hidapi_xbox360w.c SDL_hidapi_xboxone.c SDL_hidapi_steam.c +SRCS+= SDL_hidapijoystick.c SDL_hidapi_rumble.c SDL_hidapi_combined.c SDL_hidapi_gamecube.c SDL_hidapi_luna.c SDL_hidapi_ps3.c SDL_hidapi_ps4.c SDL_hidapi_ps5.c SDL_hidapi_shield.c SDL_hidapi_stadia.c SDL_hidapi_steam.c SDL_hidapi_switch.c SDL_hidapi_wii.c SDL_hidapi_xbox360.c SDL_hidapi_xbox360w.c SDL_hidapi_xboxone.c SDL_hidapi_steam.c SRCS+= SDL_dummyaudio.c SDL_diskaudio.c SRCS+= SDL_nullvideo.c SDL_nullframebuffer.c SDL_nullevents.c SRCS+= SDL_dummysensor.c diff --git a/VisualC-GDK/SDL/SDL.vcxproj b/VisualC-GDK/SDL/SDL.vcxproj index e3966e693d..c8208b41f7 100644 --- a/VisualC-GDK/SDL/SDL.vcxproj +++ b/VisualC-GDK/SDL/SDL.vcxproj @@ -600,6 +600,7 @@ + diff --git a/VisualC-GDK/SDL/SDL.vcxproj.filters b/VisualC-GDK/SDL/SDL.vcxproj.filters index 0c02e07965..02dc97ef30 100644 --- a/VisualC-GDK/SDL/SDL.vcxproj.filters +++ b/VisualC-GDK/SDL/SDL.vcxproj.filters @@ -1078,6 +1078,9 @@ joystick\hidapi + + joystick\hidapi + joystick\hidapi diff --git a/VisualC/SDL/SDL.vcxproj b/VisualC/SDL/SDL.vcxproj index e3b66d1cb1..2c85790e2c 100644 --- a/VisualC/SDL/SDL.vcxproj +++ b/VisualC/SDL/SDL.vcxproj @@ -491,6 +491,7 @@ + diff --git a/VisualC/SDL/SDL.vcxproj.filters b/VisualC/SDL/SDL.vcxproj.filters index 167e40d297..082e257b45 100644 --- a/VisualC/SDL/SDL.vcxproj.filters +++ b/VisualC/SDL/SDL.vcxproj.filters @@ -1069,6 +1069,9 @@ joystick\hidapi + + joystick\hidapi + joystick\hidapi diff --git a/Xcode/SDL/SDL.xcodeproj/project.pbxproj b/Xcode/SDL/SDL.xcodeproj/project.pbxproj index 9c086f1ff2..a0741e06c9 100644 --- a/Xcode/SDL/SDL.xcodeproj/project.pbxproj +++ b/Xcode/SDL/SDL.xcodeproj/project.pbxproj @@ -3393,6 +3393,9 @@ F323060528939F6400E66D30 /* SDL_hidapi_combined.c in Sources */ = {isa = PBXBuildFile; fileRef = F32305FE28939F6400E66D30 /* SDL_hidapi_combined.c */; }; F323060628939F6400E66D30 /* SDL_hidapi_combined.c in Sources */ = {isa = PBXBuildFile; fileRef = F32305FE28939F6400E66D30 /* SDL_hidapi_combined.c */; }; F323060728939F6400E66D30 /* SDL_hidapi_combined.c in Sources */ = {isa = PBXBuildFile; fileRef = F32305FE28939F6400E66D30 /* SDL_hidapi_combined.c */; }; + F34B9895291DEFF500AAC96E /* SDL_hidapi_steam.c in Sources */ = {isa = PBXBuildFile; fileRef = A75FDAAC23E2795C00529352 /* SDL_hidapi_steam.c */; }; + F34B9896291DEFF700AAC96E /* SDL_hidapi_steam.c in Sources */ = {isa = PBXBuildFile; fileRef = A75FDAAC23E2795C00529352 /* SDL_hidapi_steam.c */; }; + F34B9897291DEFFA00AAC96E /* SDL_hidapi_steam.c in Sources */ = {isa = PBXBuildFile; fileRef = A75FDAAC23E2795C00529352 /* SDL_hidapi_steam.c */; }; F3631C6424884ACF004F28EA /* SDL_locale.h in Headers */ = {isa = PBXBuildFile; fileRef = 566E26792462701100718109 /* SDL_locale.h */; settings = {ATTRIBUTES = (Public, ); }; }; F3631C652488534E004F28EA /* SDL_locale.h in Headers */ = {isa = PBXBuildFile; fileRef = 566E26792462701100718109 /* SDL_locale.h */; settings = {ATTRIBUTES = (Public, ); }; }; F376F6192559B29300CFC0BC /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F376F6182559B29300CFC0BC /* OpenGLES.framework */; platformFilter = ios; }; @@ -8909,6 +8912,7 @@ A7D8BBD923E2574800DCD162 /* SDL_uikitmessagebox.m in Sources */, A7D8AD2923E2514100DCD162 /* SDL_vulkan_utils.c in Sources */, A7D8A95123E2514000DCD162 /* SDL_spinlock.c in Sources */, + F34B9895291DEFF500AAC96E /* SDL_hidapi_steam.c in Sources */, A7D8BAAF23E2514400DCD162 /* s_atan.c in Sources */, A7D8B75223E2514300DCD162 /* SDL_sysloadso.c in Sources */, A7D8BBE123E2574800DCD162 /* SDL_uikitopenglview.m in Sources */, @@ -9103,6 +9107,7 @@ A7D8B41F23E2514300DCD162 /* SDL_systls.c in Sources */, A7D8AD2C23E2514100DCD162 /* SDL_vulkan_utils.c in Sources */, A7D8A95423E2514000DCD162 /* SDL_spinlock.c in Sources */, + F34B9896291DEFF700AAC96E /* SDL_hidapi_steam.c in Sources */, A7D8BAB223E2514400DCD162 /* s_atan.c in Sources */, F3A490A12554D38600E92A8B /* SDL_hidapi_ps5.c in Sources */, A7D8B75523E2514300DCD162 /* SDL_sysloadso.c in Sources */, @@ -9297,6 +9302,7 @@ A7D8AD2E23E2514100DCD162 /* SDL_vulkan_utils.c in Sources */, A7D8A95623E2514000DCD162 /* SDL_spinlock.c in Sources */, A7D8BAB423E2514400DCD162 /* s_atan.c in Sources */, + F34B9897291DEFFA00AAC96E /* SDL_hidapi_steam.c in Sources */, A7D8B75723E2514300DCD162 /* SDL_sysloadso.c in Sources */, F3A490A42554D38600E92A8B /* SDL_hidapi_ps5.c in Sources */, A7D8B98B23E2514400DCD162 /* SDL_render_metal.m in Sources */, diff --git a/include/SDL_hints.h b/include/SDL_hints.h index ce2225440f..d51525936c 100644 --- a/include/SDL_hints.h +++ b/include/SDL_hints.h @@ -817,7 +817,7 @@ extern "C" { #define SDL_HINT_JOYSTICK_HIDAPI_STADIA "SDL_JOYSTICK_HIDAPI_STADIA" /** - * \brief A variable controlling whether the HIDAPI driver for Steam Controllers should be used. + * \brief A variable controlling whether the HIDAPI driver for Bluetooth Steam Controllers should be used. * * This variable can be set to the following values: * "0" - HIDAPI driver is not used diff --git a/src/joystick/hidapi/SDL_hidapi_steam.c b/src/joystick/hidapi/SDL_hidapi_steam.c index 7b497fa959..9221d12e88 100644 --- a/src/joystick/hidapi/SDL_hidapi_steam.c +++ b/src/joystick/hidapi/SDL_hidapi_steam.c @@ -356,30 +356,41 @@ static int GetFeatureReport( SDL_hid_device *dev, unsigned char uBuffer[65] ) if ( bBle ) { int nRetries = 0; - uint8_t uSegmentBuffer[ MAX_REPORT_SEGMENT_SIZE ]; + uint8_t uSegmentBuffer[ MAX_REPORT_SEGMENT_SIZE + 1 ]; + uint8_t ucBytesToRead = MAX_REPORT_SEGMENT_SIZE; + uint8_t ucDataStartOffset = 0; SteamControllerPacketAssembler assembler; InitializeSteamControllerPacketAssembler( &assembler ); + // On Windows and macOS, BLE devices get 2 copies of the feature report ID, one that is removed by ReadFeatureReport, + // and one that's included in the buffer we receive. We pad the bytes to read and skip over the report ID + // if necessary. +#if defined(__WIN32__) || defined(__MACOSX__) + ++ucBytesToRead; + ++ucDataStartOffset; +#endif + while( nRetries < BLE_MAX_READ_RETRIES ) { SDL_memset( uSegmentBuffer, 0, sizeof( uSegmentBuffer ) ); uSegmentBuffer[ 0 ] = BLE_REPORT_NUMBER; - nRet = SDL_hid_get_feature_report( dev, uSegmentBuffer, sizeof( uSegmentBuffer ) ); + nRet = SDL_hid_get_feature_report( dev, uSegmentBuffer, ucBytesToRead ); + DPRINTF( "GetFeatureReport ble ret=%d\n", nRet ); HEXDUMP( uSegmentBuffer, nRet ); // Zero retry counter if we got data - if ( nRet > 2 && ( uSegmentBuffer[ 1 ] & REPORT_SEGMENT_DATA_FLAG ) ) + if ( nRet > 2 && ( uSegmentBuffer[ ucDataStartOffset + 1 ] & REPORT_SEGMENT_DATA_FLAG ) ) nRetries = 0; else nRetries++; - + if ( nRet > 0 ) { int nPacketLength = WriteSegmentToSteamControllerPacketAssembler( &assembler, - uSegmentBuffer, - nRet ); + uSegmentBuffer + ucDataStartOffset, + nRet - ucDataStartOffset ); if ( nPacketLength > 0 && nPacketLength < 65 ) { @@ -424,7 +435,8 @@ static bool ResetSteamController( SDL_hid_device *dev, bool bSuppressErrorSpew, { // Firmware quirk: Set Feature and Get Feature requests always require a 65-byte buffer. unsigned char buf[65]; - int res = -1, i; + unsigned int i; + int res = -1; int nSettings = 0; int nAttributesLength; FeatureReportMsg *msg; @@ -803,8 +815,8 @@ static void FormatStatePacketUntilGyro( SteamControllerStateInternal_t *pState, pState->sRightPadX = clamp(nRightPadX + nPadOffset, SDL_MIN_SINT16, SDL_MAX_SINT16); pState->sRightPadY = clamp(nRightPadY + nPadOffset, SDL_MIN_SINT16, SDL_MAX_SINT16); - pState->sTriggerL = (unsigned short)RemapValClamped( (pStatePacket->ButtonTriggerData.Triggers.nLeft << 7) | pStatePacket->ButtonTriggerData.Triggers.nLeft, 0, STEAMCONTROLLER_TRIGGER_MAX_ANALOG, 0, SDL_MAX_SINT16 ); - pState->sTriggerR = (unsigned short)RemapValClamped( (pStatePacket->ButtonTriggerData.Triggers.nRight << 7) | pStatePacket->ButtonTriggerData.Triggers.nRight, 0, STEAMCONTROLLER_TRIGGER_MAX_ANALOG, 0, SDL_MAX_SINT16 ); + pState->sTriggerL = (unsigned short)RemapValClamped( (float)((pStatePacket->ButtonTriggerData.Triggers.nLeft << 7) | pStatePacket->ButtonTriggerData.Triggers.nLeft), 0, STEAMCONTROLLER_TRIGGER_MAX_ANALOG, 0, SDL_MAX_SINT16 ); + pState->sTriggerR = (unsigned short)RemapValClamped( (float)((pStatePacket->ButtonTriggerData.Triggers.nRight << 7) | pStatePacket->ButtonTriggerData.Triggers.nRight), 0, STEAMCONTROLLER_TRIGGER_MAX_ANALOG, 0, SDL_MAX_SINT16 ); } @@ -827,8 +839,8 @@ static bool UpdateBLESteamControllerState( const uint8_t *pData, int nDataSize, if ( ucOptionDataMask & k_EBLEButtonChunk2 ) { // The middle 2 bytes of the button bits over the wire are triggers when over the wire and non-SC buttons in the internal controller state packet - pState->sTriggerL = (unsigned short)RemapValClamped( ( pData[ 0 ] << 7 ) | pData[ 0 ], 0, STEAMCONTROLLER_TRIGGER_MAX_ANALOG, 0, SDL_MAX_SINT16 ); - pState->sTriggerR = (unsigned short)RemapValClamped( ( pData[ 1 ] << 7 ) | pData[ 1 ], 0, STEAMCONTROLLER_TRIGGER_MAX_ANALOG, 0, SDL_MAX_SINT16 ); + pState->sTriggerL = (unsigned short)RemapValClamped( (float)(( pData[ 0 ] << 7 ) | pData[ 0 ]), 0, STEAMCONTROLLER_TRIGGER_MAX_ANALOG, 0, SDL_MAX_SINT16 ); + pState->sTriggerR = (unsigned short)RemapValClamped( (float)(( pData[ 1 ] << 7 ) | pData[ 1 ]), 0, STEAMCONTROLLER_TRIGGER_MAX_ANALOG, 0, SDL_MAX_SINT16 ); pData += 2; } if ( ucOptionDataMask & k_EBLEButtonChunk3 ) @@ -1035,6 +1047,14 @@ HIDAPI_DriverSteam_InitDevice(SDL_HIDAPI_Device *device) } device->context = ctx; +#if defined(__WIN32__) + if (device->serial) { + /* We get a garbage serial number on Windows */ + SDL_free(device->serial); + device->serial = NULL; + } +#endif /* __WIN32__ */ + HIDAPI_SetDeviceName(device, "Steam Controller"); return HIDAPI_JoystickConnected(device, NULL); @@ -1240,9 +1260,9 @@ HIDAPI_DriverSteam_UpdateDevice(SDL_HIDAPI_Device *device) ctx->timestamp_us += ctx->update_rate_in_us; - values[0] = (ctx->m_state.sGyroX / 32768.0f) * (2000.0f * (M_PI / 180.0f)); - values[1] = (ctx->m_state.sGyroZ / 32768.0f) * (2000.0f * (M_PI / 180.0f)); - values[2] = (ctx->m_state.sGyroY / 32768.0f) * (2000.0f * (M_PI / 180.0f)); + values[0] = (ctx->m_state.sGyroX / 32768.0f) * (2000.0f * ((float)M_PI / 180.0f)); + values[1] = (ctx->m_state.sGyroZ / 32768.0f) * (2000.0f * ((float)M_PI / 180.0f)); + values[2] = (ctx->m_state.sGyroY / 32768.0f) * (2000.0f * ((float)M_PI / 180.0f)); SDL_PrivateJoystickSensor(joystick, SDL_SENSOR_GYRO, ctx->timestamp_us, values, 3); values[0] = (ctx->m_state.sAccelX / 32768.0f) * 2.0f * SDL_STANDARD_GRAVITY; diff --git a/src/joystick/hidapi/SDL_hidapijoystick_c.h b/src/joystick/hidapi/SDL_hidapijoystick_c.h index a03221c1e2..4ebadede95 100644 --- a/src/joystick/hidapi/SDL_hidapijoystick_c.h +++ b/src/joystick/hidapi/SDL_hidapijoystick_c.h @@ -38,17 +38,13 @@ #define SDL_JOYSTICK_HIDAPI_PS4 #define SDL_JOYSTICK_HIDAPI_PS5 #define SDL_JOYSTICK_HIDAPI_STADIA +#define SDL_JOYSTICK_HIDAPI_STEAM /* Simple support for BLE Steam Controller, hint is disabled by default */ #define SDL_JOYSTICK_HIDAPI_SWITCH #define SDL_JOYSTICK_HIDAPI_WII #define SDL_JOYSTICK_HIDAPI_XBOX360 #define SDL_JOYSTICK_HIDAPI_XBOXONE #define SDL_JOYSTICK_HIDAPI_SHIELD -#if defined(__IPHONEOS__) || defined(__TVOS__) || defined(__ANDROID__) -/* Very basic Steam Controller support on mobile devices */ -#define SDL_JOYSTICK_HIDAPI_STEAM -#endif - /* Whether HIDAPI is enabled by default */ #define SDL_HIDAPI_DEFAULT SDL_TRUE diff --git a/test/testgamecontroller.c b/test/testgamecontroller.c index 5d87b7a2c7..053bea023d 100644 --- a/test/testgamecontroller.c +++ b/test/testgamecontroller.c @@ -793,6 +793,7 @@ main(int argc, char *argv[]) SDL_SetHint(SDL_HINT_ACCELEROMETER_AS_JOYSTICK, "0"); SDL_SetHint(SDL_HINT_JOYSTICK_HIDAPI_PS4_RUMBLE, "1"); SDL_SetHint(SDL_HINT_JOYSTICK_HIDAPI_PS5_RUMBLE, "1"); + SDL_SetHint(SDL_HINT_JOYSTICK_HIDAPI_STEAM, "1"); SDL_SetHint(SDL_HINT_JOYSTICK_ROG_CHAKRAM, "1"); SDL_SetHint(SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS, "1"); SDL_SetHint(SDL_HINT_LINUX_JOYSTICK_DEADZONES, "1"); From dd44cacbd66b27ecff2842b092331f06eca9b04f Mon Sep 17 00:00:00 2001 From: Ozkan Sezer Date: Fri, 11 Nov 2022 12:51:30 +0300 Subject: [PATCH 006/153] remove duplicated SDL_hidapi_steam.c additions to watcom makefiles. --- Makefile.os2 | 2 +- Makefile.w32 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile.os2 b/Makefile.os2 index 6ec172b37d..76b2b398df 100644 --- a/Makefile.os2 +++ b/Makefile.os2 @@ -94,7 +94,7 @@ SRCS+= SDL_systimer.c SRCS+= SDL_sysloadso.c SRCS+= SDL_sysfilesystem.c SRCS+= SDL_os2joystick.c SDL_syshaptic.c SDL_sysjoystick.c SDL_virtualjoystick.c -SRCS+= SDL_hidapijoystick.c SDL_hidapi_rumble.c SDL_hidapi_combined.c SDL_hidapi_gamecube.c SDL_hidapi_luna.c SDL_hidapi_ps3.c SDL_hidapi_ps4.c SDL_hidapi_ps5.c SDL_hidapi_shield.c SDL_hidapi_stadia.c SDL_hidapi_steam.c SDL_hidapi_switch.c SDL_hidapi_wii.c SDL_hidapi_xbox360.c SDL_hidapi_xbox360w.c SDL_hidapi_xboxone.c SDL_hidapi_steam.c +SRCS+= SDL_hidapijoystick.c SDL_hidapi_rumble.c SDL_hidapi_combined.c SDL_hidapi_gamecube.c SDL_hidapi_luna.c SDL_hidapi_ps3.c SDL_hidapi_ps4.c SDL_hidapi_ps5.c SDL_hidapi_shield.c SDL_hidapi_stadia.c SDL_hidapi_switch.c SDL_hidapi_wii.c SDL_hidapi_xbox360.c SDL_hidapi_xbox360w.c SDL_hidapi_xboxone.c SDL_hidapi_steam.c SRCS+= SDL_dummyaudio.c SDL_diskaudio.c SRCS+= SDL_nullvideo.c SDL_nullframebuffer.c SDL_nullevents.c SRCS+= SDL_dummysensor.c diff --git a/Makefile.w32 b/Makefile.w32 index 407bfd2a01..68c3a37315 100644 --- a/Makefile.w32 +++ b/Makefile.w32 @@ -73,7 +73,7 @@ SRCS+= SDL_systimer.c SRCS+= SDL_sysloadso.c SRCS+= SDL_sysfilesystem.c SRCS+= SDL_syshaptic.c SDL_sysjoystick.c SDL_virtualjoystick.c -SRCS+= SDL_hidapijoystick.c SDL_hidapi_rumble.c SDL_hidapi_combined.c SDL_hidapi_gamecube.c SDL_hidapi_luna.c SDL_hidapi_ps3.c SDL_hidapi_ps4.c SDL_hidapi_ps5.c SDL_hidapi_shield.c SDL_hidapi_stadia.c SDL_hidapi_steam.c SDL_hidapi_switch.c SDL_hidapi_wii.c SDL_hidapi_xbox360.c SDL_hidapi_xbox360w.c SDL_hidapi_xboxone.c SDL_hidapi_steam.c +SRCS+= SDL_hidapijoystick.c SDL_hidapi_rumble.c SDL_hidapi_combined.c SDL_hidapi_gamecube.c SDL_hidapi_luna.c SDL_hidapi_ps3.c SDL_hidapi_ps4.c SDL_hidapi_ps5.c SDL_hidapi_shield.c SDL_hidapi_stadia.c SDL_hidapi_switch.c SDL_hidapi_wii.c SDL_hidapi_xbox360.c SDL_hidapi_xbox360w.c SDL_hidapi_xboxone.c SDL_hidapi_steam.c SRCS+= SDL_dummyaudio.c SDL_diskaudio.c SRCS+= SDL_nullvideo.c SDL_nullframebuffer.c SDL_nullevents.c SRCS+= SDL_dummysensor.c From 36c6ed4b6f2622222d0515204700dfbc78c7df0f Mon Sep 17 00:00:00 2001 From: pionere Date: Fri, 11 Nov 2022 08:33:55 +0100 Subject: [PATCH 007/153] video: add SDL_DllNotSupported - add SDL_DllNotSupported and use it to sync the behavior of SDL_GL_LoadLibrary with SDL_Vulkan_LoadLibrary --- src/video/SDL_video.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c index 7994c19432..ff4602f95c 100644 --- a/src/video/SDL_video.c +++ b/src/video/SDL_video.c @@ -1587,6 +1587,12 @@ SDL_ContextNotSupported(const char *name) "(%s) or platform", name, _this->name); } +static int +SDL_DllNotSupported(const char *name) +{ + return SDL_SetError("No dynamic %s support in current SDL video driver (%s)", name, _this->name); +} + SDL_Window * SDL_CreateWindow(const char *title, int x, int y, int w, int h, Uint32 flags) { @@ -3444,7 +3450,7 @@ SDL_GL_LoadLibrary(const char *path) retval = 0; } else { if (!_this->GL_LoadLibrary) { - return SDL_SetError("No dynamic GL support in current SDL video driver (%s)", _this->name); + return SDL_DllNotSupported("OpenGL"); } retval = _this->GL_LoadLibrary(_this, path); } @@ -4755,7 +4761,7 @@ int SDL_Vulkan_LoadLibrary(const char *path) retval = 0; } else { if (!_this->Vulkan_LoadLibrary) { - return SDL_ContextNotSupported("Vulkan"); + return SDL_DllNotSupported("Vulkan"); } retval = _this->Vulkan_LoadLibrary(_this, path); } From b71d9274291d38df68254b236448e3933a8c4eb3 Mon Sep 17 00:00:00 2001 From: pionere Date: Fri, 11 Nov 2022 12:09:15 +0100 Subject: [PATCH 008/153] video: add NOT_AN_OPENGL_WINDOW define (similar to NOT_A_VULKAN_WINDOW) --- src/video/SDL_video.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c index ff4602f95c..24a42a4ce5 100644 --- a/src/video/SDL_video.c +++ b/src/video/SDL_video.c @@ -4067,6 +4067,8 @@ SDL_GL_GetAttribute(SDL_GLattr attr, int *value) #endif /* SDL_VIDEO_OPENGL */ } +#define NOT_AN_OPENGL_WINDOW "The specified window isn't an OpenGL window" + SDL_GLContext SDL_GL_CreateContext(SDL_Window * window) { @@ -4074,7 +4076,7 @@ SDL_GL_CreateContext(SDL_Window * window) CHECK_WINDOW_MAGIC(window, NULL); if (!(window->flags & SDL_WINDOW_OPENGL)) { - SDL_SetError("The specified window isn't an OpenGL window"); + SDL_SetError(NOT_AN_OPENGL_WINDOW); return NULL; } @@ -4111,7 +4113,7 @@ SDL_GL_MakeCurrent(SDL_Window * window, SDL_GLContext ctx) CHECK_WINDOW_MAGIC(window, -1); if (!(window->flags & SDL_WINDOW_OPENGL)) { - return SDL_SetError("The specified window isn't an OpenGL window"); + return SDL_SetError(NOT_AN_OPENGL_WINDOW); } } else if (!_this->gl_allow_no_surface) { return SDL_SetError("Use of OpenGL without a window is not supported on this platform"); @@ -4192,7 +4194,7 @@ SDL_GL_SwapWindowWithResult(SDL_Window * window) CHECK_WINDOW_MAGIC(window, -1); if (!(window->flags & SDL_WINDOW_OPENGL)) { - return SDL_SetError("The specified window isn't an OpenGL window"); + return SDL_SetError(NOT_AN_OPENGL_WINDOW); } if (SDL_GL_GetCurrentWindow() != window) { From d09edcbcac13e10676eedced42bd5b71948820a3 Mon Sep 17 00:00:00 2001 From: pionere Date: Fri, 11 Nov 2022 12:10:27 +0100 Subject: [PATCH 009/153] video: sync Metal_CreateView with GL_CreateContext and Vulkan_CreateSurface no need to check if _this->Metal_CreateView, since it is already checked in Re(create)Window --- src/video/SDL_video.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c index 24a42a4ce5..0495e8ca9e 100644 --- a/src/video/SDL_video.c +++ b/src/video/SDL_video.c @@ -4867,12 +4867,7 @@ SDL_Metal_CreateView(SDL_Window * window) return NULL; } - if (_this->Metal_CreateView) { - return _this->Metal_CreateView(_this, window); - } else { - SDL_SetError("Metal is not supported."); - return NULL; - } + return _this->Metal_CreateView(_this, window); } void From afbafc2aef9f06847d234997a4e7f81000d39d3d Mon Sep 17 00:00:00 2001 From: Michael Fitzmayer Date: Fri, 21 Oct 2022 08:11:48 +0200 Subject: [PATCH 010/153] Remove redundant dependency to bitdraw.h, minor cleanup --- src/video/ngage/SDL_ngagevideo.h | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/video/ngage/SDL_ngagevideo.h b/src/video/ngage/SDL_ngagevideo.h index 86fc1a586d..af8e8d857a 100644 --- a/src/video/ngage/SDL_ngagevideo.h +++ b/src/video/ngage/SDL_ngagevideo.h @@ -30,7 +30,16 @@ #include #include #include -#include // CFbsDrawDevice + +class CFbsDrawDevice : public CBase +{ +public: +public: + IMPORT_C static CFbsDrawDevice* NewScreenDeviceL(TScreenInfoV01 aInfo,TDisplayMode aDispMode); +public: + virtual void Update() {} + virtual void UpdateRegion(const TRect&) {} +}; #define _THIS SDL_VideoDevice *_this @@ -46,10 +55,7 @@ typedef struct SDL_VideoData TRequestStatus NGAGE_WsEventStatus; TRequestStatus NGAGE_RedrawEventStatus; TWsEvent NGAGE_WsEvent; - //TWsRedrawEvent NGAGE_RedrawEvent; - CFbsDrawDevice* NGAGE_DrawDevice; - TBool NGAGE_IsWindowFocused; /* Not used yet */ /* Screen hardware frame buffer info */ @@ -64,10 +70,6 @@ typedef struct SDL_VideoData CFbsBitGc::TGraphicsOrientation NGAGE_ScreenOrientation; - /* Simulate double screen height */ - //TInt NGAGE_ScreenXScaleValue; - //TInt NGAGE_ScreenYScaleValue; - } SDL_VideoData; #endif /* _SDL_ngagevideo_h */ From 875e9b35d70d88b2de3fdb7b57e4fecd8f35d39a Mon Sep 17 00:00:00 2001 From: Michael Fitzmayer Date: Wed, 26 Oct 2022 15:19:28 +0200 Subject: [PATCH 011/153] N-Gage: additional cleanup --- src/video/ngage/SDL_ngageframebuffer.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/video/ngage/SDL_ngageframebuffer.cpp b/src/video/ngage/SDL_ngageframebuffer.cpp index a67fa5a8a0..98ff9ff71a 100644 --- a/src/video/ngage/SDL_ngageframebuffer.cpp +++ b/src/video/ngage/SDL_ngageframebuffer.cpp @@ -220,10 +220,9 @@ void DirectDraw(_THIS, int numrects, SDL_Rect *rects, TUint16* screenBuffer) TInt i; - //const TInt sourceNumBytesPerPixel = ((screen->format->BitsPerPixel-1) >> 3) + 1; TDisplayMode displayMode = phdata->NGAGE_DisplayMode; const TInt sourceNumBytesPerPixel = ((GetBpp(displayMode)-1) / 8) + 1; - // + const TPoint fixedOffset = phdata->NGAGE_ScreenOffset; const TInt screenW = screen->w; const TInt screenH = screen->h; @@ -383,7 +382,6 @@ void DirectUpdate(_THIS, int numrects, SDL_Rect *rects) DirectDraw(_this, numrects, rects, screenBuffer); } - //TRect rect2 = TRect(phdata->NGAGE_WsWindow.Size()); for (int i = 0; i < numrects; ++i) { TInt aAx = rects[i].x; From b7e65a81f1b0638c084d3c4195a7b88fb7175b6c Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Fri, 11 Nov 2022 08:57:07 -0800 Subject: [PATCH 012/153] Fixed incorrect WGI controller state when the application loses focus Recenter the controller elements when WGI stops reporting valid state Fixes https://github.com/libsdl-org/SDL/issues/5261 --- src/joystick/SDL_joystick.c | 2 +- src/joystick/SDL_joystick_c.h | 1 + .../windows/SDL_windows_gaming_input.c | 26 ++++++++++++++----- 3 files changed, 21 insertions(+), 8 deletions(-) diff --git a/src/joystick/SDL_joystick.c b/src/joystick/SDL_joystick.c index c1e47beb08..c6d2bf3930 100644 --- a/src/joystick/SDL_joystick.c +++ b/src/joystick/SDL_joystick.c @@ -1432,7 +1432,7 @@ static void UpdateEventsForDeviceRemoval(int device_index, Uint32 type) SDL_small_free(events, isstack); } -static void +void SDL_PrivateJoystickForceRecentering(SDL_Joystick *joystick) { int i, j; diff --git a/src/joystick/SDL_joystick_c.h b/src/joystick/SDL_joystick_c.h index 3ded9763e5..0f2093cafb 100644 --- a/src/joystick/SDL_joystick_c.h +++ b/src/joystick/SDL_joystick_c.h @@ -152,6 +152,7 @@ extern void SDL_PrivateJoystickAddTouchpad(SDL_Joystick *joystick, int nfingers) extern void SDL_PrivateJoystickAddSensor(SDL_Joystick *joystick, SDL_SensorType type, float rate); extern void SDL_PrivateJoystickAdded(SDL_JoystickID device_instance); extern void SDL_PrivateJoystickRemoved(SDL_JoystickID device_instance); +extern void SDL_PrivateJoystickForceRecentering(SDL_Joystick *joystick); extern int SDL_PrivateJoystickAxis(SDL_Joystick *joystick, Uint8 axis, Sint16 value); extern int SDL_PrivateJoystickBall(SDL_Joystick *joystick, diff --git a/src/joystick/windows/SDL_windows_gaming_input.c b/src/joystick/windows/SDL_windows_gaming_input.c index deec84bf57..3a89d1154a 100644 --- a/src/joystick/windows/SDL_windows_gaming_input.c +++ b/src/joystick/windows/SDL_windows_gaming_input.c @@ -852,15 +852,27 @@ WGI_JoystickUpdate(SDL_Joystick *joystick) hr = __x_ABI_CWindows_CGaming_CInput_CIRawGameController_GetCurrentReading(hwdata->controller, nbuttons, buttons, nhats, hats, naxes, axes, ×tamp); if (SUCCEEDED(hr) && timestamp != hwdata->timestamp) { UINT32 i; + SDL_bool all_zero = SDL_TRUE; - for (i = 0; i < nbuttons; ++i) { - SDL_PrivateJoystickButton(joystick, (Uint8)i, buttons[i]); - } - for (i = 0; i < nhats; ++i) { - SDL_PrivateJoystickHat(joystick, (Uint8)i, ConvertHatValue(hats[i])); - } + /* The axes are all zero when the application loses focus */ for (i = 0; i < naxes; ++i) { - SDL_PrivateJoystickAxis(joystick, (Uint8)i, (Sint16)((int) (axes[i] * 65535) - 32768)); + if (axes[i] != 0.0f) { + all_zero = SDL_FALSE; + break; + } + } + if (all_zero) { + SDL_PrivateJoystickForceRecentering(joystick); + } else { + for (i = 0; i < nbuttons; ++i) { + SDL_PrivateJoystickButton(joystick, (Uint8) i, buttons[i]); + } + for (i = 0; i < nhats; ++i) { + SDL_PrivateJoystickHat(joystick, (Uint8) i, ConvertHatValue(hats[i])); + } + for (i = 0; i < naxes; ++i) { + SDL_PrivateJoystickAxis(joystick, (Uint8)i, (Sint16)((int) (axes[i] * 65535) - 32768)); + } } hwdata->timestamp = timestamp; } From 9f8b68a2785563031473011379878bb63ed5d3a3 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Fri, 11 Nov 2022 10:24:17 -0800 Subject: [PATCH 013/153] Fixed building without linux/input.h https://github.com/libsdl-org/SDL/issues/6169 --- CMakeLists.txt | 3 ++- configure | 16 ++++++++++++---- configure.ac | 14 ++++++++------ include/SDL_config.h.cmake | 1 + include/SDL_config.h.in | 1 + src/core/linux/SDL_evdev_capabilities.c | 8 ++++++-- src/core/linux/SDL_evdev_capabilities.h | 5 ++++- src/core/linux/SDL_ime.c | 1 + src/core/linux/SDL_sandbox.c | 3 +-- src/core/linux/SDL_udev.c | 1 + src/core/linux/SDL_udev.h | 4 ++-- src/hidapi/SDL_hidapi.c | 1 - 12 files changed, 39 insertions(+), 19 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index bbb200274d..d27141d1f6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1010,6 +1010,7 @@ if(SDL_LIBC) string(REPLACE "." "_" _HAVE_H ${_UPPER}) check_include_file("${_HEADER}" ${_HAVE_H}) endforeach() + check_include_file(linux/input.h HAVE_LINUX_INPUT_H) set(STDC_HEADER_NAMES "stddef.h;stdarg.h;stdlib.h;string.h;stdio.h;wchar.h;float.h") check_include_files("${STDC_HEADER_NAMES}" STDC_HEADERS) @@ -1579,7 +1580,7 @@ elseif(UNIX AND NOT APPLE AND NOT RISCOS AND NOT HAIKU) if(FREEBSD OR NETBSD OR OPENBSD OR BSDI) CheckUSBHID() endif() - if(LINUX AND NOT ANDROID) + if(LINUX AND HAVE_LINUX_INPUT_H AND NOT ANDROID) set(SDL_JOYSTICK_LINUX 1) file(GLOB JOYSTICK_SOURCES ${SDL2_SOURCE_DIR}/src/joystick/linux/*.c ${SDL2_SOURCE_DIR}/src/joystick/steam/*.c) list(APPEND SOURCE_FILES ${JOYSTICK_SOURCES}) diff --git a/configure b/configure index 0f8806ced0..4f4253cf1e 100755 --- a/configure +++ b/configure @@ -18816,6 +18816,12 @@ if test "x$ac_cv_header_signal_h" = xyes then : printf "%s\n" "#define HAVE_SIGNAL_H 1" >>confdefs.h +fi +ac_fn_c_check_header_compile "$LINENO" "linux/input.h" "ac_cv_header_linux_input_h" "$ac_includes_default" +if test "x$ac_cv_header_linux_input_h" = xyes +then : + printf "%s\n" "#define HAVE_LINUX_INPUT_H 1" >>confdefs.h + fi @@ -28492,15 +28498,17 @@ printf "%s\n" "#define SDL_AUDIO_DRIVER_AAUDIO 1" >>confdefs.h if test x$enable_joystick = xyes; then case $ARCH in linux) + if test "x$ac_cv_header_linux_input_h" = xyes; then printf "%s\n" "#define SDL_JOYSTICK_LINUX 1" >>confdefs.h - SOURCES="$SOURCES $srcdir/src/joystick/linux/*.c" - SOURCES="$SOURCES $srcdir/src/joystick/steam/*.c" - have_joystick=yes + SOURCES="$SOURCES $srcdir/src/joystick/linux/*.c" + SOURCES="$SOURCES $srcdir/src/joystick/steam/*.c" + have_joystick=yes + fi ;; freebsd) - if test x$use_input_events = xyes; then + if test x$use_input_events = xyes -a x$ac_cv_header_linux_input_h = xyes; then printf "%s\n" "#define SDL_JOYSTICK_LINUX 1" >>confdefs.h diff --git a/configure.ac b/configure.ac index b520d21ad0..60ab5b6f16 100644 --- a/configure.ac +++ b/configure.ac @@ -329,7 +329,7 @@ if test x$enable_libc = xyes; then dnl Check for C library headers dnl AC_CHECK_INCLUDES_DEFAULT is an autoconf-2.7x thing where AC_HEADER_STDC is deprecated. m4_ifdef([AC_CHECK_INCLUDES_DEFAULT], [AC_CHECK_INCLUDES_DEFAULT], [AC_HEADER_STDC]) - AC_CHECK_HEADERS(sys/types.h stdio.h stdlib.h stddef.h stdarg.h malloc.h memory.h string.h strings.h wchar.h inttypes.h stdint.h limits.h ctype.h math.h float.h iconv.h signal.h) + AC_CHECK_HEADERS(sys/types.h stdio.h stdlib.h stddef.h stdarg.h malloc.h memory.h string.h strings.h wchar.h inttypes.h stdint.h limits.h ctype.h math.h float.h iconv.h signal.h linux/input.h) dnl Check for typedefs, structures, etc. AC_TYPE_SIZE_T @@ -3900,13 +3900,15 @@ case "$host" in if test x$enable_joystick = xyes; then case $ARCH in linux) - AC_DEFINE(SDL_JOYSTICK_LINUX, 1, [ ]) - SOURCES="$SOURCES $srcdir/src/joystick/linux/*.c" - SOURCES="$SOURCES $srcdir/src/joystick/steam/*.c" - have_joystick=yes + if test "x$ac_cv_header_linux_input_h" = xyes; then + AC_DEFINE(SDL_JOYSTICK_LINUX, 1, [ ]) + SOURCES="$SOURCES $srcdir/src/joystick/linux/*.c" + SOURCES="$SOURCES $srcdir/src/joystick/steam/*.c" + have_joystick=yes + fi ;; freebsd) - if test x$use_input_events = xyes; then + if test x$use_input_events = xyes -a x$ac_cv_header_linux_input_h = xyes; then AC_DEFINE(SDL_JOYSTICK_LINUX, 1, [ ]) SOURCES="$SOURCES $srcdir/src/joystick/linux/*.c" SOURCES="$SOURCES $srcdir/src/joystick/steam/*.c" diff --git a/include/SDL_config.h.cmake b/include/SDL_config.h.cmake index c9ee9df997..b85c5672b1 100644 --- a/include/SDL_config.h.cmake +++ b/include/SDL_config.h.cmake @@ -72,6 +72,7 @@ #cmakedefine HAVE_STRING_H 1 #cmakedefine HAVE_SYS_TYPES_H 1 #cmakedefine HAVE_WCHAR_H 1 +#cmakedefine HAVE_LINUX_INPUT_H 1 #cmakedefine HAVE_PTHREAD_NP_H 1 #cmakedefine HAVE_LIBUNWIND_H 1 diff --git a/include/SDL_config.h.in b/include/SDL_config.h.in index f6f2171fa4..67e50745b4 100644 --- a/include/SDL_config.h.in +++ b/include/SDL_config.h.in @@ -75,6 +75,7 @@ #undef HAVE_STRING_H #undef HAVE_SYS_TYPES_H #undef HAVE_WCHAR_H +#undef HAVE_LINUX_INPUT_H #undef HAVE_PTHREAD_NP_H #undef HAVE_LIBUNWIND_H diff --git a/src/core/linux/SDL_evdev_capabilities.c b/src/core/linux/SDL_evdev_capabilities.c index 976f629fc0..e23d499736 100644 --- a/src/core/linux/SDL_evdev_capabilities.c +++ b/src/core/linux/SDL_evdev_capabilities.c @@ -19,10 +19,12 @@ misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. */ +#include "../../SDL_internal.h" #include "SDL_evdev_capabilities.h" -#if HAVE_LIBUDEV_H || defined(SDL_JOYSTICK_LINUX) + +#if HAVE_LINUX_INPUT_H /* missing defines in older Linux kernel headers */ #ifndef BTN_TRIGGER_HAPPY @@ -142,4 +144,6 @@ SDL_EVDEV_GuessDeviceClass(unsigned long bitmask_ev[NBITS(EV_MAX)], return devclass; } -#endif +#endif /* HAVE_LINUX_INPUT_H */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/core/linux/SDL_evdev_capabilities.h b/src/core/linux/SDL_evdev_capabilities.h index 990ebe01b8..67b7075cca 100644 --- a/src/core/linux/SDL_evdev_capabilities.h +++ b/src/core/linux/SDL_evdev_capabilities.h @@ -19,12 +19,13 @@ misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. */ - #include "../../SDL_internal.h" #ifndef SDL_evdev_capabilities_h_ #define SDL_evdev_capabilities_h_ +#if HAVE_LINUX_INPUT_H + #include /* A device can be any combination of these classes */ @@ -51,6 +52,8 @@ extern int SDL_EVDEV_GuessDeviceClass(unsigned long bitmask_ev[NBITS(EV_MAX)], unsigned long bitmask_key[NBITS(KEY_MAX)], unsigned long bitmask_rel[NBITS(REL_MAX)]); +#endif /* HAVE_LINUX_INPUT_H */ + #endif /* SDL_evdev_capabilities_h_ */ /* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/core/linux/SDL_ime.c b/src/core/linux/SDL_ime.c index 50b5ebf7d5..3ad4dbf434 100644 --- a/src/core/linux/SDL_ime.c +++ b/src/core/linux/SDL_ime.c @@ -18,6 +18,7 @@ misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. */ +#include "../../SDL_internal.h" #include "SDL_ime.h" #include "SDL_ibus.h" diff --git a/src/core/linux/SDL_sandbox.c b/src/core/linux/SDL_sandbox.c index e266e5e5ca..3987890ad4 100644 --- a/src/core/linux/SDL_sandbox.c +++ b/src/core/linux/SDL_sandbox.c @@ -19,9 +19,8 @@ misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. */ - - #include "../../SDL_internal.h" + #include "SDL_sandbox.h" #include diff --git a/src/core/linux/SDL_udev.c b/src/core/linux/SDL_udev.c index fa775bc22d..311cdd1ebe 100644 --- a/src/core/linux/SDL_udev.c +++ b/src/core/linux/SDL_udev.c @@ -18,6 +18,7 @@ misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. */ +#include "../../SDL_internal.h" /* * To list the properties of a device, try something like: diff --git a/src/core/linux/SDL_udev.h b/src/core/linux/SDL_udev.h index 9af4c3f5db..8ac6cbe89e 100644 --- a/src/core/linux/SDL_udev.h +++ b/src/core/linux/SDL_udev.h @@ -24,7 +24,7 @@ #ifndef SDL_udev_h_ #define SDL_udev_h_ -#if HAVE_LIBUDEV_H +#if HAVE_LIBUDEV_H && HAVE_LINUX_INPUT_H #ifndef SDL_USE_LIBUDEV #define SDL_USE_LIBUDEV 1 @@ -108,7 +108,7 @@ extern const SDL_UDEV_Symbols *SDL_UDEV_GetUdevSyms(void); extern void SDL_UDEV_ReleaseUdevSyms(void); -#endif /* HAVE_LIBUDEV_H */ +#endif /* HAVE_LIBUDEV_H && HAVE_LINUX_INPUT_H */ #endif /* SDL_udev_h_ */ diff --git a/src/hidapi/SDL_hidapi.c b/src/hidapi/SDL_hidapi.c index 07f8c1ea82..52ee670271 100644 --- a/src/hidapi/SDL_hidapi.c +++ b/src/hidapi/SDL_hidapi.c @@ -551,7 +551,6 @@ HIDAPI_ShutdownDiscovery() #undef HIDAPI_H__ #if __LINUX__ -#include "../core/linux/SDL_udev.h" #if SDL_USE_LIBUDEV static const SDL_UDEV_Symbols *udev_ctx = NULL; From 85aa9b8b6f3457e3fcc687cff1afc62ab102aa4e Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Fri, 11 Nov 2022 13:47:36 -0500 Subject: [PATCH 014/153] wasapi: Favor the system resampler again, for now. Reference Issue #5538. --- src/audio/wasapi/SDL_wasapi.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/audio/wasapi/SDL_wasapi.c b/src/audio/wasapi/SDL_wasapi.c index 80a36bdfb6..3a1acfeb08 100644 --- a/src/audio/wasapi/SDL_wasapi.c +++ b/src/audio/wasapi/SDL_wasapi.c @@ -458,7 +458,10 @@ WASAPI_PrepDevice(_THIS, const SDL_bool updatestream) return WIN_SetErrorFromHRESULT("WASAPI can't determine minimum device period", ret); } -#if 1 /* we're getting reports that WASAPI's resampler introduces distortions, so it's disabled for now. --ryan. */ + /* we've gotten reports that WASAPI's resampler introduces distortions, but in the short term + it fixes some other WASAPI-specific quirks we haven't quite tracked down. + Refer to bug #6326 for the immediate concern. */ +#if 0 this->spec.freq = waveformat->nSamplesPerSec; /* force sampling rate so our resampler kicks in, if necessary. */ #else /* favor WASAPI's resampler over our own */ From 22354b414276872f50218a9596d10fd2f4d0ad82 Mon Sep 17 00:00:00 2001 From: pionere Date: Sat, 12 Nov 2022 08:29:15 +0100 Subject: [PATCH 015/153] video: simplify window-type check in SDL_CreateWindow --- src/video/SDL_video.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c index 0495e8ca9e..fdfd912cd0 100644 --- a/src/video/SDL_video.c +++ b/src/video/SDL_video.c @@ -1597,7 +1597,7 @@ SDL_Window * SDL_CreateWindow(const char *title, int x, int y, int w, int h, Uint32 flags) { SDL_Window *window; - Uint32 graphics_flags = flags & (SDL_WINDOW_OPENGL | SDL_WINDOW_METAL | SDL_WINDOW_VULKAN); + Uint32 type_flags, graphics_flags = flags & (SDL_WINDOW_OPENGL | SDL_WINDOW_METAL | SDL_WINDOW_VULKAN); if (!_this) { /* Initialize the video system if needed */ @@ -1606,7 +1606,9 @@ SDL_CreateWindow(const char *title, int x, int y, int w, int h, Uint32 flags) } } - if ((((flags & SDL_WINDOW_UTILITY) != 0) + ((flags & SDL_WINDOW_TOOLTIP) != 0) + ((flags & SDL_WINDOW_POPUP_MENU) != 0)) > 1) { + /* ensure no more than one of these flags is set */ + type_flags = flags & (SDL_WINDOW_UTILITY | SDL_WINDOW_TOOLTIP | SDL_WINDOW_POPUP_MENU); + if ((type_flags & (type_flags - 1)) != 0) { SDL_SetError("Conflicting window flags specified"); return NULL; } From 5f2a1231ddd1e08a9d03e28a3471f20b8e161547 Mon Sep 17 00:00:00 2001 From: pionere Date: Sun, 13 Nov 2022 08:00:03 +0100 Subject: [PATCH 016/153] video: check graphics flags the same way as the type flags --- src/video/SDL_video.c | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c index fdfd912cd0..19458608b4 100644 --- a/src/video/SDL_video.c +++ b/src/video/SDL_video.c @@ -1597,7 +1597,7 @@ SDL_Window * SDL_CreateWindow(const char *title, int x, int y, int w, int h, Uint32 flags) { SDL_Window *window; - Uint32 type_flags, graphics_flags = flags & (SDL_WINDOW_OPENGL | SDL_WINDOW_METAL | SDL_WINDOW_VULKAN); + Uint32 type_flags, graphics_flags; if (!_this) { /* Initialize the video system if needed */ @@ -1627,6 +1627,13 @@ SDL_CreateWindow(const char *title, int x, int y, int w, int h, Uint32 flags) return NULL; } + /* ensure no more than one of these flags is set */ + graphics_flags = flags & (SDL_WINDOW_OPENGL | SDL_WINDOW_METAL | SDL_WINDOW_VULKAN); + if ((graphics_flags & (graphics_flags - 1)) != 0) { + SDL_SetError("Conflicting window flags specified"); + return NULL; + } + /* Some platforms have certain graphics backends enabled by default */ if (!graphics_flags && !SDL_IsVideoContextExternal()) { #if (SDL_VIDEO_OPENGL && __MACOSX__) || (__IPHONEOS__ && !TARGET_OS_MACCATALYST) || __ANDROID__ || __NACL__ @@ -1656,10 +1663,6 @@ SDL_CreateWindow(const char *title, int x, int y, int w, int h, Uint32 flags) SDL_ContextNotSupported("Vulkan"); return NULL; } - if (graphics_flags & SDL_WINDOW_OPENGL) { - SDL_SetError("Vulkan and OpenGL not supported on same window"); - return NULL; - } if (SDL_Vulkan_LoadLibrary(NULL) < 0) { return NULL; } @@ -1670,16 +1673,6 @@ SDL_CreateWindow(const char *title, int x, int y, int w, int h, Uint32 flags) SDL_ContextNotSupported("Metal"); return NULL; } - /* 'flags' may have default flags appended, don't check against that. */ - if (graphics_flags & SDL_WINDOW_OPENGL) { - SDL_SetError("Metal and OpenGL not supported on same window"); - return NULL; - } - if (graphics_flags & SDL_WINDOW_VULKAN) { - SDL_SetError("Metal and Vulkan not supported on same window. " - "To use MoltenVK, set SDL_WINDOW_VULKAN only."); - return NULL; - } } /* Unless the user has specified the high-DPI disabling hint, respect the From c4b9f621649d4e2ddb05e7f396e43e2d9e0402cc Mon Sep 17 00:00:00 2001 From: Ethan Lee Date: Sun, 13 Nov 2022 12:45:13 -0500 Subject: [PATCH 017/153] x11: Add support for the Steam Deck on-screen keyboard --- src/video/x11/SDL_x11keyboard.c | 44 +++++++++++++++++++++++++++++++++ src/video/x11/SDL_x11keyboard.h | 4 +++ src/video/x11/SDL_x11video.c | 9 +++++++ src/video/x11/SDL_x11video.h | 4 +++ 4 files changed, 61 insertions(+) diff --git a/src/video/x11/SDL_x11keyboard.c b/src/video/x11/SDL_x11keyboard.c index 664c816613..f5be37ec5d 100644 --- a/src/video/x11/SDL_x11keyboard.c +++ b/src/video/x11/SDL_x11keyboard.c @@ -22,6 +22,8 @@ #if SDL_VIDEO_DRIVER_X11 +#include "SDL_hints.h" +#include "SDL_misc.h" #include "SDL_x11video.h" #include "../../events/SDL_keyboard_c.h" @@ -841,6 +843,48 @@ X11_SetTextInputRect(_THIS, const SDL_Rect *rect) #endif } +SDL_bool +X11_HasScreenKeyboardSupport(_THIS) +{ + SDL_VideoData *videodata = (SDL_VideoData *) _this->driverdata; + return videodata->is_steam_deck; +} + +void +X11_ShowScreenKeyboard(_THIS, SDL_Window *window) +{ + SDL_VideoData *videodata = (SDL_VideoData *) _this->driverdata; + + if (videodata->is_steam_deck) { + /* For more documentation of the URL parameters, see: + * https://partner.steamgames.com/doc/api/ISteamUtils#ShowFloatingGamepadTextInput + */ + char deeplink[128]; + SDL_snprintf(deeplink, sizeof(deeplink), + "steam://open/keyboard?XPosition=0&YPosition=0&Width=0&Height=0&Mode=%d", + SDL_GetHintBoolean(SDL_HINT_RETURN_KEY_HIDES_IME, SDL_FALSE) ? 0 : 1); + SDL_OpenURL(deeplink); + videodata->steam_keyboard_open = SDL_TRUE; + } +} + +void X11_HideScreenKeyboard(_THIS, SDL_Window *window) +{ + SDL_VideoData *videodata = (SDL_VideoData *) _this->driverdata; + + if (videodata->is_steam_deck) { + SDL_OpenURL("steam://close/keyboard"); + videodata->steam_keyboard_open = SDL_FALSE; + } +} + +SDL_bool X11_IsScreenKeyboardShown(_THIS, SDL_Window *window) +{ + SDL_VideoData *videodata = (SDL_VideoData *) _this->driverdata; + + return videodata->steam_keyboard_open; +} + #endif /* SDL_VIDEO_DRIVER_X11 */ /* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/video/x11/SDL_x11keyboard.h b/src/video/x11/SDL_x11keyboard.h index 4ce41069b7..645e7ba415 100644 --- a/src/video/x11/SDL_x11keyboard.h +++ b/src/video/x11/SDL_x11keyboard.h @@ -29,6 +29,10 @@ extern void X11_QuitKeyboard(_THIS); extern void X11_StartTextInput(_THIS); extern void X11_StopTextInput(_THIS); extern void X11_SetTextInputRect(_THIS, const SDL_Rect *rect); +extern SDL_bool X11_HasScreenKeyboardSupport(_THIS); +extern void X11_ShowScreenKeyboard(_THIS, SDL_Window *window); +extern void X11_HideScreenKeyboard(_THIS, SDL_Window *window); +extern SDL_bool X11_IsScreenKeyboardShown(_THIS, SDL_Window *window); extern KeySym X11_KeyCodeToSym(_THIS, KeyCode, unsigned char group); #endif /* SDL_x11keyboard_h_ */ diff --git a/src/video/x11/SDL_x11video.c b/src/video/x11/SDL_x11video.c index 2e5e190bd0..49f5c5b9bc 100644 --- a/src/video/x11/SDL_x11video.c +++ b/src/video/x11/SDL_x11video.c @@ -212,6 +212,11 @@ X11_CreateDevice(void) safety_net_triggered = SDL_FALSE; orig_x11_errhandler = X11_XSetErrorHandler(X11_SafetyNetErrHandler); + /* Steam Deck will have an on-screen keyboard, so check their environment + * variable so we can make use of SDL_StartTextInput. + */ + data->is_steam_deck = SDL_GetHintBoolean("SteamDeck", SDL_FALSE); + /* Set the function pointers */ device->VideoInit = X11_VideoInit; device->VideoQuit = X11_VideoQuit; @@ -307,6 +312,10 @@ X11_CreateDevice(void) device->StartTextInput = X11_StartTextInput; device->StopTextInput = X11_StopTextInput; device->SetTextInputRect = X11_SetTextInputRect; + device->HasScreenKeyboardSupport = X11_HasScreenKeyboardSupport; + device->ShowScreenKeyboard = X11_ShowScreenKeyboard; + device->HideScreenKeyboard = X11_HideScreenKeyboard; + device->IsScreenKeyboardShown = X11_IsScreenKeyboardShown; device->free = X11_DeleteDevice; diff --git a/src/video/x11/SDL_x11video.h b/src/video/x11/SDL_x11video.h index e2edf248ad..511ed365c9 100644 --- a/src/video/x11/SDL_x11video.h +++ b/src/video/x11/SDL_x11video.h @@ -152,6 +152,10 @@ typedef struct SDL_VideoData PFN_XGetXCBConnection vulkan_XGetXCBConnection; #endif + /* Used to interact with the on-screen keyboard */ + SDL_bool is_steam_deck; + SDL_bool steam_keyboard_open; + } SDL_VideoData; extern SDL_bool X11_UseDirectColorVisuals(void); From 1b0277da61551c7fef1a09ad359024dfaaebd81a Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sun, 13 Nov 2022 11:08:37 -0800 Subject: [PATCH 018/153] Move SDL_mslibc.c into the source file list --- VisualC-WinRT/SDL-UWP.vcxproj.filters | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/VisualC-WinRT/SDL-UWP.vcxproj.filters b/VisualC-WinRT/SDL-UWP.vcxproj.filters index d788502e14..6599cdabb0 100644 --- a/VisualC-WinRT/SDL-UWP.vcxproj.filters +++ b/VisualC-WinRT/SDL-UWP.vcxproj.filters @@ -842,5 +842,8 @@ Source Files + + Source Files + - + \ No newline at end of file From 674989261d1f3c7efd36a1cfdfc0efbc1cca6949 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sun, 13 Nov 2022 11:09:20 -0800 Subject: [PATCH 019/153] Fixed warning Fixes https://github.com/libsdl-org/SDL/issues/5842 --- src/video/winrt/SDL_winrtvideo.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/video/winrt/SDL_winrtvideo.cpp b/src/video/winrt/SDL_winrtvideo.cpp index 3a7b220b9e..7511aa5310 100644 --- a/src/video/winrt/SDL_winrtvideo.cpp +++ b/src/video/winrt/SDL_winrtvideo.cpp @@ -526,7 +526,7 @@ WINRT_DetectWindowFlags(SDL_Window * window) #if SDL_WINRT_USE_APPLICATIONVIEW if (data->appView) { - is_fullscreen = data->appView->IsFullScreen; + is_fullscreen = data->appView->IsFullScreenMode; } #elif (WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP) || (NTDDI_VERSION == NTDDI_WIN8) is_fullscreen = true; From eef4d3c86a653f91b7221c80809ba8ab56f94cf1 Mon Sep 17 00:00:00 2001 From: Frank Praznik Date: Sun, 13 Nov 2022 16:56:04 -0500 Subject: [PATCH 020/153] wayland: Clamp wl_seat version on older versions of libwayland Clamp the wl_seat max version to 5 if being built against a version of libwayland below 1.21.0, or containers that bundle newer versions of SDL with older versions of libwayland can break if the compositor advertises support for a protocol version above 5. --- src/video/wayland/SDL_waylandevents.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/video/wayland/SDL_waylandevents.c b/src/video/wayland/SDL_waylandevents.c index 00563c8f12..2d37a0e239 100644 --- a/src/video/wayland/SDL_waylandevents.c +++ b/src/video/wayland/SDL_waylandevents.c @@ -64,6 +64,13 @@ #include #include "../../events/imKStoUCS.h" +/* Clamp the wl_seat version on older versions of libwayland. */ +#if SDL_WAYLAND_CHECK_VERSION(1, 21, 0) +#define SDL_WL_SEAT_VERSION 8 +#else +#define SDL_WL_SEAT_VERSION 5 +#endif + /* Weston uses a ratio of 10 units per scroll tick */ #define WAYLAND_WHEEL_AXIS_UNIT 10 @@ -2384,7 +2391,7 @@ Wayland_display_add_input(SDL_VideoData *d, uint32_t id, uint32_t version) return; input->display = d; - input->seat = wl_registry_bind(d->registry, id, &wl_seat_interface, SDL_min(8, version)); + input->seat = wl_registry_bind(d->registry, id, &wl_seat_interface, SDL_min(SDL_WL_SEAT_VERSION, version)); input->sx_w = wl_fixed_from_int(0); input->sy_w = wl_fixed_from_int(0); input->xkb.current_group = ~0; From dad8df3ed1e6397e6ad97215921322f5ed6a70b4 Mon Sep 17 00:00:00 2001 From: pionere Date: Mon, 14 Nov 2022 08:20:31 +0100 Subject: [PATCH 021/153] video: check graphics flags the same way in SDL_RecreateWindow as in SDL_CreateWindow - single check to validate the graphics flags - check it before tearing down the window --- src/video/SDL_video.c | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c index 19458608b4..51e282f066 100644 --- a/src/video/SDL_video.c +++ b/src/video/SDL_video.c @@ -1874,6 +1874,13 @@ SDL_RecreateWindow(SDL_Window * window, Uint32 flags) SDL_bool loaded_vulkan = SDL_FALSE; SDL_bool need_vulkan_unload = SDL_FALSE; SDL_bool need_vulkan_load = SDL_FALSE; + Uint32 graphics_flags; + + /* ensure no more than one of these flags is set */ + graphics_flags = flags & (SDL_WINDOW_OPENGL | SDL_WINDOW_METAL | SDL_WINDOW_VULKAN); + if ((graphics_flags & (graphics_flags - 1)) != 0) { + return SDL_SetError("Conflicting window flags specified"); + } if ((flags & SDL_WINDOW_OPENGL) && !_this->GL_CreateContext) { return SDL_ContextNotSupported("OpenGL"); @@ -1937,18 +1944,6 @@ SDL_RecreateWindow(SDL_Window * window, Uint32 flags) need_vulkan_load = SDL_TRUE; } - if ((flags & SDL_WINDOW_VULKAN) && (flags & SDL_WINDOW_OPENGL)) { - return SDL_SetError("Vulkan and OpenGL not supported on same window"); - } - - if ((flags & SDL_WINDOW_METAL) && (flags & SDL_WINDOW_OPENGL)) { - return SDL_SetError("Metal and OpenGL not supported on same window"); - } - - if ((flags & SDL_WINDOW_METAL) && (flags & SDL_WINDOW_VULKAN)) { - return SDL_SetError("Metal and Vulkan not supported on same window"); - } - if (need_gl_unload) { SDL_GL_UnloadLibrary(); } From b886f4c6c97f3d37d65f65afdb6bd68148fd4de6 Mon Sep 17 00:00:00 2001 From: pionere Date: Mon, 14 Nov 2022 17:35:28 +0100 Subject: [PATCH 022/153] events: eliminate redundant code in SDL_SendEditingText --- src/events/SDL_keyboard.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/events/SDL_keyboard.c b/src/events/SDL_keyboard.c index 87fee123b8..7dc0fb9b26 100644 --- a/src/events/SDL_keyboard.c +++ b/src/events/SDL_keyboard.c @@ -1058,11 +1058,6 @@ SDL_SendEditingText(const char *text, int start, int length) posted = 0; if (SDL_GetEventState(SDL_TEXTEDITING) == SDL_ENABLE) { SDL_Event event; - event.edit.type = SDL_TEXTEDITING; - event.edit.windowID = keyboard->focus ? keyboard->focus->id : 0; - event.edit.start = start; - event.edit.length = length; - SDL_utf8strlcpy(event.edit.text, text, SDL_arraysize(event.edit.text)); if (SDL_GetHintBoolean(SDL_HINT_IME_SUPPORT_EXTENDED_TEXT, SDL_FALSE) && SDL_strlen(text) >= SDL_arraysize(event.text.text)) { From 9f784b1887fea886efb03ea65416eb956ba79bf1 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Mon, 14 Nov 2022 10:58:59 -0800 Subject: [PATCH 023/153] The iOS and tvOS demos link SDL statically, not as a framework --- Xcode-iOS/Demos/config.xcconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Xcode-iOS/Demos/config.xcconfig b/Xcode-iOS/Demos/config.xcconfig index a73eec4d7e..5639172909 100644 --- a/Xcode-iOS/Demos/config.xcconfig +++ b/Xcode-iOS/Demos/config.xcconfig @@ -10,5 +10,5 @@ #include? "build.xcconfig" CONFIG_FRAMEWORK_LDFLAGS[sdk=macos*] = $(inherited) -framework SDL2 -framework AudioToolbox -framework Carbon -framework Cocoa -framework CoreAudio -framework CoreHaptics -framework CoreVideo -framework ForceFeedback -framework GameController -framework IOKit -framework Metal -CONFIG_FRAMEWORK_LDFLAGS[sdk=iphone*] = $(inherited) -framework SDL2 -framework AVFoundation -framework AudioToolbox -framework CoreGraphics -framework CoreHaptics -framework CoreMotion -framework Foundation -framework GameController -framework Metal -framework OpenGLES -framework QuartzCore -framework UIKit -CONFIG_FRAMEWORK_LDFLAGS[sdk=appletv*] = $(inherited) -framework SDL2 -framework AVFoundation -framework AudioToolbox -framework CoreGraphics -framework CoreHaptics -framework Foundation -framework GameController -framework Metal -framework OpenGLES -framework QuartzCore -framework UIKit +CONFIG_FRAMEWORK_LDFLAGS[sdk=iphone*] = $(inherited) -framework AVFoundation -framework AudioToolbox -framework CoreGraphics -framework CoreHaptics -framework CoreMotion -framework Foundation -framework GameController -framework Metal -framework OpenGLES -framework QuartzCore -framework UIKit +CONFIG_FRAMEWORK_LDFLAGS[sdk=appletv*] = $(inherited) -framework AVFoundation -framework AudioToolbox -framework CoreGraphics -framework CoreHaptics -framework Foundation -framework GameController -framework Metal -framework OpenGLES -framework QuartzCore -framework UIKit From a40b7cde10e434f861ae5683a4619efbad6210b7 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Mon, 14 Nov 2022 13:03:52 -0800 Subject: [PATCH 024/153] Workaround for views being in portrait instead of landscape mode on iOS 16 Fixes https://github.com/libsdl-org/SDL/issues/6289 --- src/video/uikit/SDL_uikitmetalview.m | 12 ++++++++++++ src/video/uikit/SDL_uikitview.h | 2 ++ src/video/uikit/SDL_uikitview.m | 25 ++++++++++++++++++++++++- 3 files changed, 38 insertions(+), 1 deletion(-) diff --git a/src/video/uikit/SDL_uikitmetalview.m b/src/video/uikit/SDL_uikitmetalview.m index 8bc3380955..af6eb0cd3e 100644 --- a/src/video/uikit/SDL_uikitmetalview.m +++ b/src/video/uikit/SDL_uikitmetalview.m @@ -69,6 +69,18 @@ CGSize size = self.bounds.size; size.width *= self.layer.contentsScale; size.height *= self.layer.contentsScale; + + /* Make sure the width/height are oriented correctly + * + * This works around an issue in iOS 16 where the bounds come back in portrait mode + * instead of landscape until the event loop runs. + */ + if ([self shouldSwapDimensions:(size.width >= size.height)]) { + CGFloat temp = size.width; + size.width = size.height; + size.height = temp; + } + ((CAMetalLayer *)self.layer).drawableSize = size; } diff --git a/src/video/uikit/SDL_uikitview.h b/src/video/uikit/SDL_uikitview.h index dcd63c7a56..5369bb2124 100644 --- a/src/video/uikit/SDL_uikitview.h +++ b/src/video/uikit/SDL_uikitview.h @@ -35,6 +35,8 @@ - (void)setSDLWindow:(SDL_Window *)window; +- (BOOL)shouldSwapDimensions:(BOOL)portrait; + #if !TARGET_OS_TV && defined(__IPHONE_13_4) - (UIPointerRegion *)pointerInteraction:(UIPointerInteraction *)interaction regionForRequest:(UIPointerRegionRequest *)request defaultRegion:(UIPointerRegion *)defaultRegion API_AVAILABLE(ios(13.4)); - (UIPointerStyle *)pointerInteraction:(UIPointerInteraction *)interaction styleForRegion:(UIPointerRegion *)region API_AVAILABLE(ios(13.4)); diff --git a/src/video/uikit/SDL_uikitview.m b/src/video/uikit/SDL_uikitview.m index 8c48cfa503..50d7393e7f 100644 --- a/src/video/uikit/SDL_uikitview.m +++ b/src/video/uikit/SDL_uikitview.m @@ -120,6 +120,8 @@ extern int SDL_AppleTVRemoteOpenedAsJoystick; [data.uiwindow layoutIfNeeded]; } + sdlwindow = window; + /* Add ourself to the new window. */ if (window) { data = (__bridge SDL_WindowData *) window->driverdata; @@ -144,8 +146,29 @@ extern int SDL_AppleTVRemoteOpenedAsJoystick; * layout now to immediately update the bounds. */ [data.uiwindow layoutIfNeeded]; } +} - sdlwindow = window; +- (BOOL)shouldSwapDimensions:(BOOL)landscape +{ +#if !TARGET_OS_TV + if (sdlwindow) { + SDL_VideoDisplay *display = SDL_GetDisplayForWindow(sdlwindow); + SDL_DisplayData *displaydata = (__bridge SDL_DisplayData *) display->driverdata; + + if (displaydata.uiscreen == [UIScreen mainScreen]) { + NSUInteger orients = UIKit_GetSupportedOrientations(sdlwindow); + BOOL supportsLandscape = (orients & UIInterfaceOrientationMaskLandscape) != 0; + BOOL supportsPortrait = (orients & (UIInterfaceOrientationMaskPortrait|UIInterfaceOrientationMaskPortraitUpsideDown)) != 0; + + /* Make sure the width/height are oriented correctly */ + if ((landscape && !supportsLandscape) || (!landscape && !supportsPortrait)) { + return YES; + } + } + } +#endif /* !TARGET_OS_TV */ + + return NO; } #if !TARGET_OS_TV && defined(__IPHONE_13_4) From d080e3bf3a581035d4d078f52803fc60b2504817 Mon Sep 17 00:00:00 2001 From: Pierre Wendling Date: Mon, 14 Nov 2022 17:56:48 -0500 Subject: [PATCH 025/153] Silence `-Wmaybe-uninitialized` warnings in tests. --- test/controllermap.c | 6 ++++-- test/testautomation_pixels.c | 2 ++ test/testautomation_rwops.c | 1 + test/testautomation_video.c | 7 +++++++ 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/test/controllermap.c b/test/controllermap.c index 5905b8a583..22ab19e37b 100644 --- a/test/controllermap.c +++ b/test/controllermap.c @@ -611,7 +611,7 @@ WatchJoystick(SDL_Joystick * joystick) SDL_GameControllerButton eButton = (SDL_GameControllerButton)iIndex; SDL_strlcat(mapping, SDL_GameControllerGetStringForButton(eButton), SDL_arraysize(mapping)); } else { - const char *pszAxisName; + const char *pszAxisName = NULL; switch (iIndex - SDL_CONTROLLER_BUTTON_MAX) { case SDL_CONTROLLER_BINDING_AXIS_LEFTX_NEGATIVE: if (!BMergeAxisBindings(iIndex)) { @@ -660,7 +660,9 @@ WatchJoystick(SDL_Joystick * joystick) pszAxisName = SDL_GameControllerGetStringForAxis(SDL_CONTROLLER_AXIS_TRIGGERRIGHT); break; } - SDL_strlcat(mapping, pszAxisName, SDL_arraysize(mapping)); + if (pszAxisName) { + SDL_strlcat(mapping, pszAxisName, SDL_arraysize(mapping)); + } } SDL_strlcat(mapping, ":", SDL_arraysize(mapping)); diff --git a/test/testautomation_pixels.c b/test/testautomation_pixels.c index 63b177f18f..8117c11e47 100644 --- a/test/testautomation_pixels.c +++ b/test/testautomation_pixels.c @@ -330,6 +330,7 @@ pixels_allocFreePalette(void *arg) for (variation = 1; variation <= 3; variation++) { switch (variation) { /* Just one color */ + default: case 1: ncolors = 1; break; @@ -426,6 +427,7 @@ pixels_calcGammaRamp(void *arg) for (variation = 0; variation < 4; variation++) { switch (variation) { /* gamma = 0 all black */ + default: case 0: gamma = 0.0f; break; diff --git a/test/testautomation_rwops.c b/test/testautomation_rwops.c index 16d5407520..687ff75de8 100644 --- a/test/testautomation_rwops.c +++ b/test/testautomation_rwops.c @@ -616,6 +616,7 @@ rwops_testFileWriteReadEndian(void) /* Create test data */ switch (mode) { + default: case 0: SDLTest_Log("All 0 values"); BE16value = 0; diff --git a/test/testautomation_video.c b/test/testautomation_video.c index bf0283b807..8d248bf8f8 100644 --- a/test/testautomation_video.c +++ b/test/testautomation_video.c @@ -123,6 +123,7 @@ video_createWindowVariousPositions(void *arg) for (xVariation = 0; xVariation < 6; xVariation++) { for (yVariation = 0; yVariation < 6; yVariation++) { switch(xVariation) { + default: case 0: /* Zero X Position */ x = 0; @@ -150,6 +151,7 @@ video_createWindowVariousPositions(void *arg) } switch(yVariation) { + default: case 0: /* Zero X Position */ y = 0; @@ -267,6 +269,7 @@ video_createWindowVariousFlags(void *arg) for (fVariation = 0; fVariation < 14; fVariation++) { switch(fVariation) { + default: case 0: flags = SDL_WINDOW_FULLSCREEN; /* Skip - blanks screen; comment out next line to run test */ @@ -1074,6 +1077,7 @@ video_getSetWindowPosition(void *arg) for (xVariation = 0; xVariation < 4; xVariation++) { for (yVariation = 0; yVariation < 4; yVariation++) { switch(xVariation) { + default: case 0: /* Zero X Position */ desiredX = 0; @@ -1093,6 +1097,7 @@ video_getSetWindowPosition(void *arg) } switch(yVariation) { + default: case 0: /* Zero X Position */ desiredY = 0; @@ -1236,6 +1241,7 @@ video_getSetWindowSize(void *arg) for (wVariation = 0; wVariation < maxwVariation; wVariation++) { for (hVariation = 0; hVariation < maxhVariation; hVariation++) { switch(wVariation) { + default: case 0: /* 1 Pixel Wide */ desiredW = 1; @@ -1259,6 +1265,7 @@ video_getSetWindowSize(void *arg) } switch(hVariation) { + default: case 0: /* 1 Pixel High */ desiredH = 1; From bf4f9aaa636863555a6edd7a611a3fb4191cd1c7 Mon Sep 17 00:00:00 2001 From: Pierre Wendling Date: Mon, 14 Nov 2022 16:11:58 -0500 Subject: [PATCH 026/153] N3DS: Use designated initialiser for drivers. Just a sanity check that the functions are actually mapped correctly. --- src/joystick/n3ds/SDL_sysjoystick.c | 40 ++++++++++++++--------------- src/sensor/n3ds/SDL_n3dssensor.c | 22 ++++++++-------- 2 files changed, 31 insertions(+), 31 deletions(-) diff --git a/src/joystick/n3ds/SDL_sysjoystick.c b/src/joystick/n3ds/SDL_sysjoystick.c index ea00a6d697..933f64ee09 100644 --- a/src/joystick/n3ds/SDL_sysjoystick.c +++ b/src/joystick/n3ds/SDL_sysjoystick.c @@ -279,26 +279,26 @@ N3DS_JoystickSendEffect(SDL_Joystick *joystick, const void *data, int size) } SDL_JoystickDriver SDL_N3DS_JoystickDriver = { - N3DS_JoystickInit, - N3DS_JoystickGetCount, - N3DS_JoystickDetect, - N3DS_JoystickGetDeviceName, - N3DS_JoystickGetDevicePath, - N3DS_JoystickGetDevicePlayerIndex, - N3DS_JoystickSetDevicePlayerIndex, - N3DS_JoystickGetDeviceGUID, - N3DS_JoystickGetDeviceInstanceID, - N3DS_JoystickOpen, - N3DS_JoystickRumble, - N3DS_JoystickRumbleTriggers, - N3DS_JoystickGetCapabilities, - N3DS_JoystickSetLED, - N3DS_JoystickSendEffect, - N3DS_JoystickSetSensorsEnabled, - N3DS_JoystickUpdate, - N3DS_JoystickClose, - N3DS_JoystickQuit, - N3DS_JoystickGetGamepadMapping + .Init = N3DS_JoystickInit, + .GetCount = N3DS_JoystickGetCount, + .Detect = N3DS_JoystickDetect, + .GetDeviceName = N3DS_JoystickGetDeviceName, + .GetDevicePath = N3DS_JoystickGetDevicePath, + .GetDevicePlayerIndex = N3DS_JoystickGetDevicePlayerIndex, + .SetDevicePlayerIndex = N3DS_JoystickSetDevicePlayerIndex, + .GetDeviceGUID = N3DS_JoystickGetDeviceGUID, + .GetDeviceInstanceID = N3DS_JoystickGetDeviceInstanceID, + .Open = N3DS_JoystickOpen, + .Rumble = N3DS_JoystickRumble, + .RumbleTriggers = N3DS_JoystickRumbleTriggers, + .GetCapabilities = N3DS_JoystickGetCapabilities, + .SetLED = N3DS_JoystickSetLED, + .SendEffect = N3DS_JoystickSendEffect, + .SetSensorsEnabled = N3DS_JoystickSetSensorsEnabled, + .Update = N3DS_JoystickUpdate, + .Close = N3DS_JoystickClose, + .Quit = N3DS_JoystickQuit, + .GetGamepadMapping = N3DS_JoystickGetGamepadMapping }; #endif /* SDL_JOYSTICK_N3DS */ diff --git a/src/sensor/n3ds/SDL_n3dssensor.c b/src/sensor/n3ds/SDL_n3dssensor.c index a435ae2367..ea22ef247f 100644 --- a/src/sensor/n3ds/SDL_n3dssensor.c +++ b/src/sensor/n3ds/SDL_n3dssensor.c @@ -200,17 +200,17 @@ N3DS_SensorQuit(void) } SDL_SensorDriver SDL_N3DS_SensorDriver = { - N3DS_SensorInit, - N3DS_SensorGetCount, - N3DS_SensorDetect, - N3DS_SensorGetDeviceName, - N3DS_SensorGetDeviceType, - N3DS_SensorGetDeviceNonPortableType, - N3DS_SensorGetDeviceInstanceID, - N3DS_SensorOpen, - N3DS_SensorUpdate, - N3DS_SensorClose, - N3DS_SensorQuit, + .Init = N3DS_SensorInit, + .GetCount = N3DS_SensorGetCount, + .Detect = N3DS_SensorDetect, + .GetDeviceName = N3DS_SensorGetDeviceName, + .GetDeviceType = N3DS_SensorGetDeviceType, + .GetDeviceNonPortableType = N3DS_SensorGetDeviceNonPortableType, + .GetDeviceInstanceID = N3DS_SensorGetDeviceInstanceID, + .Open = N3DS_SensorOpen, + .Update = N3DS_SensorUpdate, + .Close = N3DS_SensorClose, + .Quit = N3DS_SensorQuit, }; #endif /* SDL_SENSOR_N3DS */ From 7d536d52406c87c0102afed2d620d6b07cc1ca00 Mon Sep 17 00:00:00 2001 From: Pierre Wendling Date: Mon, 14 Nov 2022 16:16:21 -0500 Subject: [PATCH 027/153] N3DS: Put `SDL_Log.txt` in the proper directory. The homebrew "user" directory should be `/3ds/`. To avoid ambiguity, `sdmc:` is specified. --- src/SDL_log.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/SDL_log.c b/src/SDL_log.c index 66191d2b41..c01e31d8a9 100644 --- a/src/SDL_log.c +++ b/src/SDL_log.c @@ -487,10 +487,10 @@ SDL_LogOutput(void *userdata, int category, SDL_LogPriority priority, } #elif defined(__3DS__) { - FILE* pFile; - pFile = fopen ("/SDL_Log.txt", "a"); + FILE *pFile; + pFile = fopen("sdmc:/3ds/SDL_Log.txt", "a"); fprintf(pFile, "%s: %s\n", SDL_priority_prefixes[priority], message); - fclose (pFile); + fclose(pFile); } #endif #if HAVE_STDIO_H && \ From de5fa89b509a155d962b01de5b36955b5ba0df09 Mon Sep 17 00:00:00 2001 From: Pierre Wendling Date: Mon, 14 Nov 2022 16:56:51 -0500 Subject: [PATCH 028/153] N3DS: Prepend PrefPath with `sdmc:`. --- src/filesystem/n3ds/SDL_sysfilesystem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/filesystem/n3ds/SDL_sysfilesystem.c b/src/filesystem/n3ds/SDL_sysfilesystem.c index 06b4cd65b7..9d0621bd48 100644 --- a/src/filesystem/n3ds/SDL_sysfilesystem.c +++ b/src/filesystem/n3ds/SDL_sysfilesystem.c @@ -68,7 +68,7 @@ SDL_FORCE_INLINE char * MakePrefPath(const char *app) { char *pref_path; - if (SDL_asprintf(&pref_path, "/3ds/%s/", app) < 0) { + if (SDL_asprintf(&pref_path, "sdmc:/3ds/%s/", app) < 0) { SDL_OutOfMemory(); return NULL; } From dcfa127fd4c553db20f3e53cad9dfa7916a19b84 Mon Sep 17 00:00:00 2001 From: Pierre Wendling Date: Mon, 14 Nov 2022 17:34:22 -0500 Subject: [PATCH 029/153] N3DS: Document the SDL_GetBasePath behaviour. --- docs/README-n3ds.md | 1 + include/SDL_filesystem.h | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/docs/README-n3ds.md b/docs/README-n3ds.md index 991eaa07fa..66e194d0b3 100644 --- a/docs/README-n3ds.md +++ b/docs/README-n3ds.md @@ -24,3 +24,4 @@ cmake --install build - Currently only software rendering is supported. - SDL2main should be used to ensure ROMFS is enabled. - By default, the extra L2 cache and higher clock speeds of the New 2/3DS lineup are enabled. If you wish to turn it off, use `osSetSpeedupEnable(false)` in your main function. +- `SDL_GetBasePath` returns the romfs root instead of the executable's directory. diff --git a/include/SDL_filesystem.h b/include/SDL_filesystem.h index a7606bde2a..60f8202bed 100644 --- a/include/SDL_filesystem.h +++ b/include/SDL_filesystem.h @@ -60,6 +60,10 @@ extern "C" { * - `parent`: the containing directory of the bundle. For example: * `/Applications/SDLApp/` * + * **Nintendo 3DS Specific Functionality**: This function returns "romfs" + * directory of the application as it is uncommon to store resources + * outside the executable. As such it is not a writable directory. + * * The returned path is guaranteed to end with a path separator ('\' on * Windows, '/' on most other platforms). * From 491d0bcc3ca152158653f656957a5e78471436a7 Mon Sep 17 00:00:00 2001 From: Pierre Wendling Date: Mon, 14 Nov 2022 17:38:42 -0500 Subject: [PATCH 030/153] N3DS: Refactor N3DS_FileOpen. --- src/file/n3ds/SDL_rwopsromfs.c | 60 +++++++++++++++++++++++++++------- 1 file changed, 48 insertions(+), 12 deletions(-) diff --git a/src/file/n3ds/SDL_rwopsromfs.c b/src/file/n3ds/SDL_rwopsromfs.c index c75323f61f..9d3ec87e9b 100644 --- a/src/file/n3ds/SDL_rwopsromfs.c +++ b/src/file/n3ds/SDL_rwopsromfs.c @@ -22,6 +22,15 @@ #include "SDL_rwopsromfs.h" #include "SDL_error.h" +/* Checks if the mode is a kind of reading */ +SDL_FORCE_INLINE SDL_bool IsReadMode(const char *mode); + +/* Checks if the file starts with the given prefix */ +SDL_FORCE_INLINE SDL_bool HasPrefix(const char *file, const char *prefix); + +SDL_FORCE_INLINE FILE *TryOpenFile(const char *file, const char *mode); +SDL_FORCE_INLINE FILE *TryOpenInRomfs(const char *file, const char *mode); + /* Nintendo 3DS applications may embed resources in the executable. The resources are stored in a special read-only partition prefixed with 'romfs:/'. As such, when opening a file, we should first try the romfs @@ -30,31 +39,58 @@ FILE * N3DS_FileOpen(const char *file, const char *mode) { - FILE *fp = NULL; - char *romfs_path; - /* romfs are read-only */ - if (SDL_strchr(mode, 'r') == NULL) { + if (!IsReadMode(mode)) { return fopen(file, mode); } /* If the path has an explicit prefix, we skip the guess work */ - if (SDL_strncmp("romfs:/", file, 7) == 0 || - SDL_strncmp("sdmc:/", file, 6) == 0) { + if (HasPrefix(file, "romfs:/") || HasPrefix(file, "sdmc:/")) { return fopen(file, mode); } - if (SDL_asprintf(&romfs_path, "romfs:/%s", file) < 0) { - SDL_OutOfMemory(); - return NULL; - } + return TryOpenFile(file, mode); +} - fp = fopen(romfs_path, mode); +SDL_FORCE_INLINE SDL_bool +IsReadMode(const char *mode) +{ + return SDL_strchr(mode, 'r') != NULL; +} + +SDL_FORCE_INLINE SDL_bool +HasPrefix(const char *file, const char *prefix) +{ + return SDL_strncmp(prefix, file, SDL_strlen(prefix)) == 0; +} + +SDL_FORCE_INLINE FILE * +TryOpenFile(const char *file, const char *mode) +{ + FILE *fp = NULL; + + fp = TryOpenInRomfs(file, mode); if (fp == NULL) { fp = fopen(file, mode); } - SDL_free(romfs_path); + return fp; +} + +SDL_FORCE_INLINE FILE * +TryOpenInRomfs(const char *file, const char *mode) +{ + FILE *fp = NULL; + char *prefixed_filepath = NULL; + + if (SDL_asprintf(&prefixed_filepath, "romfs:/%s", file) < 0) { + SDL_OutOfMemory(); + return NULL; + } + + fp = fopen(prefixed_filepath, mode); + + SDL_free(prefixed_filepath); return fp; } From 80ff20f6fe15fdba95fb1c49cfdc855a12e6eea1 Mon Sep 17 00:00:00 2001 From: Pierre Wendling Date: Mon, 14 Nov 2022 23:56:20 -0500 Subject: [PATCH 031/153] N3DS: Set keyboard focus to newly created windows. This fixes polling issues with Joystick subsystem where `SDL_PrivateJoystickShouldIgnoreEvent` would always return true, thus ignoring all inputs. --- src/video/n3ds/SDL_n3dsvideo.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/video/n3ds/SDL_n3dsvideo.c b/src/video/n3ds/SDL_n3dsvideo.c index 73486e653a..d4a46ad065 100644 --- a/src/video/n3ds/SDL_n3dsvideo.c +++ b/src/video/n3ds/SDL_n3dsvideo.c @@ -178,6 +178,7 @@ N3DS_CreateWindow(_THIS, SDL_Window *window) display_data = (DisplayDriverData *) SDL_GetDisplayDriverData(window->display_index); window_data->screen = display_data->screen; window->driverdata = window_data; + SDL_SetKeyboardFocus(window); return 0; } From 5e61f245ab5e5dd178a35001b37bab1f6292ffd7 Mon Sep 17 00:00:00 2001 From: SDL Wiki Bot Date: Tue, 15 Nov 2022 05:25:16 +0000 Subject: [PATCH 032/153] Sync SDL wiki -> header --- include/SDL_filesystem.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/SDL_filesystem.h b/include/SDL_filesystem.h index 60f8202bed..1914f81d91 100644 --- a/include/SDL_filesystem.h +++ b/include/SDL_filesystem.h @@ -61,8 +61,8 @@ extern "C" { * `/Applications/SDLApp/` * * **Nintendo 3DS Specific Functionality**: This function returns "romfs" - * directory of the application as it is uncommon to store resources - * outside the executable. As such it is not a writable directory. + * directory of the application as it is uncommon to store resources outside + * the executable. As such it is not a writable directory. * * The returned path is guaranteed to end with a path separator ('\' on * Windows, '/' on most other platforms). From a71ad40ac3646b33c47bfd6b2f62478b82e0f25d Mon Sep 17 00:00:00 2001 From: Pierre Wendling <50808272+FtZPetruska@users.noreply.github.com> Date: Tue, 15 Nov 2022 13:04:22 -0500 Subject: [PATCH 033/153] CMake: Add option to use Ccache. --- CMakeLists.txt | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index d27141d1f6..3103b01f48 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -513,6 +513,7 @@ dep_option(SDL_HIDAPI_JOYSTICK "Use HIDAPI for low level joystick drivers" O dep_option(SDL_VIRTUAL_JOYSTICK "Enable the virtual-joystick driver" ON SDL_HIDAPI OFF) set_option(SDL_ASAN "Use AddressSanitizer to detect memory errors" OFF) option_string(SDL_VENDOR_INFO "Vendor name and/or version to add to SDL_REVISION" "") +set_option(SDL_CCACHE "Use Ccache to speed up build" ON) option(SDL_WERROR "Enable -Werror" OFF) @@ -3113,6 +3114,19 @@ if (SDL_ASAN) endif() endif() +if(SDL_CCACHE) + cmake_minimum_required(VERSION 3.4) + find_program(CCACHE_BINARY ccache) + if(CCACHE_BINARY) + set(CMAKE_C_COMPILER_LAUNCHER ${CCACHE_BINARY}) + set(CMAKE_CXX_COMPILER_LAUNCHER ${CCACHE_BINARY}) + set(CMAKE_OBJC_COMPILER_LAUNCHER ${CCACHE_BINARY}) + set(HAVE_CCACHE ON) + else() + set(HAVE_CCACHE OFF) + endif() +endif() + if(SDL_TESTS) set(HAVE_TESTS ON) endif() From 70656b133c89c614422130b6c7e0a52cdccc6d4f Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Tue, 15 Nov 2022 10:18:41 -0800 Subject: [PATCH 034/153] Don't recreate the window when creating a Metal renderer on an OpenGL window. It turns out that we can safely create a Metal view on an existing window, and that avoids issues with the window being recreated with the wrong orientation in iOS 16. Fixes https://github.com/libsdl-org/SDL/issues/6289 --- src/render/metal/SDL_render_metal.m | 25 ------------------------- src/video/SDL_video.c | 12 ++++++++++-- src/video/uikit/SDL_uikitmetalview.m | 12 ------------ src/video/uikit/SDL_uikitview.h | 2 -- src/video/uikit/SDL_uikitview.m | 25 +------------------------ 5 files changed, 11 insertions(+), 65 deletions(-) diff --git a/src/render/metal/SDL_render_metal.m b/src/render/metal/SDL_render_metal.m index 3dc346d57e..80fd96f075 100644 --- a/src/render/metal/SDL_render_metal.m +++ b/src/render/metal/SDL_render_metal.m @@ -55,9 +55,6 @@ /* Apple Metal renderer implementation */ -/* Used to re-create the window with Metal capability */ -extern int SDL_RecreateWindow(SDL_Window * window, Uint32 flags); - /* macOS requires constants in a buffer to have a 256 byte alignment. */ /* Use native type alignments from https://developer.apple.com/metal/Metal-Shading-Language-Specification.pdf */ #if defined(__MACOSX__) || TARGET_OS_SIMULATOR || TARGET_OS_MACCATALYST @@ -1635,13 +1632,11 @@ METAL_CreateRenderer(SDL_Window * window, Uint32 flags) SDL_MetalView view = NULL; CAMetalLayer *layer = nil; SDL_SysWMinfo syswm; - SDL_bool changed_window = SDL_FALSE; NSError *err = nil; dispatch_data_t mtllibdata; char *constantdata; int maxtexsize, quadcount = UINT16_MAX / 4; UInt16 *indexdata; - Uint32 window_flags; size_t indicessize = sizeof(UInt16) * quadcount * 6; MTLSamplerDescriptor *samplerdesc; id mtlcmdqueue; @@ -1697,20 +1692,9 @@ METAL_CreateRenderer(SDL_Window * window, Uint32 flags) return NULL; } - window_flags = SDL_GetWindowFlags(window); - if (!(window_flags & SDL_WINDOW_METAL)) { - changed_window = SDL_TRUE; - if (SDL_RecreateWindow(window, (window_flags & ~(SDL_WINDOW_VULKAN | SDL_WINDOW_OPENGL)) | SDL_WINDOW_METAL) < 0) { - return NULL; - } - } - renderer = (SDL_Renderer *) SDL_calloc(1, sizeof(*renderer)); if (!renderer) { SDL_OutOfMemory(); - if (changed_window) { - SDL_RecreateWindow(window, window_flags); - } return NULL; } @@ -1720,9 +1704,6 @@ METAL_CreateRenderer(SDL_Window * window, Uint32 flags) if (mtldevice == nil) { SDL_free(renderer); SDL_SetError("Failed to obtain Metal device"); - if (changed_window) { - SDL_RecreateWindow(window, window_flags); - } return NULL; } @@ -1733,9 +1714,6 @@ METAL_CreateRenderer(SDL_Window * window, Uint32 flags) if (view == NULL) { SDL_free(renderer); - if (changed_window) { - SDL_RecreateWindow(window, window_flags); - } return NULL; } @@ -1749,9 +1727,6 @@ METAL_CreateRenderer(SDL_Window * window, Uint32 flags) /* SDL_Metal_DestroyView(view); */ CFBridgingRelease(view); SDL_free(renderer); - if (changed_window) { - SDL_RecreateWindow(window, window_flags); - } return NULL; } diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c index 51e282f066..c75b026d98 100644 --- a/src/video/SDL_video.c +++ b/src/video/SDL_video.c @@ -4853,8 +4853,16 @@ SDL_Metal_CreateView(SDL_Window * window) CHECK_WINDOW_MAGIC(window, NULL); if (!(window->flags & SDL_WINDOW_METAL)) { - SDL_SetError("The specified window isn't a Metal window"); - return NULL; + /* No problem, we can convert to Metal */ + if (window->flags & SDL_WINDOW_OPENGL) { + window->flags &= ~SDL_WINDOW_OPENGL; + SDL_GL_UnloadLibrary(); + } + if (window->flags & SDL_WINDOW_VULKAN) { + window->flags &= ~SDL_WINDOW_VULKAN; + SDL_Vulkan_UnloadLibrary(); + } + window->flags |= SDL_WINDOW_METAL; } return _this->Metal_CreateView(_this, window); diff --git a/src/video/uikit/SDL_uikitmetalview.m b/src/video/uikit/SDL_uikitmetalview.m index af6eb0cd3e..8bc3380955 100644 --- a/src/video/uikit/SDL_uikitmetalview.m +++ b/src/video/uikit/SDL_uikitmetalview.m @@ -69,18 +69,6 @@ CGSize size = self.bounds.size; size.width *= self.layer.contentsScale; size.height *= self.layer.contentsScale; - - /* Make sure the width/height are oriented correctly - * - * This works around an issue in iOS 16 where the bounds come back in portrait mode - * instead of landscape until the event loop runs. - */ - if ([self shouldSwapDimensions:(size.width >= size.height)]) { - CGFloat temp = size.width; - size.width = size.height; - size.height = temp; - } - ((CAMetalLayer *)self.layer).drawableSize = size; } diff --git a/src/video/uikit/SDL_uikitview.h b/src/video/uikit/SDL_uikitview.h index 5369bb2124..dcd63c7a56 100644 --- a/src/video/uikit/SDL_uikitview.h +++ b/src/video/uikit/SDL_uikitview.h @@ -35,8 +35,6 @@ - (void)setSDLWindow:(SDL_Window *)window; -- (BOOL)shouldSwapDimensions:(BOOL)portrait; - #if !TARGET_OS_TV && defined(__IPHONE_13_4) - (UIPointerRegion *)pointerInteraction:(UIPointerInteraction *)interaction regionForRequest:(UIPointerRegionRequest *)request defaultRegion:(UIPointerRegion *)defaultRegion API_AVAILABLE(ios(13.4)); - (UIPointerStyle *)pointerInteraction:(UIPointerInteraction *)interaction styleForRegion:(UIPointerRegion *)region API_AVAILABLE(ios(13.4)); diff --git a/src/video/uikit/SDL_uikitview.m b/src/video/uikit/SDL_uikitview.m index 50d7393e7f..8c48cfa503 100644 --- a/src/video/uikit/SDL_uikitview.m +++ b/src/video/uikit/SDL_uikitview.m @@ -120,8 +120,6 @@ extern int SDL_AppleTVRemoteOpenedAsJoystick; [data.uiwindow layoutIfNeeded]; } - sdlwindow = window; - /* Add ourself to the new window. */ if (window) { data = (__bridge SDL_WindowData *) window->driverdata; @@ -146,29 +144,8 @@ extern int SDL_AppleTVRemoteOpenedAsJoystick; * layout now to immediately update the bounds. */ [data.uiwindow layoutIfNeeded]; } -} -- (BOOL)shouldSwapDimensions:(BOOL)landscape -{ -#if !TARGET_OS_TV - if (sdlwindow) { - SDL_VideoDisplay *display = SDL_GetDisplayForWindow(sdlwindow); - SDL_DisplayData *displaydata = (__bridge SDL_DisplayData *) display->driverdata; - - if (displaydata.uiscreen == [UIScreen mainScreen]) { - NSUInteger orients = UIKit_GetSupportedOrientations(sdlwindow); - BOOL supportsLandscape = (orients & UIInterfaceOrientationMaskLandscape) != 0; - BOOL supportsPortrait = (orients & (UIInterfaceOrientationMaskPortrait|UIInterfaceOrientationMaskPortraitUpsideDown)) != 0; - - /* Make sure the width/height are oriented correctly */ - if ((landscape && !supportsLandscape) || (!landscape && !supportsPortrait)) { - return YES; - } - } - } -#endif /* !TARGET_OS_TV */ - - return NO; + sdlwindow = window; } #if !TARGET_OS_TV && defined(__IPHONE_13_4) From e6c4db816085d2cb84e7d44562a3cd10cabe62a5 Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Tue, 15 Nov 2022 19:22:42 +0100 Subject: [PATCH 035/153] The SDL2::SDL2 target in SDL2.framework needs to see the SDL2 include folder SDL.h includes other files through SDL2/SDL_xxx.h --- Xcode/SDL/pkg-support/resources/CMake/sdl2-config.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Xcode/SDL/pkg-support/resources/CMake/sdl2-config.cmake b/Xcode/SDL/pkg-support/resources/CMake/sdl2-config.cmake index e4294d90ff..28c34bc705 100644 --- a/Xcode/SDL/pkg-support/resources/CMake/sdl2-config.cmake +++ b/Xcode/SDL/pkg-support/resources/CMake/sdl2-config.cmake @@ -39,7 +39,7 @@ string(REGEX REPLACE "SDL2\\.framework.*" "" SDL2_FRAMEWORK_PARENT_PATH "${CMAKE set_and_check(SDL2_PREFIX "${SDL2_FRAMEWORK_PATH}") set_and_check(SDL2_EXEC_PREFIX "${SDL2_FRAMEWORK_PATH}") set_and_check(SDL2_INCLUDE_DIR "${SDL2_FRAMEWORK_PATH}/Headers") -set(SDL2_INCLUDE_DIRS "${SDL2_INCLUDE_DIR}") +set(SDL2_INCLUDE_DIRS "${SDL2_INCLUDE_DIR};${SDL2_FRAMEWORK_PATH}") set_and_check(SDL2_BINDIR "${SDL2_FRAMEWORK_PATH}") set_and_check(SDL2_LIBDIR "${SDL2_FRAMEWORK_PATH}") @@ -53,7 +53,7 @@ if(NOT TARGET SDL2::SDL2) set_target_properties(SDL2::SDL2 PROPERTIES INTERFACE_COMPILE_OPTIONS "SHELL:-F \"${SDL2_FRAMEWORK_PARENT_PATH}\"" - INTERFACE_INCLUDE_DIRECTORIES "${SDL2_INCLUDE_DIR}" + INTERFACE_INCLUDE_DIRECTORIES "${SDL2_INCLUDE_DIRS}" INTERFACE_LINK_OPTIONS "SHELL:-F \"${SDL2_FRAMEWORK_PARENT_PATH}\";SHELL:-framework SDL2" COMPATIBLE_INTERFACE_BOOL "SDL2_SHARED" INTERFACE_SDL2_SHARED "ON" From f3cc99fb9342337c75ecf16250f80f54f4a4c8b5 Mon Sep 17 00:00:00 2001 From: Ethan Lee Date: Tue, 15 Nov 2022 13:56:44 -0500 Subject: [PATCH 036/153] x11: Minor style fixes for recent OSK changes --- src/video/x11/SDL_x11keyboard.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/video/x11/SDL_x11keyboard.c b/src/video/x11/SDL_x11keyboard.c index f5be37ec5d..0583f7a811 100644 --- a/src/video/x11/SDL_x11keyboard.c +++ b/src/video/x11/SDL_x11keyboard.c @@ -868,7 +868,8 @@ X11_ShowScreenKeyboard(_THIS, SDL_Window *window) } } -void X11_HideScreenKeyboard(_THIS, SDL_Window *window) +void +X11_HideScreenKeyboard(_THIS, SDL_Window *window) { SDL_VideoData *videodata = (SDL_VideoData *) _this->driverdata; @@ -878,7 +879,8 @@ void X11_HideScreenKeyboard(_THIS, SDL_Window *window) } } -SDL_bool X11_IsScreenKeyboardShown(_THIS, SDL_Window *window) +SDL_bool +X11_IsScreenKeyboardShown(_THIS, SDL_Window *window) { SDL_VideoData *videodata = (SDL_VideoData *) _this->driverdata; From 44d7b8b91d6c22247188cc926716f54106cb91b9 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Tue, 15 Nov 2022 13:57:01 -0500 Subject: [PATCH 037/153] egl: Check for a NULL pointer in SDL_EGL_GetProcAddress. This happens on kmsdrm if you try to GetProcAddress before creating a window. Fixes #5399. --- src/video/SDL_egl.c | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/src/video/SDL_egl.c b/src/video/SDL_egl.c index 28d02b132c..2438faf00a 100644 --- a/src/video/SDL_egl.c +++ b/src/video/SDL_egl.c @@ -244,27 +244,28 @@ SDL_bool SDL_EGL_HasExtension(_THIS, SDL_EGL_ExtensionType type, const char *ext void * SDL_EGL_GetProcAddress(_THIS, const char *proc) { - const Uint32 eglver = (((Uint32) _this->egl_data->egl_version_major) << 16) | ((Uint32) _this->egl_data->egl_version_minor); - const SDL_bool is_egl_15_or_later = eglver >= ((((Uint32) 1) << 16) | 5); void *retval = NULL; + if (_this->egl_data != NULL) { + const Uint32 eglver = (((Uint32) _this->egl_data->egl_version_major) << 16) | ((Uint32) _this->egl_data->egl_version_minor); + const SDL_bool is_egl_15_or_later = eglver >= ((((Uint32) 1) << 16) | 5); - /* EGL 1.5 can use eglGetProcAddress() for any symbol. 1.4 and earlier can't use it for core entry points. */ - if (!retval && is_egl_15_or_later && _this->egl_data->eglGetProcAddress) { - retval = _this->egl_data->eglGetProcAddress(proc); + /* EGL 1.5 can use eglGetProcAddress() for any symbol. 1.4 and earlier can't use it for core entry points. */ + if (!retval && is_egl_15_or_later && _this->egl_data->eglGetProcAddress) { + retval = _this->egl_data->eglGetProcAddress(proc); + } + + #if !defined(__EMSCRIPTEN__) && !defined(SDL_VIDEO_DRIVER_VITA) /* LoadFunction isn't needed on Emscripten and will call dlsym(), causing other problems. */ + /* Try SDL_LoadFunction() first for EGL <= 1.4, or as a fallback for >= 1.5. */ + if (!retval) { + retval = SDL_LoadFunction(_this->egl_data->opengl_dll_handle, proc); + } + #endif + + /* Try eglGetProcAddress if we're on <= 1.4 and still searching... */ + if (!retval && !is_egl_15_or_later && _this->egl_data->eglGetProcAddress) { + retval = _this->egl_data->eglGetProcAddress(proc); + } } - - #if !defined(__EMSCRIPTEN__) && !defined(SDL_VIDEO_DRIVER_VITA) /* LoadFunction isn't needed on Emscripten and will call dlsym(), causing other problems. */ - /* Try SDL_LoadFunction() first for EGL <= 1.4, or as a fallback for >= 1.5. */ - if (!retval) { - retval = SDL_LoadFunction(_this->egl_data->opengl_dll_handle, proc); - } - #endif - - /* Try eglGetProcAddress if we're on <= 1.4 and still searching... */ - if (!retval && !is_egl_15_or_later && _this->egl_data->eglGetProcAddress) { - retval = _this->egl_data->eglGetProcAddress(proc); - } - return retval; } From 0e446c54bd487f29ed624619fc45728c3767ff10 Mon Sep 17 00:00:00 2001 From: Frank Praznik Date: Fri, 4 Nov 2022 12:27:36 -0400 Subject: [PATCH 038/153] events: Factor out the xkb keysym to scancode conversion from the X11 driver --- src/events/SDL_keysym_to_scancode.c | 444 ++++++++++++++++++++++++++ src/events/SDL_keysym_to_scancode_c.h | 31 ++ src/video/x11/SDL_x11keyboard.c | 406 +---------------------- 3 files changed, 479 insertions(+), 402 deletions(-) create mode 100644 src/events/SDL_keysym_to_scancode.c create mode 100644 src/events/SDL_keysym_to_scancode_c.h diff --git a/src/events/SDL_keysym_to_scancode.c b/src/events/SDL_keysym_to_scancode.c new file mode 100644 index 0000000000..267cc0b3a2 --- /dev/null +++ b/src/events/SDL_keysym_to_scancode.c @@ -0,0 +1,444 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2022 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +#include "../SDL_internal.h" + +#if SDL_VIDEO_DRIVER_WAYLAND || SDL_VIDEO_DRIVER_X11 + +#include "SDL_keyboard_c.h" +#include "SDL_scancode_tables_c.h" + +#include +#include + +/* *INDENT-OFF* */ /* clang-format off */ +static const struct { + xkb_keysym_t keysym; + SDL_Scancode scancode; +} KeySymToSDLScancode[] = { + { XKB_KEY_KP_End, SDL_SCANCODE_KP_1 }, + { XKB_KEY_KP_Down, SDL_SCANCODE_KP_2 }, + { XKB_KEY_KP_Next, SDL_SCANCODE_KP_3 }, + { XKB_KEY_KP_Left, SDL_SCANCODE_KP_4 }, + { XKB_KEY_KP_Begin, SDL_SCANCODE_KP_5 }, + { XKB_KEY_KP_Right, SDL_SCANCODE_KP_6 }, + { XKB_KEY_KP_Home, SDL_SCANCODE_KP_7 }, + { XKB_KEY_KP_Up, SDL_SCANCODE_KP_8 }, + { XKB_KEY_KP_Prior, SDL_SCANCODE_KP_9 }, + { XKB_KEY_KP_Insert, SDL_SCANCODE_KP_0 }, + { XKB_KEY_KP_Delete, SDL_SCANCODE_KP_PERIOD }, + { XKB_KEY_Execute, SDL_SCANCODE_EXECUTE }, + { XKB_KEY_Hyper_R, SDL_SCANCODE_APPLICATION }, + { XKB_KEY_ISO_Level3_Shift, SDL_SCANCODE_RALT }, + { XKB_KEY_Super_L, SDL_SCANCODE_LGUI }, + { XKB_KEY_Super_R, SDL_SCANCODE_RGUI }, + { XKB_KEY_Mode_switch, SDL_SCANCODE_MODE }, + { 0x1008FF65, SDL_SCANCODE_MENU }, /* XF86MenuKB */ + { 0x1008FF81, SDL_SCANCODE_F13 }, /* XF86Tools */ + { 0x1008FF45, SDL_SCANCODE_F14 }, /* XF86Launch5 */ + { 0x1008FF46, SDL_SCANCODE_F15 }, /* XF86Launch6 */ + { 0x1008FF47, SDL_SCANCODE_F16 }, /* XF86Launch7 */ + { 0x1008FF48, SDL_SCANCODE_F17 }, /* XF86Launch8 */ + { 0x1008FF49, SDL_SCANCODE_F18 }, /* XF86Launch9 */ +}; + +/* This is a mapping from X keysym to Linux keycode */ +static const xkb_keysym_t LinuxKeycodeKeysyms[] = { + /* 0, 0x000 */ 0x0, /* NoSymbol */ + /* 1, 0x001 */ 0xFF1B, /* Escape */ + /* 2, 0x002 */ 0x31, /* 1 */ + /* 3, 0x003 */ 0x32, /* 2 */ + /* 4, 0x004 */ 0x33, /* 3 */ + /* 5, 0x005 */ 0x34, /* 4 */ + /* 6, 0x006 */ 0x35, /* 5 */ + /* 7, 0x007 */ 0x36, /* 6 */ + /* 8, 0x008 */ 0x37, /* 7 */ + /* 9, 0x009 */ 0x38, /* 8 */ + /* 10, 0x00a */ 0x39, /* 9 */ + /* 11, 0x00b */ 0x30, /* 0 */ + /* 12, 0x00c */ 0x2D, /* minus */ + /* 13, 0x00d */ 0x3D, /* equal */ + /* 14, 0x00e */ 0xFF08, /* BackSpace */ + /* 15, 0x00f */ 0xFF09, /* Tab */ + /* 16, 0x010 */ 0x71, /* q */ + /* 17, 0x011 */ 0x77, /* w */ + /* 18, 0x012 */ 0x65, /* e */ + /* 19, 0x013 */ 0x72, /* r */ + /* 20, 0x014 */ 0x74, /* t */ + /* 21, 0x015 */ 0x79, /* y */ + /* 22, 0x016 */ 0x75, /* u */ + /* 23, 0x017 */ 0x69, /* i */ + /* 24, 0x018 */ 0x6F, /* o */ + /* 25, 0x019 */ 0x70, /* p */ + /* 26, 0x01a */ 0x5B, /* bracketleft */ + /* 27, 0x01b */ 0x5D, /* bracketright */ + /* 28, 0x01c */ 0xFF0D, /* Return */ + /* 29, 0x01d */ 0xFFE3, /* Control_L */ + /* 30, 0x01e */ 0x61, /* a */ + /* 31, 0x01f */ 0x73, /* s */ + /* 32, 0x020 */ 0x64, /* d */ + /* 33, 0x021 */ 0x66, /* f */ + /* 34, 0x022 */ 0x67, /* g */ + /* 35, 0x023 */ 0x68, /* h */ + /* 36, 0x024 */ 0x6A, /* j */ + /* 37, 0x025 */ 0x6B, /* k */ + /* 38, 0x026 */ 0x6C, /* l */ + /* 39, 0x027 */ 0x3B, /* semicolon */ + /* 40, 0x028 */ 0x27, /* apostrophe */ + /* 41, 0x029 */ 0x60, /* grave */ + /* 42, 0x02a */ 0xFFE1, /* Shift_L */ + /* 43, 0x02b */ 0x5C, /* backslash */ + /* 44, 0x02c */ 0x7A, /* z */ + /* 45, 0x02d */ 0x78, /* x */ + /* 46, 0x02e */ 0x63, /* c */ + /* 47, 0x02f */ 0x76, /* v */ + /* 48, 0x030 */ 0x62, /* b */ + /* 49, 0x031 */ 0x6E, /* n */ + /* 50, 0x032 */ 0x6D, /* m */ + /* 51, 0x033 */ 0x2C, /* comma */ + /* 52, 0x034 */ 0x2E, /* period */ + /* 53, 0x035 */ 0x2F, /* slash */ + /* 54, 0x036 */ 0xFFE2, /* Shift_R */ + /* 55, 0x037 */ 0xFFAA, /* KP_Multiply */ + /* 56, 0x038 */ 0xFFE9, /* Alt_L */ + /* 57, 0x039 */ 0x20, /* space */ + /* 58, 0x03a */ 0xFFE5, /* Caps_Lock */ + /* 59, 0x03b */ 0xFFBE, /* F1 */ + /* 60, 0x03c */ 0xFFBF, /* F2 */ + /* 61, 0x03d */ 0xFFC0, /* F3 */ + /* 62, 0x03e */ 0xFFC1, /* F4 */ + /* 63, 0x03f */ 0xFFC2, /* F5 */ + /* 64, 0x040 */ 0xFFC3, /* F6 */ + /* 65, 0x041 */ 0xFFC4, /* F7 */ + /* 66, 0x042 */ 0xFFC5, /* F8 */ + /* 67, 0x043 */ 0xFFC6, /* F9 */ + /* 68, 0x044 */ 0xFFC7, /* F10 */ + /* 69, 0x045 */ 0xFF7F, /* Num_Lock */ + /* 70, 0x046 */ 0xFF14, /* Scroll_Lock */ + /* 71, 0x047 */ 0xFFB7, /* KP_7 */ + /* 72, 0x048 */ 0XFFB8, /* KP_8 */ + /* 73, 0x049 */ 0XFFB9, /* KP_9 */ + /* 74, 0x04a */ 0xFFAD, /* KP_Subtract */ + /* 75, 0x04b */ 0xFFB4, /* KP_4 */ + /* 76, 0x04c */ 0xFFB5, /* KP_5 */ + /* 77, 0x04d */ 0xFFB6, /* KP_6 */ + /* 78, 0x04e */ 0xFFAB, /* KP_Add */ + /* 79, 0x04f */ 0xFFB1, /* KP_1 */ + /* 80, 0x050 */ 0xFFB2, /* KP_2 */ + /* 81, 0x051 */ 0xFFB3, /* KP_3 */ + /* 82, 0x052 */ 0xFFB0, /* KP_0 */ + /* 83, 0x053 */ 0xFFAE, /* KP_Decimal */ + /* 84, 0x054 */ 0x0, /* NoSymbol */ + /* 85, 0x055 */ 0x0, /* NoSymbol */ + /* 86, 0x056 */ 0x3C, /* less */ + /* 87, 0x057 */ 0xFFC8, /* F11 */ + /* 88, 0x058 */ 0xFFC9, /* F12 */ + /* 89, 0x059 */ 0x0, /* NoSymbol */ + /* 90, 0x05a */ 0xFF26, /* Katakana */ + /* 91, 0x05b */ 0xFF25, /* Hiragana */ + /* 92, 0x05c */ 0xFF23, /* Henkan_Mode */ + /* 93, 0x05d */ 0xFF27, /* Hiragana_Katakana */ + /* 94, 0x05e */ 0xFF22, /* Muhenkan */ + /* 95, 0x05f */ 0x0, /* NoSymbol */ + /* 96, 0x060 */ 0xFF8D, /* KP_Enter */ + /* 97, 0x061 */ 0xFFE4, /* Control_R */ + /* 98, 0x062 */ 0xFFAF, /* KP_Divide */ + /* 99, 0x063 */ 0xFF15, /* Sys_Req */ + /* 100, 0x064 */ 0xFFEA, /* Alt_R */ + /* 101, 0x065 */ 0xFF0A, /* Linefeed */ + /* 102, 0x066 */ 0xFF50, /* Home */ + /* 103, 0x067 */ 0xFF52, /* Up */ + /* 104, 0x068 */ 0xFF55, /* Prior */ + /* 105, 0x069 */ 0xFF51, /* Left */ + /* 106, 0x06a */ 0xFF53, /* Right */ + /* 107, 0x06b */ 0xFF57, /* End */ + /* 108, 0x06c */ 0xFF54, /* Down */ + /* 109, 0x06d */ 0xFF56, /* Next */ + /* 110, 0x06e */ 0xFF63, /* Insert */ + /* 111, 0x06f */ 0xFFFF, /* Delete */ + /* 112, 0x070 */ 0x0, /* NoSymbol */ + /* 113, 0x071 */ 0x1008FF12, /* XF86AudioMute */ + /* 114, 0x072 */ 0x1008FF11, /* XF86AudioLowerVolume */ + /* 115, 0x073 */ 0x1008FF13, /* XF86AudioRaiseVolume */ + /* 116, 0x074 */ 0x1008FF2A, /* XF86PowerOff */ + /* 117, 0x075 */ 0xFFBD, /* KP_Equal */ + /* 118, 0x076 */ 0xB1, /* plusminus */ + /* 119, 0x077 */ 0xFF13, /* Pause */ + /* 120, 0x078 */ 0x1008FF4A, /* XF86LaunchA */ + /* 121, 0x079 */ 0xFFAC, /* KP_Separator */ + /* 122, 0x07a */ 0xFF31, /* Hangul */ + /* 123, 0x07b */ 0xFF34, /* Hangul_Hanja */ + /* 124, 0x07c */ 0x0, /* NoSymbol */ + /* 125, 0x07d */ 0xFFE7, /* Meta_L */ + /* 126, 0x07e */ 0xFFE8, /* Meta_R */ + /* 127, 0x07f */ 0xFF67, /* Menu */ + /* 128, 0x080 */ 0x00, /* NoSymbol */ + /* 129, 0x081 */ 0xFF66, /* Redo */ + /* 130, 0x082 */ 0x1005FF70, /* SunProps */ + /* 131, 0x083 */ 0xFF65, /* Undo */ + /* 132, 0x084 */ 0x1005FF71, /* SunFront */ + /* 133, 0x085 */ 0x1008FF57, /* XF86Copy */ + /* 134, 0x086 */ 0x1008FF6B, /* XF86Open */ + /* 135, 0x087 */ 0x1008FF6D, /* XF86Paste */ + /* 136, 0x088 */ 0xFF68, /* Find */ + /* 137, 0x089 */ 0x1008FF58, /* XF86Cut */ + /* 138, 0x08a */ 0xFF6A, /* Help */ + /* 139, 0x08b */ 0xFF67, /* Menu */ + /* 140, 0x08c */ 0x1008FF1D, /* XF86Calculator */ + /* 141, 0x08d */ 0x0, /* NoSymbol */ + /* 142, 0x08e */ 0x1008FF2F, /* XF86Sleep */ + /* 143, 0x08f */ 0x1008FF2B, /* XF86WakeUp */ + /* 144, 0x090 */ 0x1008FF5D, /* XF86Explorer */ + /* 145, 0x091 */ 0x1008FF7B, /* XF86Send */ + /* 146, 0x092 */ 0x0, /* NoSymbol */ + /* 147, 0x093 */ 0x1008FF8A, /* XF86Xfer */ + /* 148, 0x094 */ 0x1008FF41, /* XF86Launch1 */ + /* 149, 0x095 */ 0x1008FF42, /* XF86Launch2 */ + /* 150, 0x096 */ 0x1008FF2E, /* XF86WWW */ + /* 151, 0x097 */ 0x1008FF5A, /* XF86DOS */ + /* 152, 0x098 */ 0x1008FF2D, /* XF86ScreenSaver */ + /* 153, 0x099 */ 0x1008FF74, /* XF86RotateWindows */ + /* 154, 0x09a */ 0x1008FF7F, /* XF86TaskPane */ + /* 155, 0x09b */ 0x1008FF19, /* XF86Mail */ + /* 156, 0x09c */ 0x1008FF30, /* XF86Favorites */ + /* 157, 0x09d */ 0x1008FF33, /* XF86MyComputer */ + /* 158, 0x09e */ 0x1008FF26, /* XF86Back */ + /* 159, 0x09f */ 0x1008FF27, /* XF86Forward */ + /* 160, 0x0a0 */ 0x0, /* NoSymbol */ + /* 161, 0x0a1 */ 0x1008FF2C, /* XF86Eject */ + /* 162, 0x0a2 */ 0x1008FF2C, /* XF86Eject */ + /* 163, 0x0a3 */ 0x1008FF17, /* XF86AudioNext */ + /* 164, 0x0a4 */ 0x1008FF14, /* XF86AudioPlay */ + /* 165, 0x0a5 */ 0x1008FF16, /* XF86AudioPrev */ + /* 166, 0x0a6 */ 0x1008FF15, /* XF86AudioStop */ + /* 167, 0x0a7 */ 0x1008FF1C, /* XF86AudioRecord */ + /* 168, 0x0a8 */ 0x1008FF3E, /* XF86AudioRewind */ + /* 169, 0x0a9 */ 0x1008FF6E, /* XF86Phone */ + /* 170, 0x0aa */ 0x0, /* NoSymbol */ + /* 171, 0x0ab */ 0x1008FF81, /* XF86Tools */ + /* 172, 0x0ac */ 0x1008FF18, /* XF86HomePage */ + /* 173, 0x0ad */ 0x1008FF73, /* XF86Reload */ + /* 174, 0x0ae */ 0x1008FF56, /* XF86Close */ + /* 175, 0x0af */ 0x0, /* NoSymbol */ + /* 176, 0x0b0 */ 0x0, /* NoSymbol */ + /* 177, 0x0b1 */ 0x1008FF78, /* XF86ScrollUp */ + /* 178, 0x0b2 */ 0x1008FF79, /* XF86ScrollDown */ + /* 179, 0x0b3 */ 0x28, /* parenleft */ + /* 180, 0x0b4 */ 0x29, /* parenright */ + /* 181, 0x0b5 */ 0x1008FF68, /* XF86New */ + /* 182, 0x0b6 */ 0xFF66, /* Redo */ + /* 183, 0x0b7 */ 0xFFCA, /* F13 */ + /* 184, 0x0b8 */ 0xFFCB, /* F14 */ + /* 185, 0x0b9 */ 0xFFCC, /* F15 */ + /* 186, 0x0ba */ 0xFFCD, /* F16 */ + /* 187, 0x0bb */ 0xFFCE, /* F17 */ + /* 188, 0x0bc */ 0xFFCF, /* F18 */ + /* 189, 0x0bd */ 0xFFD0, /* F19 */ + /* 190, 0x0be */ 0xFFD1, /* F20 */ + /* 191, 0x0bf */ 0xFFD2, /* F21 */ + /* 192, 0x0c0 */ 0xFFD3, /* F22 */ + /* 193, 0x0c1 */ 0xFFD4, /* F23 */ + /* 194, 0x0c2 */ 0xFFD5, /* F24 */ + /* 195, 0x0c3 */ 0x0, /* NoSymbol */ + /* 196, 0x0c4 */ 0x0, /* NoSymbol */ + /* 197, 0x0c5 */ 0x0, /* NoSymbol */ + /* 198, 0x0c6 */ 0x0, /* NoSymbol */ + /* 199, 0x0c7 */ 0x0, /* NoSymbol */ + /* 200, 0x0c8 */ 0x1008FF14, /* XF86AudioPlay */ + /* 201, 0x0c9 */ 0x1008FF31, /* XF86AudioPause */ + /* 202, 0x0ca */ 0x1008FF43, /* XF86Launch3 */ + /* 203, 0x0cb */ 0x1008FF44, /* XF86Launch4 */ + /* 204, 0x0cc */ 0x1008FF4B, /* XF86LaunchB */ + /* 205, 0x0cd */ 0x1008FFA7, /* XF86Suspend */ + /* 206, 0x0ce */ 0x1008FF56, /* XF86Close */ + /* 207, 0x0cf */ 0x1008FF14, /* XF86AudioPlay */ + /* 208, 0x0d0 */ 0x1008FF97, /* XF86AudioForward */ + /* 209, 0x0d1 */ 0x0, /* NoSymbol */ + /* 210, 0x0d2 */ 0xFF61, /* Print */ + /* 211, 0x0d3 */ 0x0, /* NoSymbol */ + /* 212, 0x0d4 */ 0x1008FF8F, /* XF86WebCam */ + /* 213, 0x0d5 */ 0x1008FFB6, /* XF86AudioPreset */ + /* 214, 0x0d6 */ 0x0, /* NoSymbol */ + /* 215, 0x0d7 */ 0x1008FF19, /* XF86Mail */ + /* 216, 0x0d8 */ 0x1008FF8E, /* XF86Messenger */ + /* 217, 0x0d9 */ 0x1008FF1B, /* XF86Search */ + /* 218, 0x0da */ 0x1008FF5F, /* XF86Go */ + /* 219, 0x0db */ 0x1008FF3C, /* XF86Finance */ + /* 220, 0x0dc */ 0x1008FF5E, /* XF86Game */ + /* 221, 0x0dd */ 0x1008FF36, /* XF86Shop */ + /* 222, 0x0de */ 0x0, /* NoSymbol */ + /* 223, 0x0df */ 0xFF69, /* Cancel */ + /* 224, 0x0e0 */ 0x1008FF03, /* XF86MonBrightnessDown */ + /* 225, 0x0e1 */ 0x1008FF02, /* XF86MonBrightnessUp */ + /* 226, 0x0e2 */ 0x1008FF32, /* XF86AudioMedia */ + /* 227, 0x0e3 */ 0x1008FF59, /* XF86Display */ + /* 228, 0x0e4 */ 0x1008FF04, /* XF86KbdLightOnOff */ + /* 229, 0x0e5 */ 0x1008FF06, /* XF86KbdBrightnessDown */ + /* 230, 0x0e6 */ 0x1008FF05, /* XF86KbdBrightnessUp */ + /* 231, 0x0e7 */ 0x1008FF7B, /* XF86Send */ + /* 232, 0x0e8 */ 0x1008FF72, /* XF86Reply */ + /* 233, 0x0e9 */ 0x1008FF90, /* XF86MailForward */ + /* 234, 0x0ea */ 0x1008FF77, /* XF86Save */ + /* 235, 0x0eb */ 0x1008FF5B, /* XF86Documents */ + /* 236, 0x0ec */ 0x1008FF93, /* XF86Battery */ + /* 237, 0x0ed */ 0x1008FF94, /* XF86Bluetooth */ + /* 238, 0x0ee */ 0x1008FF95, /* XF86WLAN */ + /* 239, 0x0ef */ 0x1008FF96, /* XF86UWB */ + /* 240, 0x0f0 */ 0x0, /* NoSymbol */ + /* 241, 0x0f1 */ 0x1008FE22, /* XF86Next_VMode */ + /* 242, 0x0f2 */ 0x1008FE23, /* XF86Prev_VMode */ + /* 243, 0x0f3 */ 0x1008FF07, /* XF86MonBrightnessCycle */ + /* 244, 0x0f4 */ 0x100810F4, /* XF86BrightnessAuto */ + /* 245, 0x0f5 */ 0x100810F5, /* XF86DisplayOff */ + /* 246, 0x0f6 */ 0x1008FFB4, /* XF86WWAN */ + /* 247, 0x0f7 */ 0x1008FFB5, /* XF86RFKill */ +}; + +#if 0 /* Here is a script to generate the ExtendedLinuxKeycodeKeysyms table */ +#!/bin/bash + +function process_line +{ + sym=$(echo "$1" | awk '{print $3}') + code=$(echo "$1" | sed 's,.*_EVDEVK(\(0x[0-9A-Fa-f]*\)).*,\1,') + value=$(egrep "#define ${sym}\s" -R /usr/include/X11 | awk '{print $3}') + printf " { 0x%.8X, 0x%.3x }, /* $sym */\n" $value $code +} + +fgrep "/* Use: " /usr/include/xkbcommon/xkbcommon-keysyms.h | fgrep _EVDEVK | while read line; do + process_line "$line" +done +#endif + +static const struct { + xkb_keysym_t keysym; + int linux_keycode; +} ExtendedLinuxKeycodeKeysyms[] = { + { 0x1008FF2C, 0x0a2 }, /* XF86XK_Eject */ + { 0x1008FF68, 0x0b5 }, /* XF86XK_New */ + { 0x0000FF66, 0x0b6 }, /* XK_Redo */ + { 0x1008FF4B, 0x0cc }, /* XF86XK_LaunchB */ + { 0x1008FF59, 0x0e3 }, /* XF86XK_Display */ + { 0x1008FF04, 0x0e4 }, /* XF86XK_KbdLightOnOff */ + { 0x1008FF06, 0x0e5 }, /* XF86XK_KbdBrightnessDown */ + { 0x1008FF05, 0x0e6 }, /* XF86XK_KbdBrightnessUp */ + { 0x1008FF7B, 0x0e7 }, /* XF86XK_Send */ + { 0x1008FF72, 0x0e8 }, /* XF86XK_Reply */ + { 0x1008FF90, 0x0e9 }, /* XF86XK_MailForward */ + { 0x1008FF77, 0x0ea }, /* XF86XK_Save */ + { 0x1008FF5B, 0x0eb }, /* XF86XK_Documents */ + { 0x1008FF93, 0x0ec }, /* XF86XK_Battery */ + { 0x1008FF94, 0x0ed }, /* XF86XK_Bluetooth */ + { 0x1008FF95, 0x0ee }, /* XF86XK_WLAN */ + { 0x1008FF96, 0x0ef }, /* XF86XK_UWB */ + { 0x1008FE22, 0x0f1 }, /* XF86XK_Next_VMode */ + { 0x1008FE23, 0x0f2 }, /* XF86XK_Prev_VMode */ + { 0x1008FF07, 0x0f3 }, /* XF86XK_MonBrightnessCycle */ + { 0x1008FFB4, 0x0f6 }, /* XF86XK_WWAN */ + { 0x1008FFB5, 0x0f7 }, /* XF86XK_RFKill */ + { 0x1008FFB2, 0x0f8 }, /* XF86XK_AudioMicMute */ + { 0x1008FF9C, 0x173 }, /* XF86XK_CycleAngle */ + { 0x1008FFB8, 0x174 }, /* XF86XK_FullScreen */ + { 0x1008FF87, 0x189 }, /* XF86XK_Video */ + { 0x1008FF20, 0x18d }, /* XF86XK_Calendar */ + { 0x1008FF99, 0x19a }, /* XF86XK_AudioRandomPlay */ + { 0x1008FF5E, 0x1a1 }, /* XF86XK_Game */ + { 0x1008FF8B, 0x1a2 }, /* XF86XK_ZoomIn */ + { 0x1008FF8C, 0x1a3 }, /* XF86XK_ZoomOut */ + { 0x1008FF89, 0x1a5 }, /* XF86XK_Word */ + { 0x1008FF5C, 0x1a7 }, /* XF86XK_Excel */ + { 0x1008FF69, 0x1ab }, /* XF86XK_News */ + { 0x1008FF8E, 0x1ae }, /* XF86XK_Messenger */ + { 0x1008FF61, 0x1b1 }, /* XF86XK_LogOff */ + { 0x00000024, 0x1b2 }, /* XK_dollar */ + { 0x000020AC, 0x1b3 }, /* XK_EuroSign */ + { 0x1008FF9D, 0x1b4 }, /* XF86XK_FrameBack */ + { 0x1008FF9E, 0x1b5 }, /* XF86XK_FrameForward */ + { 0x0000FFF1, 0x1f1 }, /* XK_braille_dot_1 */ + { 0x0000FFF2, 0x1f2 }, /* XK_braille_dot_2 */ + { 0x0000FFF3, 0x1f3 }, /* XK_braille_dot_3 */ + { 0x0000FFF4, 0x1f4 }, /* XK_braille_dot_4 */ + { 0x0000FFF5, 0x1f5 }, /* XK_braille_dot_5 */ + { 0x0000FFF6, 0x1f6 }, /* XK_braille_dot_6 */ + { 0x0000FFF7, 0x1f7 }, /* XK_braille_dot_7 */ + { 0x0000FFF8, 0x1f8 }, /* XK_braille_dot_8 */ + { 0x0000FFF9, 0x1f9 }, /* XK_braille_dot_9 */ + { 0x0000FFF1, 0x1fa }, /* XK_braille_dot_1 */ + { 0x1008FFA9, 0x212 }, /* XF86XK_TouchpadToggle */ + { 0x1008FFB0, 0x213 }, /* XF86XK_TouchpadOn */ + { 0x1008FFB1, 0x214 }, /* XF86XK_TouchpadOff */ + { 0x1008FFB7, 0x231 }, /* XF86XK_RotationLockToggle */ + { 0x0000FE08, 0x248 }, /* XK_ISO_Next_Group */ +}; +/* *INDENT-ON* */ /* clang-format on */ + +SDL_Scancode +SDL_GetScancodeFromKeySym(Uint32 keysym, Uint32 keycode) +{ + int i; + Uint32 linux_keycode = 0; + + /* First check our custom list */ + for (i = 0; i < SDL_arraysize(KeySymToSDLScancode); ++i) { + if (keysym == KeySymToSDLScancode[i].keysym) { + return KeySymToSDLScancode[i].scancode; + } + } + + if (keysym >= 0x41 && keysym <= 0x5a) { + /* Normalize alphabetic keysyms to the lowercase form */ + keysym += 0x20; + } else if (keysym >= 0x10081000 && keysym <= 0x10081FFF) { + /* The rest of the keysyms map to Linux keycodes, so use that mapping + * Per xkbcommon-keysyms.h, this is actually a linux keycode. + */ + linux_keycode = (keysym - 0x10081000); + } + if (!linux_keycode) { + /* See if this keysym is an exact match in our table */ + i = (keycode - 8); + if (i >= 0 && i < SDL_arraysize(LinuxKeycodeKeysyms) && keysym == LinuxKeycodeKeysyms[i]) { + linux_keycode = i; + } else { + /* Scan the table for this keysym */ + for (i = 0; i < SDL_arraysize(LinuxKeycodeKeysyms); ++i) { + if (keysym == LinuxKeycodeKeysyms[i]) { + linux_keycode = i; + break; + } + } + } + } + if (!linux_keycode) { + /* Scan the extended table for this keysym */ + for (i = 0; i < SDL_arraysize(ExtendedLinuxKeycodeKeysyms); ++i) { + if (keysym == ExtendedLinuxKeycodeKeysyms[i].keysym) { + linux_keycode = ExtendedLinuxKeycodeKeysyms[i].linux_keycode; + break; + } + } + } + return SDL_GetScancodeFromTable(SDL_SCANCODE_TABLE_LINUX, linux_keycode); +} + +#endif /* SDL_VIDEO_DRIVER_WAYLAND */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/events/SDL_keysym_to_scancode_c.h b/src/events/SDL_keysym_to_scancode_c.h new file mode 100644 index 0000000000..da6c7e19ab --- /dev/null +++ b/src/events/SDL_keysym_to_scancode_c.h @@ -0,0 +1,31 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2022 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef SDL_keysym_to_scancode_c_h_ +#define SDL_keysym_to_scancode_c_h_ + +#include "SDL_scancode.h" + +extern SDL_Scancode SDL_GetScancodeFromKeySym(Uint32 keysym, Uint32 keycode); + +#endif /* SDL_keysym_to_scancode_c_h_ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/video/x11/SDL_x11keyboard.c b/src/video/x11/SDL_x11keyboard.c index 0583f7a811..6f0eb6ab83 100644 --- a/src/video/x11/SDL_x11keyboard.c +++ b/src/video/x11/SDL_x11keyboard.c @@ -33,429 +33,31 @@ #include #include "../../events/imKStoUCS.h" +#include "../../events/SDL_keysym_to_scancode_c.h" #ifdef X_HAVE_UTF8_STRING #include #endif -/* *INDENT-OFF* */ /* clang-format off */ -static const struct { - KeySym keysym; - SDL_Scancode scancode; -} KeySymToSDLScancode[] = { - { XK_KP_End, SDL_SCANCODE_KP_1 }, - { XK_KP_Down, SDL_SCANCODE_KP_2 }, - { XK_KP_Next, SDL_SCANCODE_KP_3 }, - { XK_KP_Left, SDL_SCANCODE_KP_4 }, - { XK_KP_Begin, SDL_SCANCODE_KP_5 }, - { XK_KP_Right, SDL_SCANCODE_KP_6 }, - { XK_KP_Home, SDL_SCANCODE_KP_7 }, - { XK_KP_Up, SDL_SCANCODE_KP_8 }, - { XK_KP_Prior, SDL_SCANCODE_KP_9 }, - { XK_KP_Insert, SDL_SCANCODE_KP_0 }, - { XK_KP_Delete, SDL_SCANCODE_KP_PERIOD }, - { XK_Execute, SDL_SCANCODE_EXECUTE }, - { XK_Hyper_R, SDL_SCANCODE_APPLICATION }, - { XK_ISO_Level3_Shift, SDL_SCANCODE_RALT }, - { XK_Super_L, SDL_SCANCODE_LGUI }, - { XK_Super_R, SDL_SCANCODE_RGUI }, - { XK_Mode_switch, SDL_SCANCODE_MODE }, - { 0x1008FF65, SDL_SCANCODE_MENU }, /* XF86MenuKB */ - { 0x1008FF81, SDL_SCANCODE_F13 }, /* XF86Tools */ - { 0x1008FF45, SDL_SCANCODE_F14 }, /* XF86Launch5 */ - { 0x1008FF46, SDL_SCANCODE_F15 }, /* XF86Launch6 */ - { 0x1008FF47, SDL_SCANCODE_F16 }, /* XF86Launch7 */ - { 0x1008FF48, SDL_SCANCODE_F17 }, /* XF86Launch8 */ - { 0x1008FF49, SDL_SCANCODE_F18 }, /* XF86Launch9 */ -}; - -/* This is a mapping from X keysym to Linux keycode */ -static const KeySym LinuxKeycodeKeysyms[] = { - /* 0, 0x000 */ 0x0, /* NoSymbol */ - /* 1, 0x001 */ 0xFF1B, /* Escape */ - /* 2, 0x002 */ 0x31, /* 1 */ - /* 3, 0x003 */ 0x32, /* 2 */ - /* 4, 0x004 */ 0x33, /* 3 */ - /* 5, 0x005 */ 0x34, /* 4 */ - /* 6, 0x006 */ 0x35, /* 5 */ - /* 7, 0x007 */ 0x36, /* 6 */ - /* 8, 0x008 */ 0x37, /* 7 */ - /* 9, 0x009 */ 0x38, /* 8 */ - /* 10, 0x00a */ 0x39, /* 9 */ - /* 11, 0x00b */ 0x30, /* 0 */ - /* 12, 0x00c */ 0x2D, /* minus */ - /* 13, 0x00d */ 0x3D, /* equal */ - /* 14, 0x00e */ 0xFF08, /* BackSpace */ - /* 15, 0x00f */ 0xFF09, /* Tab */ - /* 16, 0x010 */ 0x71, /* q */ - /* 17, 0x011 */ 0x77, /* w */ - /* 18, 0x012 */ 0x65, /* e */ - /* 19, 0x013 */ 0x72, /* r */ - /* 20, 0x014 */ 0x74, /* t */ - /* 21, 0x015 */ 0x79, /* y */ - /* 22, 0x016 */ 0x75, /* u */ - /* 23, 0x017 */ 0x69, /* i */ - /* 24, 0x018 */ 0x6F, /* o */ - /* 25, 0x019 */ 0x70, /* p */ - /* 26, 0x01a */ 0x5B, /* bracketleft */ - /* 27, 0x01b */ 0x5D, /* bracketright */ - /* 28, 0x01c */ 0xFF0D, /* Return */ - /* 29, 0x01d */ 0xFFE3, /* Control_L */ - /* 30, 0x01e */ 0x61, /* a */ - /* 31, 0x01f */ 0x73, /* s */ - /* 32, 0x020 */ 0x64, /* d */ - /* 33, 0x021 */ 0x66, /* f */ - /* 34, 0x022 */ 0x67, /* g */ - /* 35, 0x023 */ 0x68, /* h */ - /* 36, 0x024 */ 0x6A, /* j */ - /* 37, 0x025 */ 0x6B, /* k */ - /* 38, 0x026 */ 0x6C, /* l */ - /* 39, 0x027 */ 0x3B, /* semicolon */ - /* 40, 0x028 */ 0x27, /* apostrophe */ - /* 41, 0x029 */ 0x60, /* grave */ - /* 42, 0x02a */ 0xFFE1, /* Shift_L */ - /* 43, 0x02b */ 0x5C, /* backslash */ - /* 44, 0x02c */ 0x7A, /* z */ - /* 45, 0x02d */ 0x78, /* x */ - /* 46, 0x02e */ 0x63, /* c */ - /* 47, 0x02f */ 0x76, /* v */ - /* 48, 0x030 */ 0x62, /* b */ - /* 49, 0x031 */ 0x6E, /* n */ - /* 50, 0x032 */ 0x6D, /* m */ - /* 51, 0x033 */ 0x2C, /* comma */ - /* 52, 0x034 */ 0x2E, /* period */ - /* 53, 0x035 */ 0x2F, /* slash */ - /* 54, 0x036 */ 0xFFE2, /* Shift_R */ - /* 55, 0x037 */ 0xFFAA, /* KP_Multiply */ - /* 56, 0x038 */ 0xFFE9, /* Alt_L */ - /* 57, 0x039 */ 0x20, /* space */ - /* 58, 0x03a */ 0xFFE5, /* Caps_Lock */ - /* 59, 0x03b */ 0xFFBE, /* F1 */ - /* 60, 0x03c */ 0xFFBF, /* F2 */ - /* 61, 0x03d */ 0xFFC0, /* F3 */ - /* 62, 0x03e */ 0xFFC1, /* F4 */ - /* 63, 0x03f */ 0xFFC2, /* F5 */ - /* 64, 0x040 */ 0xFFC3, /* F6 */ - /* 65, 0x041 */ 0xFFC4, /* F7 */ - /* 66, 0x042 */ 0xFFC5, /* F8 */ - /* 67, 0x043 */ 0xFFC6, /* F9 */ - /* 68, 0x044 */ 0xFFC7, /* F10 */ - /* 69, 0x045 */ 0xFF7F, /* Num_Lock */ - /* 70, 0x046 */ 0xFF14, /* Scroll_Lock */ - /* 71, 0x047 */ 0xFFB7, /* KP_7 */ - /* 72, 0x048 */ 0XFFB8, /* KP_8 */ - /* 73, 0x049 */ 0XFFB9, /* KP_9 */ - /* 74, 0x04a */ 0xFFAD, /* KP_Subtract */ - /* 75, 0x04b */ 0xFFB4, /* KP_4 */ - /* 76, 0x04c */ 0xFFB5, /* KP_5 */ - /* 77, 0x04d */ 0xFFB6, /* KP_6 */ - /* 78, 0x04e */ 0xFFAB, /* KP_Add */ - /* 79, 0x04f */ 0xFFB1, /* KP_1 */ - /* 80, 0x050 */ 0xFFB2, /* KP_2 */ - /* 81, 0x051 */ 0xFFB3, /* KP_3 */ - /* 82, 0x052 */ 0xFFB0, /* KP_0 */ - /* 83, 0x053 */ 0xFFAE, /* KP_Decimal */ - /* 84, 0x054 */ 0x0, /* NoSymbol */ - /* 85, 0x055 */ 0x0, /* NoSymbol */ - /* 86, 0x056 */ 0x3C, /* less */ - /* 87, 0x057 */ 0xFFC8, /* F11 */ - /* 88, 0x058 */ 0xFFC9, /* F12 */ - /* 89, 0x059 */ 0x0, /* NoSymbol */ - /* 90, 0x05a */ 0xFF26, /* Katakana */ - /* 91, 0x05b */ 0xFF25, /* Hiragana */ - /* 92, 0x05c */ 0xFF23, /* Henkan_Mode */ - /* 93, 0x05d */ 0xFF27, /* Hiragana_Katakana */ - /* 94, 0x05e */ 0xFF22, /* Muhenkan */ - /* 95, 0x05f */ 0x0, /* NoSymbol */ - /* 96, 0x060 */ 0xFF8D, /* KP_Enter */ - /* 97, 0x061 */ 0xFFE4, /* Control_R */ - /* 98, 0x062 */ 0xFFAF, /* KP_Divide */ - /* 99, 0x063 */ 0xFF15, /* Sys_Req */ - /* 100, 0x064 */ 0xFFEA, /* Alt_R */ - /* 101, 0x065 */ 0xFF0A, /* Linefeed */ - /* 102, 0x066 */ 0xFF50, /* Home */ - /* 103, 0x067 */ 0xFF52, /* Up */ - /* 104, 0x068 */ 0xFF55, /* Prior */ - /* 105, 0x069 */ 0xFF51, /* Left */ - /* 106, 0x06a */ 0xFF53, /* Right */ - /* 107, 0x06b */ 0xFF57, /* End */ - /* 108, 0x06c */ 0xFF54, /* Down */ - /* 109, 0x06d */ 0xFF56, /* Next */ - /* 110, 0x06e */ 0xFF63, /* Insert */ - /* 111, 0x06f */ 0xFFFF, /* Delete */ - /* 112, 0x070 */ 0x0, /* NoSymbol */ - /* 113, 0x071 */ 0x1008FF12, /* XF86AudioMute */ - /* 114, 0x072 */ 0x1008FF11, /* XF86AudioLowerVolume */ - /* 115, 0x073 */ 0x1008FF13, /* XF86AudioRaiseVolume */ - /* 116, 0x074 */ 0x1008FF2A, /* XF86PowerOff */ - /* 117, 0x075 */ 0xFFBD, /* KP_Equal */ - /* 118, 0x076 */ 0xB1, /* plusminus */ - /* 119, 0x077 */ 0xFF13, /* Pause */ - /* 120, 0x078 */ 0x1008FF4A, /* XF86LaunchA */ - /* 121, 0x079 */ 0xFFAC, /* KP_Separator */ - /* 122, 0x07a */ 0xFF31, /* Hangul */ - /* 123, 0x07b */ 0xFF34, /* Hangul_Hanja */ - /* 124, 0x07c */ 0x0, /* NoSymbol */ - /* 125, 0x07d */ 0xFFE7, /* Meta_L */ - /* 126, 0x07e */ 0xFFE8, /* Meta_R */ - /* 127, 0x07f */ 0xFF67, /* Menu */ - /* 128, 0x080 */ 0x00, /* NoSymbol */ - /* 129, 0x081 */ 0xFF66, /* Redo */ - /* 130, 0x082 */ 0x1005FF70, /* SunProps */ - /* 131, 0x083 */ 0xFF65, /* Undo */ - /* 132, 0x084 */ 0x1005FF71, /* SunFront */ - /* 133, 0x085 */ 0x1008FF57, /* XF86Copy */ - /* 134, 0x086 */ 0x1008FF6B, /* XF86Open */ - /* 135, 0x087 */ 0x1008FF6D, /* XF86Paste */ - /* 136, 0x088 */ 0xFF68, /* Find */ - /* 137, 0x089 */ 0x1008FF58, /* XF86Cut */ - /* 138, 0x08a */ 0xFF6A, /* Help */ - /* 139, 0x08b */ 0xFF67, /* Menu */ - /* 140, 0x08c */ 0x1008FF1D, /* XF86Calculator */ - /* 141, 0x08d */ 0x0, /* NoSymbol */ - /* 142, 0x08e */ 0x1008FF2F, /* XF86Sleep */ - /* 143, 0x08f */ 0x1008FF2B, /* XF86WakeUp */ - /* 144, 0x090 */ 0x1008FF5D, /* XF86Explorer */ - /* 145, 0x091 */ 0x1008FF7B, /* XF86Send */ - /* 146, 0x092 */ 0x0, /* NoSymbol */ - /* 147, 0x093 */ 0x1008FF8A, /* XF86Xfer */ - /* 148, 0x094 */ 0x1008FF41, /* XF86Launch1 */ - /* 149, 0x095 */ 0x1008FF42, /* XF86Launch2 */ - /* 150, 0x096 */ 0x1008FF2E, /* XF86WWW */ - /* 151, 0x097 */ 0x1008FF5A, /* XF86DOS */ - /* 152, 0x098 */ 0x1008FF2D, /* XF86ScreenSaver */ - /* 153, 0x099 */ 0x1008FF74, /* XF86RotateWindows */ - /* 154, 0x09a */ 0x1008FF7F, /* XF86TaskPane */ - /* 155, 0x09b */ 0x1008FF19, /* XF86Mail */ - /* 156, 0x09c */ 0x1008FF30, /* XF86Favorites */ - /* 157, 0x09d */ 0x1008FF33, /* XF86MyComputer */ - /* 158, 0x09e */ 0x1008FF26, /* XF86Back */ - /* 159, 0x09f */ 0x1008FF27, /* XF86Forward */ - /* 160, 0x0a0 */ 0x0, /* NoSymbol */ - /* 161, 0x0a1 */ 0x1008FF2C, /* XF86Eject */ - /* 162, 0x0a2 */ 0x1008FF2C, /* XF86Eject */ - /* 163, 0x0a3 */ 0x1008FF17, /* XF86AudioNext */ - /* 164, 0x0a4 */ 0x1008FF14, /* XF86AudioPlay */ - /* 165, 0x0a5 */ 0x1008FF16, /* XF86AudioPrev */ - /* 166, 0x0a6 */ 0x1008FF15, /* XF86AudioStop */ - /* 167, 0x0a7 */ 0x1008FF1C, /* XF86AudioRecord */ - /* 168, 0x0a8 */ 0x1008FF3E, /* XF86AudioRewind */ - /* 169, 0x0a9 */ 0x1008FF6E, /* XF86Phone */ - /* 170, 0x0aa */ 0x0, /* NoSymbol */ - /* 171, 0x0ab */ 0x1008FF81, /* XF86Tools */ - /* 172, 0x0ac */ 0x1008FF18, /* XF86HomePage */ - /* 173, 0x0ad */ 0x1008FF73, /* XF86Reload */ - /* 174, 0x0ae */ 0x1008FF56, /* XF86Close */ - /* 175, 0x0af */ 0x0, /* NoSymbol */ - /* 176, 0x0b0 */ 0x0, /* NoSymbol */ - /* 177, 0x0b1 */ 0x1008FF78, /* XF86ScrollUp */ - /* 178, 0x0b2 */ 0x1008FF79, /* XF86ScrollDown */ - /* 179, 0x0b3 */ 0x28, /* parenleft */ - /* 180, 0x0b4 */ 0x29, /* parenright */ - /* 181, 0x0b5 */ 0x1008FF68, /* XF86New */ - /* 182, 0x0b6 */ 0xFF66, /* Redo */ - /* 183, 0x0b7 */ 0xFFCA, /* F13 */ - /* 184, 0x0b8 */ 0xFFCB, /* F14 */ - /* 185, 0x0b9 */ 0xFFCC, /* F15 */ - /* 186, 0x0ba */ 0xFFCD, /* F16 */ - /* 187, 0x0bb */ 0xFFCE, /* F17 */ - /* 188, 0x0bc */ 0xFFCF, /* F18 */ - /* 189, 0x0bd */ 0xFFD0, /* F19 */ - /* 190, 0x0be */ 0xFFD1, /* F20 */ - /* 191, 0x0bf */ 0xFFD2, /* F21 */ - /* 192, 0x0c0 */ 0xFFD3, /* F22 */ - /* 193, 0x0c1 */ 0xFFD4, /* F23 */ - /* 194, 0x0c2 */ 0xFFD5, /* F24 */ - /* 195, 0x0c3 */ 0x0, /* NoSymbol */ - /* 196, 0x0c4 */ 0x0, /* NoSymbol */ - /* 197, 0x0c5 */ 0x0, /* NoSymbol */ - /* 198, 0x0c6 */ 0x0, /* NoSymbol */ - /* 199, 0x0c7 */ 0x0, /* NoSymbol */ - /* 200, 0x0c8 */ 0x1008FF14, /* XF86AudioPlay */ - /* 201, 0x0c9 */ 0x1008FF31, /* XF86AudioPause */ - /* 202, 0x0ca */ 0x1008FF43, /* XF86Launch3 */ - /* 203, 0x0cb */ 0x1008FF44, /* XF86Launch4 */ - /* 204, 0x0cc */ 0x1008FF4B, /* XF86LaunchB */ - /* 205, 0x0cd */ 0x1008FFA7, /* XF86Suspend */ - /* 206, 0x0ce */ 0x1008FF56, /* XF86Close */ - /* 207, 0x0cf */ 0x1008FF14, /* XF86AudioPlay */ - /* 208, 0x0d0 */ 0x1008FF97, /* XF86AudioForward */ - /* 209, 0x0d1 */ 0x0, /* NoSymbol */ - /* 210, 0x0d2 */ 0xFF61, /* Print */ - /* 211, 0x0d3 */ 0x0, /* NoSymbol */ - /* 212, 0x0d4 */ 0x1008FF8F, /* XF86WebCam */ - /* 213, 0x0d5 */ 0x1008FFB6, /* XF86AudioPreset */ - /* 214, 0x0d6 */ 0x0, /* NoSymbol */ - /* 215, 0x0d7 */ 0x1008FF19, /* XF86Mail */ - /* 216, 0x0d8 */ 0x1008FF8E, /* XF86Messenger */ - /* 217, 0x0d9 */ 0x1008FF1B, /* XF86Search */ - /* 218, 0x0da */ 0x1008FF5F, /* XF86Go */ - /* 219, 0x0db */ 0x1008FF3C, /* XF86Finance */ - /* 220, 0x0dc */ 0x1008FF5E, /* XF86Game */ - /* 221, 0x0dd */ 0x1008FF36, /* XF86Shop */ - /* 222, 0x0de */ 0x0, /* NoSymbol */ - /* 223, 0x0df */ 0xFF69, /* Cancel */ - /* 224, 0x0e0 */ 0x1008FF03, /* XF86MonBrightnessDown */ - /* 225, 0x0e1 */ 0x1008FF02, /* XF86MonBrightnessUp */ - /* 226, 0x0e2 */ 0x1008FF32, /* XF86AudioMedia */ - /* 227, 0x0e3 */ 0x1008FF59, /* XF86Display */ - /* 228, 0x0e4 */ 0x1008FF04, /* XF86KbdLightOnOff */ - /* 229, 0x0e5 */ 0x1008FF06, /* XF86KbdBrightnessDown */ - /* 230, 0x0e6 */ 0x1008FF05, /* XF86KbdBrightnessUp */ - /* 231, 0x0e7 */ 0x1008FF7B, /* XF86Send */ - /* 232, 0x0e8 */ 0x1008FF72, /* XF86Reply */ - /* 233, 0x0e9 */ 0x1008FF90, /* XF86MailForward */ - /* 234, 0x0ea */ 0x1008FF77, /* XF86Save */ - /* 235, 0x0eb */ 0x1008FF5B, /* XF86Documents */ - /* 236, 0x0ec */ 0x1008FF93, /* XF86Battery */ - /* 237, 0x0ed */ 0x1008FF94, /* XF86Bluetooth */ - /* 238, 0x0ee */ 0x1008FF95, /* XF86WLAN */ - /* 239, 0x0ef */ 0x1008FF96, /* XF86UWB */ - /* 240, 0x0f0 */ 0x0, /* NoSymbol */ - /* 241, 0x0f1 */ 0x1008FE22, /* XF86Next_VMode */ - /* 242, 0x0f2 */ 0x1008FE23, /* XF86Prev_VMode */ - /* 243, 0x0f3 */ 0x1008FF07, /* XF86MonBrightnessCycle */ - /* 244, 0x0f4 */ 0x100810F4, /* XF86BrightnessAuto */ - /* 245, 0x0f5 */ 0x100810F5, /* XF86DisplayOff */ - /* 246, 0x0f6 */ 0x1008FFB4, /* XF86WWAN */ - /* 247, 0x0f7 */ 0x1008FFB5, /* XF86RFKill */ -}; - -#if 0 /* Here is a script to generate the ExtendedLinuxKeycodeKeysyms table */ -#!/bin/bash - -function process_line -{ - sym=$(echo "$1" | awk '{print $3}') - code=$(echo "$1" | sed 's,.*_EVDEVK(\(0x[0-9A-Fa-f]*\)).*,\1,') - value=$(egrep "#define ${sym}\s" -R /usr/include/X11 | awk '{print $3}') - printf " { 0x%.8X, 0x%.3x }, /* $sym */\n" $value $code -} - -fgrep "/* Use: " /usr/include/xkbcommon/xkbcommon-keysyms.h | fgrep _EVDEVK | while read line; do - process_line "$line" -done -#endif - -static const struct { - KeySym keysym; - int linux_keycode; -} ExtendedLinuxKeycodeKeysyms[] = { - { 0x1008FF2C, 0x0a2 }, /* XF86XK_Eject */ - { 0x1008FF68, 0x0b5 }, /* XF86XK_New */ - { 0x0000FF66, 0x0b6 }, /* XK_Redo */ - { 0x1008FF4B, 0x0cc }, /* XF86XK_LaunchB */ - { 0x1008FF59, 0x0e3 }, /* XF86XK_Display */ - { 0x1008FF04, 0x0e4 }, /* XF86XK_KbdLightOnOff */ - { 0x1008FF06, 0x0e5 }, /* XF86XK_KbdBrightnessDown */ - { 0x1008FF05, 0x0e6 }, /* XF86XK_KbdBrightnessUp */ - { 0x1008FF7B, 0x0e7 }, /* XF86XK_Send */ - { 0x1008FF72, 0x0e8 }, /* XF86XK_Reply */ - { 0x1008FF90, 0x0e9 }, /* XF86XK_MailForward */ - { 0x1008FF77, 0x0ea }, /* XF86XK_Save */ - { 0x1008FF5B, 0x0eb }, /* XF86XK_Documents */ - { 0x1008FF93, 0x0ec }, /* XF86XK_Battery */ - { 0x1008FF94, 0x0ed }, /* XF86XK_Bluetooth */ - { 0x1008FF95, 0x0ee }, /* XF86XK_WLAN */ - { 0x1008FF96, 0x0ef }, /* XF86XK_UWB */ - { 0x1008FE22, 0x0f1 }, /* XF86XK_Next_VMode */ - { 0x1008FE23, 0x0f2 }, /* XF86XK_Prev_VMode */ - { 0x1008FF07, 0x0f3 }, /* XF86XK_MonBrightnessCycle */ - { 0x1008FFB4, 0x0f6 }, /* XF86XK_WWAN */ - { 0x1008FFB5, 0x0f7 }, /* XF86XK_RFKill */ - { 0x1008FFB2, 0x0f8 }, /* XF86XK_AudioMicMute */ - { 0x1008FF9C, 0x173 }, /* XF86XK_CycleAngle */ - { 0x1008FFB8, 0x174 }, /* XF86XK_FullScreen */ - { 0x1008FF87, 0x189 }, /* XF86XK_Video */ - { 0x1008FF20, 0x18d }, /* XF86XK_Calendar */ - { 0x1008FF99, 0x19a }, /* XF86XK_AudioRandomPlay */ - { 0x1008FF5E, 0x1a1 }, /* XF86XK_Game */ - { 0x1008FF8B, 0x1a2 }, /* XF86XK_ZoomIn */ - { 0x1008FF8C, 0x1a3 }, /* XF86XK_ZoomOut */ - { 0x1008FF89, 0x1a5 }, /* XF86XK_Word */ - { 0x1008FF5C, 0x1a7 }, /* XF86XK_Excel */ - { 0x1008FF69, 0x1ab }, /* XF86XK_News */ - { 0x1008FF8E, 0x1ae }, /* XF86XK_Messenger */ - { 0x1008FF61, 0x1b1 }, /* XF86XK_LogOff */ - { 0x00000024, 0x1b2 }, /* XK_dollar */ - { 0x000020AC, 0x1b3 }, /* XK_EuroSign */ - { 0x1008FF9D, 0x1b4 }, /* XF86XK_FrameBack */ - { 0x1008FF9E, 0x1b5 }, /* XF86XK_FrameForward */ - { 0x0000FFF1, 0x1f1 }, /* XK_braille_dot_1 */ - { 0x0000FFF2, 0x1f2 }, /* XK_braille_dot_2 */ - { 0x0000FFF3, 0x1f3 }, /* XK_braille_dot_3 */ - { 0x0000FFF4, 0x1f4 }, /* XK_braille_dot_4 */ - { 0x0000FFF5, 0x1f5 }, /* XK_braille_dot_5 */ - { 0x0000FFF6, 0x1f6 }, /* XK_braille_dot_6 */ - { 0x0000FFF7, 0x1f7 }, /* XK_braille_dot_7 */ - { 0x0000FFF8, 0x1f8 }, /* XK_braille_dot_8 */ - { 0x0000FFF9, 0x1f9 }, /* XK_braille_dot_9 */ - { 0x0000FFF1, 0x1fa }, /* XK_braille_dot_1 */ - { 0x1008FFA9, 0x212 }, /* XF86XK_TouchpadToggle */ - { 0x1008FFB0, 0x213 }, /* XF86XK_TouchpadOn */ - { 0x1008FFB1, 0x214 }, /* XF86XK_TouchpadOff */ - { 0x1008FFB7, 0x231 }, /* XF86XK_RotationLockToggle */ - { 0x0000FE08, 0x248 }, /* XK_ISO_Next_Group */ -}; - static SDL_ScancodeTable scancode_set[] = { SDL_SCANCODE_TABLE_DARWIN, SDL_SCANCODE_TABLE_XFREE86_1, SDL_SCANCODE_TABLE_XFREE86_2, SDL_SCANCODE_TABLE_XVNC, }; -/* *INDENT-OFF* */ /* clang-format off */ +/* *INDENT-ON* */ /* clang-format on */ /* This function only correctly maps letters and numbers for keyboards in US QWERTY layout */ static SDL_Scancode X11_KeyCodeToSDLScancode(_THIS, KeyCode keycode) { - KeySym keysym; - int i; - int linux_keycode = 0; + const KeySym keysym = X11_KeyCodeToSym(_this, keycode, 0); - keysym = X11_KeyCodeToSym(_this, keycode, 0); if (keysym == NoSymbol) { return SDL_SCANCODE_UNKNOWN; } - /* First check our custom list */ - for (i = 0; i < SDL_arraysize(KeySymToSDLScancode); ++i) { - if (keysym == KeySymToSDLScancode[i].keysym) { - return KeySymToSDLScancode[i].scancode; - } - } - - /* The rest of the keysyms map to Linux keycodes, so use that mapping */ - if (keysym >= 0x10081000 && keysym <= 0x10081FFF) { - /* Per xkbcommon-keysyms.h, this is actually a linux keycode */ - linux_keycode = (keysym - 0x10081000); - } - if (!linux_keycode) { - /* See if this keysym is an exact match in our table */ - i = (keycode - 8); - if (i >= 0 && i < SDL_arraysize(LinuxKeycodeKeysyms) && keysym == LinuxKeycodeKeysyms[i]) { - linux_keycode = i; - } else { - /* Scan the table for this keysym */ - for (i = 0; i < SDL_arraysize(LinuxKeycodeKeysyms); ++i) { - if (keysym == LinuxKeycodeKeysyms[i]) { - linux_keycode = i; - break; - } - } - } - } - if (!linux_keycode) { - /* Scan the extended table for this keysym */ - for (i = 0; i < SDL_arraysize(ExtendedLinuxKeycodeKeysyms); ++i) { - if (keysym == ExtendedLinuxKeycodeKeysyms[i].keysym) { - linux_keycode = ExtendedLinuxKeycodeKeysyms[i].linux_keycode; - break; - } - } - } - return SDL_GetScancodeFromTable(SDL_SCANCODE_TABLE_LINUX, linux_keycode); + return SDL_GetScancodeFromKeySym(keysym, keycode); } static Uint32 From d1858eb124293ace5783a5e1a6788df7c57c02a8 Mon Sep 17 00:00:00 2001 From: Frank Praznik Date: Fri, 4 Nov 2022 12:33:45 -0400 Subject: [PATCH 039/153] events: Add a helper function to get the default keycode for a scancode Add a helper function to get the keycode for a scancode from the default lookup table. Unlike SDL_GetKeyFromScancode(), this is not affected by the set keymap. --- src/events/SDL_keyboard.c | 11 +++++++++++ src/events/SDL_keyboard_c.h | 3 +++ 2 files changed, 14 insertions(+) diff --git a/src/events/SDL_keyboard.c b/src/events/SDL_keyboard.c index 7dc0fb9b26..30ec14c243 100644 --- a/src/events/SDL_keyboard.c +++ b/src/events/SDL_keyboard.c @@ -1137,6 +1137,17 @@ SDL_GetKeyFromScancode(SDL_Scancode scancode) return keyboard->keymap[scancode]; } +SDL_Keycode +SDL_GetDefaultKeyFromScancode(SDL_Scancode scancode) +{ + if (((int)scancode) < SDL_SCANCODE_UNKNOWN || scancode >= SDL_NUM_SCANCODES) { + SDL_InvalidParamError("scancode"); + return 0; + } + + return SDL_default_keymap[scancode]; +} + SDL_Scancode SDL_GetScancodeFromKey(SDL_Keycode key) { diff --git a/src/events/SDL_keyboard_c.h b/src/events/SDL_keyboard_c.h index db9703aaf0..3ace4af641 100644 --- a/src/events/SDL_keyboard_c.h +++ b/src/events/SDL_keyboard_c.h @@ -32,6 +32,9 @@ extern int SDL_KeyboardInit(void); /* Get the default keymap */ extern void SDL_GetDefaultKeymap(SDL_Keycode * keymap); +/* Get the default key code for a scancode */ +extern SDL_Keycode SDL_GetDefaultKeyFromScancode(SDL_Scancode scancode); + /* Set the mapping of scancode to key codes */ extern void SDL_SetKeymap(int start, const SDL_Keycode * keys, int length, SDL_bool send_event); From c855184765840c13cb7a3351c616eada10e921f6 Mon Sep 17 00:00:00 2001 From: Frank Praznik Date: Fri, 4 Nov 2022 12:41:46 -0400 Subject: [PATCH 040/153] wayland: Handle virtual keyboards that don't fit the X mapping SDL is built around the concept of keyboards having a fixed layout with scancodes that correspond to physical keys no matter what linguistic layout is used. Virtual keyboards don't have this concept and can present an arbitrary layout of keys with arbitrary scancodes and names, which don't fit the SDL model. When one of these keyboards is encountered, it requires special handling: use the keysym of the pressed keys to derive their ANSI keyboard scancode equivalents for control keys and ASCII characters. All other characters are passed through as text events only. --- src/events/SDL_keysym_to_scancode_c.h | 1 + src/video/wayland/SDL_waylandevents.c | 257 +++++++++++++----------- src/video/wayland/SDL_waylandevents_c.h | 9 + src/video/wayland/SDL_waylandsym.h | 1 + src/video/x11/SDL_x11keyboard.c | 1 - 5 files changed, 154 insertions(+), 115 deletions(-) diff --git a/src/events/SDL_keysym_to_scancode_c.h b/src/events/SDL_keysym_to_scancode_c.h index da6c7e19ab..d2feb8c7fb 100644 --- a/src/events/SDL_keysym_to_scancode_c.h +++ b/src/events/SDL_keysym_to_scancode_c.h @@ -24,6 +24,7 @@ #include "SDL_scancode.h" +/* This function only correctly maps letters and numbers for keyboards in US QWERTY layout */ extern SDL_Scancode SDL_GetScancodeFromKeySym(Uint32 keysym, Uint32 keycode); #endif /* SDL_keysym_to_scancode_c_h_ */ diff --git a/src/video/wayland/SDL_waylandevents.c b/src/video/wayland/SDL_waylandevents.c index 2d37a0e239..5ccffd9dd5 100644 --- a/src/video/wayland/SDL_waylandevents.c +++ b/src/video/wayland/SDL_waylandevents.c @@ -63,6 +63,7 @@ #include #include #include "../../events/imKStoUCS.h" +#include "../../events/SDL_keysym_to_scancode_c.h" /* Clamp the wl_seat version on older versions of libwayland. */ #if SDL_WAYLAND_CHECK_VERSION(1, 21, 0) @@ -74,28 +75,6 @@ /* Weston uses a ratio of 10 units per scroll tick */ #define WAYLAND_WHEEL_AXIS_UNIT 10 -static const struct { - xkb_keysym_t keysym; - SDL_KeyCode keycode; -} KeySymToSDLKeyCode[] = { - { XKB_KEY_Escape, SDLK_ESCAPE }, - { XKB_KEY_Num_Lock, SDLK_NUMLOCKCLEAR }, - { XKB_KEY_Shift_L, SDLK_LSHIFT }, - { XKB_KEY_Shift_R, SDLK_RSHIFT }, - { XKB_KEY_Control_L, SDLK_LCTRL }, - { XKB_KEY_Control_R, SDLK_RCTRL }, - { XKB_KEY_Caps_Lock, SDLK_CAPSLOCK }, - { XKB_KEY_Alt_L, SDLK_LALT }, - { XKB_KEY_Alt_R, SDLK_RALT }, - { XKB_KEY_Meta_L, SDLK_LGUI }, - { XKB_KEY_Meta_R, SDLK_RGUI }, - { XKB_KEY_Super_L, SDLK_LGUI }, - { XKB_KEY_Super_R, SDLK_RGUI }, - { XKB_KEY_Hyper_L, SDLK_LGUI }, - { XKB_KEY_Hyper_R, SDLK_RGUI }, - { XKB_KEY_BackSpace, SDLK_BACKSPACE }, -}; - struct SDL_WaylandTouchPoint { SDL_TouchID id; float x; @@ -113,19 +92,6 @@ struct SDL_WaylandTouchPointList { static struct SDL_WaylandTouchPointList touch_points = {NULL, NULL}; -static SDL_KeyCode -Wayland_KeySymToSDLKeyCode(xkb_keysym_t keysym) -{ - int i; - - for (i = 0; i < SDL_arraysize(KeySymToSDLKeyCode); ++i) { - if (keysym == KeySymToSDLKeyCode[i].keysym) { - return KeySymToSDLKeyCode[i].keycode; - } - } - return SDLK_UNKNOWN; -} - static void touch_add(SDL_TouchID id, float x, float y, struct wl_surface *surface) { @@ -937,6 +903,59 @@ static const struct wl_touch_listener touch_listener = { NULL, /* orientation */ }; +typedef struct Wayland_Keymap +{ + xkb_layout_index_t layout; + SDL_Keycode keymap[SDL_NUM_SCANCODES]; +} Wayland_Keymap; + +static void +Wayland_keymap_iter(struct xkb_keymap *keymap, xkb_keycode_t key, void *data) +{ + const xkb_keysym_t *syms; + Wayland_Keymap *sdlKeymap = (Wayland_Keymap *)data; + SDL_Scancode scancode; + + scancode = SDL_GetScancodeFromTable(SDL_SCANCODE_TABLE_XFREE86_2, (key - 8)); + if (scancode == SDL_SCANCODE_UNKNOWN) { + return; + } + + if (WAYLAND_xkb_keymap_key_get_syms_by_level(keymap, key, sdlKeymap->layout, 0, &syms) > 0) { + uint32_t keycode = SDL_KeySymToUcs4(syms[0]); + + if (!keycode) { + const SDL_Scancode sc = SDL_GetScancodeFromKeySym(syms[0], key); + keycode = SDL_GetDefaultKeyFromScancode(sc); + } + + if (keycode) { + sdlKeymap->keymap[scancode] = keycode; + } else { + switch (scancode) { + case SDL_SCANCODE_RETURN: + sdlKeymap->keymap[scancode] = SDLK_RETURN; + break; + case SDL_SCANCODE_ESCAPE: + sdlKeymap->keymap[scancode] = SDLK_ESCAPE; + break; + case SDL_SCANCODE_BACKSPACE: + sdlKeymap->keymap[scancode] = SDLK_BACKSPACE; + break; + case SDL_SCANCODE_TAB: + sdlKeymap->keymap[scancode] = SDLK_TAB; + break; + case SDL_SCANCODE_DELETE: + sdlKeymap->keymap[scancode] = SDLK_DELETE; + break; + default: + sdlKeymap->keymap[scancode] = SDL_SCANCODE_TO_KEYCODE(scancode); + break; + } + } + } +} + static void keyboard_handle_keymap(void *data, struct wl_keyboard *keyboard, uint32_t format, int fd, uint32_t size) @@ -962,9 +981,9 @@ keyboard_handle_keymap(void *data, struct wl_keyboard *keyboard, } input->xkb.keymap = WAYLAND_xkb_keymap_new_from_string(input->display->xkb_context, - map_str, - XKB_KEYMAP_FORMAT_TEXT_V1, - 0); + map_str, + XKB_KEYMAP_FORMAT_TEXT_V1, + 0); munmap(map_str, size); close(fd); @@ -973,6 +992,16 @@ keyboard_handle_keymap(void *data, struct wl_keyboard *keyboard, return; } +#define GET_MOD_INDEX(mod) \ + WAYLAND_xkb_keymap_mod_get_index(input->xkb.keymap, XKB_MOD_NAME_##mod) + input->xkb.idx_shift = 1 << GET_MOD_INDEX(SHIFT); + input->xkb.idx_ctrl = 1 << GET_MOD_INDEX(CTRL); + input->xkb.idx_alt = 1 << GET_MOD_INDEX(ALT); + input->xkb.idx_gui = 1 << GET_MOD_INDEX(LOGO); + input->xkb.idx_num = 1 << GET_MOD_INDEX(NUM); + input->xkb.idx_caps = 1 << GET_MOD_INDEX(CAPS); +#undef GET_MOD_INDEX + input->xkb.state = WAYLAND_xkb_state_new(input->xkb.keymap); if (!input->xkb.state) { SDL_SetError("failed to create XKB state\n"); @@ -981,6 +1010,25 @@ keyboard_handle_keymap(void *data, struct wl_keyboard *keyboard, return; } + /* + * Assume that a nameless layout implies a virtual keyboard with an arbitrary layout. + * TODO: Use a better method of detection? + */ + input->keyboard_is_virtual = WAYLAND_xkb_keymap_layout_get_name(input->xkb.keymap, 0) == NULL; + + /* Update the keymap if changed. Virtual keyboards use the default keymap. */ + if (input->xkb.current_group != XKB_GROUP_INVALID) { + Wayland_Keymap keymap; + keymap.layout = input->xkb.current_group; + SDL_GetDefaultKeymap(keymap.keymap); + if (!input->keyboard_is_virtual) { + WAYLAND_xkb_keymap_key_for_each(input->xkb.keymap, + Wayland_keymap_iter, + &keymap); + } + SDL_SetKeymap(0, keymap.keymap, SDL_NUM_SCANCODES, SDL_TRUE); + } + /* * See https://blogs.s-osg.org/compose-key-support-weston/ * for further explanation on dead keys in Wayland. @@ -997,11 +1045,11 @@ keyboard_handle_keymap(void *data, struct wl_keyboard *keyboard, /* Set up XKB compose table */ input->xkb.compose_table = WAYLAND_xkb_compose_table_new_from_locale(input->display->xkb_context, - locale, XKB_COMPOSE_COMPILE_NO_FLAGS); + locale, XKB_COMPOSE_COMPILE_NO_FLAGS); if (input->xkb.compose_table) { /* Set up XKB compose state */ input->xkb.compose_state = WAYLAND_xkb_compose_state_new(input->xkb.compose_table, - XKB_COMPOSE_STATE_NO_FLAGS); + XKB_COMPOSE_STATE_NO_FLAGS); if (!input->xkb.compose_state) { SDL_SetError("could not create XKB compose state\n"); WAYLAND_xkb_compose_table_unref(input->xkb.compose_table); @@ -1010,16 +1058,37 @@ keyboard_handle_keymap(void *data, struct wl_keyboard *keyboard, } } +/* + * Virtual keyboards can have arbitrary layouts, arbitrary scancodes/keycodes, etc... + * Key presses from these devices must be looked up by their keysym value. + */ +static SDL_Scancode +Wayland_get_scancode_from_key(struct SDL_WaylandInput *input, uint32_t key) +{ + SDL_Scancode scancode = SDL_SCANCODE_UNKNOWN; + + if (!input->keyboard_is_virtual) { + scancode = SDL_GetScancodeFromTable(SDL_SCANCODE_TABLE_XFREE86_2, key - 8); + } else { + const xkb_keysym_t *syms; + if (WAYLAND_xkb_keymap_key_get_syms_by_level(input->xkb.keymap, key, input->xkb.current_group, 0, &syms) > 0) { + scancode = SDL_GetScancodeFromKeySym(syms[0], key); + } + } + + return scancode; +} static void keyboard_handle_enter(void *data, struct wl_keyboard *keyboard, uint32_t serial, struct wl_surface *surface, struct wl_array *keys) { - // Caps Lock not included because it only makes sense to consider modifiers - // that get held down, for the case where a user clicks on an unfocused - // window with a modifier key like Shift pressed, in a situation where the - // application handles Shift+click differently from a click + /* Caps Lock not included because it only makes sense to consider modifiers + * that get held down, for the case where a user clicks on an unfocused + * window with a modifier key like Shift pressed, in a situation where the + * application handles Shift+click differently from a click + */ const SDL_Scancode mod_scancodes[] = { SDL_SCANCODE_LSHIFT, SDL_SCANCODE_RSHIFT, @@ -1033,7 +1102,6 @@ keyboard_handle_enter(void *data, struct wl_keyboard *keyboard, struct SDL_WaylandInput *input = data; SDL_WindowData *window; uint32_t *key; - SDL_Scancode scancode; if (!surface) { /* enter event for a window we've just destroyed */ @@ -1057,12 +1125,15 @@ keyboard_handle_enter(void *data, struct wl_keyboard *keyboard, } #endif - wl_array_for_each(key, keys) { - scancode = SDL_GetScancodeFromTable(SDL_SCANCODE_TABLE_XFREE86_2, *key); - for (uint32_t i = 0; i < sizeof mod_scancodes / sizeof *mod_scancodes; ++i) { - if (mod_scancodes[i] == scancode) { - SDL_SendKeyboardKey(SDL_PRESSED, scancode); - break; + wl_array_for_each (key, keys) { + const SDL_Scancode scancode = Wayland_get_scancode_from_key(input, *key + 8); + + if (scancode != SDL_SCANCODE_UNKNOWN) { + for (uint32_t i = 0; i < sizeof mod_scancodes / sizeof *mod_scancodes; ++i) { + if (mod_scancodes[i] == scancode) { + SDL_SendKeyboardKey(SDL_PRESSED, scancode); + break; + } } } } @@ -1156,7 +1227,7 @@ keyboard_handle_key(void *data, struct wl_keyboard *keyboard, { struct SDL_WaylandInput *input = data; enum wl_keyboard_key_state state = state_w; - uint32_t scancode = SDL_SCANCODE_UNKNOWN; + SDL_Scancode scancode = SDL_SCANCODE_UNKNOWN; char text[8]; SDL_bool has_text = SDL_FALSE; SDL_bool handled_by_ime = SDL_FALSE; @@ -1177,11 +1248,8 @@ keyboard_handle_key(void *data, struct wl_keyboard *keyboard, } if (!handled_by_ime) { - scancode = SDL_GetScancodeFromTable(SDL_SCANCODE_TABLE_XFREE86_2, key); - if (scancode != SDL_SCANCODE_UNKNOWN) { - SDL_SendKeyboardKey(state == WL_KEYBOARD_KEY_STATE_PRESSED ? - SDL_PRESSED : SDL_RELEASED, scancode); - } + scancode = Wayland_get_scancode_from_key(input, key + 8); + SDL_SendKeyboardKey(state == WL_KEYBOARD_KEY_STATE_PRESSED ? SDL_PRESSED : SDL_RELEASED, scancode); } if (state == WL_KEYBOARD_KEY_STATE_PRESSED) { @@ -1198,58 +1266,6 @@ keyboard_handle_key(void *data, struct wl_keyboard *keyboard, } } -typedef struct Wayland_Keymap -{ - xkb_layout_index_t layout; - SDL_Keycode keymap[SDL_NUM_SCANCODES]; -} Wayland_Keymap; - -static void -Wayland_keymap_iter(struct xkb_keymap *keymap, xkb_keycode_t key, void *data) -{ - const xkb_keysym_t *syms; - Wayland_Keymap *sdlKeymap = (Wayland_Keymap *)data; - SDL_Scancode scancode; - - scancode = SDL_GetScancodeFromTable(SDL_SCANCODE_TABLE_XFREE86_2, (key - 8)); - if (scancode == SDL_SCANCODE_UNKNOWN) { - return; - } - - if (WAYLAND_xkb_keymap_key_get_syms_by_level(keymap, key, sdlKeymap->layout, 0, &syms) > 0) { - uint32_t keycode = SDL_KeySymToUcs4(syms[0]); - - if (!keycode) { - keycode = Wayland_KeySymToSDLKeyCode(syms[0]); - } - - if (keycode) { - sdlKeymap->keymap[scancode] = keycode; - } else { - switch (scancode) { - case SDL_SCANCODE_RETURN: - sdlKeymap->keymap[scancode] = SDLK_RETURN; - break; - case SDL_SCANCODE_ESCAPE: - sdlKeymap->keymap[scancode] = SDLK_ESCAPE; - break; - case SDL_SCANCODE_BACKSPACE: - sdlKeymap->keymap[scancode] = SDLK_BACKSPACE; - break; - case SDL_SCANCODE_TAB: - sdlKeymap->keymap[scancode] = SDLK_TAB; - break; - case SDL_SCANCODE_DELETE: - sdlKeymap->keymap[scancode] = SDLK_DELETE; - break; - default: - sdlKeymap->keymap[scancode] = SDL_SCANCODE_TO_KEYCODE(scancode); - break; - } - } - } -} - static void keyboard_handle_modifiers(void *data, struct wl_keyboard *keyboard, uint32_t serial, uint32_t mods_depressed, @@ -1258,10 +1274,21 @@ keyboard_handle_modifiers(void *data, struct wl_keyboard *keyboard, { struct SDL_WaylandInput *input = data; Wayland_Keymap keymap; + const uint32_t modstate = (mods_depressed | mods_latched | mods_locked); WAYLAND_xkb_state_update_mask(input->xkb.state, mods_depressed, mods_latched, mods_locked, 0, 0, group); + /* Toggle the modifier states for virtual keyboards, as they may not send key presses. */ + if (input->keyboard_is_virtual) { + SDL_ToggleModState(KMOD_SHIFT, modstate & input->xkb.idx_shift); + SDL_ToggleModState(KMOD_CTRL, modstate & input->xkb.idx_ctrl); + SDL_ToggleModState(KMOD_ALT, modstate & input->xkb.idx_alt); + SDL_ToggleModState(KMOD_GUI, modstate & input->xkb.idx_gui); + SDL_ToggleModState(KMOD_NUM, modstate & input->xkb.idx_num); + SDL_ToggleModState(KMOD_CAPS, modstate & input->xkb.idx_caps); + } + /* If a key is repeating, update the text to apply the modifier. */ if(keyboard_repeat_is_set(&input->keyboard_repeat)) { char text[8]; @@ -1276,13 +1303,15 @@ keyboard_handle_modifiers(void *data, struct wl_keyboard *keyboard, return; } - /* The layout changed, remap and fire an event */ + /* The layout changed, remap and fire an event. Virtual keyboards use the default keymap. */ input->xkb.current_group = group; keymap.layout = group; SDL_GetDefaultKeymap(keymap.keymap); - WAYLAND_xkb_keymap_key_for_each(input->xkb.keymap, - Wayland_keymap_iter, - &keymap); + if (!input->keyboard_is_virtual) { + WAYLAND_xkb_keymap_key_for_each(input->xkb.keymap, + Wayland_keymap_iter, + &keymap); + } SDL_SetKeymap(0, keymap.keymap, SDL_NUM_SCANCODES, SDL_TRUE); } @@ -2394,7 +2423,7 @@ Wayland_display_add_input(SDL_VideoData *d, uint32_t id, uint32_t version) input->seat = wl_registry_bind(d->registry, id, &wl_seat_interface, SDL_min(SDL_WL_SEAT_VERSION, version)); input->sx_w = wl_fixed_from_int(0); input->sy_w = wl_fixed_from_int(0); - input->xkb.current_group = ~0; + input->xkb.current_group = XKB_GROUP_INVALID; d->input = input; if (d->data_device_manager != NULL) { diff --git a/src/video/wayland/SDL_waylandevents_c.h b/src/video/wayland/SDL_waylandevents_c.h index f1f4726337..aab2abf436 100644 --- a/src/video/wayland/SDL_waylandevents_c.h +++ b/src/video/wayland/SDL_waylandevents_c.h @@ -110,6 +110,14 @@ struct SDL_WaylandInput { /* Keyboard layout "group" */ uint32_t current_group; + + /* Modifier bitshift values */ + uint32_t idx_shift; + uint32_t idx_ctrl; + uint32_t idx_alt; + uint32_t idx_gui; + uint32_t idx_num; + uint32_t idx_caps; } xkb; /* information about axis events on current frame */ @@ -129,6 +137,7 @@ struct SDL_WaylandInput { SDL_bool cursor_visible; SDL_bool relative_mode_override; SDL_bool warp_emulation_prohibited; + SDL_bool keyboard_is_virtual; }; extern void Wayland_PumpEvents(_THIS); diff --git a/src/video/wayland/SDL_waylandsym.h b/src/video/wayland/SDL_waylandsym.h index 987bc499d7..8b31d8cac6 100644 --- a/src/video/wayland/SDL_waylandsym.h +++ b/src/video/wayland/SDL_waylandsym.h @@ -155,6 +155,7 @@ SDL_WAYLAND_SYM(int, xkb_keymap_key_get_syms_by_level, (struct xkb_keymap *, SDL_WAYLAND_SYM(uint32_t, xkb_keysym_to_utf32, (xkb_keysym_t) ) SDL_WAYLAND_SYM(uint32_t, xkb_keymap_mod_get_index, (struct xkb_keymap *, const char *) ) +SDL_WAYLAND_SYM(const char *, xkb_keymap_layout_get_name, (struct xkb_keymap*, xkb_layout_index_t)) #ifdef HAVE_LIBDECOR_H SDL_WAYLAND_MODULE(WAYLAND_LIBDECOR) diff --git a/src/video/x11/SDL_x11keyboard.c b/src/video/x11/SDL_x11keyboard.c index 6f0eb6ab83..bad2029646 100644 --- a/src/video/x11/SDL_x11keyboard.c +++ b/src/video/x11/SDL_x11keyboard.c @@ -45,7 +45,6 @@ static SDL_ScancodeTable scancode_set[] = { SDL_SCANCODE_TABLE_XFREE86_2, SDL_SCANCODE_TABLE_XVNC, }; -/* *INDENT-ON* */ /* clang-format on */ /* This function only correctly maps letters and numbers for keyboards in US QWERTY layout */ static SDL_Scancode From 615901dbfee8867ff1eb71f788dd041703b694ca Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Tue, 15 Nov 2022 11:19:08 -0800 Subject: [PATCH 041/153] Removed unnecessary header The xkbcommon-keysyms.h header isn't available on some older systems, and we don't actually need it for this code. --- src/events/SDL_keysym_to_scancode.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/events/SDL_keysym_to_scancode.c b/src/events/SDL_keysym_to_scancode.c index 267cc0b3a2..53b55891b0 100644 --- a/src/events/SDL_keysym_to_scancode.c +++ b/src/events/SDL_keysym_to_scancode.c @@ -26,7 +26,6 @@ #include "SDL_keyboard_c.h" #include "SDL_scancode_tables_c.h" -#include #include /* *INDENT-OFF* */ /* clang-format off */ From 98f93d0aa18328c9290779ef5e995e9c691c52fb Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Tue, 15 Nov 2022 11:39:06 -0800 Subject: [PATCH 042/153] Fixed building without xkbcommon support --- src/events/SDL_keysym_to_scancode.c | 36 ++++++++++++++++++++++++++--- 1 file changed, 33 insertions(+), 3 deletions(-) diff --git a/src/events/SDL_keysym_to_scancode.c b/src/events/SDL_keysym_to_scancode.c index 53b55891b0..d965a375c5 100644 --- a/src/events/SDL_keysym_to_scancode.c +++ b/src/events/SDL_keysym_to_scancode.c @@ -26,13 +26,24 @@ #include "SDL_keyboard_c.h" #include "SDL_scancode_tables_c.h" +#if SDL_VIDEO_DRIVER_WAYLAND #include +typedef xkb_keysym_t SDL_xkb_keysym_t; +#else +#include +#include + +typedef KeySym SDL_xkb_keysym_t; +#endif + + /* *INDENT-OFF* */ /* clang-format off */ static const struct { - xkb_keysym_t keysym; + SDL_xkb_keysym_t keysym; SDL_Scancode scancode; } KeySymToSDLScancode[] = { +#if SDL_VIDEO_DRIVER_WAYLAND { XKB_KEY_KP_End, SDL_SCANCODE_KP_1 }, { XKB_KEY_KP_Down, SDL_SCANCODE_KP_2 }, { XKB_KEY_KP_Next, SDL_SCANCODE_KP_3 }, @@ -50,6 +61,25 @@ static const struct { { XKB_KEY_Super_L, SDL_SCANCODE_LGUI }, { XKB_KEY_Super_R, SDL_SCANCODE_RGUI }, { XKB_KEY_Mode_switch, SDL_SCANCODE_MODE }, +#else + { XK_KP_End, SDL_SCANCODE_KP_1 }, + { XK_KP_Down, SDL_SCANCODE_KP_2 }, + { XK_KP_Next, SDL_SCANCODE_KP_3 }, + { XK_KP_Left, SDL_SCANCODE_KP_4 }, + { XK_KP_Begin, SDL_SCANCODE_KP_5 }, + { XK_KP_Right, SDL_SCANCODE_KP_6 }, + { XK_KP_Home, SDL_SCANCODE_KP_7 }, + { XK_KP_Up, SDL_SCANCODE_KP_8 }, + { XK_KP_Prior, SDL_SCANCODE_KP_9 }, + { XK_KP_Insert, SDL_SCANCODE_KP_0 }, + { XK_KP_Delete, SDL_SCANCODE_KP_PERIOD }, + { XK_Execute, SDL_SCANCODE_EXECUTE }, + { XK_Hyper_R, SDL_SCANCODE_APPLICATION }, + { XK_ISO_Level3_Shift, SDL_SCANCODE_RALT }, + { XK_Super_L, SDL_SCANCODE_LGUI }, + { XK_Super_R, SDL_SCANCODE_RGUI }, + { XK_Mode_switch, SDL_SCANCODE_MODE }, +#endif { 0x1008FF65, SDL_SCANCODE_MENU }, /* XF86MenuKB */ { 0x1008FF81, SDL_SCANCODE_F13 }, /* XF86Tools */ { 0x1008FF45, SDL_SCANCODE_F14 }, /* XF86Launch5 */ @@ -60,7 +90,7 @@ static const struct { }; /* This is a mapping from X keysym to Linux keycode */ -static const xkb_keysym_t LinuxKeycodeKeysyms[] = { +static const SDL_xkb_keysym_t LinuxKeycodeKeysyms[] = { /* 0, 0x000 */ 0x0, /* NoSymbol */ /* 1, 0x001 */ 0xFF1B, /* Escape */ /* 2, 0x002 */ 0x31, /* 1 */ @@ -328,7 +358,7 @@ done #endif static const struct { - xkb_keysym_t keysym; + SDL_xkb_keysym_t keysym; int linux_keycode; } ExtendedLinuxKeycodeKeysyms[] = { { 0x1008FF2C, 0x0a2 }, /* XF86XK_Eject */ From 02ab7f37458c34b67bbb87b7650e73ab51c01a64 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Tue, 15 Nov 2022 12:57:07 -0800 Subject: [PATCH 043/153] Fixed release build using clang on Windows --- src/stdlib/SDL_malloc.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/stdlib/SDL_malloc.c b/src/stdlib/SDL_malloc.c index 093a2a0e9e..ebafb66cfb 100644 --- a/src/stdlib/SDL_malloc.c +++ b/src/stdlib/SDL_malloc.c @@ -3463,7 +3463,9 @@ add_segment(mstate m, char *tbase, size_t tsize, flag_t mmapped) msegmentptr ss = (msegmentptr) (chunk2mem(sp)); mchunkptr tnext = chunk_plus_offset(sp, ssize); mchunkptr p = tnext; +#ifdef DEBUG int nfences = 0; +#endif /* reset top to new space */ init_top(m, (mchunkptr) tbase, tsize - TOP_FOOT_SIZE); @@ -3481,13 +3483,17 @@ add_segment(mstate m, char *tbase, size_t tsize, flag_t mmapped) for (;;) { mchunkptr nextp = chunk_plus_offset(p, SIZE_T_SIZE); p->head = FENCEPOST_HEAD; +#ifdef DEBUG ++nfences; +#endif if ((char *) (&(nextp->head)) < old_end) p = nextp; else break; } +#ifdef DEBUG assert(nfences >= 2); +#endif /* Insert the rest of old top into a bin as an ordinary free chunk */ if (csp != old_top) { From 06492c598158cf825a18aececaf7511d7fd04f48 Mon Sep 17 00:00:00 2001 From: Ozkan Sezer Date: Wed, 16 Nov 2022 00:20:28 +0300 Subject: [PATCH 044/153] CI, MSVC: update to use microsoft/setup-msbuild v1.1.3. Fixes github deprecation warnings --- .github/workflows/msvc.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/msvc.yml b/.github/workflows/msvc.yml index b4644ecc5e..78fb73a7c6 100644 --- a/.github/workflows/msvc.yml +++ b/.github/workflows/msvc.yml @@ -68,7 +68,7 @@ jobs: - name: Add msbuild to PATH if: ${{ matrix.platform.project != '' }} - uses: microsoft/setup-msbuild@v1.0.2 + uses: microsoft/setup-msbuild@v1.1.3 - name: Build msbuild if: ${{ matrix.platform.project != '' }} run: msbuild ${{ matrix.platform.project }} /m /p:BuildInParallel=true /p:Configuration=Release ${{ matrix.platform.projectflags }} From d8b1ef42aee52dad4ac3de69795ca2e8d2fd7704 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Tue, 15 Nov 2022 22:18:51 -0500 Subject: [PATCH 045/153] pulseaudio: Only use PA_STREAM_ADJUST_LATENCY if buffer isn't super small. Fixes #6121. --- src/audio/pulseaudio/SDL_pulseaudio.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/audio/pulseaudio/SDL_pulseaudio.c b/src/audio/pulseaudio/SDL_pulseaudio.c index 288c3d98a2..9934a56267 100644 --- a/src/audio/pulseaudio/SDL_pulseaudio.c +++ b/src/audio/pulseaudio/SDL_pulseaudio.c @@ -630,7 +630,13 @@ PULSEAUDIO_OpenDevice(_THIS, const char *devname) paattr.prebuf = -1; paattr.maxlength = -1; paattr.minreq = -1; - flags |= PA_STREAM_ADJUST_LATENCY; + + /* don't let this change the global device's latency if the number is + extremely small, as it will affect other applications. Without this + flag, it only affects this specific stream. */ + if (this->spec.samples >= 512) { + flags |= PA_STREAM_ADJUST_LATENCY; + } if (ConnectToPulseServer(&h->mainloop, &h->context) < 0) { return SDL_SetError("Could not connect to PulseAudio server"); From 903301c6aaabd87f9b7cb1c03c323387d25b4eee Mon Sep 17 00:00:00 2001 From: Frank Praznik Date: Wed, 16 Nov 2022 02:04:59 -0500 Subject: [PATCH 046/153] wayland: Always use integer scaling for cursors. Cursors don't get fractionally scaled, so always scale system cursor sizes to the next whole integer. --- src/video/wayland/SDL_waylandmouse.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/video/wayland/SDL_waylandmouse.c b/src/video/wayland/SDL_waylandmouse.c index c35457b5b5..20c5efca00 100644 --- a/src/video/wayland/SDL_waylandmouse.c +++ b/src/video/wayland/SDL_waylandmouse.c @@ -199,8 +199,10 @@ wayland_get_system_cursor(SDL_VideoData *vdata, Wayland_CursorData *cdata, float return SDL_FALSE; } focusdata = focus->driverdata; - *scale = focusdata->scale_factor; - size *= focusdata->scale_factor; + + /* Cursors use integer scaling. */ + *scale = SDL_ceilf(focusdata->scale_factor); + size *= *scale; for (i = 0; i < vdata->num_cursor_themes; i += 1) { if (vdata->cursor_themes[i].size == size) { theme = vdata->cursor_themes[i].theme; From 76e3cf384021a986007c653a56f31bb89ca7fb27 Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Tue, 1 Nov 2022 11:04:45 +0100 Subject: [PATCH 047/153] cmake: use custom add_sdl_test_executable macro to add test --- test/CMakeLists.txt | 334 ++++++++++++++------------------------------ 1 file changed, 105 insertions(+), 229 deletions(-) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 578a422be0..d89be52b08 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -2,8 +2,26 @@ cmake_minimum_required(VERSION 3.0) project(SDL2_test) include(CheckCCompilerFlag) +include(CMakeParseArguments) include(CMakePushCheckState) +set(SDL_TEST_EXECUTABLES) +set(SDL_TESTS_NONINTERACTIVE) +set(SDL_TESTS_NEEDS_ESOURCES) + +macro(add_sdl_test_executable TARGET) + cmake_parse_arguments(AST "NONINTERACTIVE;NEEDS_RESOURCES" "" "" ${ARGN}) + add_executable(${TARGET} ${AST_UNPARSED_ARGUMENTS}) + + list(APPEND SDL_TEST_EXECUTABLES ${TARGET}) + if(AST_NONINTERACTIVE) + list(APPEND SDL_TESTS_NONINTERACTIVE ${TARGET}) + endif() + if(AST_NEEDS_RESOURCES) + list(APPEND SDL_TESTS_NEEDS_ESOURCES ${TARGET}) + endif() +endmacro() + if(NOT TARGET SDL2::SDL2-static) find_package(SDL2 2.0.23 REQUIRED COMPONENTS SDL2-static SDL2test) endif() @@ -76,57 +94,59 @@ if (OPENGL_FOUND) add_definitions(-DHAVE_OPENGL) endif() -add_executable(checkkeys checkkeys.c) -add_executable(checkkeysthreads checkkeysthreads.c) -add_executable(loopwave loopwave.c testutils.c) -add_executable(loopwavequeue loopwavequeue.c testutils.c) -add_executable(testsurround testsurround.c) -add_executable(testresample testresample.c) -add_executable(testaudioinfo testaudioinfo.c) +add_sdl_test_executable(checkkeys checkkeys.c) +add_sdl_test_executable(checkkeysthreads checkkeysthreads.c) +add_sdl_test_executable(loopwave NEEDS_RESOURCES loopwave.c testutils.c) +add_sdl_test_executable(loopwavequeue NEEDS_RESOURCES loopwavequeue.c testutils.c) +add_sdl_test_executable(testsurround testsurround.c) +add_sdl_test_executable(testresample NEEDS_RESOURCES testresample.c) +add_sdl_test_executable(testaudioinfo testaudioinfo.c) file(GLOB TESTAUTOMATION_SOURCE_FILES testautomation*.c) -add_executable(testautomation ${TESTAUTOMATION_SOURCE_FILES}) -add_executable(testmultiaudio testmultiaudio.c testutils.c) -add_executable(testaudiohotplug testaudiohotplug.c testutils.c) -add_executable(testaudiocapture testaudiocapture.c) -add_executable(testatomic testatomic.c) -add_executable(testintersections testintersections.c) -add_executable(testrelative testrelative.c) -add_executable(testhittesting testhittesting.c) -add_executable(testdraw2 testdraw2.c) -add_executable(testdrawchessboard testdrawchessboard.c) -add_executable(testdropfile testdropfile.c) -add_executable(testerror testerror.c) +add_sdl_test_executable(testautomation NEEDS_RESOURCES ${TESTAUTOMATION_SOURCE_FILES}) +add_sdl_test_executable(testmultiaudio NEEDS_RESOURCES testmultiaudio.c testutils.c) +add_sdl_test_executable(testaudiohotplug NEEDS_RESOURCES testaudiohotplug.c testutils.c) +add_sdl_test_executable(testaudiocapture testaudiocapture.c) +add_sdl_test_executable(testatomic NONINTERACTIVE testatomic.c) +add_sdl_test_executable(testintersections testintersections.c) +add_sdl_test_executable(testrelative testrelative.c) +add_sdl_test_executable(testhittesting testhittesting.c) +add_sdl_test_executable(testdraw2 testdraw2.c) +add_sdl_test_executable(testdrawchessboard testdrawchessboard.c) +add_sdl_test_executable(testdropfile testdropfile.c) +add_sdl_test_executable(testerror NONINTERACTIVE testerror.c) if(LINUX) - add_executable(testevdev testevdev.c) + add_sdl_test_executable(testevdev NONINTERACTIVE testevdev.c) endif() -add_executable(testfile testfile.c) -add_executable(testgamecontroller testgamecontroller.c testutils.c) -add_executable(testgeometry testgeometry.c testutils.c) -add_executable(testgesture testgesture.c) -add_executable(testgl2 testgl2.c) -add_executable(testgles testgles.c) -add_executable(testgles2 testgles2.c) -add_executable(testhaptic testhaptic.c) -add_executable(testhotplug testhotplug.c) -add_executable(testrumble testrumble.c) -add_executable(testthread testthread.c) -add_executable(testiconv testiconv.c testutils.c) -add_executable(testime testime.c testutils.c) -add_executable(testjoystick testjoystick.c) -add_executable(testkeys testkeys.c) -add_executable(testloadso testloadso.c) -add_executable(testlocale testlocale.c) -add_executable(testlock testlock.c) -add_executable(testmouse testmouse.c) +add_sdl_test_executable(testfile testfile.c) +add_sdl_test_executable(testgamecontroller NEEDS_RESOURCES testgamecontroller.c testutils.c) +add_sdl_test_executable(testgeometry testgeometry.c testutils.c) +add_sdl_test_executable(testgesture testgesture.c) +add_sdl_test_executable(testgl2 testgl2.c) +add_sdl_test_executable(testgles testgles.c) +add_sdl_test_executable(testgles2 testgles2.c) +add_sdl_test_executable(testhaptic testhaptic.c) +add_sdl_test_executable(testhotplug testhotplug.c) +add_sdl_test_executable(testrumble testrumble.c) +add_sdl_test_executable(testthread NONINTERACTIVE testthread.c) +add_sdl_test_executable(testiconv NEEDS_RESOURCES testiconv.c testutils.c) +add_sdl_test_executable(testime NEEDS_RESOURCES testime.c testutils.c) +add_sdl_test_executable(testjoystick testjoystick.c) +add_sdl_test_executable(testkeys testkeys.c) +add_sdl_test_executable(testloadso testloadso.c) +add_sdl_test_executable(testlocale NONINTERACTIVE testlocale.c) +add_sdl_test_executable(testlock testlock.c) +add_sdl_test_executable(testmouse testmouse.c) if(APPLE) - add_executable(testnative testnative.c - testnativecocoa.m - testnativex11.c - testutils.c) + add_sdl_test_executable(testnative NEEDS_RESOURCES + testnative.c + testnativecocoa.m + testnativex11.c + testutils.c + ) cmake_push_check_state(RESET) check_c_compiler_flag(-Wno-error=deprecated-declarations HAVE_WNO_ERROR_DEPRECATED_DECLARATIONS) @@ -135,41 +155,41 @@ if(APPLE) set_property(SOURCE "testnativecocoa.m" APPEND_STRING PROPERTY COMPILE_FLAGS " -Wno-error=deprecated-declarations") endif() elseif(WINDOWS) - add_executable(testnative testnative.c testnativew32.c testutils.c) + add_sdl_test_executable(testnative NEEDS_RESOURCES testnative.c testnativew32.c testutils.c) elseif(HAVE_X11) - add_executable(testnative testnative.c testnativex11.c testutils.c) + add_sdl_test_executable(testnative NEEDS_RESOURCES testnative.c testnativex11.c testutils.c) target_link_libraries(testnative X11) endif() -add_executable(testoverlay2 testoverlay2.c testyuv_cvt.c testutils.c) -add_executable(testplatform testplatform.c) -add_executable(testpower testpower.c) -add_executable(testfilesystem testfilesystem.c) -add_executable(testrendertarget testrendertarget.c testutils.c) -add_executable(testscale testscale.c testutils.c) -add_executable(testsem testsem.c) -add_executable(testsensor testsensor.c) -add_executable(testshader testshader.c) -add_executable(testshape testshape.c) -add_executable(testsprite2 testsprite2.c testutils.c) -add_executable(testspriteminimal testspriteminimal.c testutils.c) -add_executable(teststreaming teststreaming.c testutils.c) -add_executable(testtimer testtimer.c) -add_executable(testurl testurl.c) -add_executable(testver testver.c) -add_executable(testviewport testviewport.c testutils.c) -add_executable(testwm2 testwm2.c) -add_executable(testyuv testyuv.c testyuv_cvt.c) -add_executable(torturethread torturethread.c) -add_executable(testrendercopyex testrendercopyex.c testutils.c) -add_executable(testmessage testmessage.c) -add_executable(testdisplayinfo testdisplayinfo.c) -add_executable(testqsort testqsort.c) -add_executable(testbounds testbounds.c) -add_executable(testcustomcursor testcustomcursor.c) -add_executable(controllermap controllermap.c testutils.c) -add_executable(testvulkan testvulkan.c) -add_executable(testoffscreen testoffscreen.c) +add_sdl_test_executable(testoverlay2 NEEDS_RESOURCES testoverlay2.c testyuv_cvt.c testutils.c) +add_sdl_test_executable(testplatform NONINTERACTIVE testplatform.c) +add_sdl_test_executable(testpower NONINTERACTIVE testpower.c) +add_sdl_test_executable(testfilesystem NONINTERACTIVE testfilesystem.c) +add_sdl_test_executable(testrendertarget NEEDS_RESOURCES testrendertarget.c testutils.c) +add_sdl_test_executable(testscale NEEDS_RESOURCES testscale.c testutils.c) +add_sdl_test_executable(testsem testsem.c) +add_sdl_test_executable(testsensor testsensor.c) +add_sdl_test_executable(testshader NEEDS_RESOURCES testshader.c) +add_sdl_test_executable(testshape NEEDS_RESOURCES testshape.c) +add_sdl_test_executable(testsprite2 NEEDS_RESOURCES testsprite2.c testutils.c) +add_sdl_test_executable(testspriteminimal NEEDS_RESOURCES testspriteminimal.c testutils.c) +add_sdl_test_executable(teststreaming NEEDS_RESOURCES teststreaming.c testutils.c) +add_sdl_test_executable(testtimer NONINTERACTIVE testtimer.c) +add_sdl_test_executable(testurl testurl.c) +add_sdl_test_executable(testver NONINTERACTIVE testver.c) +add_sdl_test_executable(testviewport NEEDS_RESOURCES testviewport.c testutils.c) +add_sdl_test_executable(testwm2 testwm2.c) +add_sdl_test_executable(testyuv NEEDS_RESOURCES testyuv.c testyuv_cvt.c) +add_sdl_test_executable(torturethread torturethread.c) +add_sdl_test_executable(testrendercopyex NEEDS_RESOURCES testrendercopyex.c testutils.c) +add_sdl_test_executable(testmessage testmessage.c) +add_sdl_test_executable(testdisplayinfo testdisplayinfo.c) +add_sdl_test_executable(testqsort NONINTERACTIVE testqsort.c) +add_sdl_test_executable(testbounds testbounds.c) +add_sdl_test_executable(testcustomcursor testcustomcursor.c) +add_sdl_test_executable(controllermap NEEDS_RESOURCES controllermap.c testutils.c) +add_sdl_test_executable(testvulkan testvulkan.c) +add_sdl_test_executable(testoffscreen testoffscreen.c) cmake_push_check_state(RESET) @@ -190,107 +210,15 @@ endif() cmake_pop_check_state() -SET(ALL_TESTS - checkkeys - checkkeysthreads - controllermap - loopwave - loopwavequeue - testatomic - testaudiocapture - testaudiohotplug - testaudioinfo - testautomation - testbounds - testcustomcursor - testdisplayinfo - testdraw2 - testdrawchessboard - testdropfile - testerror - testfile - testfilesystem - testgamecontroller - testgeometry - testgesture - testgl2 - testgles - testgles2 - testhaptic - testhittesting - testhotplug - testiconv - testime - testintersections - testjoystick - testkeys - testloadso - testlocale - testlock - testmessage - testmouse - testmultiaudio - testoffscreen - testoverlay2 - testplatform - testpower - testqsort - testrelative - testrendercopyex - testrendertarget - testresample - testrumble - testscale - testsem - testsensor - testshader - testshape - testsprite2 - testspriteminimal - teststreaming - testsurround - testthread - testtimer - testurl - testver - testviewport - testvulkan - testwm2 - testyuv - torturethread -) - -set(NONINTERACTIVE - testatomic - testerror - testfilesystem - testlocale - testplatform - testpower - testqsort - testthread - testtimer - testver -) - -if(WINDOWS OR APPLE OR SDL_X11) - list(APPEND ALL_TESTS testnative) -endif() - -if(LINUX) - list(APPEND ALL_TESTS testevdev) - list(APPEND NONINTERACTIVE testevdev) -endif() - if(SDL_DUMMYAUDIO) - set(NEEDS_AUDIO + list(APPEND SDL_TESTS_NONINTERACTIVE testaudioinfo testsurround ) endif() if(SDL_DUMMYVIDEO) - set(NEEDS_DISPLAY + list(APPEND SDL_TESTS_NONINTERACTIVE testkeys testbounds testdisplayinfo @@ -304,63 +232,11 @@ endif() file(GLOB RESOURCE_FILES *.bmp *.wav *.hex moose.dat utf8.txt) file(COPY ${RESOURCE_FILES} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) -if(PSP OR PS2) - set(NEEDS_RESOURCES - testscale - testrendercopyex - controllermap - testyuv - testgamecontroller - testshape - testshader - testspriteminimal - testautomation - testrendertarget - testsprite2 - loopwave - loopwavequeue - testresample - testaudiohotplug - testmultiaudio - testiconv - testoverlay2 - teststreaming - testviewport - ) -else() - set(NEEDS_RESOURCES - testscale - testrendercopyex - controllermap - testyuv - testgamecontroller - testshape - testshader - testspriteminimal - testautomation - testcustomcursor - testrendertarget - testsprite2 - loopwave - loopwavequeue - testresample - testaudiohotplug - testmultiaudio - testime - testiconv - testoverlay2 - teststreaming - testviewport - ) - if(WINDOWS OR APPLE OR HAVE_X11) - list(APPEND NEEDS_RESOURCES testnative) - endif() -endif() if(PSP) # Build EBOOT files if building for PSP set(BUILD_EBOOT - ${NEEDS_RESOURCES} + ${SDL_TESTS_NEEDS_ESOURCES} testatomic testaudiocapture testaudioinfo @@ -438,7 +314,7 @@ if(N3DS) set(ROMFS_DIR "${CMAKE_CURRENT_BINARY_DIR}/romfs") file(COPY ${RESOURCE_FILES} DESTINATION "${ROMFS_DIR}") - foreach(APP IN LISTS ALL_TESTS) + foreach(APP IN LISTS SDL_TEST_EXECUTABLES) get_target_property(TARGET_BINARY_DIR ${APP} BINARY_DIR) set(SMDH_FILE "${TARGET_BINARY_DIR}/${APP}.smdh") ctr_generate_smdh("${SMDH_FILE}" @@ -456,8 +332,8 @@ if(N3DS) endif() if(RISCOS) - set(ALL_TESTS_AIF "") - foreach(APP IN LISTS ALL_TESTS) + set(SDL_TEST_EXECUTABLES_AIF) + foreach(APP IN LISTS SDL_TEST_EXECUTABLES) target_link_options(${APP} PRIVATE -static) add_custom_command( OUTPUT ${APP},ff8 @@ -465,11 +341,11 @@ if(RISCOS) DEPENDS ${APP} ) add_custom_target(${APP}-aif ALL DEPENDS ${APP},ff8) - list(APPEND ALL_TESTS_AIF ${CMAKE_CURRENT_BINARY_DIR}/${APP},ff8) + list(APPEND SDL_TEST_EXECUTABLES_AIF ${CMAKE_CURRENT_BINARY_DIR}/${APP},ff8) endforeach() endif() -foreach(APP IN LISTS NEEDS_RESOURCES) +foreach(APP IN LISTS SDL_TESTS_NEEDS_RESOURCES) foreach(RESOURCE_FILE ${RESOURCE_FILES}) if(PSP OR PS2) add_custom_command(TARGET ${APP} POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${RESOURCE_FILE} $/sdl-${APP}) @@ -511,7 +387,7 @@ set(TESTS_ENVIRONMENT SDL_VIDEODRIVER=dummy ) -foreach(TESTCASE ${NONINTERACTIVE} ${NEEDS_AUDIO} ${NEEDS_DISPLAY}) +foreach(TESTCASE ${SDL_TESTS_NONINTERACTIVE}) add_test( NAME ${TESTCASE} COMMAND ${TESTCASE} @@ -535,12 +411,12 @@ endforeach() if(SDL_INSTALL_TESTS) if(RISCOS) install( - FILES ${ALL_TESTS_AIF} + FILES ${SDL_TEST_EXECUTABLES_AIF} DESTINATION ${CMAKE_INSTALL_LIBEXECDIR}/installed-tests/SDL2 ) else() install( - TARGETS ${ALL_TESTS} + TARGETS ${SDL_TEST_EXECUTABLES} DESTINATION ${CMAKE_INSTALL_LIBEXECDIR}/installed-tests/SDL2 ) endif() From cfa76973ff446b3f9a9909be90a140edf3566e42 Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Tue, 1 Nov 2022 11:33:39 +0100 Subject: [PATCH 048/153] cmake: FindOpenGL.cmake shipped by emscripten does not have OpenGL::GL --- test/CMakeLists.txt | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index d89be52b08..f358b039b3 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -226,8 +226,14 @@ if(SDL_DUMMYVIDEO) endif() if(OPENGL_FOUND) - target_link_libraries(testshader OpenGL::GL) - target_link_libraries(testgl2 OpenGL::GL) + if(TARGET OpenGL::GL) + target_link_libraries(testshader OpenGL::GL) + target_link_libraries(testgl2 OpenGL::GL) + else() + # emscripten's FindOpenGL.cmake does not create OpenGL::GL + target_link_libraries(testshader ${OPENGL_gl_LIBRARY}) + target_link_libraries(testgl2 ${OPENGL_gl_LIBRARY}) + endif() endif() file(GLOB RESOURCE_FILES *.bmp *.wav *.hex moose.dat utf8.txt) From 500bac0b1350f6bec536ddcaf1da0d8149b33c6a Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Tue, 1 Nov 2022 13:06:39 +0100 Subject: [PATCH 049/153] cmake: include FIndPkgConfig.cmake through find_package --- CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3103b01f48..9f3567c416 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -67,9 +67,10 @@ include(CheckCXXCompilerFlag) include(CheckStructHasMember) include(CMakeDependentOption) include(CMakePushCheckState) -include(FindPkgConfig) include(GNUInstallDirs) +find_package(PkgConfig) + list(APPEND CMAKE_MODULE_PATH "${SDL2_SOURCE_DIR}/cmake") include(${SDL2_SOURCE_DIR}/cmake/macros.cmake) include(${SDL2_SOURCE_DIR}/cmake/sdlchecks.cmake) From 6e46090a303ffc2d4c9b830304df13a05eb1e58b Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Tue, 1 Nov 2022 13:08:38 +0100 Subject: [PATCH 050/153] cmake: check ALL headers inside the look (including sys/types.h) --- CMakeLists.txt | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9f3567c416..51595bc513 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1004,12 +1004,30 @@ if(SDL_LIBC) set(STDC_HEADERS 1) else() set(HAVE_LIBC TRUE) - check_include_file(sys/types.h HAVE_SYS_TYPES_H) - foreach(_HEADER - stdio.h stdlib.h stddef.h stdarg.h malloc.h memory.h string.h limits.h float.h - strings.h wchar.h inttypes.h stdint.h ctype.h math.h iconv.h signal.h libunwind.h) + set(headers_to_check + ctype.h + float.h + iconv.h + inttypes.h + libunwind + limits.h + malloc.h + math.h + memory.h + signal.h + stdarg.h + stddef.h + stdint.h + stdio.h + stdlib.h + string.h + strings.h + sys/types.h + wchar.h + ) + foreach(_HEADER ${headers_to_check}) string(TOUPPER "HAVE_${_HEADER}" _UPPER) - string(REPLACE "." "_" _HAVE_H ${_UPPER}) + string(REGEX REPLACE "[./]" "_" _HAVE_H ${_UPPER}) check_include_file("${_HEADER}" ${_HAVE_H}) endforeach() check_include_file(linux/input.h HAVE_LINUX_INPUT_H) From 55384db8a628b4c3958004977257c9ee9112a17d Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Tue, 1 Nov 2022 13:09:29 +0100 Subject: [PATCH 051/153] cmake: emscripten has libunwind.h, libunwind.a has missing symbols --- CMakeLists.txt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 51595bc513..4eec086abb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1009,7 +1009,6 @@ if(SDL_LIBC) float.h iconv.h inttypes.h - libunwind limits.h malloc.h math.h @@ -1025,6 +1024,9 @@ if(SDL_LIBC) sys/types.h wchar.h ) + if(NOT EMSCRIPTEN) + list(APPEND headers_to_check libunwind.h) + endif() foreach(_HEADER ${headers_to_check}) string(TOUPPER "HAVE_${_HEADER}" _UPPER) string(REGEX REPLACE "[./]" "_" _HAVE_H ${_UPPER}) @@ -1399,6 +1401,10 @@ elseif(EMSCRIPTEN) CheckPTHREAD() + if(HAVE_LIBUNWIND_H) + list(APPEND EXTRA_TEST_LIBS unwind) + endif() + elseif(UNIX AND NOT APPLE AND NOT RISCOS AND NOT HAIKU) if(SDL_AUDIO) if(SYSV5 OR SOLARIS OR HPUX) From a71e558d85ddd2fe0d20ca18a1c1c54955485ca7 Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Tue, 1 Nov 2022 13:09:52 +0100 Subject: [PATCH 052/153] cmake: testshader needs -sLEGACY_GL_EMULATION on Emscripten --- test/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index f358b039b3..c608f47b1f 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -235,6 +235,9 @@ if(OPENGL_FOUND) target_link_libraries(testgl2 ${OPENGL_gl_LIBRARY}) endif() endif() +if(EMSCRIPTEN) + target_link_libraries(testshader -sLEGACY_GL_EMULATION) +endif() file(GLOB RESOURCE_FILES *.bmp *.wav *.hex moose.dat utf8.txt) file(COPY ${RESOURCE_FILES} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) From d8884b845ecad6985b0551d3bd2d4295a6d0c42a Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Tue, 1 Nov 2022 13:10:46 +0100 Subject: [PATCH 053/153] emscripten: fix warnings in tests --- test/loopwave.c | 3 ++- test/testgles2.c | 2 ++ test/testoffscreen.c | 4 ++++ test/testviewport.c | 4 ++-- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/test/loopwave.c b/test/loopwave.c index 354ac2cb7b..1b5fa95f0e 100644 --- a/test/loopwave.c +++ b/test/loopwave.c @@ -70,12 +70,13 @@ open_audio() SDL_PauseAudioDevice(device, SDL_FALSE); } +#ifndef __EMSCRIPTEN__ static void reopen_audio() { close_audio(); open_audio(); } - +#endif void SDLCALL fillerup(void *unused, Uint8 * stream, int len) diff --git a/test/testgles2.c b/test/testgles2.c index b5c0ec8838..721c24b7f2 100644 --- a/test/testgles2.c +++ b/test/testgles2.c @@ -472,6 +472,7 @@ render_window(int index) ++frames; } +#ifndef __EMSCRIPTEN__ static int SDLCALL render_thread_fn(void* render_ctx) { @@ -512,6 +513,7 @@ loop_threaded() SDLTest_CommonEvent(state, &event, &done); } } +#endif static void loop() diff --git a/test/testoffscreen.c b/test/testoffscreen.c index e5fd72107c..e2a8f4b68b 100644 --- a/test/testoffscreen.c +++ b/test/testoffscreen.c @@ -100,7 +100,9 @@ loop() int main(int argc, char *argv[]) { +#ifndef __EMSCRIPTEN__ Uint32 then, now, frames; +#endif /* Enable standard application logging */ SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); @@ -135,10 +137,12 @@ main(int argc, char *argv[]) srand((unsigned int)time(NULL)); +#ifndef __EMSCRIPTEN__ /* Main render loop */ frames = 0; then = SDL_GetTicks(); done = 0; +#endif SDL_Log("Rendering %u frames offscreen\n", max_frames); diff --git a/test/testviewport.c b/test/testviewport.c index 162b31069a..ad5faf77a7 100644 --- a/test/testviewport.c +++ b/test/testviewport.c @@ -99,14 +99,14 @@ DrawOnViewport(SDL_Renderer * renderer) void loop() { + SDL_Event event; + int i; #ifdef __EMSCRIPTEN__ /* Avoid using delays */ if(SDL_GetTicks() - wait_start < 1000) return; wait_start = SDL_GetTicks(); #endif - SDL_Event event; - int i; /* Check for events */ while (SDL_PollEvent(&event)) { SDLTest_CommonEvent(state, &event, &done); From a22fcf77fd9729504ba7ab26198a3707b7d72780 Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Tue, 1 Nov 2022 13:40:19 +0100 Subject: [PATCH 054/153] cmake: older emscripten releases have a broken FindOpenGL.cmake This is fixed since 3.1.10: https://github.com/emscripten-core/emscripten/commit/485a7b4d6f84d4bc3b594ff81d39b6b143c8d598#diff-034f4d123f23ec5493d0fbf28cba1c36e404a991f286c8d031a22799e4e8b0e5 --- test/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index c608f47b1f..a396ad54c0 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -230,6 +230,9 @@ if(OPENGL_FOUND) target_link_libraries(testshader OpenGL::GL) target_link_libraries(testgl2 OpenGL::GL) else() + if(EMSCRIPTEN AND OPENGL_gl_LIBRARY STREQUAL "nul") + set(OPENGL_gl_LIBRARY GL) + endif() # emscripten's FindOpenGL.cmake does not create OpenGL::GL target_link_libraries(testshader ${OPENGL_gl_LIBRARY}) target_link_libraries(testgl2 ${OPENGL_gl_LIBRARY}) From 819b0143e3b576c0dda39a31d1d560446dc88e76 Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Tue, 1 Nov 2022 10:42:57 +0100 Subject: [PATCH 055/153] cmake: enable SDL_TEST by default for emscripten --- CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4eec086abb..484220f1fd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -383,7 +383,6 @@ if(EMSCRIPTEN) set(SDL_ATOMIC_ENABLED_BY_DEFAULT OFF) set(SDL_LOADSO_ENABLED_BY_DEFAULT OFF) set(SDL_CPUINFO_ENABLED_BY_DEFAULT OFF) - set(SDL_TEST_ENABLED_BY_DEFAULT OFF) endif() if(VITA OR PSP OR PS2 OR N3DS) From 2e47016b01a77c33134a330089fcf2d41838b162 Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Tue, 1 Nov 2022 15:28:57 +0100 Subject: [PATCH 056/153] ci: use Ninja generator in hop of accelerating the build --- .github/workflows/emscripten.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/emscripten.yml b/.github/workflows/emscripten.yml index 5f41cb53d5..bb8a134d4e 100644 --- a/.github/workflows/emscripten.yml +++ b/.github/workflows/emscripten.yml @@ -10,6 +10,10 @@ jobs: - uses: mymindstorm/setup-emsdk@v10 with: version: 2.0.32 + - name: Install ninja + run: | + sudo apt-get -y update + sudo apt-get install -y ninja-build - name: Configure CMake run: | emcmake cmake -S . -B build \ @@ -17,7 +21,8 @@ jobs: -DSDL_TESTS=ON \ -DSDL_INSTALL_TESTS=ON \ -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_INSTALL_PREFIX=prefix + -DCMAKE_INSTALL_PREFIX=prefix \ + -GNinja - name: Build run: cmake --build build/ --verbose - name: Run build-time tests From 55534e277ef81a917f6b78b680faac7b498e89c8 Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Tue, 1 Nov 2022 15:39:13 +0100 Subject: [PATCH 057/153] cmake: add time out to tests to avoid ci timeouts --- test/CMakeLists.txt | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index a396ad54c0..676a8e7919 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -405,9 +405,10 @@ foreach(TESTCASE ${SDL_TESTS_NONINTERACTIVE}) COMMAND ${TESTCASE} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} ) - set_tests_properties( - ${TESTCASE} - PROPERTIES ENVIRONMENT "${TESTS_ENVIRONMENT}" + set_tests_properties(${TESTCASE} + PROPERTIES + ENVIRONMENT "${TESTS_ENVIRONMENT}" + TIMEOUT 10 ) if(SDL_INSTALL_TESTS) set(exe ${TESTCASE}) @@ -420,6 +421,9 @@ foreach(TESTCASE ${SDL_TESTS_NONINTERACTIVE}) endif() endforeach() +set_tests_properties(testthread PROPERTIES TIMEOUT 40) +set_tests_properties(testtimer PROPERTIES TIMEOUT 60) + if(SDL_INSTALL_TESTS) if(RISCOS) install( From 81fd45f723be5ba7765901ee0d794c6b21ac2dd8 Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Wed, 16 Nov 2022 15:13:04 +0100 Subject: [PATCH 058/153] ci: Disable emscripten build time tests --- .github/workflows/emscripten.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/emscripten.yml b/.github/workflows/emscripten.yml index bb8a134d4e..56f77b6ce0 100644 --- a/.github/workflows/emscripten.yml +++ b/.github/workflows/emscripten.yml @@ -29,7 +29,8 @@ jobs: run: | set -eu export SDL_TESTS_QUICK=1 - ctest -VV --test-dir build/ + # FIXME: enable Emscripten build time tests + # ctest -VV --test-dir build/ - name: Install run: | echo "SDL2_DIR=$(pwd)/prefix" >> $GITHUB_ENV From 6801d676c0ce09e168195ec024e0d7033138b73f Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Wed, 16 Nov 2022 09:52:33 -0500 Subject: [PATCH 059/153] Revert "pulseaudio: Only use PA_STREAM_ADJUST_LATENCY if buffer isn't super small." This reverts commit d8b1ef42aee52dad4ac3de69795ca2e8d2fd7704. This turned out to be unnecessary (it was a problem on the user's system, not an SDL bug). Reference Issue #6121. --- src/audio/pulseaudio/SDL_pulseaudio.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/audio/pulseaudio/SDL_pulseaudio.c b/src/audio/pulseaudio/SDL_pulseaudio.c index 9934a56267..288c3d98a2 100644 --- a/src/audio/pulseaudio/SDL_pulseaudio.c +++ b/src/audio/pulseaudio/SDL_pulseaudio.c @@ -630,13 +630,7 @@ PULSEAUDIO_OpenDevice(_THIS, const char *devname) paattr.prebuf = -1; paattr.maxlength = -1; paattr.minreq = -1; - - /* don't let this change the global device's latency if the number is - extremely small, as it will affect other applications. Without this - flag, it only affects this specific stream. */ - if (this->spec.samples >= 512) { - flags |= PA_STREAM_ADJUST_LATENCY; - } + flags |= PA_STREAM_ADJUST_LATENCY; if (ConnectToPulseServer(&h->mainloop, &h->context) < 0) { return SDL_SetError("Could not connect to PulseAudio server"); From 9d67686a5b9ceec998e65f63ab60f29687cbc340 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Wed, 16 Nov 2022 10:08:40 -0500 Subject: [PATCH 060/153] haptic: Deal with deprecated macOS symbol. --- src/haptic/darwin/SDL_syshaptic.c | 2 +- src/haptic/darwin/SDL_syshaptic_c.h | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/haptic/darwin/SDL_syshaptic.c b/src/haptic/darwin/SDL_syshaptic.c index 1141bec766..50905e19c4 100644 --- a/src/haptic/darwin/SDL_syshaptic.c +++ b/src/haptic/darwin/SDL_syshaptic.c @@ -167,7 +167,7 @@ SDL_SYS_HapticInit(void) } /* Now search I/O Registry for matching devices. */ - result = IOServiceGetMatchingServices(kIOMasterPortDefault, match, &iter); + result = IOServiceGetMatchingServices(kIOMainPortDefault, match, &iter); if (result != kIOReturnSuccess) { return SDL_SetError("Haptic: Couldn't create a HID object iterator."); } diff --git a/src/haptic/darwin/SDL_syshaptic_c.h b/src/haptic/darwin/SDL_syshaptic_c.h index f7f890a7c2..5f68a6d630 100644 --- a/src/haptic/darwin/SDL_syshaptic_c.h +++ b/src/haptic/darwin/SDL_syshaptic_c.h @@ -19,6 +19,14 @@ 3. This notice may not be removed or altered from any source distribution. */ +/* Things named "Master" were renamed to "Main" in macOS 12.0's SDK. */ +#if MACOSX_COREAUDIO +#include +#ifndef MAC_OS_VERSION_12_0 +#define kIOMainPortDefault kIOMasterPortDefault +#endif +#endif + extern int MacHaptic_MaybeAddDevice( io_object_t device ); extern int MacHaptic_MaybeRemoveDevice( io_object_t device ); From 1fd66cc890a4cc16d23e34982f6600d403e7a74f Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Wed, 16 Nov 2022 10:15:21 -0500 Subject: [PATCH 061/153] Revert "cocoa: Backed out CVDisplayLink code for macOS vsync." This reverts commit 04b50f6c6bef67b744b192c78775771b51ff2141. It turns out OpenGL vsync has broken again in macOS 12, so we're reintroducing our CVDisplayLink code to deal with it, again. Reference Issue #4918. --- src/video/cocoa/SDL_cocoaopengl.h | 7 ++- src/video/cocoa/SDL_cocoaopengl.m | 96 +++++++++++++++++++++++-------- 2 files changed, 79 insertions(+), 24 deletions(-) diff --git a/src/video/cocoa/SDL_cocoaopengl.h b/src/video/cocoa/SDL_cocoaopengl.h index 0f9b1c7f0a..a483ac08a0 100644 --- a/src/video/cocoa/SDL_cocoaopengl.h +++ b/src/video/cocoa/SDL_cocoaopengl.h @@ -42,6 +42,11 @@ struct SDL_GLDriverData @interface SDLOpenGLContext : NSOpenGLContext { SDL_atomic_t dirty; SDL_Window *window; + CVDisplayLinkRef displayLink; + @public SDL_mutex *swapIntervalMutex; + @public SDL_cond *swapIntervalCond; + @public SDL_atomic_t swapIntervalSetting; + @public SDL_atomic_t swapIntervalsPassed; } - (id)initWithFormat:(NSOpenGLPixelFormat *)format @@ -51,7 +56,7 @@ struct SDL_GLDriverData - (void)setWindow:(SDL_Window *)window; - (SDL_Window*)window; - (void)explicitUpdate; - +- (void)dealloc; @end /* OpenGL functions */ diff --git a/src/video/cocoa/SDL_cocoaopengl.m b/src/video/cocoa/SDL_cocoaopengl.m index 8aab0c4cb6..af17ae228f 100644 --- a/src/video/cocoa/SDL_cocoaopengl.m +++ b/src/video/cocoa/SDL_cocoaopengl.m @@ -52,6 +52,23 @@ SDL_OpenGLAsyncDispatchChanged(void *userdata, const char *name, const char *old SDL_opengl_async_dispatch = SDL_GetStringBoolean(hint, SDL_FALSE); } +static CVReturn +DisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTimeStamp* now, const CVTimeStamp* outputTime, CVOptionFlags flagsIn, CVOptionFlags* flagsOut, void* displayLinkContext) +{ + SDLOpenGLContext *nscontext = (__bridge SDLOpenGLContext *) displayLinkContext; + + /*printf("DISPLAY LINK! %u\n", (unsigned int) SDL_GetTicks()); */ + const int setting = SDL_AtomicGet(&nscontext->swapIntervalSetting); + if (setting != 0) { /* nothing to do if vsync is disabled, don't even lock */ + SDL_LockMutex(nscontext->swapIntervalMutex); + SDL_AtomicAdd(&nscontext->swapIntervalsPassed, 1); + SDL_CondSignal(nscontext->swapIntervalCond); + SDL_UnlockMutex(nscontext->swapIntervalMutex); + } + + return kCVReturnSuccess; +} + @implementation SDLOpenGLContext : NSOpenGLContext - (id)initWithFormat:(NSOpenGLPixelFormat *)format @@ -61,6 +78,19 @@ SDL_OpenGLAsyncDispatchChanged(void *userdata, const char *name, const char *old if (self) { SDL_AtomicSet(&self->dirty, 0); self->window = NULL; + SDL_AtomicSet(&self->swapIntervalSetting, 0); + SDL_AtomicSet(&self->swapIntervalsPassed, 0); + self->swapIntervalCond = SDL_CreateCond(); + self->swapIntervalMutex = SDL_CreateMutex(); + if (!self->swapIntervalCond || !self->swapIntervalMutex) { + return nil; + } + + /* !!! FIXME: check return values. */ + CVDisplayLinkCreateWithActiveCGDisplays(&self->displayLink); + CVDisplayLinkSetOutputCallback(self->displayLink, &DisplayLinkCallback, (__bridge void * _Nullable) self); + CVDisplayLinkSetCurrentCGDisplayFromOpenGLContext(self->displayLink, [self CGLContextObj], [format CGLPixelFormatObj]); + CVDisplayLinkStart(displayLink); } SDL_AddHintCallback(SDL_HINT_MAC_OPENGL_ASYNC_DISPATCH, SDL_OpenGLAsyncDispatchChanged, NULL); @@ -158,6 +188,15 @@ SDL_OpenGLAsyncDispatchChanged(void *userdata, const char *name, const char *old - (void)dealloc { SDL_DelHintCallback(SDL_HINT_MAC_OPENGL_ASYNC_DISPATCH, SDL_OpenGLAsyncDispatchChanged, NULL); + if (self->displayLink) { + CVDisplayLinkRelease(self->displayLink); + } + if (self->swapIntervalCond) { + SDL_DestroyCond(self->swapIntervalCond); + } + if (self->swapIntervalMutex) { + SDL_DestroyMutex(self->swapIntervalMutex); + } } @end @@ -211,6 +250,7 @@ Cocoa_GL_CreateContext(_THIS, SDL_Window * window) int glversion_major; int glversion_minor; NSOpenGLPixelFormatAttribute profile; + int interval; if (_this->gl_config.profile_mask == SDL_GL_CONTEXT_PROFILE_ES) { #if SDL_VIDEO_OPENGL_EGL @@ -318,6 +358,10 @@ Cocoa_GL_CreateContext(_THIS, SDL_Window * window) sdlcontext = (SDL_GLContext)CFBridgingRetain(context); + /* vsync is handled separately by synchronizing with a display link. */ + interval = 0; + [context setValues:&interval forParameter:NSOpenGLCPSwapInterval]; + if ( Cocoa_GL_MakeCurrent(_this, window, (__bridge SDL_GLContext)context) < 0 ) { Cocoa_GL_DeleteContext(_this, (__bridge SDL_GLContext)context); SDL_SetError("Failed making OpenGL context current"); @@ -389,21 +433,17 @@ int Cocoa_GL_SetSwapInterval(_THIS, int interval) { @autoreleasepool { - NSOpenGLContext *nscontext; - GLint value; + SDLOpenGLContext *nscontext = (__bridge SDLOpenGLContext *) SDL_GL_GetCurrentContext(); int status; - if (interval < 0) { /* no extension for this on Mac OS X at the moment. */ - return SDL_SetError("Late swap tearing currently unsupported"); - } - - nscontext = (__bridge NSOpenGLContext*)SDL_GL_GetCurrentContext(); - if (nscontext != nil) { - value = interval; - [nscontext setValues:&value forParameter:NSOpenGLCPSwapInterval]; - status = 0; - } else { + if (nscontext == nil) { status = SDL_SetError("No current OpenGL context"); + } else { + SDL_LockMutex(nscontext->swapIntervalMutex); + SDL_AtomicSet(&nscontext->swapIntervalsPassed, 0); + SDL_AtomicSet(&nscontext->swapIntervalSetting, interval); + SDL_UnlockMutex(nscontext->swapIntervalMutex); + status = 0; } return status; @@ -413,17 +453,8 @@ int Cocoa_GL_GetSwapInterval(_THIS) { @autoreleasepool { - NSOpenGLContext *nscontext; - GLint value; - int status = 0; - - nscontext = (__bridge NSOpenGLContext*)SDL_GL_GetCurrentContext(); - if (nscontext != nil) { - [nscontext getValues:&value forParameter:NSOpenGLCPSwapInterval]; - status = (int)value; - } - - return status; + SDLOpenGLContext* nscontext = (__bridge SDLOpenGLContext*)SDL_GL_GetCurrentContext(); + return nscontext ? SDL_AtomicGet(&nscontext->swapIntervalSetting) : 0; }} int @@ -432,6 +463,25 @@ Cocoa_GL_SwapWindow(_THIS, SDL_Window * window) { SDLOpenGLContext* nscontext = (__bridge SDLOpenGLContext*)SDL_GL_GetCurrentContext(); SDL_VideoData *videodata = (__bridge SDL_VideoData *) _this->driverdata; + const int setting = SDL_AtomicGet(&nscontext->swapIntervalSetting); + + if (setting == 0) { + /* nothing to do if vsync is disabled, don't even lock */ + } else if (setting < 0) { /* late swap tearing */ + SDL_LockMutex(nscontext->swapIntervalMutex); + while (SDL_AtomicGet(&nscontext->swapIntervalsPassed) == 0) { + SDL_CondWait(nscontext->swapIntervalCond, nscontext->swapIntervalMutex); + } + SDL_AtomicSet(&nscontext->swapIntervalsPassed, 0); + SDL_UnlockMutex(nscontext->swapIntervalMutex); + } else { + SDL_LockMutex(nscontext->swapIntervalMutex); + do { /* always wait here so we know we just hit a swap interval. */ + SDL_CondWait(nscontext->swapIntervalCond, nscontext->swapIntervalMutex); + } while ((SDL_AtomicGet(&nscontext->swapIntervalsPassed) % setting) != 0); + SDL_AtomicSet(&nscontext->swapIntervalsPassed, 0); + SDL_UnlockMutex(nscontext->swapIntervalMutex); + } /* on 10.14 ("Mojave") and later, this deadlocks if two contexts in two threads try to swap at the same time, so put a mutex around it. */ From 7c760f7f79f65cc628fc43db9d507f051475a43f Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Wed, 16 Nov 2022 11:32:08 -0500 Subject: [PATCH 062/153] cocoa: Update CVDisplayLink timing when screen changes. This handles both the window moving to a new display and changing the current display's refresh rate in System Preferences Reference Issue #4918. --- src/video/cocoa/SDL_cocoaopengl.h | 1 + src/video/cocoa/SDL_cocoaopengl.m | 9 +++++++++ src/video/cocoa/SDL_cocoawindow.h | 1 + src/video/cocoa/SDL_cocoawindow.m | 12 ++++++++++++ 4 files changed, 23 insertions(+) diff --git a/src/video/cocoa/SDL_cocoaopengl.h b/src/video/cocoa/SDL_cocoaopengl.h index a483ac08a0..7b900dee63 100644 --- a/src/video/cocoa/SDL_cocoaopengl.h +++ b/src/video/cocoa/SDL_cocoaopengl.h @@ -53,6 +53,7 @@ struct SDL_GLDriverData shareContext:(NSOpenGLContext *)share; - (void)scheduleUpdate; - (void)updateIfNeeded; +- (void)movedToNewScreen; - (void)setWindow:(SDL_Window *)window; - (SDL_Window*)window; - (void)explicitUpdate; diff --git a/src/video/cocoa/SDL_cocoaopengl.m b/src/video/cocoa/SDL_cocoaopengl.m index af17ae228f..607f307161 100644 --- a/src/video/cocoa/SDL_cocoaopengl.m +++ b/src/video/cocoa/SDL_cocoaopengl.m @@ -97,6 +97,13 @@ DisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTimeStamp* now, const return self; } +- (void)movedToNewScreen +{ + if (self->displayLink) { + CVDisplayLinkSetCurrentCGDisplayFromOpenGLContext(self->displayLink, [self CGLContextObj], [[self pixelFormat] CGLPixelFormatObj]); + } +} + - (void)scheduleUpdate { SDL_AtomicAdd(&self->dirty, 1); @@ -483,6 +490,8 @@ Cocoa_GL_SwapWindow(_THIS, SDL_Window * window) SDL_UnlockMutex(nscontext->swapIntervalMutex); } + /*{ static Uint64 prev = 0; const Uint64 now = SDL_GetTicks64(); const unsigned int diff = (unsigned int) (now - prev); prev = now; printf("GLSWAPBUFFERS TICKS %u\n", diff); }*/ + /* on 10.14 ("Mojave") and later, this deadlocks if two contexts in two threads try to swap at the same time, so put a mutex around it. */ SDL_LockMutex(videodata.swaplock); diff --git a/src/video/cocoa/SDL_cocoawindow.h b/src/video/cocoa/SDL_cocoawindow.h index cd76b0cd9d..18f7d8587d 100644 --- a/src/video/cocoa/SDL_cocoawindow.h +++ b/src/video/cocoa/SDL_cocoawindow.h @@ -85,6 +85,7 @@ typedef enum -(void) windowDidResignKey:(NSNotification *) aNotification; -(void) windowDidChangeBackingProperties:(NSNotification *) aNotification; -(void) windowDidChangeScreenProfile:(NSNotification *) aNotification; +-(void) windowDidChangeScreen:(NSNotification *) aNotification; -(void) windowWillEnterFullScreen:(NSNotification *) aNotification; -(void) windowDidEnterFullScreen:(NSNotification *) aNotification; -(void) windowWillExitFullScreen:(NSNotification *) aNotification; diff --git a/src/video/cocoa/SDL_cocoawindow.m b/src/video/cocoa/SDL_cocoawindow.m index eea7f981a6..05cdcbcbd4 100644 --- a/src/video/cocoa/SDL_cocoawindow.m +++ b/src/video/cocoa/SDL_cocoawindow.m @@ -500,6 +500,7 @@ Cocoa_UpdateClipCursor(SDL_Window * window) [center addObserver:self selector:@selector(windowDidResignKey:) name:NSWindowDidResignKeyNotification object:window]; [center addObserver:self selector:@selector(windowDidChangeBackingProperties:) name:NSWindowDidChangeBackingPropertiesNotification object:window]; [center addObserver:self selector:@selector(windowDidChangeScreenProfile:) name:NSWindowDidChangeScreenProfileNotification object:window]; + [center addObserver:self selector:@selector(windowDidChangeScreen:) name:NSWindowDidChangeScreenNotification object:window]; [center addObserver:self selector:@selector(windowWillEnterFullScreen:) name:NSWindowWillEnterFullScreenNotification object:window]; [center addObserver:self selector:@selector(windowDidEnterFullScreen:) name:NSWindowDidEnterFullScreenNotification object:window]; [center addObserver:self selector:@selector(windowWillExitFullScreen:) name:NSWindowWillExitFullScreenNotification object:window]; @@ -632,6 +633,7 @@ Cocoa_UpdateClipCursor(SDL_Window * window) [center removeObserver:self name:NSWindowDidResignKeyNotification object:window]; [center removeObserver:self name:NSWindowDidChangeBackingPropertiesNotification object:window]; [center removeObserver:self name:NSWindowDidChangeScreenProfileNotification object:window]; + [center removeObserver:self name:NSWindowDidChangeScreenNotification object:window]; [center removeObserver:self name:NSWindowWillEnterFullScreenNotification object:window]; [center removeObserver:self name:NSWindowDidEnterFullScreenNotification object:window]; [center removeObserver:self name:NSWindowWillExitFullScreenNotification object:window]; @@ -920,6 +922,16 @@ Cocoa_UpdateClipCursor(SDL_Window * window) SDL_SendWindowEvent(_data.window, SDL_WINDOWEVENT_ICCPROF_CHANGED, 0, 0); } +- (void)windowDidChangeScreen:(NSNotification *)aNotification +{ + /*printf("WINDOWDIDCHANGESCREEN\n");*/ + if (_data && _data.nscontexts) { + for (SDLOpenGLContext *context in _data.nscontexts) { + [context movedToNewScreen]; + } + } +} + - (void)windowWillEnterFullScreen:(NSNotification *)aNotification { SDL_Window *window = _data.window; From 7ebdae5dc977b9605ae196bfafa9336b316c739a Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Wed, 16 Nov 2022 11:45:41 -0500 Subject: [PATCH 063/153] cocoa: Fix OpenGL deprecation warning. --- src/video/cocoa/SDL_cocoawindow.m | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/video/cocoa/SDL_cocoawindow.m b/src/video/cocoa/SDL_cocoawindow.m index 05cdcbcbd4..ddf2fc9f55 100644 --- a/src/video/cocoa/SDL_cocoawindow.m +++ b/src/video/cocoa/SDL_cocoawindow.m @@ -260,12 +260,6 @@ static void ConvertNSRect(NSScreen *screen, BOOL fullscreen, NSRect *r) static void ScheduleContextUpdates(SDL_WindowData *data) { - NSOpenGLContext *currentContext; - NSMutableArray *contexts; - if (!data || !data.nscontexts) { - return; - } - /* We still support OpenGL as long as Apple offers it, deprecated or not, so disable deprecation warnings about it. */ #if SDL_VIDEO_OPENGL @@ -274,6 +268,12 @@ ScheduleContextUpdates(SDL_WindowData *data) #pragma clang diagnostic ignored "-Wdeprecated-declarations" #endif + NSOpenGLContext *currentContext; + NSMutableArray *contexts; + if (!data || !data.nscontexts) { + return; + } + currentContext = [NSOpenGLContext currentContext]; contexts = data.nscontexts; @synchronized (contexts) { From ec58a817ef66efc23d7d6e964844317673b23ead Mon Sep 17 00:00:00 2001 From: ulatekh Date: Wed, 5 Oct 2022 19:26:09 -0700 Subject: [PATCH 064/153] Fixes made in response to running a static code analyzer under MS Windows. Most of these are probably harmless, but the changes to SDL_immdevice.c and SDL_pixels.c appear to have fixed genuine bugs. SDL_audiocvt.c: By separating the calculation of the divisor, I got rid of the suspicion that dividing a double by an integer led to loss of precision. SDL_immdevice.c: Added a missing test, one that could have otherwise led to dereferencing a null pointer. SDL_events.c, SDL_gamecontroller.c, SDL_joystick.c, SDL_malloc.c, SDL_video.c: Made it clear the return values weren't used. SDL_hidapi_shield.c: The size is zero, so nothing bad would have happened, but the SDL_memset() was still being given an address outside of the array's range. SDL_dinputjoystick.c: Initialize local data, just in case IDirectInputDevice8_GetProperty() isn't guaranteed to write to it. SDL_render_sw.c: drawstate.viewport could be null (as seen on line 691). SDL.c: SDL_MostSignificantBitIndex32() could return -1, though I don't know if you want to cope with that (what I did) or SDL_assert() that it can't happen. SDL_hints.c: Replaced boolean tests on pointer values with comparisons to NULL. SDL_pixels.c: Looks like the switch is genuinely missing a break! SDL_rect_impl.h: The MacOS static checker pointed out issues with the X comparisons that were handled by assertions; I added assertions for the Y comparisons. SDL_yuv.c, SDL_windowskeyboard.c, SDL_windowswindow.c: Checked error-result returns. --- src/SDL.c | 15 ++++++++------- src/SDL_hints.c | 6 +++--- src/audio/SDL_audiocvt.c | 3 ++- src/core/windows/SDL_immdevice.c | 4 +++- src/events/SDL_events.c | 12 ++++++------ src/joystick/SDL_gamecontroller.c | 2 +- src/joystick/SDL_joystick.c | 2 +- src/joystick/hidapi/SDL_hidapi_shield.c | 3 ++- src/joystick/windows/SDL_dinputjoystick.c | 1 + src/render/software/SDL_render_sw.c | 14 +++++++------- src/stdlib/SDL_malloc.c | 2 +- src/video/SDL_pixels.c | 1 + src/video/SDL_rect_impl.h | 2 ++ src/video/SDL_video.c | 8 ++++---- src/video/SDL_yuv.c | 7 ++++--- src/video/windows/SDL_windowskeyboard.c | 10 +++++++++- src/video/windows/SDL_windowswindow.c | 12 ++++++++---- 17 files changed, 63 insertions(+), 41 deletions(-) diff --git a/src/SDL.c b/src/SDL.c index 67db48c3bf..42ebc2cfc0 100644 --- a/src/SDL.c +++ b/src/SDL.c @@ -125,8 +125,9 @@ static void SDL_PrivateSubsystemRefCountIncr(Uint32 subsystem) { int subsystem_index = SDL_MostSignificantBitIndex32(subsystem); - SDL_assert(SDL_SubsystemRefCount[subsystem_index] < 255); - ++SDL_SubsystemRefCount[subsystem_index]; + SDL_assert(subsystem_index < 0 || SDL_SubsystemRefCount[subsystem_index] < 255); + if (subsystem_index >= 0) + ++SDL_SubsystemRefCount[subsystem_index]; } /* Private helper to decrement a subsystem's ref counter. */ @@ -134,7 +135,7 @@ static void SDL_PrivateSubsystemRefCountDecr(Uint32 subsystem) { int subsystem_index = SDL_MostSignificantBitIndex32(subsystem); - if (SDL_SubsystemRefCount[subsystem_index] > 0) { + if (subsystem_index >= 0 && SDL_SubsystemRefCount[subsystem_index] > 0) { --SDL_SubsystemRefCount[subsystem_index]; } } @@ -144,22 +145,22 @@ static SDL_bool SDL_PrivateShouldInitSubsystem(Uint32 subsystem) { int subsystem_index = SDL_MostSignificantBitIndex32(subsystem); - SDL_assert(SDL_SubsystemRefCount[subsystem_index] < 255); - return (SDL_SubsystemRefCount[subsystem_index] == 0) ? SDL_TRUE : SDL_FALSE; + SDL_assert(subsystem_index < 0 || SDL_SubsystemRefCount[subsystem_index] < 255); + return (subsystem_index >= 0 && SDL_SubsystemRefCount[subsystem_index] == 0) ? SDL_TRUE : SDL_FALSE; } /* Private helper to check if a system needs to be quit. */ static SDL_bool SDL_PrivateShouldQuitSubsystem(Uint32 subsystem) { int subsystem_index = SDL_MostSignificantBitIndex32(subsystem); - if (SDL_SubsystemRefCount[subsystem_index] == 0) { + if (subsystem_index >= 0 && SDL_SubsystemRefCount[subsystem_index] == 0) { return SDL_FALSE; } /* If we're in SDL_Quit, we shut down every subsystem, even if refcount * isn't zero. */ - return (SDL_SubsystemRefCount[subsystem_index] == 1 || SDL_bInMainQuit) ? SDL_TRUE : SDL_FALSE; + return ((subsystem_index >= 0 && SDL_SubsystemRefCount[subsystem_index] == 1) || SDL_bInMainQuit) ? SDL_TRUE : SDL_FALSE; } void diff --git a/src/SDL_hints.c b/src/SDL_hints.c index 4f2f5f61d3..4341f8d203 100644 --- a/src/SDL_hints.c +++ b/src/SDL_hints.c @@ -112,7 +112,7 @@ SDL_ResetHint(const char *name) if (SDL_strcmp(name, hint->name) == 0) { if ((env == NULL && hint->value != NULL) || (env != NULL && hint->value == NULL) || - (env && SDL_strcmp(env, hint->value) != 0)) { + (env != NULL && SDL_strcmp(env, hint->value) != 0)) { for (entry = hint->callbacks; entry; ) { /* Save the next entry in case this one is deleted */ SDL_HintWatch *next = entry->next; @@ -140,7 +140,7 @@ SDL_ResetHints(void) env = SDL_getenv(hint->name); if ((env == NULL && hint->value != NULL) || (env != NULL && hint->value == NULL) || - (env && SDL_strcmp(env, hint->value) != 0)) { + (env != NULL && SDL_strcmp(env, hint->value) != 0)) { for (entry = hint->callbacks; entry; ) { /* Save the next entry in case this one is deleted */ SDL_HintWatch *next = entry->next; @@ -169,7 +169,7 @@ SDL_GetHint(const char *name) env = SDL_getenv(name); for (hint = SDL_hints; hint; hint = hint->next) { if (SDL_strcmp(name, hint->name) == 0) { - if (!env || hint->priority == SDL_HINT_OVERRIDE) { + if (env == NULL || hint->priority == SDL_HINT_OVERRIDE) { return hint->value; } break; diff --git a/src/audio/SDL_audiocvt.c b/src/audio/SDL_audiocvt.c index 0884fa373a..196013e11e 100644 --- a/src/audio/SDL_audiocvt.c +++ b/src/audio/SDL_audiocvt.c @@ -403,7 +403,8 @@ SDL_BuildAudioTypeCVTFromFloat(SDL_AudioCVT *cvt, const SDL_AudioFormat dst_fmt) cvt->len_mult *= mult; cvt->len_ratio *= mult; } else if (src_bitsize > dst_bitsize) { - cvt->len_ratio /= (src_bitsize / dst_bitsize); + const int div = (src_bitsize / dst_bitsize); + cvt->len_ratio /= div; } retval = 1; /* added a converter. */ } diff --git a/src/core/windows/SDL_immdevice.c b/src/core/windows/SDL_immdevice.c index 0a00a6d029..335596d95d 100644 --- a/src/core/windows/SDL_immdevice.c +++ b/src/core/windows/SDL_immdevice.c @@ -399,7 +399,9 @@ static int SDLCALL sort_endpoints(const void *_a, const void *_b) { LPWSTR a = ((const EndpointItem *)_a)->devid; LPWSTR b = ((const EndpointItem *)_b)->devid; - if (!a && b) { + if (!a && !b) { + return 0; + } else if (!a && b) { return -1; } else if (a && !b) { return 1; diff --git a/src/events/SDL_events.c b/src/events/SDL_events.c index 52b72cd225..9ba5e44b88 100644 --- a/src/events/SDL_events.c +++ b/src/events/SDL_events.c @@ -147,7 +147,7 @@ SDL_AutoUpdateSensorsChanged(void *userdata, const char *name, const char *oldVa static void SDLCALL SDL_PollSentinelChanged(void *userdata, const char *name, const char *oldValue, const char *hint) { - SDL_EventState(SDL_POLLSENTINEL, SDL_GetStringBoolean(hint, SDL_TRUE) ? SDL_ENABLE : SDL_DISABLE); + (void)SDL_EventState(SDL_POLLSENTINEL, SDL_GetStringBoolean(hint, SDL_TRUE) ? SDL_ENABLE : SDL_DISABLE); } /** @@ -566,12 +566,12 @@ SDL_StartEventLoop(void) #endif /* !SDL_THREADS_DISABLED */ /* Process most event types */ - SDL_EventState(SDL_TEXTINPUT, SDL_DISABLE); - SDL_EventState(SDL_TEXTEDITING, SDL_DISABLE); - SDL_EventState(SDL_SYSWMEVENT, SDL_DISABLE); + (void)SDL_EventState(SDL_TEXTINPUT, SDL_DISABLE); + (void)SDL_EventState(SDL_TEXTEDITING, SDL_DISABLE); + (void)SDL_EventState(SDL_SYSWMEVENT, SDL_DISABLE); #if 0 /* Leave these events enabled so apps can respond to items being dragged onto them at startup */ - SDL_EventState(SDL_DROPFILE, SDL_DISABLE); - SDL_EventState(SDL_DROPTEXT, SDL_DISABLE); + (void)SDL_EventState(SDL_DROPFILE, SDL_DISABLE); + (void)SDL_EventState(SDL_DROPTEXT, SDL_DISABLE); #endif SDL_EventQ.active = SDL_TRUE; diff --git a/src/joystick/SDL_gamecontroller.c b/src/joystick/SDL_gamecontroller.c index 2bb97657b2..26979a2ffb 100644 --- a/src/joystick/SDL_gamecontroller.c +++ b/src/joystick/SDL_gamecontroller.c @@ -3009,7 +3009,7 @@ SDL_GameControllerEventState(int state) break; default: for (i = 0; i < SDL_arraysize(event_list); ++i) { - SDL_EventState(event_list[i], state); + (void)SDL_EventState(event_list[i], state); } break; } diff --git a/src/joystick/SDL_joystick.c b/src/joystick/SDL_joystick.c index c6d2bf3930..4b95581452 100644 --- a/src/joystick/SDL_joystick.c +++ b/src/joystick/SDL_joystick.c @@ -1798,7 +1798,7 @@ SDL_JoystickEventState(int state) break; default: for (i = 0; i < SDL_arraysize(event_list); ++i) { - SDL_EventState(event_list[i], state); + (void)SDL_EventState(event_list[i], state); } break; } diff --git a/src/joystick/hidapi/SDL_hidapi_shield.c b/src/joystick/hidapi/SDL_hidapi_shield.c index 1d54676b81..557ca45aba 100644 --- a/src/joystick/hidapi/SDL_hidapi_shield.c +++ b/src/joystick/hidapi/SDL_hidapi_shield.c @@ -169,7 +169,8 @@ HIDAPI_DriverShield_SendCommand(SDL_HIDAPI_Device *device, Uint8 cmd, const void } /* Zero unused data in the payload */ - SDL_memset(&cmd_pkt.payload[size], 0, sizeof(cmd_pkt.payload) - size); + if (size != sizeof(cmd_pkt.payload)) + SDL_memset(&cmd_pkt.payload[size], 0, sizeof(cmd_pkt.payload) - size); if (SDL_HIDAPI_SendRumbleAndUnlock(device, (Uint8*)&cmd_pkt, sizeof(cmd_pkt)) != sizeof(cmd_pkt)) { return SDL_SetError("Couldn't send command packet"); diff --git a/src/joystick/windows/SDL_dinputjoystick.c b/src/joystick/windows/SDL_dinputjoystick.c index 2f06053700..9c5a46bd08 100644 --- a/src/joystick/windows/SDL_dinputjoystick.c +++ b/src/joystick/windows/SDL_dinputjoystick.c @@ -329,6 +329,7 @@ QueryDeviceInfo(LPDIRECTINPUTDEVICE8 device, Uint16* vendor_id, Uint16* product_ dipdw.diph.dwHeaderSize = sizeof(dipdw.diph); dipdw.diph.dwObj = 0; dipdw.diph.dwHow = DIPH_DEVICE; + dipdw.dwData = 0; if (FAILED(IDirectInputDevice8_GetProperty(device, DIPROP_VIDPID, &dipdw.diph))) { return SDL_FALSE; diff --git a/src/render/software/SDL_render_sw.c b/src/render/software/SDL_render_sw.c index 874f92b330..6ba77d46e5 100644 --- a/src/render/software/SDL_render_sw.c +++ b/src/render/software/SDL_render_sw.c @@ -733,7 +733,7 @@ SW_RunCommandQueue(SDL_Renderer * renderer, SDL_RenderCommand *cmd, void *vertic SetDrawState(surface, &drawstate); /* Apply viewport */ - if (drawstate.viewport->x || drawstate.viewport->y) { + if (drawstate.viewport != NULL && (drawstate.viewport->x || drawstate.viewport->y)) { int i; for (i = 0; i < count; i++) { verts[i].x += drawstate.viewport->x; @@ -760,7 +760,7 @@ SW_RunCommandQueue(SDL_Renderer * renderer, SDL_RenderCommand *cmd, void *vertic SetDrawState(surface, &drawstate); /* Apply viewport */ - if (drawstate.viewport->x || drawstate.viewport->y) { + if (drawstate.viewport != NULL && (drawstate.viewport->x || drawstate.viewport->y)) { int i; for (i = 0; i < count; i++) { verts[i].x += drawstate.viewport->x; @@ -787,7 +787,7 @@ SW_RunCommandQueue(SDL_Renderer * renderer, SDL_RenderCommand *cmd, void *vertic SetDrawState(surface, &drawstate); /* Apply viewport */ - if (drawstate.viewport->x || drawstate.viewport->y) { + if (drawstate.viewport != NULL && (drawstate.viewport->x || drawstate.viewport->y)) { int i; for (i = 0; i < count; i++) { verts[i].x += drawstate.viewport->x; @@ -815,7 +815,7 @@ SW_RunCommandQueue(SDL_Renderer * renderer, SDL_RenderCommand *cmd, void *vertic PrepTextureForCopy(cmd); /* Apply viewport */ - if (drawstate.viewport->x || drawstate.viewport->y) { + if (drawstate.viewport != NULL && (drawstate.viewport->x || drawstate.viewport->y)) { dstrect->x += drawstate.viewport->x; dstrect->y += drawstate.viewport->y; } @@ -873,7 +873,7 @@ SW_RunCommandQueue(SDL_Renderer * renderer, SDL_RenderCommand *cmd, void *vertic PrepTextureForCopy(cmd); /* Apply viewport */ - if (drawstate.viewport->x || drawstate.viewport->y) { + if (drawstate.viewport != NULL && (drawstate.viewport->x || drawstate.viewport->y)) { copydata->dstrect.x += drawstate.viewport->x; copydata->dstrect.y += drawstate.viewport->y; } @@ -901,7 +901,7 @@ SW_RunCommandQueue(SDL_Renderer * renderer, SDL_RenderCommand *cmd, void *vertic PrepTextureForCopy(cmd); /* Apply viewport */ - if (drawstate.viewport->x || drawstate.viewport->y) { + if (drawstate.viewport != NULL && (drawstate.viewport->x || drawstate.viewport->y)) { SDL_Point vp; vp.x = drawstate.viewport->x; vp.y = drawstate.viewport->y; @@ -924,7 +924,7 @@ SW_RunCommandQueue(SDL_Renderer * renderer, SDL_RenderCommand *cmd, void *vertic GeometryFillData *ptr = (GeometryFillData *) verts; /* Apply viewport */ - if (drawstate.viewport->x || drawstate.viewport->y) { + if (drawstate.viewport != NULL && (drawstate.viewport->x || drawstate.viewport->y)) { SDL_Point vp; vp.x = drawstate.viewport->x; vp.y = drawstate.viewport->y; diff --git a/src/stdlib/SDL_malloc.c b/src/stdlib/SDL_malloc.c index ebafb66cfb..de02b5eefd 100644 --- a/src/stdlib/SDL_malloc.c +++ b/src/stdlib/SDL_malloc.c @@ -2580,7 +2580,7 @@ init_mparams(void) #else /* (FOOTERS && !INSECURE) */ s = (size_t) 0x58585858U; #endif /* (FOOTERS && !INSECURE) */ - ACQUIRE_MAGIC_INIT_LOCK(); + (void)ACQUIRE_MAGIC_INIT_LOCK(); if (mparams.magic == 0) { mparams.magic = s; /* Set up lock for main malloc area */ diff --git a/src/video/SDL_pixels.c b/src/video/SDL_pixels.c index 1646d844fc..654453278b 100644 --- a/src/video/SDL_pixels.c +++ b/src/video/SDL_pixels.c @@ -436,6 +436,7 @@ SDL_MasksToPixelFormatEnum(int bpp, Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, return SDL_PIXELFORMAT_RGB24; #endif } + break; case 32: if (Rmask == 0) { return SDL_PIXELFORMAT_RGB888; diff --git a/src/video/SDL_rect_impl.h b/src/video/SDL_rect_impl.h index 993bb8eb0a..26a54484ac 100644 --- a/src/video/SDL_rect_impl.h +++ b/src/video/SDL_rect_impl.h @@ -400,9 +400,11 @@ SDL_INTERSECTRECTANDLINE(const RECTTYPE * rect, SCALARTYPE *X1, SCALARTYPE *Y1, outcode1 = COMPUTEOUTCODE(rect, x, y); } else { if (outcode2 & CODE_TOP) { + SDL_assert(y2 != y1); /* if equal: division by zero. */ y = recty1; x = x1 + ((x2 - x1) * (y - y1)) / (y2 - y1); } else if (outcode2 & CODE_BOTTOM) { + SDL_assert(y2 != y1); /* if equal: division by zero. */ y = recty2; x = x1 + ((x2 - x1) * (y - y1)) / (y2 - y1); } else if (outcode2 & CODE_LEFT) { diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c index c75b026d98..1ac9165ade 100644 --- a/src/video/SDL_video.c +++ b/src/video/SDL_video.c @@ -4337,8 +4337,8 @@ SDL_StartTextInput(void) SDL_Window *window; /* First, enable text events */ - SDL_EventState(SDL_TEXTINPUT, SDL_ENABLE); - SDL_EventState(SDL_TEXTEDITING, SDL_ENABLE); + (void)SDL_EventState(SDL_TEXTINPUT, SDL_ENABLE); + (void)SDL_EventState(SDL_TEXTEDITING, SDL_ENABLE); /* Then show the on-screen keyboard, if any */ window = SDL_GetFocusWindow(); @@ -4393,8 +4393,8 @@ SDL_StopTextInput(void) } /* Finally disable text events */ - SDL_EventState(SDL_TEXTINPUT, SDL_DISABLE); - SDL_EventState(SDL_TEXTEDITING, SDL_DISABLE); + (void)SDL_EventState(SDL_TEXTINPUT, SDL_DISABLE); + (void)SDL_EventState(SDL_TEXTEDITING, SDL_DISABLE); } void diff --git a/src/video/SDL_yuv.c b/src/video/SDL_yuv.c index 50395ff488..b163216b95 100644 --- a/src/video/SDL_yuv.c +++ b/src/video/SDL_yuv.c @@ -601,9 +601,10 @@ SDL_ConvertPixels_ARGB8888_to_YUV(int width, int height, const void *src, int sr Uint8 *plane_interleaved_uv; Uint32 y_stride, uv_stride, y_skip, uv_skip; - GetYUVPlanes(width, height, dst_format, dst, dst_pitch, - (const Uint8 **)&plane_y, (const Uint8 **)&plane_u, (const Uint8 **)&plane_v, - &y_stride, &uv_stride); + if (GetYUVPlanes(width, height, dst_format, dst, dst_pitch, + (const Uint8 **)&plane_y, (const Uint8 **)&plane_u, (const Uint8 **)&plane_v, + &y_stride, &uv_stride) != 0) + return -1; plane_interleaved_uv = (plane_y + height * y_stride); y_skip = (y_stride - width); diff --git a/src/video/windows/SDL_windowskeyboard.c b/src/video/windows/SDL_windowskeyboard.c index 4f288c77a8..3a9988deb6 100644 --- a/src/video/windows/SDL_windowskeyboard.c +++ b/src/video/windows/SDL_windowskeyboard.c @@ -389,13 +389,21 @@ WIN_ShouldShowNativeUI() static void IME_Init(SDL_VideoData *videodata, HWND hwnd) { + HRESULT hResult = S_OK; + if (videodata->ime_initialized) return; videodata->ime_hwnd_main = hwnd; if (SUCCEEDED(WIN_CoInitialize())) { videodata->ime_com_initialized = SDL_TRUE; - CoCreateInstance(&CLSID_TF_ThreadMgr, NULL, CLSCTX_INPROC_SERVER, &IID_ITfThreadMgr, (LPVOID *)&videodata->ime_threadmgr); + hResult = CoCreateInstance(&CLSID_TF_ThreadMgr, NULL, CLSCTX_INPROC_SERVER, &IID_ITfThreadMgr, (LPVOID *)&videodata->ime_threadmgr); + if (hResult != S_OK) + { + videodata->ime_available = SDL_FALSE; + SDL_SetError("CoCreateInstance() failed, HRESULT is %08X", (unsigned int)hResult); + return; + } } videodata->ime_initialized = SDL_TRUE; videodata->ime_himm32 = SDL_LoadObject("imm32.dll"); diff --git a/src/video/windows/SDL_windowswindow.c b/src/video/windows/SDL_windowswindow.c index 488b6fe1a5..d74f1dda79 100644 --- a/src/video/windows/SDL_windowswindow.c +++ b/src/video/windows/SDL_windowswindow.c @@ -739,15 +739,18 @@ WIN_GetWindowBordersSize(_THIS, SDL_Window * window, int *top, int *left, int *b /* rcClient stores the size of the inner window, while rcWindow stores the outer size relative to the top-left * screen position; so the top/left values of rcClient are always {0,0} and bottom/right are {height,width} */ - GetClientRect(hwnd, &rcClient); - GetWindowRect(hwnd, &rcWindow); + if (!GetClientRect(hwnd, &rcClient)) + SDL_SetError("GetClientRect() failed, error %08X", (unsigned int)GetLastError()); + if (!GetWindowRect(hwnd, &rcWindow)) + SDL_SetError("GetWindowRect() failed, error %08X", (unsigned int)GetLastError()); /* convert the top/left values to make them relative to * the window; they will end up being slightly negative */ ptDiff.y = rcWindow.top; ptDiff.x = rcWindow.left; - ScreenToClient(hwnd, &ptDiff); + if (!ScreenToClient(hwnd, &ptDiff)) + SDL_SetError("ScreenToClient() failed, error %08X", (unsigned int)GetLastError()); rcWindow.top = ptDiff.y; rcWindow.left = ptDiff.x; @@ -757,7 +760,8 @@ WIN_GetWindowBordersSize(_THIS, SDL_Window * window, int *top, int *left, int *b ptDiff.y = rcWindow.bottom; ptDiff.x = rcWindow.right; - ScreenToClient(hwnd, &ptDiff); + if (!ScreenToClient(hwnd, &ptDiff)) + SDL_SetError("ScreenToClient() failed, error %08X", (unsigned int)GetLastError()); rcWindow.bottom = ptDiff.y; rcWindow.right = ptDiff.x; From 389ffab733b9e875125313e68ad66be9734223ed Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Wed, 16 Nov 2022 12:53:48 -0500 Subject: [PATCH 065/153] Code style fixes, etc. Reference PR #6345. --- src/SDL.c | 25 +++++++++++++------------ src/joystick/hidapi/SDL_hidapi_shield.c | 3 ++- src/video/SDL_yuv.c | 4 +++- src/video/windows/SDL_windowskeyboard.c | 3 +-- src/video/windows/SDL_windowswindow.c | 21 +++++++++++++-------- 5 files changed, 32 insertions(+), 24 deletions(-) diff --git a/src/SDL.c b/src/SDL.c index 42ebc2cfc0..6297159e42 100644 --- a/src/SDL.c +++ b/src/SDL.c @@ -124,18 +124,19 @@ static Uint8 SDL_SubsystemRefCount[ 32 ]; static void SDL_PrivateSubsystemRefCountIncr(Uint32 subsystem) { - int subsystem_index = SDL_MostSignificantBitIndex32(subsystem); - SDL_assert(subsystem_index < 0 || SDL_SubsystemRefCount[subsystem_index] < 255); - if (subsystem_index >= 0) + const int subsystem_index = SDL_MostSignificantBitIndex32(subsystem); + SDL_assert((subsystem_index < 0) || (SDL_SubsystemRefCount[subsystem_index] < 255)); + if (subsystem_index >= 0) { ++SDL_SubsystemRefCount[subsystem_index]; + } } /* Private helper to decrement a subsystem's ref counter. */ static void SDL_PrivateSubsystemRefCountDecr(Uint32 subsystem) { - int subsystem_index = SDL_MostSignificantBitIndex32(subsystem); - if (subsystem_index >= 0 && SDL_SubsystemRefCount[subsystem_index] > 0) { + const int subsystem_index = SDL_MostSignificantBitIndex32(subsystem); + if ((subsystem_index >= 0) && (SDL_SubsystemRefCount[subsystem_index] > 0)) { --SDL_SubsystemRefCount[subsystem_index]; } } @@ -144,23 +145,23 @@ SDL_PrivateSubsystemRefCountDecr(Uint32 subsystem) static SDL_bool SDL_PrivateShouldInitSubsystem(Uint32 subsystem) { - int subsystem_index = SDL_MostSignificantBitIndex32(subsystem); - SDL_assert(subsystem_index < 0 || SDL_SubsystemRefCount[subsystem_index] < 255); - return (subsystem_index >= 0 && SDL_SubsystemRefCount[subsystem_index] == 0) ? SDL_TRUE : SDL_FALSE; + const int subsystem_index = SDL_MostSignificantBitIndex32(subsystem); + SDL_assert((subsystem_index < 0) || (SDL_SubsystemRefCount[subsystem_index] < 255)); + return ((subsystem_index >= 0) && (SDL_SubsystemRefCount[subsystem_index] == 0)) ? SDL_TRUE : SDL_FALSE; } /* Private helper to check if a system needs to be quit. */ static SDL_bool SDL_PrivateShouldQuitSubsystem(Uint32 subsystem) { - int subsystem_index = SDL_MostSignificantBitIndex32(subsystem); - if (subsystem_index >= 0 && SDL_SubsystemRefCount[subsystem_index] == 0) { - return SDL_FALSE; + const int subsystem_index = SDL_MostSignificantBitIndex32(subsystem); + if ((subsystem_index >= 0) && (SDL_SubsystemRefCount[subsystem_index] == 0)) { + return SDL_FALSE; } /* If we're in SDL_Quit, we shut down every subsystem, even if refcount * isn't zero. */ - return ((subsystem_index >= 0 && SDL_SubsystemRefCount[subsystem_index] == 1) || SDL_bInMainQuit) ? SDL_TRUE : SDL_FALSE; + return (((subsystem_index >= 0) && (SDL_SubsystemRefCount[subsystem_index] == 1)) || SDL_bInMainQuit) ? SDL_TRUE : SDL_FALSE; } void diff --git a/src/joystick/hidapi/SDL_hidapi_shield.c b/src/joystick/hidapi/SDL_hidapi_shield.c index 557ca45aba..4fe00901c3 100644 --- a/src/joystick/hidapi/SDL_hidapi_shield.c +++ b/src/joystick/hidapi/SDL_hidapi_shield.c @@ -169,8 +169,9 @@ HIDAPI_DriverShield_SendCommand(SDL_HIDAPI_Device *device, Uint8 cmd, const void } /* Zero unused data in the payload */ - if (size != sizeof(cmd_pkt.payload)) + if (size != sizeof(cmd_pkt.payload)) { SDL_memset(&cmd_pkt.payload[size], 0, sizeof(cmd_pkt.payload) - size); + } if (SDL_HIDAPI_SendRumbleAndUnlock(device, (Uint8*)&cmd_pkt, sizeof(cmd_pkt)) != sizeof(cmd_pkt)) { return SDL_SetError("Couldn't send command packet"); diff --git a/src/video/SDL_yuv.c b/src/video/SDL_yuv.c index b163216b95..38cf9e733e 100644 --- a/src/video/SDL_yuv.c +++ b/src/video/SDL_yuv.c @@ -603,8 +603,10 @@ SDL_ConvertPixels_ARGB8888_to_YUV(int width, int height, const void *src, int sr if (GetYUVPlanes(width, height, dst_format, dst, dst_pitch, (const Uint8 **)&plane_y, (const Uint8 **)&plane_u, (const Uint8 **)&plane_v, - &y_stride, &uv_stride) != 0) + &y_stride, &uv_stride) != 0) { return -1; + } + plane_interleaved_uv = (plane_y + height * y_stride); y_skip = (y_stride - width); diff --git a/src/video/windows/SDL_windowskeyboard.c b/src/video/windows/SDL_windowskeyboard.c index 3a9988deb6..83a939d64e 100644 --- a/src/video/windows/SDL_windowskeyboard.c +++ b/src/video/windows/SDL_windowskeyboard.c @@ -398,8 +398,7 @@ IME_Init(SDL_VideoData *videodata, HWND hwnd) if (SUCCEEDED(WIN_CoInitialize())) { videodata->ime_com_initialized = SDL_TRUE; hResult = CoCreateInstance(&CLSID_TF_ThreadMgr, NULL, CLSCTX_INPROC_SERVER, &IID_ITfThreadMgr, (LPVOID *)&videodata->ime_threadmgr); - if (hResult != S_OK) - { + if (hResult != S_OK) { videodata->ime_available = SDL_FALSE; SDL_SetError("CoCreateInstance() failed, HRESULT is %08X", (unsigned int)hResult); return; diff --git a/src/video/windows/SDL_windowswindow.c b/src/video/windows/SDL_windowswindow.c index d74f1dda79..d260f15c60 100644 --- a/src/video/windows/SDL_windowswindow.c +++ b/src/video/windows/SDL_windowswindow.c @@ -739,18 +739,22 @@ WIN_GetWindowBordersSize(_THIS, SDL_Window * window, int *top, int *left, int *b /* rcClient stores the size of the inner window, while rcWindow stores the outer size relative to the top-left * screen position; so the top/left values of rcClient are always {0,0} and bottom/right are {height,width} */ - if (!GetClientRect(hwnd, &rcClient)) - SDL_SetError("GetClientRect() failed, error %08X", (unsigned int)GetLastError()); - if (!GetWindowRect(hwnd, &rcWindow)) - SDL_SetError("GetWindowRect() failed, error %08X", (unsigned int)GetLastError()); + if (!GetClientRect(hwnd, &rcClient)) { + return SDL_SetError("GetClientRect() failed, error %08X", (unsigned int)GetLastError()); + } + + if (!GetWindowRect(hwnd, &rcWindow)) { + return SDL_SetError("GetWindowRect() failed, error %08X", (unsigned int)GetLastError()); + } /* convert the top/left values to make them relative to * the window; they will end up being slightly negative */ ptDiff.y = rcWindow.top; ptDiff.x = rcWindow.left; - if (!ScreenToClient(hwnd, &ptDiff)) - SDL_SetError("ScreenToClient() failed, error %08X", (unsigned int)GetLastError()); + if (!ScreenToClient(hwnd, &ptDiff)) { + return SDL_SetError("ScreenToClient() failed, error %08X", (unsigned int)GetLastError()); + } rcWindow.top = ptDiff.y; rcWindow.left = ptDiff.x; @@ -760,8 +764,9 @@ WIN_GetWindowBordersSize(_THIS, SDL_Window * window, int *top, int *left, int *b ptDiff.y = rcWindow.bottom; ptDiff.x = rcWindow.right; - if (!ScreenToClient(hwnd, &ptDiff)) - SDL_SetError("ScreenToClient() failed, error %08X", (unsigned int)GetLastError()); + if (!ScreenToClient(hwnd, &ptDiff)) { + return SDL_SetError("ScreenToClient() failed, error %08X", (unsigned int)GetLastError()); + } rcWindow.bottom = ptDiff.y; rcWindow.right = ptDiff.x; From 20af698b021b157aa4054d6f23b999b9d0d58dba Mon Sep 17 00:00:00 2001 From: chalonverse Date: Wed, 16 Nov 2022 11:31:35 -0800 Subject: [PATCH 066/153] GDK: Updated MicrosoftGame.config files to use placeholder identifiers from the GDK project template rather than using Microsoft sample identifiers --- .../testgamecontroller/wingdk/MicrosoftGame.config | 8 ++++---- .../xboxone/MicrosoftGame.config | 14 ++++---------- .../xboxseries/MicrosoftGame.config | 8 ++++---- .../tests/testgdk/wingdk/MicrosoftGame.config | 8 ++++---- .../tests/testgdk/xboxone/MicrosoftGame.config | 8 ++++---- .../tests/testgdk/xboxseries/MicrosoftGame.config | 8 ++++---- .../tests/testsprite2/wingdk/MicrosoftGame.config | 8 ++++---- .../tests/testsprite2/xboxone/MicrosoftGame.config | 8 ++++---- .../testsprite2/xboxseries/MicrosoftGame.config | 8 ++++---- 9 files changed, 36 insertions(+), 42 deletions(-) diff --git a/VisualC-GDK/tests/testgamecontroller/wingdk/MicrosoftGame.config b/VisualC-GDK/tests/testgamecontroller/wingdk/MicrosoftGame.config index 6a9ea2bf82..eb4ec4e171 100644 --- a/VisualC-GDK/tests/testgamecontroller/wingdk/MicrosoftGame.config +++ b/VisualC-GDK/tests/testgamecontroller/wingdk/MicrosoftGame.config @@ -2,9 +2,9 @@ - + Publisher="CN=Publisher"/> - 7325F784 - 0000000000000000 + PleaseChangeMe + FFFFFFFF - + Publisher="CN=Publisher"/> - - - - - - - 7325F784 - 0000000000000000 + PleaseChangeMe + FFFFFFFF - + Publisher="CN=Publisher"/> - 7325F784 - 0000000000000000 + PleaseChangeMe + FFFFFFFF - + Publisher="CN=Publisher"/> - 7325F784 - 0000000000000000 + PleaseChangeMe + FFFFFFFF - + Publisher="CN=Publisher"/> - 7325F784 - 0000000000000000 + PleaseChangeMe + FFFFFFFF - + Publisher="CN=Publisher"/> - 7325F784 - 0000000000000000 + PleaseChangeMe + FFFFFFFF - + Publisher="CN=Publisher"/> - 7325F784 - 0000000000000000 + PleaseChangeMe + FFFFFFFF - + Publisher="CN=Publisher"/> - 7325F784 - 0000000000000000 + PleaseChangeMe + FFFFFFFF - + Publisher="CN=Publisher"/> - 7325F784 - 0000000000000000 + PleaseChangeMe + FFFFFFFF Date: Wed, 16 Nov 2022 11:32:31 -0500 Subject: [PATCH 067/153] events: Remove X and XKB keysym constants and headers The XKB_KEY_* and XK_* macros resolve to the same constant values, so use the raw values and note what keys they correspond to in the comments, as is done for the other keysym values in this file. This completely eliminates the need for any X or XKB system headers along with the if/else defines. --- src/events/SDL_keysym_to_scancode.c | 72 ++++++++--------------------- 1 file changed, 20 insertions(+), 52 deletions(-) diff --git a/src/events/SDL_keysym_to_scancode.c b/src/events/SDL_keysym_to_scancode.c index d965a375c5..c1c1ba626d 100644 --- a/src/events/SDL_keysym_to_scancode.c +++ b/src/events/SDL_keysym_to_scancode.c @@ -26,60 +26,28 @@ #include "SDL_keyboard_c.h" #include "SDL_scancode_tables_c.h" -#if SDL_VIDEO_DRIVER_WAYLAND -#include - -typedef xkb_keysym_t SDL_xkb_keysym_t; -#else -#include -#include - -typedef KeySym SDL_xkb_keysym_t; -#endif - - /* *INDENT-OFF* */ /* clang-format off */ static const struct { - SDL_xkb_keysym_t keysym; + Uint32 keysym; SDL_Scancode scancode; } KeySymToSDLScancode[] = { -#if SDL_VIDEO_DRIVER_WAYLAND - { XKB_KEY_KP_End, SDL_SCANCODE_KP_1 }, - { XKB_KEY_KP_Down, SDL_SCANCODE_KP_2 }, - { XKB_KEY_KP_Next, SDL_SCANCODE_KP_3 }, - { XKB_KEY_KP_Left, SDL_SCANCODE_KP_4 }, - { XKB_KEY_KP_Begin, SDL_SCANCODE_KP_5 }, - { XKB_KEY_KP_Right, SDL_SCANCODE_KP_6 }, - { XKB_KEY_KP_Home, SDL_SCANCODE_KP_7 }, - { XKB_KEY_KP_Up, SDL_SCANCODE_KP_8 }, - { XKB_KEY_KP_Prior, SDL_SCANCODE_KP_9 }, - { XKB_KEY_KP_Insert, SDL_SCANCODE_KP_0 }, - { XKB_KEY_KP_Delete, SDL_SCANCODE_KP_PERIOD }, - { XKB_KEY_Execute, SDL_SCANCODE_EXECUTE }, - { XKB_KEY_Hyper_R, SDL_SCANCODE_APPLICATION }, - { XKB_KEY_ISO_Level3_Shift, SDL_SCANCODE_RALT }, - { XKB_KEY_Super_L, SDL_SCANCODE_LGUI }, - { XKB_KEY_Super_R, SDL_SCANCODE_RGUI }, - { XKB_KEY_Mode_switch, SDL_SCANCODE_MODE }, -#else - { XK_KP_End, SDL_SCANCODE_KP_1 }, - { XK_KP_Down, SDL_SCANCODE_KP_2 }, - { XK_KP_Next, SDL_SCANCODE_KP_3 }, - { XK_KP_Left, SDL_SCANCODE_KP_4 }, - { XK_KP_Begin, SDL_SCANCODE_KP_5 }, - { XK_KP_Right, SDL_SCANCODE_KP_6 }, - { XK_KP_Home, SDL_SCANCODE_KP_7 }, - { XK_KP_Up, SDL_SCANCODE_KP_8 }, - { XK_KP_Prior, SDL_SCANCODE_KP_9 }, - { XK_KP_Insert, SDL_SCANCODE_KP_0 }, - { XK_KP_Delete, SDL_SCANCODE_KP_PERIOD }, - { XK_Execute, SDL_SCANCODE_EXECUTE }, - { XK_Hyper_R, SDL_SCANCODE_APPLICATION }, - { XK_ISO_Level3_Shift, SDL_SCANCODE_RALT }, - { XK_Super_L, SDL_SCANCODE_LGUI }, - { XK_Super_R, SDL_SCANCODE_RGUI }, - { XK_Mode_switch, SDL_SCANCODE_MODE }, -#endif + { 0xFF9C, SDL_SCANCODE_KP_1 }, /* XK_KP_End */ + { 0xFF99, SDL_SCANCODE_KP_2 }, /* XK_KP_Down */ + { 0xFF9B, SDL_SCANCODE_KP_3 }, /* XK_KP_Next */ + { 0xFF96, SDL_SCANCODE_KP_4 }, /* XK_KP_Left */ + { 0xFF9D, SDL_SCANCODE_KP_5 }, /* XK_KP_Begin */ + { 0xFF98, SDL_SCANCODE_KP_6 }, /* XK_KP_Right */ + { 0xFF95, SDL_SCANCODE_KP_7 }, /* XK_KP_Home */ + { 0xFF97, SDL_SCANCODE_KP_8 }, /* XK_KP_Up */ + { 0xFF9A, SDL_SCANCODE_KP_9 }, /* XK_KP_Prior */ + { 0xFF9E, SDL_SCANCODE_KP_0 }, /* XK_KP_Insert */ + { 0xFF9F, SDL_SCANCODE_KP_PERIOD }, /* XK_KP_Delete */ + { 0xFF62, SDL_SCANCODE_EXECUTE }, /* XK_Execute */ + { 0xFFEE, SDL_SCANCODE_APPLICATION }, /* XK_Hyper_R */ + { 0xFE03, SDL_SCANCODE_RALT }, /* XK_ISO_Level3_Shift */ + { 0xFFEB, SDL_SCANCODE_LGUI }, /* XK_Super_L */ + { 0xFFEC, SDL_SCANCODE_RGUI }, /* XK_Super_R */ + { 0xFF7E, SDL_SCANCODE_MODE }, /* XK_Mode_switch */ { 0x1008FF65, SDL_SCANCODE_MENU }, /* XF86MenuKB */ { 0x1008FF81, SDL_SCANCODE_F13 }, /* XF86Tools */ { 0x1008FF45, SDL_SCANCODE_F14 }, /* XF86Launch5 */ @@ -90,7 +58,7 @@ static const struct { }; /* This is a mapping from X keysym to Linux keycode */ -static const SDL_xkb_keysym_t LinuxKeycodeKeysyms[] = { +static const Uint32 LinuxKeycodeKeysyms[] = { /* 0, 0x000 */ 0x0, /* NoSymbol */ /* 1, 0x001 */ 0xFF1B, /* Escape */ /* 2, 0x002 */ 0x31, /* 1 */ @@ -358,7 +326,7 @@ done #endif static const struct { - SDL_xkb_keysym_t keysym; + Uint32 keysym; int linux_keycode; } ExtendedLinuxKeycodeKeysyms[] = { { 0x1008FF2C, 0x0a2 }, /* XF86XK_Eject */ From 1d7966df150eac7e5bfc98c84d5ce0327f33dccc Mon Sep 17 00:00:00 2001 From: Sylvain Date: Wed, 16 Nov 2022 21:27:16 +0100 Subject: [PATCH 068/153] Remove un-needed check for NULL pointer. They were previously checked just before. --- src/core/linux/SDL_ibus.c | 6 ++---- src/power/linux/SDL_syspower.c | 4 +--- src/render/SDL_render.c | 2 +- src/video/SDL_video.c | 5 ++--- src/video/kmsdrm/SDL_kmsdrmvideo.c | 4 ++-- 5 files changed, 8 insertions(+), 13 deletions(-) diff --git a/src/core/linux/SDL_ibus.c b/src/core/linux/SDL_ibus.c index 8b74f575a3..b4fe231544 100644 --- a/src/core/linux/SDL_ibus.c +++ b/src/core/linux/SDL_ibus.c @@ -549,10 +549,8 @@ SDL_IBus_Init(void) inotify_wd = inotify_add_watch(inotify_fd, addr_file, IN_CREATE | IN_MODIFY); SDL_free(addr_file); - if (addr) { - result = IBus_SetupConnection(dbus, addr); - SDL_free(addr); - } + result = IBus_SetupConnection(dbus, addr); + SDL_free(addr); } return result; diff --git a/src/power/linux/SDL_syspower.c b/src/power/linux/SDL_syspower.c index f4e1ecc3da..c33ab5c944 100644 --- a/src/power/linux/SDL_syspower.c +++ b/src/power/linux/SDL_syspower.c @@ -648,9 +648,7 @@ SDL_GetPowerInfo_Linux_org_freedesktop_upower(SDL_PowerState *state, int *second check_upower_device(dbus->system_conn, paths[i], state, seconds, percent); } - if (dbus) { - dbus->free_string_array(paths); - } + dbus->free_string_array(paths); #endif /* SDL_USE_LIBDBUS */ return retval; diff --git a/src/render/SDL_render.c b/src/render/SDL_render.c index 722147c3e2..5f821b33e9 100644 --- a/src/render/SDL_render.c +++ b/src/render/SDL_render.c @@ -1078,7 +1078,7 @@ SDL_CreateRenderer(SDL_Window * window, int index, Uint32 flags) /* new textures start at zero, so we start at 1 so first render doesn't flush by accident. */ renderer->render_command_generation = 1; - if (window && renderer->GetOutputSize) { + if (renderer->GetOutputSize) { int window_w, window_h; int output_w, output_h; if (renderer->GetOutputSize(renderer, &output_w, &output_h) == 0) { diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c index 1ac9165ade..45965e32d2 100644 --- a/src/video/SDL_video.c +++ b/src/video/SDL_video.c @@ -1302,9 +1302,8 @@ SDL_GetWindowDisplayMode(SDL_Window * window, SDL_DisplayMode * mode) return SDL_SetError("Couldn't find display mode match"); } - if (mode) { - *mode = fullscreen_mode; - } + *mode = fullscreen_mode; + return 0; } diff --git a/src/video/kmsdrm/SDL_kmsdrmvideo.c b/src/video/kmsdrm/SDL_kmsdrmvideo.c index 4293e46e2b..eae7214551 100644 --- a/src/video/kmsdrm/SDL_kmsdrmvideo.c +++ b/src/video/kmsdrm/SDL_kmsdrmvideo.c @@ -308,8 +308,8 @@ KMSDRM_CreateDevice(void) return device; cleanup: - if (device) - SDL_free(device); + SDL_free(device); + if (viddata) SDL_free(viddata); return NULL; From ce5da5d579dd4a27dd7eb19ce4edb07d49bc058f Mon Sep 17 00:00:00 2001 From: Sylvain Date: Wed, 16 Nov 2022 21:47:43 +0100 Subject: [PATCH 069/153] Don't compare pointer against '0', but NULL --- Xcode-iOS/Demos/src/accelerometer.c | 4 ++-- Xcode-iOS/Demos/src/happy.c | 2 +- Xcode-iOS/Demos/src/keyboard.c | 2 +- Xcode-iOS/Demos/src/rectangles.c | 2 +- Xcode-iOS/Demos/src/touch.c | 2 +- src/audio/arts/SDL_artsaudio.c | 2 +- src/render/ps2/SDL_render_ps2.c | 4 ++-- src/render/psp/SDL_render_psp.c | 4 ++-- src/render/vitagxm/SDL_render_vita_gxm.c | 6 +++--- src/stdlib/SDL_qsort.c | 6 +++--- src/video/os2/SDL_os2dive.c | 2 +- src/video/x11/SDL_x11events.c | 2 +- src/video/x11/SDL_x11window.c | 2 +- test/testautomation_render.c | 2 +- 14 files changed, 21 insertions(+), 21 deletions(-) diff --git a/Xcode-iOS/Demos/src/accelerometer.c b/Xcode-iOS/Demos/src/accelerometer.c index 925aee4e3b..0af153676b 100644 --- a/Xcode-iOS/Demos/src/accelerometer.c +++ b/Xcode-iOS/Demos/src/accelerometer.c @@ -127,7 +127,7 @@ initializeTextures(SDL_Renderer *renderer) /* create ship texture from surface */ ship = SDL_CreateTextureFromSurface(renderer, bmp_surface); - if (ship == 0) { + if (!ship) { fatalError("could not create ship texture"); } SDL_SetTextureBlendMode(ship, SDL_BLENDMODE_BLEND); @@ -145,7 +145,7 @@ initializeTextures(SDL_Renderer *renderer) } /* create space texture from surface */ space = SDL_CreateTextureFromSurface(renderer, bmp_surface); - if (space == 0) { + if (!space) { fatalError("could not create space texture"); } SDL_FreeSurface(bmp_surface); diff --git a/Xcode-iOS/Demos/src/happy.c b/Xcode-iOS/Demos/src/happy.c index 658a65f01b..73d4d4feb3 100644 --- a/Xcode-iOS/Demos/src/happy.c +++ b/Xcode-iOS/Demos/src/happy.c @@ -117,7 +117,7 @@ initializeTexture(SDL_Renderer *renderer) /* convert RGBA surface to texture */ texture = SDL_CreateTextureFromSurface(renderer, bmp_surface); - if (texture == 0) { + if (!texture) { fatalError("could not create texture"); } SDL_SetTextureBlendMode(texture, SDL_BLENDMODE_BLEND); diff --git a/Xcode-iOS/Demos/src/keyboard.c b/Xcode-iOS/Demos/src/keyboard.c index cfbe4e66b4..4d630bae5f 100644 --- a/Xcode-iOS/Demos/src/keyboard.c +++ b/Xcode-iOS/Demos/src/keyboard.c @@ -183,7 +183,7 @@ loadFont(void) SDL_BlitSurface(surface, NULL, converted, NULL); /* create our texture */ texture = SDL_CreateTextureFromSurface(renderer, converted); - if (texture == 0) { + if (!texture) { printf("texture creation failed: %s\n", SDL_GetError()); } else { /* set blend mode for our texture */ diff --git a/Xcode-iOS/Demos/src/rectangles.c b/Xcode-iOS/Demos/src/rectangles.c index 10f9f851b3..a08f997906 100644 --- a/Xcode-iOS/Demos/src/rectangles.c +++ b/Xcode-iOS/Demos/src/rectangles.c @@ -58,7 +58,7 @@ main(int argc, char *argv[]) /* create window and renderer */ window = SDL_CreateWindow(NULL, 0, 0, 320, 480, SDL_WINDOW_ALLOW_HIGHDPI); - if (window == 0) { + if (!window) { fatalError("Could not initialize Window"); } renderer = SDL_CreateRenderer(window, -1, 0); diff --git a/Xcode-iOS/Demos/src/touch.c b/Xcode-iOS/Demos/src/touch.c index 918240b820..6c184630da 100644 --- a/Xcode-iOS/Demos/src/touch.c +++ b/Xcode-iOS/Demos/src/touch.c @@ -63,7 +63,7 @@ initializeTexture(SDL_Renderer *renderer) brush = SDL_CreateTextureFromSurface(renderer, bmp_surface); SDL_FreeSurface(bmp_surface); - if (brush == 0) { + if (!brush) { fatalError("could not create brush texture"); } /* additive blending -- laying strokes on top of eachother makes them brighter */ diff --git a/src/audio/arts/SDL_artsaudio.c b/src/audio/arts/SDL_artsaudio.c index ce74b7d4d2..82d84e320d 100644 --- a/src/audio/arts/SDL_artsaudio.c +++ b/src/audio/arts/SDL_artsaudio.c @@ -318,7 +318,7 @@ ARTS_Init(SDL_AudioDriverImpl * impl) if (LoadARTSLibrary() < 0) { return SDL_FALSE; } else { - if (SDL_NAME(arts_init) () != 0) { + if (SDL_NAME(arts_init) () != NULL) { UnloadARTSLibrary(); SDL_SetError("ARTS: arts_init failed (no audio server?)"); return SDL_FALSE; diff --git a/src/render/ps2/SDL_render_ps2.c b/src/render/ps2/SDL_render_ps2.c index 54ace06f3d..f385f53543 100644 --- a/src/render/ps2/SDL_render_ps2.c +++ b/src/render/ps2/SDL_render_ps2.c @@ -546,10 +546,10 @@ PS2_DestroyTexture(SDL_Renderer * renderer, SDL_Texture * texture) GSTEXTURE *ps2_texture = (GSTEXTURE *) texture->driverdata; PS2_RenderData *data = (PS2_RenderData *)renderer->driverdata; - if (data == 0) + if (data == NULL) return; - if(ps2_texture == 0) + if(ps2_texture == NULL) return; // Free from vram diff --git a/src/render/psp/SDL_render_psp.c b/src/render/psp/SDL_render_psp.c index 6644230ec2..9a4e5c7bbd 100644 --- a/src/render/psp/SDL_render_psp.c +++ b/src/render/psp/SDL_render_psp.c @@ -1280,10 +1280,10 @@ PSP_DestroyTexture(SDL_Renderer * renderer, SDL_Texture * texture) PSP_RenderData *renderdata = (PSP_RenderData *) renderer->driverdata; PSP_TextureData *psp_texture = (PSP_TextureData *) texture->driverdata; - if (renderdata == 0) + if (renderdata == NULL) return; - if(psp_texture == 0) + if(psp_texture == NULL) return; LRUTargetRemove(renderdata, psp_texture); diff --git a/src/render/vitagxm/SDL_render_vita_gxm.c b/src/render/vitagxm/SDL_render_vita_gxm.c index 55ffe0cde0..1391b19a4d 100644 --- a/src/render/vitagxm/SDL_render_vita_gxm.c +++ b/src/render/vitagxm/SDL_render_vita_gxm.c @@ -1236,13 +1236,13 @@ VITA_GXM_DestroyTexture(SDL_Renderer *renderer, SDL_Texture *texture) VITA_GXM_RenderData *data = (VITA_GXM_RenderData *) renderer->driverdata; VITA_GXM_TextureData *vita_texture = (VITA_GXM_TextureData *) texture->driverdata; - if (data == 0) + if (data == NULL) return; - if(vita_texture == 0) + if(vita_texture == NULL) return; - if(vita_texture->tex == 0) + if(vita_texture->tex == NULL) return; sceGxmFinish(data->gxm_context); diff --git a/src/stdlib/SDL_qsort.c b/src/stdlib/SDL_qsort.c index 26e97c908b..b0f92fde86 100644 --- a/src/stdlib/SDL_qsort.c +++ b/src/stdlib/SDL_qsort.c @@ -414,7 +414,7 @@ static void qsort_nonaligned(void *base, size_t nmemb, size_t size, char *first,*last; char *pivot=malloc(size); size_t trunc=TRUNC_nonaligned*size; - assert(pivot!=0); + assert(pivot); first=(char*)base; last=first+(nmemb-1)*size; @@ -445,7 +445,7 @@ static void qsort_aligned(void *base, size_t nmemb, size_t size, char *first,*last; char *pivot=malloc(size); size_t trunc=TRUNC_aligned*size; - assert(pivot!=0); + assert(pivot); first=(char*)base; last=first+(nmemb-1)*size; @@ -475,7 +475,7 @@ static void qsort_words(void *base, size_t nmemb, int stacktop=0; char *first,*last; char *pivot=malloc(WORD_BYTES); - assert(pivot!=0); + assert(pivot); first=(char*)base; last=first+(nmemb-1)*WORD_BYTES; diff --git a/src/video/os2/SDL_os2dive.c b/src/video/os2/SDL_os2dive.c index 95aae6f05c..56cfde1b3b 100644 --- a/src/video/os2/SDL_os2dive.c +++ b/src/video/os2/SDL_os2dive.c @@ -296,7 +296,7 @@ static BOOL voUpdate(PVODATA pVOData, HWND hwnd, SDL_Rect *pSDLRects, return FALSE; } - if (pSDLRects != 0) { + if (pSDLRects != NULL) { PBYTE pbLineMask; pbLineMask = SDL_stack_alloc(BYTE, pVOData->ulHeight); diff --git a/src/video/x11/SDL_x11events.c b/src/video/x11/SDL_x11events.c index 38e1a79658..6b6b834b40 100644 --- a/src/video/x11/SDL_x11events.c +++ b/src/video/x11/SDL_x11events.c @@ -100,7 +100,7 @@ static void X11_ReadProperty(SDL_x11Prop *p, Display *disp, Window w, Atom prop) int bytes_fetch = 0; do { - if (ret != 0) X11_XFree(ret); + if (ret != NULL) X11_XFree(ret); X11_XGetWindowProperty(disp, w, prop, 0, bytes_fetch, False, AnyPropertyType, &type, &fmt, &count, &bytes_left, &ret); bytes_fetch += bytes_left; } while (bytes_left != 0); diff --git a/src/video/x11/SDL_x11window.c b/src/video/x11/SDL_x11window.c index 9b007e79d7..6d4e53f20d 100644 --- a/src/video/x11/SDL_x11window.c +++ b/src/video/x11/SDL_x11window.c @@ -1562,7 +1562,7 @@ static void X11_ReadProperty(SDL_x11Prop *p, Display *disp, Window w, Atom prop) int bytes_fetch = 0; do { - if (ret != 0) X11_XFree(ret); + if (ret != NULL) X11_XFree(ret); X11_XGetWindowProperty(disp, w, prop, 0, bytes_fetch, False, AnyPropertyType, &type, &fmt, &count, &bytes_left, &ret); bytes_fetch += bytes_left; } while (bytes_left != 0); diff --git a/test/testautomation_render.c b/test/testautomation_render.c index 0117334a25..50142f26bd 100644 --- a/test/testautomation_render.c +++ b/test/testautomation_render.c @@ -53,7 +53,7 @@ void InitCreateRenderer(void *arg) renderer = SDL_CreateRenderer(window, -1, SDL_RENDERER_ACCELERATED); SDLTest_AssertPass("SDL_CreateRenderer()"); - SDLTest_AssertCheck(renderer != 0, "Check SDL_CreateRenderer result"); + SDLTest_AssertCheck(renderer, "Check SDL_CreateRenderer result"); if (renderer == NULL) { SDL_DestroyWindow(window); return; From 4192d1a1c71dc70f9ebc69d3280253437ccefbde Mon Sep 17 00:00:00 2001 From: Sylvain Date: Wed, 16 Nov 2022 21:56:19 +0100 Subject: [PATCH 070/153] Fix compilation. It needs to be casted to 'int' type --- test/testautomation_render.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/testautomation_render.c b/test/testautomation_render.c index 50142f26bd..0117334a25 100644 --- a/test/testautomation_render.c +++ b/test/testautomation_render.c @@ -53,7 +53,7 @@ void InitCreateRenderer(void *arg) renderer = SDL_CreateRenderer(window, -1, SDL_RENDERER_ACCELERATED); SDLTest_AssertPass("SDL_CreateRenderer()"); - SDLTest_AssertCheck(renderer, "Check SDL_CreateRenderer result"); + SDLTest_AssertCheck(renderer != 0, "Check SDL_CreateRenderer result"); if (renderer == NULL) { SDL_DestroyWindow(window); return; From fcc994e132a9fa83eb0e2cd385d7fd98a25f0dd8 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Wed, 16 Nov 2022 17:39:55 -0800 Subject: [PATCH 071/153] ensure that SDL2 does not set conflicting window flags (thanks @pionere!) --- src/video/SDL_video.c | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c index 45965e32d2..18b7bfc587 100644 --- a/src/video/SDL_video.c +++ b/src/video/SDL_video.c @@ -202,6 +202,22 @@ typedef struct { } SDL_WindowTextureData; +static Uint32 +SDL_DefaultGraphicsBackends(SDL_VideoDevice *_this) +{ +#if (SDL_VIDEO_OPENGL && __MACOSX__) || (__IPHONEOS__ && !TARGET_OS_MACCATALYST) || __ANDROID__ || __NACL__ + if (_this->GL_CreateContext != NULL) { + return SDL_WINDOW_OPENGL; + } +#endif +#if SDL_VIDEO_METAL && (TARGET_OS_MACCATALYST || __MACOSX__ || __IPHONEOS__) + if (_this->Metal_CreateView != NULL) { + return SDL_WINDOW_METAL; + } +#endif + return 0; +} + static int SDL_CreateWindowTexture(SDL_VideoDevice *_this, SDL_Window * window, Uint32 * format, void ** pixels, int *pitch) { @@ -1635,16 +1651,7 @@ SDL_CreateWindow(const char *title, int x, int y, int w, int h, Uint32 flags) /* Some platforms have certain graphics backends enabled by default */ if (!graphics_flags && !SDL_IsVideoContextExternal()) { -#if (SDL_VIDEO_OPENGL && __MACOSX__) || (__IPHONEOS__ && !TARGET_OS_MACCATALYST) || __ANDROID__ || __NACL__ - if (_this->GL_CreateContext != NULL) { - flags |= SDL_WINDOW_OPENGL; - } -#endif -#if SDL_VIDEO_METAL && (TARGET_OS_MACCATALYST || __MACOSX__ || __IPHONEOS__) - if (_this->Metal_CreateView != NULL) { - flags |= SDL_WINDOW_METAL; - } -#endif + flags |= SDL_DefaultGraphicsBackends(_this); } if (flags & SDL_WINDOW_OPENGL) { From 913e403f2aa5a23beee878b6b13f7603b884c18a Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Wed, 16 Nov 2022 18:03:29 -0800 Subject: [PATCH 072/153] Fixed error message when trying to create an OpenGLES2 renderer on macOS Testing: testsprite2 --renderer opengles2 OpenGLES2 isn't available by default, and we want to see the error "Could not load EGL library" --- src/video/cocoa/SDL_cocoawindow.m | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/video/cocoa/SDL_cocoawindow.m b/src/video/cocoa/SDL_cocoawindow.m index ddf2fc9f55..c738276568 100644 --- a/src/video/cocoa/SDL_cocoawindow.m +++ b/src/video/cocoa/SDL_cocoawindow.m @@ -2274,7 +2274,9 @@ Cocoa_GetWindowDisplayIndex(_THIS, SDL_Window * window) /* Not recognized via CHECK_WINDOW_MAGIC */ if (data == nil) { - return SDL_SetError("Window data not set"); + /* Don't set the error here, it hides other errors and is ignored anyway */ + /*return SDL_SetError("Window data not set");*/ + return -1; } /* NSWindow.screen may be nil when the window is off-screen. */ From bb0b8adacc7a082d1a530f9ac912771cb1c09a97 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Wed, 16 Nov 2022 22:02:21 -0500 Subject: [PATCH 073/153] mac: Fix handling of deprecated symbol. This needs to check what our deployment target is, not what SDK is available, since this is a linker symbol and not an enum value or whatever. Also removed a copy/paste error that mentioned CoreAudio in the haptic subsystem. Fixes #6534. --- src/haptic/darwin/SDL_syshaptic_c.h | 4 +--- src/hidapi/SDL_hidapi.c | 7 ++++++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/haptic/darwin/SDL_syshaptic_c.h b/src/haptic/darwin/SDL_syshaptic_c.h index 5f68a6d630..8e3a6ca95f 100644 --- a/src/haptic/darwin/SDL_syshaptic_c.h +++ b/src/haptic/darwin/SDL_syshaptic_c.h @@ -20,12 +20,10 @@ */ /* Things named "Master" were renamed to "Main" in macOS 12.0's SDK. */ -#if MACOSX_COREAUDIO #include -#ifndef MAC_OS_VERSION_12_0 +#if MAC_OS_X_VERSION_MIN_REQUIRED < 120000 #define kIOMainPortDefault kIOMasterPortDefault #endif -#endif extern int MacHaptic_MaybeAddDevice( io_object_t device ); extern int MacHaptic_MaybeRemoveDevice( io_object_t device ); diff --git a/src/hidapi/SDL_hidapi.c b/src/hidapi/SDL_hidapi.c index 52ee670271..47818d4dcb 100644 --- a/src/hidapi/SDL_hidapi.c +++ b/src/hidapi/SDL_hidapi.c @@ -47,6 +47,11 @@ #include #include #include +#include +/* Things named "Master" were renamed to "Main" in macOS 12.0's SDK. */ +#if MAC_OS_X_VERSION_MIN_REQUIRED < 120000 +#define kIOMainPortDefault kIOMasterPortDefault +#endif #endif #include "../core/linux/SDL_udev.h" @@ -250,7 +255,7 @@ HIDAPI_InitializeDiscovery() #endif /* defined(__WIN32__) || defined(__WINGDK__) */ #if defined(__MACOSX__) - SDL_HIDAPI_discovery.m_notificationPort = IONotificationPortCreate(kIOMasterPortDefault); + SDL_HIDAPI_discovery.m_notificationPort = IONotificationPortCreate(kIOMainPortDefault); if (SDL_HIDAPI_discovery.m_notificationPort) { { io_iterator_t portIterator = 0; From a1702d463ce85d064ea679272b5a02c0a9304a3a Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Wed, 16 Nov 2022 23:39:41 -0500 Subject: [PATCH 074/153] ibus: Try to use org.freedesktop.portal.IBus first if available. This should fix apps that want ibus support inside sandboxed environments like FlatPak or Snaps. Fixes #4706. --- src/core/linux/SDL_ibus.c | 111 +++++++++++++++++++++++++++----------- 1 file changed, 81 insertions(+), 30 deletions(-) diff --git a/src/core/linux/SDL_ibus.c b/src/core/linux/SDL_ibus.c index b4fe231544..94f7aa626d 100644 --- a/src/core/linux/SDL_ibus.c +++ b/src/core/linux/SDL_ibus.c @@ -37,17 +37,27 @@ #include #include -static const char IBUS_SERVICE[] = "org.freedesktop.IBus"; static const char IBUS_PATH[] = "/org/freedesktop/IBus"; + +static const char IBUS_SERVICE[] = "org.freedesktop.IBus"; static const char IBUS_INTERFACE[] = "org.freedesktop.IBus"; static const char IBUS_INPUT_INTERFACE[] = "org.freedesktop.IBus.InputContext"; +static const char IBUS_PORTAL_SERVICE[] = "org.freedesktop.portal.IBus"; +static const char IBUS_PORTAL_INTERFACE[] = "org.freedesktop.IBus.Portal"; +static const char IBUS_PORTAL_INPUT_INTERFACE[] = "org.freedesktop.IBus.InputContext"; + +static const char *ibus_service = NULL; +static const char *ibus_interface = NULL; +static const char *ibus_input_interface = NULL; static char *input_ctx_path = NULL; static SDL_Rect ibus_cursor_rect = { 0, 0, 0, 0 }; static DBusConnection *ibus_conn = NULL; +static SDL_bool ibus_is_portal_interface = SDL_FALSE; static char *ibus_addr_file = NULL; static int inotify_fd = -1, inotify_wd = -1; + static Uint32 IBus_ModState(void) { @@ -202,7 +212,7 @@ IBus_MessageHandler(DBusConnection *conn, DBusMessage *msg, void *user_data) { SDL_DBusContext *dbus = (SDL_DBusContext *)user_data; - if (dbus->message_is_signal(msg, IBUS_INPUT_INTERFACE, "CommitText")) { + if (dbus->message_is_signal(msg, ibus_input_interface, "CommitText")) { DBusMessageIter iter; const char *text; @@ -224,7 +234,7 @@ IBus_MessageHandler(DBusConnection *conn, DBusMessage *msg, void *user_data) return DBUS_HANDLER_RESULT_HANDLED; } - if (dbus->message_is_signal(msg, IBUS_INPUT_INTERFACE, "UpdatePreeditText")) { + if (dbus->message_is_signal(msg, ibus_input_interface, "UpdatePreeditText")) { DBusMessageIter iter; const char *text; @@ -273,7 +283,7 @@ IBus_MessageHandler(DBusConnection *conn, DBusMessage *msg, void *user_data) return DBUS_HANDLER_RESULT_HANDLED; } - if (dbus->message_is_signal(msg, IBUS_INPUT_INTERFACE, "HidePreeditText")) { + if (dbus->message_is_signal(msg, ibus_input_interface, "HidePreeditText")) { SDL_SendEditingText("", 0, 0); return DBUS_HANDLER_RESULT_HANDLED; } @@ -415,7 +425,7 @@ IBus_SetCapabilities(void *data, const char *name, const char *old_val, caps |= IBUS_CAP_PREEDIT_TEXT; } - SDL_DBus_CallVoidMethodOnConnection(ibus_conn, IBUS_SERVICE, input_ctx_path, IBUS_INPUT_INTERFACE, "SetCapabilities", + SDL_DBus_CallVoidMethodOnConnection(ibus_conn, ibus_service, input_ctx_path, ibus_input_interface, "SetCapabilities", DBUS_TYPE_UINT32, &caps, DBUS_TYPE_INVALID); } } @@ -428,36 +438,56 @@ IBus_SetupConnection(SDL_DBusContext *dbus, const char* addr) const char *path = NULL; SDL_bool result = SDL_FALSE; DBusObjectPathVTable ibus_vtable; - + SDL_zero(ibus_vtable); ibus_vtable.message_function = &IBus_MessageHandler; - ibus_conn = dbus->connection_open_private(addr, NULL); + /* try the portal interface first. Modern systems have this in general, + and sandbox things like FlakPak and Snaps, etc, require it. */ - if (!ibus_conn) { - return SDL_FALSE; + ibus_is_portal_interface = SDL_TRUE; + ibus_service = IBUS_PORTAL_SERVICE; + ibus_interface = IBUS_PORTAL_INTERFACE; + ibus_input_interface = IBUS_PORTAL_INPUT_INTERFACE; + ibus_conn = dbus->session_conn; + + result = SDL_DBus_CallMethodOnConnection(ibus_conn, ibus_service, IBUS_PATH, ibus_interface, "CreateInputContext", + DBUS_TYPE_STRING, &client_name, DBUS_TYPE_INVALID, + DBUS_TYPE_OBJECT_PATH, &path, DBUS_TYPE_INVALID); + if (!result) { + ibus_is_portal_interface = SDL_FALSE; + ibus_service = IBUS_SERVICE; + ibus_interface = IBUS_INTERFACE; + ibus_input_interface = IBUS_INPUT_INTERFACE; + ibus_conn = dbus->connection_open_private(addr, NULL); + + if (!ibus_conn) { + return SDL_FALSE; /* oh well. */ + } + + dbus->connection_flush(ibus_conn); + + if (!dbus->bus_register(ibus_conn, NULL)) { + ibus_conn = NULL; + return SDL_FALSE; + } + + dbus->connection_flush(ibus_conn); + + result = SDL_DBus_CallMethodOnConnection(ibus_conn, ibus_service, IBUS_PATH, ibus_interface, "CreateInputContext", + DBUS_TYPE_STRING, &client_name, DBUS_TYPE_INVALID, + DBUS_TYPE_OBJECT_PATH, &path, DBUS_TYPE_INVALID); } - dbus->connection_flush(ibus_conn); - - if (!dbus->bus_register(ibus_conn, NULL)) { - ibus_conn = NULL; - return SDL_FALSE; - } - - dbus->connection_flush(ibus_conn); - - if (SDL_DBus_CallMethodOnConnection(ibus_conn, IBUS_SERVICE, IBUS_PATH, IBUS_INTERFACE, "CreateInputContext", - DBUS_TYPE_STRING, &client_name, DBUS_TYPE_INVALID, - DBUS_TYPE_OBJECT_PATH, &path, DBUS_TYPE_INVALID)) { + if (result) { + char matchstr[128]; + SDL_snprintf(matchstr, sizeof (matchstr), "type='signal',interface='%s'", ibus_input_interface); SDL_free(input_ctx_path); input_ctx_path = SDL_strdup(path); SDL_AddHintCallback(SDL_HINT_IME_INTERNAL_EDITING, IBus_SetCapabilities, NULL); - - dbus->bus_add_match(ibus_conn, "type='signal',interface='org.freedesktop.IBus.InputContext'", NULL); + dbus->bus_add_match(ibus_conn, matchstr, NULL); dbus->connection_try_register_object_path(ibus_conn, input_ctx_path, &ibus_vtable, dbus, NULL); dbus->connection_flush(ibus_conn); - result = SDL_TRUE; } SDL_IBus_SetFocus(SDL_GetKeyboardFocus() != NULL); @@ -551,6 +581,18 @@ SDL_IBus_Init(void) result = IBus_SetupConnection(dbus, addr); SDL_free(addr); + + /* don't use the addr_file if using the portal interface. */ + if (result && ibus_is_portal_interface) { + if (inotify_fd > 0) { + if (inotify_wd > 0) { + inotify_rm_watch(inotify_fd, inotify_wd); + inotify_wd = -1; + } + close(inotify_fd); + inotify_fd = -1; + } + } } return result; @@ -573,16 +615,25 @@ SDL_IBus_Quit(void) dbus = SDL_DBus_GetContext(); - if (dbus && ibus_conn) { + /* if using portal, ibus_conn == session_conn; don't release it here. */ + if (dbus && ibus_conn && !ibus_is_portal_interface) { dbus->connection_close(ibus_conn); dbus->connection_unref(ibus_conn); } - + + ibus_conn = NULL; + ibus_service = NULL; + ibus_interface = NULL; + ibus_input_interface = NULL; + ibus_is_portal_interface = SDL_FALSE; + if (inotify_fd > 0 && inotify_wd > 0) { inotify_rm_watch(inotify_fd, inotify_wd); inotify_wd = -1; } - + + /* !!! FIXME: should we close(inotify_fd) here? */ + SDL_DelHintCallback(SDL_HINT_IME_INTERNAL_EDITING, IBus_SetCapabilities, NULL); SDL_memset(&ibus_cursor_rect, 0, sizeof(ibus_cursor_rect)); @@ -594,7 +645,7 @@ IBus_SimpleMessage(const char *method) SDL_DBusContext *dbus = SDL_DBus_GetContext(); if ((input_ctx_path != NULL) && (IBus_CheckConnection(dbus))) { - SDL_DBus_CallVoidMethodOnConnection(ibus_conn, IBUS_SERVICE, input_ctx_path, IBUS_INPUT_INTERFACE, method, DBUS_TYPE_INVALID); + SDL_DBus_CallVoidMethodOnConnection(ibus_conn, ibus_service, input_ctx_path, ibus_input_interface, method, DBUS_TYPE_INVALID); } } @@ -624,7 +675,7 @@ SDL_IBus_ProcessKeyEvent(Uint32 keysym, Uint32 keycode, Uint8 state) if (state == SDL_RELEASED) { mods |= (1 << 30); // IBUS_RELEASE_MASK } - if (!SDL_DBus_CallMethodOnConnection(ibus_conn, IBUS_SERVICE, input_ctx_path, IBUS_INPUT_INTERFACE, "ProcessKeyEvent", + if (!SDL_DBus_CallMethodOnConnection(ibus_conn, ibus_service, input_ctx_path, ibus_input_interface, "ProcessKeyEvent", DBUS_TYPE_UINT32, &keysym, DBUS_TYPE_UINT32, &ibus_keycode, DBUS_TYPE_UINT32, &mods, DBUS_TYPE_INVALID, DBUS_TYPE_BOOLEAN, &result, DBUS_TYPE_INVALID)) { result = 0; @@ -679,7 +730,7 @@ SDL_IBus_UpdateTextRect(const SDL_Rect *rect) dbus = SDL_DBus_GetContext(); if (IBus_CheckConnection(dbus)) { - SDL_DBus_CallVoidMethodOnConnection(ibus_conn, IBUS_SERVICE, input_ctx_path, IBUS_INPUT_INTERFACE, "SetCursorLocation", + SDL_DBus_CallVoidMethodOnConnection(ibus_conn, ibus_service, input_ctx_path, ibus_input_interface, "SetCursorLocation", DBUS_TYPE_INT32, &x, DBUS_TYPE_INT32, &y, DBUS_TYPE_INT32, &ibus_cursor_rect.w, DBUS_TYPE_INT32, &ibus_cursor_rect.h, DBUS_TYPE_INVALID); } } From 77bcd269beccdd281789673313c4bb677e70bb12 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Wed, 16 Nov 2022 22:23:16 -0800 Subject: [PATCH 075/153] Allow creating an empty surface with pitch 0 This fixes Maelstrom, which creates an empty staging surface and then uses it for transfer to texture --- src/video/SDL_surface.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/video/SDL_surface.c b/src/video/SDL_surface.c index f3ee6a4c41..5930e40551 100644 --- a/src/video/SDL_surface.c +++ b/src/video/SDL_surface.c @@ -230,7 +230,7 @@ SDL_CreateRGBSurfaceFrom(void *pixels, minimalPitch = SDL_CalculatePitch(format, width, SDL_TRUE); - if (pitch < 0 || ((size_t) pitch) < minimalPitch) { + if (pitch < 0 || (pitch > 0 && ((size_t) pitch) < minimalPitch)) { SDL_InvalidParamError("pitch"); return NULL; } @@ -272,7 +272,7 @@ SDL_CreateRGBSurfaceWithFormatFrom(void *pixels, minimalPitch = SDL_CalculatePitch(format, width, SDL_TRUE); - if (pitch < 0 || ((size_t) pitch) < minimalPitch) { + if (pitch < 0 || (pitch > 0 && ((size_t) pitch) < minimalPitch)) { SDL_InvalidParamError("pitch"); return NULL; } From b7358e47d57f921e09d1db55371b3111ee2b7bff Mon Sep 17 00:00:00 2001 From: Sylvain Date: Thu, 17 Nov 2022 09:18:49 +0100 Subject: [PATCH 076/153] Don't compare pointer against '0', but NULL --- test/testautomation_render.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/testautomation_render.c b/test/testautomation_render.c index 0117334a25..52da1bfe1e 100644 --- a/test/testautomation_render.c +++ b/test/testautomation_render.c @@ -53,7 +53,7 @@ void InitCreateRenderer(void *arg) renderer = SDL_CreateRenderer(window, -1, SDL_RENDERER_ACCELERATED); SDLTest_AssertPass("SDL_CreateRenderer()"); - SDLTest_AssertCheck(renderer != 0, "Check SDL_CreateRenderer result"); + SDLTest_AssertCheck(renderer != NULL, "Check SDL_CreateRenderer result"); if (renderer == NULL) { SDL_DestroyWindow(window); return; From 60c6cd554d910b997150c63b2e626ed9c4e40d00 Mon Sep 17 00:00:00 2001 From: Sylvain Date: Thu, 17 Nov 2022 09:34:27 +0100 Subject: [PATCH 077/153] Fixed bug #6533 - PS2_JoystickUpdate: some invalid condition --- src/joystick/ps2/SDL_sysjoystick.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/joystick/ps2/SDL_sysjoystick.c b/src/joystick/ps2/SDL_sysjoystick.c index c43a1ef107..3847d79c59 100644 --- a/src/joystick/ps2/SDL_sysjoystick.c +++ b/src/joystick/ps2/SDL_sysjoystick.c @@ -275,7 +275,7 @@ static void PS2_JoystickUpdate(SDL_Joystick *joystick) struct JoyInfo *info = &joyInfo[index]; int state = padGetState(info->port, info->slot); - if (state != PAD_STATE_DISCONN || state != PAD_STATE_EXECCMD || state != PAD_STATE_ERROR) { + if (state != PAD_STATE_DISCONN && state != PAD_STATE_EXECCMD && state != PAD_STATE_ERROR) { int ret = padRead(info->port, info->slot, &buttons); /* port, slot, buttons */ if (ret != 0) { /* Buttons */ From ddad901c0ddd107757353a0ffe097d3af7118ca1 Mon Sep 17 00:00:00 2001 From: Sylvain Date: Thu, 17 Nov 2022 10:43:45 +0100 Subject: [PATCH 078/153] Remove unneeded semicolon --- src/events/SDL_events.c | 4 ++-- src/hidapi/libusb/hid.c | 2 +- src/hidapi/linux/hid.c | 2 +- src/main/ps2/SDL_ps2_main.c | 6 ++++-- src/render/software/SDL_triangle.c | 4 ++-- src/video/SDL_video.c | 2 +- src/video/windows/SDL_windowskeyboard.c | 1 - src/video/x11/edid-parse.c | 2 +- test/testrelative.c | 2 +- visualtest/src/windows/windows_screenshot.c | 2 +- 10 files changed, 14 insertions(+), 13 deletions(-) diff --git a/src/events/SDL_events.c b/src/events/SDL_events.c index 9ba5e44b88..493ae76651 100644 --- a/src/events/SDL_events.c +++ b/src/events/SDL_events.c @@ -406,7 +406,7 @@ SDL_LogEvent(const SDL_Event *event) SDL_snprintf(details, sizeof (details), " (timestamp=%u touchid=%"SDL_PRIs64" gestureid=%"SDL_PRIs64" numfingers=%u error=%f x=%f y=%f)", \ (uint) event->dgesture.timestamp, (long long)event->dgesture.touchId, \ (long long)event->dgesture.gestureId, (uint) event->dgesture.numFingers, \ - event->dgesture.error, event->dgesture.x, event->dgesture.y); + event->dgesture.error, event->dgesture.x, event->dgesture.y) SDL_EVENT_CASE(SDL_DOLLARGESTURE) PRINT_DOLLAR_EVENT(event); break; SDL_EVENT_CASE(SDL_DOLLARRECORD) PRINT_DOLLAR_EVENT(event); break; #undef PRINT_DOLLAR_EVENT @@ -425,7 +425,7 @@ SDL_LogEvent(const SDL_Event *event) SDL_EVENT_CASE(SDL_DROPCOMPLETE) PRINT_DROP_EVENT(event); break; #undef PRINT_DROP_EVENT - #define PRINT_AUDIODEV_EVENT(event) SDL_snprintf(details, sizeof (details), " (timestamp=%u which=%u iscapture=%s)", (uint) event->adevice.timestamp, (uint) event->adevice.which, event->adevice.iscapture ? "true" : "false"); + #define PRINT_AUDIODEV_EVENT(event) SDL_snprintf(details, sizeof (details), " (timestamp=%u which=%u iscapture=%s)", (uint) event->adevice.timestamp, (uint) event->adevice.which, event->adevice.iscapture ? "true" : "false") SDL_EVENT_CASE(SDL_AUDIODEVICEADDED) PRINT_AUDIODEV_EVENT(event); break; SDL_EVENT_CASE(SDL_AUDIODEVICEREMOVED) PRINT_AUDIODEV_EVENT(event); break; #undef PRINT_AUDIODEV_EVENT diff --git a/src/hidapi/libusb/hid.c b/src/hidapi/libusb/hid.c index 1f08aedfa2..9e2a435899 100644 --- a/src/hidapi/libusb/hid.c +++ b/src/hidapi/libusb/hid.c @@ -322,7 +322,7 @@ static int get_usage(uint8_t *report_descriptor, size_t size, /* Can't ever happen since size_code is & 0x3 */ data_len = 0; break; - }; + } key_size = 1; } diff --git a/src/hidapi/linux/hid.c b/src/hidapi/linux/hid.c index fbd010144a..cf857a6759 100644 --- a/src/hidapi/linux/hid.c +++ b/src/hidapi/linux/hid.c @@ -200,7 +200,7 @@ static int uses_numbered_reports(__u8 *report_descriptor, __u32 size) { /* Can't ever happen since size_code is & 0x3 */ data_len = 0; break; - }; + } key_size = 1; } diff --git a/src/main/ps2/SDL_ps2_main.c b/src/main/ps2/SDL_ps2_main.c index 6d5c43a032..e9a4b513dd 100644 --- a/src/main/ps2/SDL_ps2_main.c +++ b/src/main/ps2/SDL_ps2_main.c @@ -28,8 +28,10 @@ __attribute__((weak)) void reset_IOP() { SifInitRpc(0); - while(!SifIopReset(NULL, 0)){}; - while(!SifIopSync()){}; + while(!SifIopReset(NULL, 0)) { + } + while(!SifIopSync()){ + } } static void prepare_IOP() diff --git a/src/render/software/SDL_triangle.c b/src/render/software/SDL_triangle.c index 694cb4d912..f70c079338 100644 --- a/src/render/software/SDL_triangle.c +++ b/src/render/software/SDL_triangle.c @@ -533,7 +533,7 @@ int SDL_SW_BlitTriangle( if (is_uniform) { // SDL_GetSurfaceColorMod(src, &r, &g, &b); - has_modulation = c0.r != 255 || c0.g != 255 || c0.b != 255 || c0.a != 255;; + has_modulation = c0.r != 255 || c0.g != 255 || c0.b != 255 || c0.a != 255; } else { has_modulation = SDL_TRUE; } @@ -759,7 +759,7 @@ SDL_BlitTriangle_Slow(SDL_BlitInfo *info, Uint32 ckey = info->colorkey & rgbmask; Uint8 *dst_ptr = info->dst; - int dst_pitch = info->dst_pitch;; + int dst_pitch = info->dst_pitch; srcfmt_val = detect_format(src_fmt); dstfmt_val = detect_format(dst_fmt); diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c index 18b7bfc587..0804c9cfbf 100644 --- a/src/video/SDL_video.c +++ b/src/video/SDL_video.c @@ -3754,7 +3754,7 @@ SDL_GL_SetAttribute(SDL_GLattr attr, int value) SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_ES); } else { SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, 0); - }; + } break; case SDL_GL_CONTEXT_FLAGS: if (value & ~(SDL_GL_CONTEXT_DEBUG_FLAG | diff --git a/src/video/windows/SDL_windowskeyboard.c b/src/video/windows/SDL_windowskeyboard.c index 83a939d64e..a62ba07170 100644 --- a/src/video/windows/SDL_windowskeyboard.c +++ b/src/video/windows/SDL_windowskeyboard.c @@ -1634,7 +1634,6 @@ IME_RenderCandidateList(SDL_VideoData *videodata, HDC hdc) (candcount * candborder * 2) + (candcount * candpadding * 2) + ((candcount - 1) * horzcandspacing); - ; for (i = 0; i < candcount; ++i) size.cx += candsizes[i].cx; diff --git a/src/video/x11/edid-parse.c b/src/video/x11/edid-parse.c index c717f1b1f4..52c5d5f80c 100644 --- a/src/video/x11/edid-parse.c +++ b/src/video/x11/edid-parse.c @@ -623,7 +623,7 @@ dump_monitor_info (MonitorInfo *info) case RGB: s = "rgb"; break; case OTHER_COLOR: s = "other color"; break; default: s = "unknown"; break; - }; + } printf ("Color: %s\n", s); } diff --git a/test/testrelative.c b/test/testrelative.c index 59a563eea1..40c670bc94 100644 --- a/test/testrelative.c +++ b/test/testrelative.c @@ -104,7 +104,7 @@ main(int argc, char *argv[]) srand((unsigned int)time(NULL)); if(SDL_SetRelativeMouseMode(SDL_TRUE) < 0) { return 3; - }; + } rect.x = DEFAULT_WINDOW_WIDTH / 2; rect.y = DEFAULT_WINDOW_HEIGHT / 2; diff --git a/visualtest/src/windows/windows_screenshot.c b/visualtest/src/windows/windows_screenshot.c index 6d9189dc4a..d4ac7d3a1e 100644 --- a/visualtest/src/windows/windows_screenshot.c +++ b/visualtest/src/windows/windows_screenshot.c @@ -261,7 +261,7 @@ screenshotwindow_cleanup_windowdc: if(!ReleaseDC(hwnd, windowdc)) { SDLTest_LogError("ReleaseDC() failed"); - return_code = 0;; + return_code = 0; } screenshotwindow_cleanup_generic: From cd0d5a5fc58a195f15c02a96f67fd55c4a60974b Mon Sep 17 00:00:00 2001 From: Sylvain Date: Thu, 17 Nov 2022 11:23:15 +0100 Subject: [PATCH 079/153] Don't compare pointer against '0', but NULL --- src/stdlib/SDL_qsort.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/stdlib/SDL_qsort.c b/src/stdlib/SDL_qsort.c index b0f92fde86..d17b6a31c6 100644 --- a/src/stdlib/SDL_qsort.c +++ b/src/stdlib/SDL_qsort.c @@ -414,7 +414,7 @@ static void qsort_nonaligned(void *base, size_t nmemb, size_t size, char *first,*last; char *pivot=malloc(size); size_t trunc=TRUNC_nonaligned*size; - assert(pivot); + assert(pivot != NULL); first=(char*)base; last=first+(nmemb-1)*size; @@ -445,7 +445,7 @@ static void qsort_aligned(void *base, size_t nmemb, size_t size, char *first,*last; char *pivot=malloc(size); size_t trunc=TRUNC_aligned*size; - assert(pivot); + assert(pivot != NULL); first=(char*)base; last=first+(nmemb-1)*size; @@ -475,7 +475,7 @@ static void qsort_words(void *base, size_t nmemb, int stacktop=0; char *first,*last; char *pivot=malloc(WORD_BYTES); - assert(pivot); + assert(pivot != NULL); first=(char*)base; last=first+(nmemb-1)*WORD_BYTES; From 89572af6a8b7e01559e5eefe730b74c3da9d3285 Mon Sep 17 00:00:00 2001 From: Sylvain Date: Thu, 17 Nov 2022 11:43:46 +0100 Subject: [PATCH 080/153] Fixed bug #6537 - AIX: use PAUDIO_WaitDevice --- src/audio/paudio/SDL_paudio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/audio/paudio/SDL_paudio.c b/src/audio/paudio/SDL_paudio.c index ae2fc2950b..c77db085ab 100644 --- a/src/audio/paudio/SDL_paudio.c +++ b/src/audio/paudio/SDL_paudio.c @@ -477,7 +477,7 @@ PAUDIO_Init(SDL_AudioDriverImpl * impl) /* Set the function pointers */ impl->OpenDevice = PAUDIO_OpenDevice; impl->PlayDevice = PAUDIO_PlayDevice; - impl->PlayDevice = PAUDIO_WaitDevice; + impl->WaitDevice = PAUDIO_WaitDevice; impl->GetDeviceBuf = PAUDIO_GetDeviceBuf; impl->CloseDevice = PAUDIO_CloseDevice; impl->OnlyHasDefaultOutputDevice = SDL_TRUE; /* !!! FIXME: add device enum! */ From 71f2864b3a24e144eaf4ae6e86eee0dd5e9f89b1 Mon Sep 17 00:00:00 2001 From: Sylvain Date: Thu, 17 Nov 2022 14:55:49 +0100 Subject: [PATCH 081/153] Fix usage of sizeof() in test/testgles*.c files --- test/testgles.c | 2 +- test/testgles2.c | 2 +- test/testgles2_sdf.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/testgles.c b/test/testgles.c index cb989f44f4..745cf8919e 100644 --- a/test/testgles.c +++ b/test/testgles.c @@ -173,7 +173,7 @@ main(int argc, char *argv[]) quit(2); } - context = (SDL_GLContext *)SDL_calloc(state->num_windows, sizeof(context)); + context = (SDL_GLContext *)SDL_calloc(state->num_windows, sizeof(*context)); if (context == NULL) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Out of memory!\n"); quit(2); diff --git a/test/testgles2.c b/test/testgles2.c index 721c24b7f2..903f7a8227 100644 --- a/test/testgles2.c +++ b/test/testgles2.c @@ -614,7 +614,7 @@ main(int argc, char *argv[]) return 0; } - context = (SDL_GLContext *)SDL_calloc(state->num_windows, sizeof(context)); + context = (SDL_GLContext *)SDL_calloc(state->num_windows, sizeof(*context)); if (context == NULL) { SDL_Log("Out of memory!\n"); quit(2); diff --git a/test/testgles2_sdf.c b/test/testgles2_sdf.c index 064b6bc2ce..e9e79d6e62 100644 --- a/test/testgles2_sdf.c +++ b/test/testgles2_sdf.c @@ -522,7 +522,7 @@ main(int argc, char *argv[]) return 0; } - context = (SDL_GLContext *)SDL_calloc(state->num_windows, sizeof(context)); + context = (SDL_GLContext *)SDL_calloc(state->num_windows, sizeof(*context)); if (context == NULL) { SDL_Log("Out of memory!\n"); quit(2); From 1f87e9e24eba5e2443b2ed677462a70b6605482e Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Thu, 17 Nov 2022 09:00:27 -0800 Subject: [PATCH 082/153] Updated patch notes for 2.26 release --- WhatsNew.txt | 33 ++++++++++++++++++++++++++++++++- include/SDL_hints.h | 4 ++-- include/SDL_video.h | 2 +- 3 files changed, 35 insertions(+), 4 deletions(-) diff --git a/WhatsNew.txt b/WhatsNew.txt index 0318b90de0..1f95f05925 100644 --- a/WhatsNew.txt +++ b/WhatsNew.txt @@ -6,9 +6,40 @@ This is a list of major changes in SDL's version history. --------------------------------------------------------------------------- General: +* Updated OpenGL headers to the latest API from The Khronos Group Inc. +* Added SDL_GetWindowSizeInPixels() to get the window size in pixels, which may differ from the window coordinate size for windows with high-DPI support +* Added simulated vsync synchronization for the software renderer +* Added the mouse position to SDL_MouseWheelEvent +* Added SDL_ResetHints() to reset all hints to their default values * Added SDL_GetJoystickGUIDInfo() to get device information encoded in a joystick GUID -* Added support for Nintendo Wii controllers to the HIDAPI driver, and a hint SDL_HINT_JOYSTICK_HIDAPI_WII to control whether this is used +* Added the hint SDL_HINT_JOYSTICK_HIDAPI_XBOX_360 to control whether the HIDAPI driver for XBox 360 controllers should be used +* Added the hint SDL_HINT_JOYSTICK_HIDAPI_XBOX_360_PLAYER_LED to control whether the player LEDs should be lit to indicate which player is associated with an Xbox 360 controller +* Added the hint SDL_HINT_JOYSTICK_HIDAPI_XBOX_360_WIRELESS to control whether the HIDAPI driver for XBox 360 wireless controllers should be used +* Added the hint SDL_HINT_JOYSTICK_HIDAPI_XBOX_ONE to control whether the HIDAPI driver for XBox One controllers should be used +* Added the hint SDL_HINT_JOYSTICK_HIDAPI_XBOX_ONE_HOME_LED to control the brightness of the XBox One guide button LED +* Added support for PS3 controllers to the HIDAPI driver, enabled by default on macOS, controlled by the SDL_HINT_JOYSTICK_HIDAPI_PS3 hint +* Added support for Nintendo Wii controllers to the HIDAPI driver, not enabled by default, controlled by the SDL_HINT_JOYSTICK_HIDAPI_WII hint * Added the hint SDL_HINT_JOYSTICK_HIDAPI_WII_PLAYER_LED to control whether the player LED should be lit on the Nintendo Wii controllers +* Added the hint SDL_HINT_JOYSTICK_HIDAPI_VERTICAL_JOY_CONS to control whether Nintendo Switch Joy-Con controllers will be in vertical mode when using the HIDAPI driver +* Added access to the individual left and right gyro sensors of the combined Joy-Cons controller +* Added a microsecond timestamp to SDL_SensorEvent and SDL_ControllerSensorEvent, when the hardware provides that information +* Added SDL_SensorGetDataWithTimestamp() and SDL_GameControllerGetSensorDataWithTimestamp() to retrieve the last sensor data with the associated microsecond timestamp +* Added the hint SDL_HINT_HIDAPI_IGNORE_DEVICES to have the SDL HID API ignore specific devices +* SDL_GetRevision() now includes more information about the SDL build, including the git commit hash if available + +Windows: +* Added the hint SDL_HINT_MOUSE_RELATIVE_SYSTEM_SCALE to control whether the system mouse acceleration curve is used for relative mouse motion + +macOS: +* Implemented vsync synchronization on macOS 12 + +Linux: +* Added SDL_SetPrimarySelectionText(), SDL_GetPrimarySelectionText(), and SDL_HasPrimarySelectionText() to interact with the X11 primary selection clipboard +* Added the hint SDL_HINT_VIDEO_WAYLAND_EMULATE_MOUSE_WARP to control whether mouse pointer warp emulation is enabled under Wayland + +Android: +* Enabled IME soft keyboard input +* Added version checking to make sure the SDL Java and C code are compatible --------------------------------------------------------------------------- diff --git a/include/SDL_hints.h b/include/SDL_hints.h index d51525936c..76a74f0ffd 100644 --- a/include/SDL_hints.h +++ b/include/SDL_hints.h @@ -278,7 +278,7 @@ extern "C" { * If this hint isn't specified to a valid setting, or libsamplerate isn't * available, SDL will use the default, internal resampling algorithm. * - * As of SDL 2.26, SDL_AudioCVT now respects this hint. + * As of SDL 2.26, SDL_ConvertAudio() respects this hint when libsamplerate is available. * * This hint is currently only checked at audio subsystem initialization. * @@ -933,7 +933,7 @@ extern "C" { #define SDL_HINT_JOYSTICK_HIDAPI_XBOX_360_WIRELESS "SDL_JOYSTICK_HIDAPI_XBOX_360_WIRELESS" /** - * \brief A variable controlling whether the HIDAPI driver for XBox One should be used. + * \brief A variable controlling whether the HIDAPI driver for XBox One controllers should be used. * * This variable can be set to the following values: * "0" - HIDAPI driver is not used diff --git a/include/SDL_video.h b/include/SDL_video.h index 79d572fcc8..b2f1509f73 100644 --- a/include/SDL_video.h +++ b/include/SDL_video.h @@ -1064,7 +1064,7 @@ extern DECLSPEC int SDLCALL SDL_GetWindowBordersSize(SDL_Window * window, * \sa SDL_CreateWindow * \sa SDL_GetWindowSize */ -extern DECLSPEC void SDLCALL SDL_GetWindowSizeInPixels(SDL_Window * window, +extern DECLSPEC void SDLCALL SDL_GetWindowSizeInPixels(SDL_Window * window, int *w, int *h); /** From 78ea6af2cddfa050a394ff9030d0ddd631099848 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Thu, 17 Nov 2022 09:01:35 -0800 Subject: [PATCH 083/153] Updated to version 2.25.1 for release candidate --- CMakeLists.txt | 2 +- Makefile.os2 | 2 +- Makefile.w32 | 2 +- Xcode/SDL/Info-Framework.plist | 4 ++-- Xcode/SDL/SDL.xcodeproj/project.pbxproj | 16 ++++++++-------- .../main/java/org/libsdl/app/SDLActivity.java | 2 +- configure | 2 +- configure.ac | 2 +- include/SDL_version.h | 2 +- src/main/windows/version.rc | 8 ++++---- 10 files changed, 21 insertions(+), 21 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 484220f1fd..408bc2f142 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -86,7 +86,7 @@ endif() # See docs/release_checklist.md set(SDL_MAJOR_VERSION 2) set(SDL_MINOR_VERSION 25) -set(SDL_MICRO_VERSION 0) +set(SDL_MICRO_VERSION 1) set(SDL_VERSION "${SDL_MAJOR_VERSION}.${SDL_MINOR_VERSION}.${SDL_MICRO_VERSION}") # Set defaults preventing destination file conflicts diff --git a/Makefile.os2 b/Makefile.os2 index 76b2b398df..111ea0eef8 100644 --- a/Makefile.os2 +++ b/Makefile.os2 @@ -15,7 +15,7 @@ LIBNAME = SDL2 MAJOR_VERSION = 2 MINOR_VERSION = 25 -MICRO_VERSION = 0 +MICRO_VERSION = 1 VERSION = $(MAJOR_VERSION).$(MINOR_VERSION).$(MICRO_VERSION) DESCRIPTION = Simple DirectMedia Layer 2 diff --git a/Makefile.w32 b/Makefile.w32 index 68c3a37315..628ee7ed69 100644 --- a/Makefile.w32 +++ b/Makefile.w32 @@ -6,7 +6,7 @@ LIBNAME = SDL2 MAJOR_VERSION = 2 MINOR_VERSION = 25 -MICRO_VERSION = 0 +MICRO_VERSION = 1 VERSION = $(MAJOR_VERSION).$(MINOR_VERSION).$(MICRO_VERSION) LIBHOME = . diff --git a/Xcode/SDL/Info-Framework.plist b/Xcode/SDL/Info-Framework.plist index ada597b7dd..16ca1d1b71 100644 --- a/Xcode/SDL/Info-Framework.plist +++ b/Xcode/SDL/Info-Framework.plist @@ -19,10 +19,10 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 2.25.0 + 2.25.1 CFBundleSignature SDLX CFBundleVersion - 2.25.0 + 2.25.1 diff --git a/Xcode/SDL/SDL.xcodeproj/project.pbxproj b/Xcode/SDL/SDL.xcodeproj/project.pbxproj index a0741e06c9..e0f747ab77 100644 --- a/Xcode/SDL/SDL.xcodeproj/project.pbxproj +++ b/Xcode/SDL/SDL.xcodeproj/project.pbxproj @@ -9528,8 +9528,8 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEPLOYMENT_POSTPROCESSING = YES; - DYLIB_COMPATIBILITY_VERSION = 2501.0.0; - DYLIB_CURRENT_VERSION = 2501.0.0; + DYLIB_COMPATIBILITY_VERSION = 2502.0.0; + DYLIB_CURRENT_VERSION = 2502.0.0; DYLIB_INSTALL_NAME_BASE = "@rpath"; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_ALTIVEC_EXTENSIONS = YES; @@ -9613,8 +9613,8 @@ CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; DEBUG_INFORMATION_FORMAT = dwarf; - DYLIB_COMPATIBILITY_VERSION = 2501.0.0; - DYLIB_CURRENT_VERSION = 2501.0.0; + DYLIB_COMPATIBILITY_VERSION = 2502.0.0; + DYLIB_CURRENT_VERSION = 2502.0.0; DYLIB_INSTALL_NAME_BASE = "@rpath"; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; @@ -9862,8 +9862,8 @@ CURRENT_PROJECT_VERSION = 1; DEFINES_MODULE = YES; DEVELOPMENT_TEAM = ""; - DYLIB_COMPATIBILITY_VERSION = 2501.0.0; - DYLIB_CURRENT_VERSION = 2501.0.0; + DYLIB_COMPATIBILITY_VERSION = 2502.0.0; + DYLIB_CURRENT_VERSION = 2502.0.0; DYLIB_INSTALL_NAME_BASE = "@rpath"; GCC_C_LANGUAGE_STANDARD = gnu11; GCC_DYNAMIC_NO_PIC = NO; @@ -9914,8 +9914,8 @@ CURRENT_PROJECT_VERSION = 1; DEFINES_MODULE = YES; DEVELOPMENT_TEAM = ""; - DYLIB_COMPATIBILITY_VERSION = 2501.0.0; - DYLIB_CURRENT_VERSION = 2501.0.0; + DYLIB_COMPATIBILITY_VERSION = 2502.0.0; + DYLIB_CURRENT_VERSION = 2502.0.0; DYLIB_INSTALL_NAME_BASE = "@rpath"; ENABLE_NS_ASSERTIONS = NO; GCC_C_LANGUAGE_STANDARD = gnu11; diff --git a/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java b/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java index 666ea3164d..e749d6b775 100644 --- a/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java +++ b/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java @@ -61,7 +61,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh private static final String TAG = "SDL"; private static final int SDL_MAJOR_VERSION = 2; private static final int SDL_MINOR_VERSION = 25; - private static final int SDL_MICRO_VERSION = 0; + private static final int SDL_MICRO_VERSION = 1; /* // Display InputType.SOURCE/CLASS of events and devices // diff --git a/configure b/configure index 4f4253cf1e..9461408e86 100755 --- a/configure +++ b/configure @@ -3454,7 +3454,7 @@ orig_CFLAGS="$CFLAGS" # See docs/release_checklist.md SDL_MAJOR_VERSION=2 SDL_MINOR_VERSION=25 -SDL_MICRO_VERSION=0 +SDL_MICRO_VERSION=1 SDL_VERSION=$SDL_MAJOR_VERSION.$SDL_MINOR_VERSION.$SDL_MICRO_VERSION SDL_BINARY_AGE=`expr $SDL_MINOR_VERSION \* 100 + $SDL_MICRO_VERSION` diff --git a/configure.ac b/configure.ac index 60ab5b6f16..a4252d2ed5 100644 --- a/configure.ac +++ b/configure.ac @@ -13,7 +13,7 @@ dnl Set various version strings - taken gratefully from the GTk sources # See docs/release_checklist.md SDL_MAJOR_VERSION=2 SDL_MINOR_VERSION=25 -SDL_MICRO_VERSION=0 +SDL_MICRO_VERSION=1 SDL_VERSION=$SDL_MAJOR_VERSION.$SDL_MINOR_VERSION.$SDL_MICRO_VERSION SDL_BINARY_AGE=`expr $SDL_MINOR_VERSION \* 100 + $SDL_MICRO_VERSION` diff --git a/include/SDL_version.h b/include/SDL_version.h index b817be1a24..612d2f53d9 100644 --- a/include/SDL_version.h +++ b/include/SDL_version.h @@ -59,7 +59,7 @@ typedef struct SDL_version */ #define SDL_MAJOR_VERSION 2 #define SDL_MINOR_VERSION 25 -#define SDL_PATCHLEVEL 0 +#define SDL_PATCHLEVEL 1 /** * Macro to determine SDL version program was compiled against. diff --git a/src/main/windows/version.rc b/src/main/windows/version.rc index f13b897590..97930ca04e 100644 --- a/src/main/windows/version.rc +++ b/src/main/windows/version.rc @@ -9,8 +9,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US // VS_VERSION_INFO VERSIONINFO - FILEVERSION 2,25,0,0 - PRODUCTVERSION 2,25,0,0 + FILEVERSION 2,25,1,0 + PRODUCTVERSION 2,25,1,0 FILEFLAGSMASK 0x3fL FILEFLAGS 0x0L FILEOS 0x40004L @@ -23,12 +23,12 @@ BEGIN BEGIN VALUE "CompanyName", "\0" VALUE "FileDescription", "SDL\0" - VALUE "FileVersion", "2, 25, 0, 0\0" + VALUE "FileVersion", "2, 25, 1, 0\0" VALUE "InternalName", "SDL\0" VALUE "LegalCopyright", "Copyright (C) 2022 Sam Lantinga\0" VALUE "OriginalFilename", "SDL2.dll\0" VALUE "ProductName", "Simple DirectMedia Layer\0" - VALUE "ProductVersion", "2, 25, 0, 0\0" + VALUE "ProductVersion", "2, 25, 1, 0\0" END END BLOCK "VarFileInfo" From 769ae185d608b72d70c8caa54deeede7ddcdf7b1 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Fri, 18 Nov 2022 06:52:12 -0800 Subject: [PATCH 084/153] Revert "sdl2.m4: Deprecate AM_PATH_SDL2 in favour of PKG_CHECK_MODULES" This reverts commit a66cb8cf216536b4e5e35c98c3f114d1787131b1. SDL 3 will have the recommended path forward, we don't need to nag in SDL 2. --- sdl2.m4 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sdl2.m4 b/sdl2.m4 index 737a5e5e86..75b60f6ea9 100644 --- a/sdl2.m4 +++ b/sdl2.m4 @@ -10,7 +10,7 @@ # * removed HP/UX 9 support. # * updated for newer autoconf. -# serial 3 +# serial 2 dnl AM_PATH_SDL2([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) dnl Test for SDL, and define SDL_CFLAGS and SDL_LIBS @@ -19,7 +19,6 @@ AC_DEFUN([AM_PATH_SDL2], [dnl dnl Get the cflags and libraries from the sdl2-config script dnl -AC_MSG_WARN([[$0 is deprecated, please use PKG_CHECK_MODULES([SDL], [sdl2 >= MINIMUM_VERSION]) instead]]) AC_ARG_WITH(sdl-prefix,[ --with-sdl-prefix=PFX Prefix where SDL is installed (optional)], sdl_prefix="$withval", sdl_prefix="") AC_ARG_WITH(sdl-exec-prefix,[ --with-sdl-exec-prefix=PFX Exec prefix where SDL is installed (optional)], From 9209942949a2a7c2b117c22cf970e58bf587e109 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Fri, 18 Nov 2022 06:53:13 -0800 Subject: [PATCH 085/153] Revert "sdl2-config.in: Deprecate sdl2-config" This reverts commit e0d904e90b15c7be45210e51b8969d3beab71437. SDL 3 will have the recommended path forward, we don't need to nag in SDL 2. --- sdl2-config.in | 5 ----- 1 file changed, 5 deletions(-) diff --git a/sdl2-config.in b/sdl2-config.in index f7e5cd0591..f6eca7668c 100644 --- a/sdl2-config.in +++ b/sdl2-config.in @@ -19,11 +19,6 @@ if test $# -eq 0; then exit 1 fi -echo "sdl2-config: This script is deprecated" >&2 -echo "sdl2-config: In Autotools builds, use PKG_CHECK_MODULES([SDL], [sdl2 >= 2.x.y])" >&2 -echo "sdl2-config: In CMake builds, use find_package(SDL2 CONFIG)" >&2 -echo "sdl2-config: In other build systems, look for 'sdl2' with pkg-config(1) or pkgconf(1)" >&2 - while test $# -gt 0; do case "$1" in -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;; From 3e70553c48032f6bf4b6acfa61e4ef87d563c1a1 Mon Sep 17 00:00:00 2001 From: Sylvain Date: Fri, 18 Nov 2022 11:06:49 +0100 Subject: [PATCH 086/153] Unneed test before calling SDL_FreeSurface --- src/video/SDL_bmp.c | 4 +--- test/testutils.c | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/video/SDL_bmp.c b/src/video/SDL_bmp.c index d52d6e84e4..369b925a67 100644 --- a/src/video/SDL_bmp.c +++ b/src/video/SDL_bmp.c @@ -574,9 +574,7 @@ SDL_LoadBMP_RW(SDL_RWops * src, int freesrc) if (src) { SDL_RWseek(src, fp_offset, RW_SEEK_SET); } - if (surface) { - SDL_FreeSurface(surface); - } + SDL_FreeSurface(surface); surface = NULL; } if (freesrc && src) { diff --git a/test/testutils.c b/test/testutils.c index ab58824d0c..a93afc1ad3 100644 --- a/test/testutils.c +++ b/test/testutils.c @@ -143,9 +143,7 @@ LoadTexture(SDL_Renderer *renderer, const char *file, SDL_bool transparent, SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create texture: %s\n", SDL_GetError()); } } - if (temp) { - SDL_FreeSurface(temp); - } + SDL_FreeSurface(temp); if (path) { SDL_free(path); } From 16824865c234f3fec9af4fded0f89cb1f147d014 Mon Sep 17 00:00:00 2001 From: Sylvain Date: Fri, 18 Nov 2022 11:01:21 +0100 Subject: [PATCH 087/153] Cleanup of SDL_SetError that already return -1 value --- src/core/gdk/SDL_gdk.cpp | 6 ++---- src/thread/ngage/SDL_sysmutex.cpp | 6 ++---- src/thread/ngage/SDL_syssem.cpp | 6 ++---- src/video/haiku/SDL_bopengl.cc | 3 +-- 4 files changed, 7 insertions(+), 14 deletions(-) diff --git a/src/core/gdk/SDL_gdk.cpp b/src/core/gdk/SDL_gdk.cpp index 4058a9b8fe..5d94c9bda0 100644 --- a/src/core/gdk/SDL_gdk.cpp +++ b/src/core/gdk/SDL_gdk.cpp @@ -42,8 +42,7 @@ SDL_GDKGetTaskQueue(XTaskQueueHandle * outTaskQueue) &GDK_GlobalTaskQueue ); if (FAILED(hr)) { - SDL_SetError("[GDK] Could not create global task queue"); - return -1; + return SDL_SetError("[GDK] Could not create global task queue"); } /* The initial call gets the non-duplicated handle so they can clean it up */ @@ -51,8 +50,7 @@ SDL_GDKGetTaskQueue(XTaskQueueHandle * outTaskQueue) } else { /* Duplicate the global task queue handle into outTaskQueue */ if (FAILED(XTaskQueueDuplicateHandle(GDK_GlobalTaskQueue, outTaskQueue))) { - SDL_SetError("[GDK] Unable to acquire global task queue"); - return -1; + return SDL_SetError("[GDK] Unable to acquire global task queue"); } } diff --git a/src/thread/ngage/SDL_sysmutex.cpp b/src/thread/ngage/SDL_sysmutex.cpp index 34cf4510d6..6893fc6283 100644 --- a/src/thread/ngage/SDL_sysmutex.cpp +++ b/src/thread/ngage/SDL_sysmutex.cpp @@ -92,8 +92,7 @@ SDL_LockMutex(SDL_mutex * mutex) { if (mutex == NULL) { - SDL_SetError("Passed a NULL mutex."); - return -1; + return SDL_SetError("Passed a NULL mutex."); } RMutex rmutex; @@ -109,8 +108,7 @@ SDL_UnlockMutex(SDL_mutex * mutex) { if ( mutex == NULL ) { - SDL_SetError("Passed a NULL mutex."); - return -1; + return SDL_SetError("Passed a NULL mutex."); } RMutex rmutex; diff --git a/src/thread/ngage/SDL_syssem.cpp b/src/thread/ngage/SDL_syssem.cpp index ab277ca5d0..622d6239a0 100644 --- a/src/thread/ngage/SDL_syssem.cpp +++ b/src/thread/ngage/SDL_syssem.cpp @@ -119,8 +119,7 @@ SDL_SemWaitTimeout(SDL_sem * sem, Uint32 timeout) { if (! sem) { - SDL_SetError("Passed a NULL sem"); - return -1; + return SDL_SetError("Passed a NULL sem"); } if (timeout == SDL_MUTEX_MAXWAIT) @@ -182,8 +181,7 @@ SDL_SemPost(SDL_sem * sem) { if (! sem) { - SDL_SetError("Passed a NULL sem."); - return -1; + return SDL_SetError("Passed a NULL sem."); } sem->count++; RSemaphore sema; diff --git a/src/video/haiku/SDL_bopengl.cc b/src/video/haiku/SDL_bopengl.cc index 0c7a704d88..72bdb77f48 100644 --- a/src/video/haiku/SDL_bopengl.cc +++ b/src/video/haiku/SDL_bopengl.cc @@ -94,8 +94,7 @@ int HAIKU_GL_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context) { // printf("HAIKU_GL_MakeCurrent(%llx), win = %llx, thread = %d\n", (uint64)context, (uint64)window, find_thread(NULL)); if (glView != NULL) { if ((glView->Window() == NULL) || (window == NULL) || (_ToBeWin(window)->GetGLView() != glView)) { - SDL_SetError("MakeCurrent failed"); - return -1; + return SDL_SetError("MakeCurrent failed"); } } _GetBeApp()->SetCurrentContext(glView); From 6dc96aa7455d00a3556618a4a459851424ae5d44 Mon Sep 17 00:00:00 2001 From: Ozkan Sezer Date: Fri, 18 Nov 2022 18:02:10 +0300 Subject: [PATCH 088/153] SDL_UDEV_DelCallback: return early if _this is NULL Fixes https://github.com/libsdl-org/SDL/issues/6548 --- src/core/linux/SDL_udev.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/core/linux/SDL_udev.c b/src/core/linux/SDL_udev.c index 311cdd1ebe..85cde89596 100644 --- a/src/core/linux/SDL_udev.c +++ b/src/core/linux/SDL_udev.c @@ -545,6 +545,10 @@ SDL_UDEV_DelCallback(SDL_UDEV_Callback cb) SDL_UDEV_CallbackList *item; SDL_UDEV_CallbackList *prev = NULL; + if (_this == NULL) { + return; + } + for (item = _this->first; item != NULL; item = item->next) { /* found it, remove it. */ if (item->callback == cb) { From 81479d8784d0e1a61eafb3a444dd3865ad762fb2 Mon Sep 17 00:00:00 2001 From: David Gow Date: Fri, 18 Nov 2022 21:08:36 +0800 Subject: [PATCH 089/153] wayland: keyboard: Cache text input parameters. Some applications (and embarrassingly, testime is one of them) call SDL_StartTextInput() or SDL_SetTextInputRect() every frame. On KDE/KWin with fcitx5, this causes there to be several preedit events every frame (particularly given some of the workarounds in Wayland_StartTextInput), which slows testime down to an unusable crawl. Instead, make SDL_StartTextInput() a no-op if text input is already enabled, and cache the input rect, only changing it when the new rect is actually different. With these changes, we only get preedit events (and hence SDL_TEXTEDITING events) when the preedit string actually changes. This matches the behaviour under XWayland, and works very smoothly. --- src/video/wayland/SDL_waylandkeyboard.c | 23 ++++++++++++++++------- src/video/wayland/SDL_waylandkeyboard.h | 1 + 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/src/video/wayland/SDL_waylandkeyboard.c b/src/video/wayland/SDL_waylandkeyboard.c index 6f6115d220..5cea5effcb 100644 --- a/src/video/wayland/SDL_waylandkeyboard.c +++ b/src/video/wayland/SDL_waylandkeyboard.c @@ -61,6 +61,10 @@ Wayland_StartTextInput(_THIS) if (input != NULL && input->text_input) { const SDL_Rect *rect = &input->text_input->cursor_rect; + /* Don't re-enable if we're already enabled. */ + if (input->text_input->is_enabled) + return; + /* For some reason this has to be done twice, it appears to be a * bug in mutter? Maybe? * -flibit @@ -83,6 +87,7 @@ Wayland_StartTextInput(_THIS) rect->h); } zwp_text_input_v3_commit(input->text_input->text_input); + input->text_input->is_enabled = SDL_TRUE; } } } @@ -97,6 +102,7 @@ Wayland_StopTextInput(_THIS) if (input != NULL && input->text_input) { zwp_text_input_v3_disable(input->text_input->text_input); zwp_text_input_v3_commit(input->text_input->text_input); + input->text_input->is_enabled = SDL_FALSE; } } @@ -120,13 +126,16 @@ Wayland_SetTextInputRect(_THIS, const SDL_Rect *rect) if (driverdata->text_input_manager) { struct SDL_WaylandInput *input = driverdata->input; if (input != NULL && input->text_input) { - SDL_copyp(&input->text_input->cursor_rect, rect); - zwp_text_input_v3_set_cursor_rectangle(input->text_input->text_input, - rect->x, - rect->y, - rect->w, - rect->h); - zwp_text_input_v3_commit(input->text_input->text_input); + if (!SDL_RectEquals(rect, &input->text_input->cursor_rect)) + { + SDL_copyp(&input->text_input->cursor_rect, rect); + zwp_text_input_v3_set_cursor_rectangle(input->text_input->text_input, + rect->x, + rect->y, + rect->w, + rect->h); + zwp_text_input_v3_commit(input->text_input->text_input); + } } } diff --git a/src/video/wayland/SDL_waylandkeyboard.h b/src/video/wayland/SDL_waylandkeyboard.h index 5909a2497b..a56ccba6d8 100644 --- a/src/video/wayland/SDL_waylandkeyboard.h +++ b/src/video/wayland/SDL_waylandkeyboard.h @@ -28,6 +28,7 @@ typedef struct SDL_WaylandTextInput struct zwp_text_input_v3 *text_input; SDL_Rect cursor_rect; SDL_bool has_preedit; + SDL_bool is_enabled; } SDL_WaylandTextInput; extern int Wayland_InitKeyboard(_THIS); From ea4ea27a59ddc0adab4d3d0bb6fbe8fa425f5a21 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Fri, 18 Nov 2022 11:14:14 -0800 Subject: [PATCH 090/153] Don't trigger an error if we try to delete a touch device after shutting down the touch system This can happen on Raspberry Pi if the display system fails to initialize. --- src/events/SDL_touch.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/events/SDL_touch.c b/src/events/SDL_touch.c index ebf26e091c..bc77b73546 100644 --- a/src/events/SDL_touch.c +++ b/src/events/SDL_touch.c @@ -456,10 +456,16 @@ SDL_SendTouchMotion(SDL_TouchID id, SDL_FingerID fingerid, SDL_Window * window, void SDL_DelTouch(SDL_TouchID id) { - int i; - int index = SDL_GetTouchIndex(id); - SDL_Touch *touch = SDL_GetTouch(id); + int i, index; + SDL_Touch *touch; + if (SDL_num_touch == 0) { + /* We've already cleaned up, we won't find this device */ + return; + } + + index = SDL_GetTouchIndex(id); + touch = SDL_GetTouch(id); if (!touch) { return; } From da9ba3a2a1536017e4ce1ee0f4276578d1ce6e29 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Fri, 18 Nov 2022 12:17:27 -0800 Subject: [PATCH 091/153] If a CRTC doesn't have a mode configured, use the preferred or largest mode as the default mode Fixes https://github.com/libsdl-org/SDL/issues/6421 --- src/video/kmsdrm/SDL_kmsdrmvideo.c | 35 +++++++++++++++++++++++++----- 1 file changed, 29 insertions(+), 6 deletions(-) diff --git a/src/video/kmsdrm/SDL_kmsdrmvideo.c b/src/video/kmsdrm/SDL_kmsdrmvideo.c index eae7214551..eeeefef2b2 100644 --- a/src/video/kmsdrm/SDL_kmsdrmvideo.c +++ b/src/video/kmsdrm/SDL_kmsdrmvideo.c @@ -666,8 +666,8 @@ KMSDRM_CrtcGetVrr(uint32_t drm_fd, uint32_t crtc_id) /* Gets a DRM connector, builds an SDL_Display with it, and adds it to the list of SDL Displays in _this->displays[] */ static void -KMSDRM_AddDisplay (_THIS, drmModeConnector *connector, drmModeRes *resources) { - +KMSDRM_AddDisplay (_THIS, drmModeConnector *connector, drmModeRes *resources) +{ SDL_VideoData *viddata = ((SDL_VideoData *)_this->driverdata); SDL_DisplayData *dispdata = NULL; SDL_VideoDisplay display = {0}; @@ -770,14 +770,37 @@ KMSDRM_AddDisplay (_THIS, drmModeConnector *connector, drmModeRes *resources) { drmModeModeInfo *mode = &connector->modes[i]; if (!SDL_memcmp(mode, &crtc->mode, sizeof(crtc->mode))) { - mode_index = i; - break; + mode_index = i; + break; } } if (mode_index == -1) { - ret = SDL_SetError("Failed to find index of mode attached to the CRTC."); - goto cleanup; + int current_area, largest_area = 0; + + /* Find the preferred mode or the highest resolution mode */ + for (i = 0; i < connector->count_modes; i++) { + drmModeModeInfo *mode = &connector->modes[i]; + + if (mode->type & DRM_MODE_TYPE_PREFERRED) { + mode_index = i; + break; + } + + current_area = mode->hdisplay * mode->vdisplay; + if (current_area > largest_area) { + mode_index = i; + largest_area = current_area; + } + } + if (mode_index != -1) { + crtc->mode = connector->modes[mode_index]; + } + } + + if (mode_index == -1) { + ret = SDL_SetError("Failed to find index of mode attached to the CRTC."); + goto cleanup; } /*********************************************/ From ff99e56d3af276f8fa199d57a64cc863d9c9f798 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Fri, 18 Nov 2022 12:54:55 -0800 Subject: [PATCH 092/153] Fixed KMSDRM window creation failing if OpenGL libraries are not available, but GLES 2.0 libraries are --- src/video/SDL_egl.c | 33 ++++++++++++++++-------- src/video/kmsdrm/SDL_kmsdrmvideo.c | 40 +++++++++++++++++------------- 2 files changed, 45 insertions(+), 28 deletions(-) diff --git a/src/video/SDL_egl.c b/src/video/SDL_egl.c index 2438faf00a..41ae6ec016 100644 --- a/src/video/SDL_egl.c +++ b/src/video/SDL_egl.c @@ -292,8 +292,8 @@ SDL_EGL_UnloadLibrary(_THIS) } } -int -SDL_EGL_LoadLibraryOnly(_THIS, const char *egl_path) +static int +SDL_EGL_LoadLibraryInternal(_THIS, const char *egl_path) { void *egl_dll_handle = NULL, *opengl_dll_handle = NULL; const char *path = NULL; @@ -304,15 +304,6 @@ SDL_EGL_LoadLibraryOnly(_THIS, const char *egl_path) SDL_bool vc4 = (0 == access("/sys/module/vc4/", F_OK)); #endif - if (_this->egl_data) { - return SDL_SetError("EGL context already created"); - } - - _this->egl_data = (struct SDL_EGL_VideoData *) SDL_calloc(1, sizeof(SDL_EGL_VideoData)); - if (!_this->egl_data) { - return SDL_OutOfMemory(); - } - #if SDL_VIDEO_DRIVER_WINDOWS || SDL_VIDEO_DRIVER_WINRT d3dcompiler = SDL_GetHint(SDL_HINT_VIDEO_WIN_D3DCOMPILER); if (d3dcompiler) { @@ -473,6 +464,26 @@ SDL_EGL_LoadLibraryOnly(_THIS, const char *egl_path) return 0; } +int +SDL_EGL_LoadLibraryOnly(_THIS, const char *egl_path) +{ + if (_this->egl_data) { + return SDL_SetError("EGL context already created"); + } + + _this->egl_data = (struct SDL_EGL_VideoData *) SDL_calloc(1, sizeof(SDL_EGL_VideoData)); + if (!_this->egl_data) { + return SDL_OutOfMemory(); + } + + if (SDL_EGL_LoadLibraryInternal(_this, egl_path) < 0) { + SDL_free(_this->egl_data); + _this->egl_data = NULL; + return -1; + } + return 0; +} + static void SDL_EGL_GetVersion(_THIS) { if (_this->egl_data->eglQueryString) { diff --git a/src/video/kmsdrm/SDL_kmsdrmvideo.c b/src/video/kmsdrm/SDL_kmsdrmvideo.c index eeeefef2b2..6c05bbd9bf 100644 --- a/src/video/kmsdrm/SDL_kmsdrmvideo.c +++ b/src/video/kmsdrm/SDL_kmsdrmvideo.c @@ -1456,28 +1456,34 @@ KMSDRM_CreateWindow(_THIS, SDL_Window * window) } } - /* Manually load the GL library. KMSDRM_EGL_LoadLibrary() has already - been called by SDL_CreateWindow() but we don't do anything there, - out KMSDRM_EGL_LoadLibrary() is a dummy precisely to be able to load it here. - If we let SDL_CreateWindow() load the lib, it would be loaded - before we call KMSDRM_GBMInit(), causing all GLES programs to fail. */ - if (!_this->egl_data) { - egl_display = (NativeDisplayType)((SDL_VideoData *)_this->driverdata)->gbm_dev; - if (SDL_EGL_LoadLibrary(_this, NULL, egl_display, EGL_PLATFORM_GBM_MESA)) { - return (SDL_SetError("Can't load EGL/GL library on window creation.")); - } + /* Manually load the GL library. KMSDRM_EGL_LoadLibrary() has already + been called by SDL_CreateWindow() but we don't do anything there, + our KMSDRM_EGL_LoadLibrary() is a dummy precisely to be able to load it here. + If we let SDL_CreateWindow() load the lib, it would be loaded + before we call KMSDRM_GBMInit(), causing all GLES programs to fail. */ + if (!_this->egl_data) { + egl_display = (NativeDisplayType)((SDL_VideoData *)_this->driverdata)->gbm_dev; + if (SDL_EGL_LoadLibrary(_this, NULL, egl_display, EGL_PLATFORM_GBM_MESA) < 0) { + /* Try again with OpenGL ES 2.0 */ + _this->gl_config.profile_mask = SDL_GL_CONTEXT_PROFILE_ES; + _this->gl_config.major_version = 2; + _this->gl_config.minor_version = 0; + if (SDL_EGL_LoadLibrary(_this, NULL, egl_display, EGL_PLATFORM_GBM_MESA) < 0) { + return (SDL_SetError("Can't load EGL/GL library on window creation.")); + } + } - _this->gl_config.driver_loaded = 1; + _this->gl_config.driver_loaded = 1; - } + } - /* Create the cursor BO for the display of this window, - now that we know this is not a VK window. */ - KMSDRM_CreateCursorBO(display); + /* Create the cursor BO for the display of this window, + now that we know this is not a VK window. */ + KMSDRM_CreateCursorBO(display); - /* Create and set the default cursor for the display + /* Create and set the default cursor for the display of this window, now that we know this is not a VK window. */ - KMSDRM_InitMouse(_this, display); + KMSDRM_InitMouse(_this, display); /* The FULLSCREEN flags are cut out from window->flags at this point, so we can't know if a window is fullscreen or not, hence all windows From 509939b1b63e16c21094f550a4627be6a8bf0d72 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Fri, 18 Nov 2022 18:20:53 -0800 Subject: [PATCH 093/153] Disable the third party PS3 HIDAPI driver by default, the L3/R3 buttons are unknown --- src/joystick/hidapi/SDL_hidapi_ps3.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/joystick/hidapi/SDL_hidapi_ps3.c b/src/joystick/hidapi/SDL_hidapi_ps3.c index 49913d9dff..10e3bc548f 100644 --- a/src/joystick/hidapi/SDL_hidapi_ps3.c +++ b/src/joystick/hidapi/SDL_hidapi_ps3.c @@ -596,9 +596,13 @@ SDL_HIDAPI_DeviceDriver SDL_HIDAPI_DriverPS3 = static SDL_bool HIDAPI_DriverPS3ThirdParty_IsEnabled(void) { +#if 1 /* Not enabled by default, we don't know what the L3/R3 buttons are */ + return SDL_GetHintBoolean(SDL_HINT_JOYSTICK_HIDAPI_PS3, SDL_FALSE); +#else return SDL_GetHintBoolean(SDL_HINT_JOYSTICK_HIDAPI_PS3, SDL_GetHintBoolean(SDL_HINT_JOYSTICK_HIDAPI, SDL_HIDAPI_DEFAULT)); +#endif } static SDL_bool From fe396e306effb170b1abd093111d3f5c5338ae4b Mon Sep 17 00:00:00 2001 From: Frank Praznik Date: Sat, 19 Nov 2022 11:28:31 -0500 Subject: [PATCH 094/153] wayland: Use the cached window size when switching from non-floating to floating window state When changing the window state from non-floating to floating (e.g. leaving fullscreen), libdecor can send bogus content sizes that are +/- the height of the window title bar and start 'walking' the window height in one direction or the other with every transition. The floating window size is known, so use the cached value instead of the size reported by libdecor when restoring the floating state. --- src/video/wayland/SDL_waylandwindow.c | 16 ++++++++++++---- src/video/wayland/SDL_waylandwindow.h | 1 + 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/video/wayland/SDL_waylandwindow.c b/src/video/wayland/SDL_waylandwindow.c index a329ad357b..a31f6baf6e 100644 --- a/src/video/wayland/SDL_waylandwindow.c +++ b/src/video/wayland/SDL_waylandwindow.c @@ -878,11 +878,17 @@ decoration_frame_configure(struct libdecor_frame *frame, wind->floating_resize_pending = SDL_FALSE; } else { /* - * XXX: When hiding a floating window, libdecor can send bogus content sizes that - * are +/- the height of the title bar, which distorts the window size. - * Ignore any values from libdecor when hiding a floating window. + * XXX: libdecor can send bogus content sizes that are +/- the height + * of the title bar when hiding a window or transitioning from + * non-floating to floating state, which distorts the window size. + * + * Ignore any size values from libdecor in these scenarios in + * favor of the cached window size. + * + * https://gitlab.gnome.org/jadahl/libdecor/-/issues/40 */ - const SDL_bool use_cached_size = (window->is_hiding || !!(window->flags & SDL_WINDOW_HIDDEN)); + const SDL_bool use_cached_size = (floating && !wind->was_floating) || + (window->is_hiding || !!(window->flags & SDL_WINDOW_HIDDEN)); /* This will never set 0 for width/height unless the function returns false */ if (use_cached_size || !libdecor_configuration_get_content_size(configuration, frame, &width, &height)) { @@ -905,6 +911,8 @@ decoration_frame_configure(struct libdecor_frame *frame, wind->floating_height = height; } + wind->was_floating = floating; + /* Do the resize on the SDL side (this will set window->w/h)... */ Wayland_HandleResize(window, width, height, scale_factor); wind->shell_surface.libdecor.initial_configure_seen = SDL_TRUE; diff --git a/src/video/wayland/SDL_waylandwindow.h b/src/video/wayland/SDL_waylandwindow.h index b6a3aa28c3..6e27010487 100644 --- a/src/video/wayland/SDL_waylandwindow.h +++ b/src/video/wayland/SDL_waylandwindow.h @@ -102,6 +102,7 @@ typedef struct { int window_width, window_height; SDL_bool needs_resize_event; SDL_bool floating_resize_pending; + SDL_bool was_floating; SDL_bool is_fullscreen; SDL_bool in_fullscreen_transition; Uint32 fullscreen_flags; From 3bc4bad8fb2b0be328f1c00628867a81a089aa2f Mon Sep 17 00:00:00 2001 From: Ozkan Sezer Date: Sun, 20 Nov 2022 23:50:10 +0300 Subject: [PATCH 095/153] add missing strcasestr checks to cmake and autotools build systems, and update config files. --- CMakeLists.txt | 2 +- configure | 6 ++++++ configure.ac | 2 +- include/SDL_config.h.cmake | 1 + include/SDL_config.h.in | 1 + include/SDL_config_android.h | 1 + include/SDL_config_iphoneos.h | 1 + include/SDL_config_macosx.h | 1 + 8 files changed, 13 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 408bc2f142..05bbac494e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1045,7 +1045,7 @@ if(SDL_LIBC) bsearch qsort abs bcopy memset memcpy memmove memcmp strlen strlcpy strlcat _strrev _strupr _strlwr index rindex strchr strrchr strstr strtok_r itoa _ltoa _uitoa _ultoa strtol strtoul _i64toa _ui64toa strtoll strtoull - atoi atof strcmp strncmp _stricmp strcasecmp _strnicmp strncasecmp + atoi atof strcmp strncmp _stricmp strcasecmp _strnicmp strncasecmp strcasestr wcscmp _wcsdup wcsdup wcslcat wcslcpy wcslen wcsncmp wcsstr wcscasecmp _wcsicmp wcsncasecmp _wcsnicmp sscanf vsscanf vsnprintf fopen64 fseeko fseeko64 _Exit diff --git a/configure b/configure index 9461408e86..59d347f3ea 100755 --- a/configure +++ b/configure @@ -19535,6 +19535,12 @@ if test "x$ac_cv_func_strncasecmp" = xyes then : printf "%s\n" "#define HAVE_STRNCASECMP 1" >>confdefs.h +fi +ac_fn_c_check_func "$LINENO" "strcasestr" "ac_cv_func_strcasestr" +if test "x$ac_cv_func_strcasestr" = xyes +then : + printf "%s\n" "#define HAVE_STRCASESTR 1" >>confdefs.h + fi ac_fn_c_check_func "$LINENO" "vsscanf" "ac_cv_func_vsscanf" if test "x$ac_cv_func_vsscanf" = xyes diff --git a/configure.ac b/configure.ac index a4252d2ed5..d8e3dc3daa 100644 --- a/configure.ac +++ b/configure.ac @@ -348,7 +348,7 @@ dnl Checks for library functions. AC_DEFINE(HAVE_MPROTECT, 1, [ ]) ],[]), ) - AC_CHECK_FUNCS(malloc calloc realloc free getenv setenv putenv unsetenv bsearch qsort abs bcopy memset memcmp memcpy memmove wcslen wcslcpy wcslcat _wcsdup wcsdup wcsstr wcscmp wcsncmp wcscasecmp _wcsicmp wcsncasecmp _wcsnicmp strlen strlcpy strlcat _strrev _strupr _strlwr index rindex strchr strrchr strstr strtok_r itoa _ltoa _uitoa _ultoa strtod strtol strtoul _i64toa _ui64toa strtoll strtoull atoi atof strcmp strncmp _stricmp strcasecmp _strnicmp strncasecmp vsscanf vsnprintf fopen64 fseeko fseeko64 sigaction setjmp nanosleep sysconf sysctlbyname getauxval elf_aux_info poll _Exit) + AC_CHECK_FUNCS(malloc calloc realloc free getenv setenv putenv unsetenv bsearch qsort abs bcopy memset memcmp memcpy memmove wcslen wcslcpy wcslcat _wcsdup wcsdup wcsstr wcscmp wcsncmp wcscasecmp _wcsicmp wcsncasecmp _wcsnicmp strlen strlcpy strlcat _strrev _strupr _strlwr index rindex strchr strrchr strstr strtok_r itoa _ltoa _uitoa _ultoa strtod strtol strtoul _i64toa _ui64toa strtoll strtoull atoi atof strcmp strncmp _stricmp strcasecmp _strnicmp strncasecmp strcasestr vsscanf vsnprintf fopen64 fseeko fseeko64 sigaction setjmp nanosleep sysconf sysctlbyname getauxval elf_aux_info poll _Exit) AC_CHECK_LIB(m, pow, [LIBS="$LIBS -lm"; EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lm"]) AC_CHECK_FUNCS(acos acosf asin asinf atan atanf atan2 atan2f ceil ceilf copysign copysignf cos cosf exp expf fabs fabsf floor floorf trunc truncf fmod fmodf log logf log10 log10f lround lroundf pow powf round roundf scalbn scalbnf sin sinf sqrt sqrtf tan tanf) diff --git a/include/SDL_config.h.cmake b/include/SDL_config.h.cmake index b85c5672b1..8fcb63d18f 100644 --- a/include/SDL_config.h.cmake +++ b/include/SDL_config.h.cmake @@ -140,6 +140,7 @@ #cmakedefine HAVE_STRCASECMP 1 #cmakedefine HAVE__STRNICMP 1 #cmakedefine HAVE_STRNCASECMP 1 +#cmakedefine HAVE_STRCASESTR 1 #cmakedefine HAVE_SSCANF 1 #cmakedefine HAVE_VSSCANF 1 #cmakedefine HAVE_VSNPRINTF 1 diff --git a/include/SDL_config.h.in b/include/SDL_config.h.in index 67e50745b4..7b8d848e0b 100644 --- a/include/SDL_config.h.in +++ b/include/SDL_config.h.in @@ -143,6 +143,7 @@ #undef HAVE_STRCASECMP #undef HAVE__STRNICMP #undef HAVE_STRNCASECMP +#undef HAVE_STRCASESTR #undef HAVE_SSCANF #undef HAVE_VSSCANF #undef HAVE_SNPRINTF diff --git a/include/SDL_config_android.h b/include/SDL_config_android.h index 5a9cfc0459..64918ae0b8 100644 --- a/include/SDL_config_android.h +++ b/include/SDL_config_android.h @@ -85,6 +85,7 @@ #define HAVE_STRNCMP 1 #define HAVE_STRCASECMP 1 #define HAVE_STRNCASECMP 1 +#define HAVE_STRCASESTR 1 #define HAVE_VSSCANF 1 #define HAVE_VSNPRINTF 1 #define HAVE_ACOS 1 diff --git a/include/SDL_config_iphoneos.h b/include/SDL_config_iphoneos.h index 48f9f9f9be..6db16eb4cc 100644 --- a/include/SDL_config_iphoneos.h +++ b/include/SDL_config_iphoneos.h @@ -85,6 +85,7 @@ #define HAVE_STRNCMP 1 #define HAVE_STRCASECMP 1 #define HAVE_STRNCASECMP 1 +#define HAVE_STRCASESTR 1 #define HAVE_VSSCANF 1 #define HAVE_VSNPRINTF 1 #define HAVE_M_PI 1 diff --git a/include/SDL_config_macosx.h b/include/SDL_config_macosx.h index 023ecaae32..e7189f3a14 100644 --- a/include/SDL_config_macosx.h +++ b/include/SDL_config_macosx.h @@ -88,6 +88,7 @@ #define HAVE_STRNCMP 1 #define HAVE_STRCASECMP 1 #define HAVE_STRNCASECMP 1 +#define HAVE_STRCASESTR 1 #define HAVE_VSSCANF 1 #define HAVE_VSNPRINTF 1 #define HAVE_M_PI 1 From 802c624ab38494c3e27093af528710b6da28d12f Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sun, 20 Nov 2022 14:37:05 -0800 Subject: [PATCH 096/153] Strip trailing newline when reading the VERSION file --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 05bbac494e..bf0c5e9ea7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2962,6 +2962,7 @@ set(EXTRA_CFLAGS ${_EXTRA_CFLAGS}) if(EXISTS "${PROJECT_SOURCE_DIR}/VERSION") file(READ "${PROJECT_SOURCE_DIR}/VERSION" SDL_SOURCE_VERSION) + string(STRIP "${SDL_SOURCE_VERSION}" SDL_SOURCE_VERSION) endif() find_package(Git) From 8ae46a49ea52839e0fe96b03ab183fe3ad99863b Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Mon, 21 Nov 2022 06:57:02 -0800 Subject: [PATCH 097/153] Save the version in VERSION.txt instead of VERSION Fixes https://github.com/libsdl-org/SDL/issues/6558 --- .gitignore | 2 +- Android.mk | 2 +- CMakeLists.txt | 4 ++-- build-scripts/showrev.sh | 4 ++-- build-scripts/updaterev.sh | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index 1ab87fbc97..a746abbc16 100644 --- a/.gitignore +++ b/.gitignore @@ -15,7 +15,7 @@ build gen Build buildbot -/VERSION +/VERSION.txt *.so *.so.* diff --git a/Android.mk b/Android.mk index facc54afb7..06146cd40c 100644 --- a/Android.mk +++ b/Android.mk @@ -12,7 +12,7 @@ LOCAL_MODULE := SDL2 LOCAL_C_INCLUDES := $(LOCAL_PATH)/include -LOCAL_EXPORT_C_INCLUDES := $(LOCAL_C_INCLUDES) +LOCAL_EXPORT_C_INCLUDES := $(LOCAL_C_INCLUDES)/include LOCAL_SRC_FILES := \ $(subst $(LOCAL_PATH)/,, \ diff --git a/CMakeLists.txt b/CMakeLists.txt index bf0c5e9ea7..ffd9de7efa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2960,8 +2960,8 @@ set(EXTRA_CFLAGS ${_EXTRA_CFLAGS}) # Compat helpers for the configuration files -if(EXISTS "${PROJECT_SOURCE_DIR}/VERSION") - file(READ "${PROJECT_SOURCE_DIR}/VERSION" SDL_SOURCE_VERSION) +if(EXISTS "${PROJECT_SOURCE_DIR}/VERSION.txt") + file(READ "${PROJECT_SOURCE_DIR}/VERSION.txt" SDL_SOURCE_VERSION) string(STRIP "${SDL_SOURCE_VERSION}" SDL_SOURCE_VERSION) endif() diff --git a/build-scripts/showrev.sh b/build-scripts/showrev.sh index 02cbbb0c68..a061df4235 100755 --- a/build-scripts/showrev.sh +++ b/build-scripts/showrev.sh @@ -5,8 +5,8 @@ SDL_ROOT=$(dirname $0)/.. cd $SDL_ROOT -if [ -e ./VERSION ]; then - cat ./VERSION +if [ -e ./VERSION.txt ]; then + cat ./VERSION.txt exit 0 fi diff --git a/build-scripts/updaterev.sh b/build-scripts/updaterev.sh index 3ab034fd54..cc8638210a 100755 --- a/build-scripts/updaterev.sh +++ b/build-scripts/updaterev.sh @@ -29,7 +29,7 @@ done rev=`sh showrev.sh 2>/dev/null` if [ "$rev" != "" ]; then if [ -n "$dist" ]; then - echo "$rev" > "$outdir/VERSION" + echo "$rev" > "$outdir/VERSION.txt" fi echo "/* Generated by updaterev.sh, do not edit */" >"$header.new" if [ -n "$vendor" ]; then From 8b20b568b0104cf1695a5a35c5e24110fe34d4c0 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Mon, 21 Nov 2022 07:41:35 -0800 Subject: [PATCH 098/153] Don't report battery level for disconnected batteries Fixes https://github.com/libsdl-org/SDL/issues/6536 --- src/core/windows/SDL_xinput.h | 5 ++++- src/joystick/SDL_joystick.c | 2 +- src/joystick/windows/SDL_rawinputjoystick.c | 3 ++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/core/windows/SDL_xinput.h b/src/core/windows/SDL_xinput.h index 461d99b485..5f6d36a989 100644 --- a/src/core/windows/SDL_xinput.h +++ b/src/core/windows/SDL_xinput.h @@ -133,10 +133,13 @@ using namespace XInputOnGameInput; #ifndef BATTERY_DEVTYPE_GAMEPAD #define BATTERY_DEVTYPE_GAMEPAD 0x00 #endif + +#ifndef BATTERY_TYPE_DISCONNECTED +#define BATTERY_TYPE_DISCONNECTED 0x00 +#endif #ifndef BATTERY_TYPE_WIRED #define BATTERY_TYPE_WIRED 0x01 #endif - #ifndef BATTERY_TYPE_UNKNOWN #define BATTERY_TYPE_UNKNOWN 0xFF #endif diff --git a/src/joystick/SDL_joystick.c b/src/joystick/SDL_joystick.c index 4b95581452..c882a1a402 100644 --- a/src/joystick/SDL_joystick.c +++ b/src/joystick/SDL_joystick.c @@ -2901,7 +2901,7 @@ void SDL_PrivateJoystickBatteryLevel(SDL_Joystick *joystick, SDL_JoystickPowerLe { CHECK_JOYSTICK_MAGIC(joystick, ); - SDL_assert(joystick->ref_count); /* make sure we are calling this only for update, not for initialisation */ + SDL_assert(joystick->ref_count); /* make sure we are calling this only for update, not for initialization */ if (ePowerLevel != joystick->epowerlevel) { #if !SDL_EVENTS_DISABLED if (SDL_GetEventState(SDL_JOYBATTERYUPDATED) == SDL_ENABLE) { diff --git a/src/joystick/windows/SDL_rawinputjoystick.c b/src/joystick/windows/SDL_rawinputjoystick.c index 120a361f13..fc738b07f3 100644 --- a/src/joystick/windows/SDL_rawinputjoystick.c +++ b/src/joystick/windows/SDL_rawinputjoystick.c @@ -1775,7 +1775,8 @@ RAWINPUT_UpdateOtherAPIs(SDL_Joystick *joystick) } has_trigger_data = SDL_TRUE; - if (battery_info->BatteryType != BATTERY_TYPE_UNKNOWN) { + if (battery_info->BatteryType != BATTERY_TYPE_UNKNOWN && + battery_info->BatteryType != BATTERY_TYPE_DISCONNECTED) { SDL_JoystickPowerLevel ePowerLevel = SDL_JOYSTICK_POWER_UNKNOWN; if (battery_info->BatteryType == BATTERY_TYPE_WIRED) { ePowerLevel = SDL_JOYSTICK_POWER_WIRED; From d167cd67159eac93aaa892c5b124c6c53718d408 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Mon, 21 Nov 2022 09:02:10 -0800 Subject: [PATCH 099/153] =?UTF-8?q?Added=20the=20Gunfighter=20Mk.III=20?= =?UTF-8?q?=E2=80=98Space=20Combat=20Edition=E2=80=99=20as=20a=20flight=20?= =?UTF-8?q?stick?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/joystick/SDL_joystick.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/joystick/SDL_joystick.c b/src/joystick/SDL_joystick.c index c882a1a402..0339296949 100644 --- a/src/joystick/SDL_joystick.c +++ b/src/joystick/SDL_joystick.c @@ -2479,6 +2479,8 @@ static SDL_bool SDL_IsJoystickProductFlightStick(Uint32 vidpid) MAKE_VIDPID(0x0738, 0x2221), /* Saitek Pro Flight X-56 Rhino Stick */ MAKE_VIDPID(0x044f, 0xb10a), /* ThrustMaster, Inc. T.16000M Joystick */ MAKE_VIDPID(0x046d, 0xc215), /* Logitech Extreme 3D */ + MAKE_VIDPID(0x231d, 0x0126), /* Gunfighter Mk.III ‘Space Combat Edition’ (right) */ + MAKE_VIDPID(0x231d, 0x0127), /* Gunfighter Mk.III ‘Space Combat Edition’ (left) */ }; int i; From 0bfeed061b10ea7dd37c88d9bae1824bad760f3a Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Mon, 21 Nov 2022 16:15:58 -0800 Subject: [PATCH 100/153] Updated to version 2.26.0 for release --- CMakeLists.txt | 4 ++-- Makefile.os2 | 4 ++-- Makefile.w32 | 4 ++-- Xcode/SDL/Info-Framework.plist | 4 ++-- Xcode/SDL/SDL.xcodeproj/project.pbxproj | 16 ++++++++-------- .../main/java/org/libsdl/app/SDLActivity.java | 4 ++-- configure | 4 ++-- configure.ac | 4 ++-- include/SDL_version.h | 4 ++-- src/main/windows/version.rc | 8 ++++---- 10 files changed, 28 insertions(+), 28 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ffd9de7efa..021b66cd57 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -85,8 +85,8 @@ endif() # See docs/release_checklist.md set(SDL_MAJOR_VERSION 2) -set(SDL_MINOR_VERSION 25) -set(SDL_MICRO_VERSION 1) +set(SDL_MINOR_VERSION 26) +set(SDL_MICRO_VERSION 0) set(SDL_VERSION "${SDL_MAJOR_VERSION}.${SDL_MINOR_VERSION}.${SDL_MICRO_VERSION}") # Set defaults preventing destination file conflicts diff --git a/Makefile.os2 b/Makefile.os2 index 111ea0eef8..2e38ed0d47 100644 --- a/Makefile.os2 +++ b/Makefile.os2 @@ -14,8 +14,8 @@ LIBNAME = SDL2 MAJOR_VERSION = 2 -MINOR_VERSION = 25 -MICRO_VERSION = 1 +MINOR_VERSION = 26 +MICRO_VERSION = 0 VERSION = $(MAJOR_VERSION).$(MINOR_VERSION).$(MICRO_VERSION) DESCRIPTION = Simple DirectMedia Layer 2 diff --git a/Makefile.w32 b/Makefile.w32 index 628ee7ed69..82609036b9 100644 --- a/Makefile.w32 +++ b/Makefile.w32 @@ -5,8 +5,8 @@ LIBNAME = SDL2 MAJOR_VERSION = 2 -MINOR_VERSION = 25 -MICRO_VERSION = 1 +MINOR_VERSION = 26 +MICRO_VERSION = 0 VERSION = $(MAJOR_VERSION).$(MINOR_VERSION).$(MICRO_VERSION) LIBHOME = . diff --git a/Xcode/SDL/Info-Framework.plist b/Xcode/SDL/Info-Framework.plist index 16ca1d1b71..09bae6c16e 100644 --- a/Xcode/SDL/Info-Framework.plist +++ b/Xcode/SDL/Info-Framework.plist @@ -19,10 +19,10 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 2.25.1 + 2.26.0 CFBundleSignature SDLX CFBundleVersion - 2.25.1 + 2.26.0 diff --git a/Xcode/SDL/SDL.xcodeproj/project.pbxproj b/Xcode/SDL/SDL.xcodeproj/project.pbxproj index e0f747ab77..b59a594fb8 100644 --- a/Xcode/SDL/SDL.xcodeproj/project.pbxproj +++ b/Xcode/SDL/SDL.xcodeproj/project.pbxproj @@ -9528,8 +9528,8 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEPLOYMENT_POSTPROCESSING = YES; - DYLIB_COMPATIBILITY_VERSION = 2502.0.0; - DYLIB_CURRENT_VERSION = 2502.0.0; + DYLIB_COMPATIBILITY_VERSION = 2601.0.0; + DYLIB_CURRENT_VERSION = 2601.0.0; DYLIB_INSTALL_NAME_BASE = "@rpath"; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_ALTIVEC_EXTENSIONS = YES; @@ -9613,8 +9613,8 @@ CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; DEBUG_INFORMATION_FORMAT = dwarf; - DYLIB_COMPATIBILITY_VERSION = 2502.0.0; - DYLIB_CURRENT_VERSION = 2502.0.0; + DYLIB_COMPATIBILITY_VERSION = 2601.0.0; + DYLIB_CURRENT_VERSION = 2601.0.0; DYLIB_INSTALL_NAME_BASE = "@rpath"; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; @@ -9862,8 +9862,8 @@ CURRENT_PROJECT_VERSION = 1; DEFINES_MODULE = YES; DEVELOPMENT_TEAM = ""; - DYLIB_COMPATIBILITY_VERSION = 2502.0.0; - DYLIB_CURRENT_VERSION = 2502.0.0; + DYLIB_COMPATIBILITY_VERSION = 2601.0.0; + DYLIB_CURRENT_VERSION = 2601.0.0; DYLIB_INSTALL_NAME_BASE = "@rpath"; GCC_C_LANGUAGE_STANDARD = gnu11; GCC_DYNAMIC_NO_PIC = NO; @@ -9914,8 +9914,8 @@ CURRENT_PROJECT_VERSION = 1; DEFINES_MODULE = YES; DEVELOPMENT_TEAM = ""; - DYLIB_COMPATIBILITY_VERSION = 2502.0.0; - DYLIB_CURRENT_VERSION = 2502.0.0; + DYLIB_COMPATIBILITY_VERSION = 2601.0.0; + DYLIB_CURRENT_VERSION = 2601.0.0; DYLIB_INSTALL_NAME_BASE = "@rpath"; ENABLE_NS_ASSERTIONS = NO; GCC_C_LANGUAGE_STANDARD = gnu11; diff --git a/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java b/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java index e749d6b775..90e3ac60b6 100644 --- a/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java +++ b/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java @@ -60,8 +60,8 @@ import java.util.Locale; public class SDLActivity extends Activity implements View.OnSystemUiVisibilityChangeListener { private static final String TAG = "SDL"; private static final int SDL_MAJOR_VERSION = 2; - private static final int SDL_MINOR_VERSION = 25; - private static final int SDL_MICRO_VERSION = 1; + private static final int SDL_MINOR_VERSION = 26; + private static final int SDL_MICRO_VERSION = 0; /* // Display InputType.SOURCE/CLASS of events and devices // diff --git a/configure b/configure index 59d347f3ea..87c576def5 100755 --- a/configure +++ b/configure @@ -3453,8 +3453,8 @@ orig_CFLAGS="$CFLAGS" # See docs/release_checklist.md SDL_MAJOR_VERSION=2 -SDL_MINOR_VERSION=25 -SDL_MICRO_VERSION=1 +SDL_MINOR_VERSION=26 +SDL_MICRO_VERSION=0 SDL_VERSION=$SDL_MAJOR_VERSION.$SDL_MINOR_VERSION.$SDL_MICRO_VERSION SDL_BINARY_AGE=`expr $SDL_MINOR_VERSION \* 100 + $SDL_MICRO_VERSION` diff --git a/configure.ac b/configure.ac index d8e3dc3daa..cc30f9a164 100644 --- a/configure.ac +++ b/configure.ac @@ -12,8 +12,8 @@ orig_CFLAGS="$CFLAGS" dnl Set various version strings - taken gratefully from the GTk sources # See docs/release_checklist.md SDL_MAJOR_VERSION=2 -SDL_MINOR_VERSION=25 -SDL_MICRO_VERSION=1 +SDL_MINOR_VERSION=26 +SDL_MICRO_VERSION=0 SDL_VERSION=$SDL_MAJOR_VERSION.$SDL_MINOR_VERSION.$SDL_MICRO_VERSION SDL_BINARY_AGE=`expr $SDL_MINOR_VERSION \* 100 + $SDL_MICRO_VERSION` diff --git a/include/SDL_version.h b/include/SDL_version.h index 612d2f53d9..e85fceb346 100644 --- a/include/SDL_version.h +++ b/include/SDL_version.h @@ -58,8 +58,8 @@ typedef struct SDL_version /* Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL */ #define SDL_MAJOR_VERSION 2 -#define SDL_MINOR_VERSION 25 -#define SDL_PATCHLEVEL 1 +#define SDL_MINOR_VERSION 26 +#define SDL_PATCHLEVEL 0 /** * Macro to determine SDL version program was compiled against. diff --git a/src/main/windows/version.rc b/src/main/windows/version.rc index 97930ca04e..fb2c268900 100644 --- a/src/main/windows/version.rc +++ b/src/main/windows/version.rc @@ -9,8 +9,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US // VS_VERSION_INFO VERSIONINFO - FILEVERSION 2,25,1,0 - PRODUCTVERSION 2,25,1,0 + FILEVERSION 2,26,0,0 + PRODUCTVERSION 2,26,0,0 FILEFLAGSMASK 0x3fL FILEFLAGS 0x0L FILEOS 0x40004L @@ -23,12 +23,12 @@ BEGIN BEGIN VALUE "CompanyName", "\0" VALUE "FileDescription", "SDL\0" - VALUE "FileVersion", "2, 25, 1, 0\0" + VALUE "FileVersion", "2, 26, 0, 0\0" VALUE "InternalName", "SDL\0" VALUE "LegalCopyright", "Copyright (C) 2022 Sam Lantinga\0" VALUE "OriginalFilename", "SDL2.dll\0" VALUE "ProductName", "Simple DirectMedia Layer\0" - VALUE "ProductVersion", "2, 25, 1, 0\0" + VALUE "ProductVersion", "2, 26, 0, 0\0" END END BLOCK "VarFileInfo" From 2c4159b99adf72c428347a7dea6e704314b5b6f1 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Mon, 21 Nov 2022 20:28:58 -0800 Subject: [PATCH 101/153] First pass at changing SDL 2.0 to SDL 3.0 --- .editorconfig | 2 +- Android.mk | 10 +- CMakeLists.txt | 754 +++++++-------- Makefile.in | 60 +- Makefile.minimal | 4 +- Makefile.os2 | 16 +- Makefile.pandora | 2 +- Makefile.w32 | 18 +- README.md | 2 +- SDL2Config.cmake.in | 65 -- SDL2.spec.in => SDL3.spec.in | 6 +- SDL3Config.cmake.in | 65 ++ VisualC-GDK/SDL.sln | 6 +- VisualC-GDK/SDL/SDL.vcxproj | 2 +- VisualC-GDK/SDLmain/SDLmain.vcxproj | 4 +- VisualC-GDK/SDLtest/SDLtest.vcxproj | 4 +- VisualC-WinRT/SDL-UWP.sln | 2 +- VisualC-WinRT/SDL-UWP.vcxproj | 20 +- VisualC/SDL.sln | 6 +- VisualC/SDL/SDL.vcxproj | 2 +- VisualC/SDLmain/SDLmain.vcxproj | 2 +- VisualC/SDLtest/SDLtest.vcxproj | 2 +- VisualC/pkg-support/cmake/sdl2-config.cmake | 111 --- ...ersion.cmake => sdl3-config-version.cmake} | 6 +- VisualC/pkg-support/cmake/sdl3-config.cmake | 111 +++ .../Demos/Demos.xcodeproj/project.pbxproj | 98 +- Xcode-iOS/Demos/README | 2 +- Xcode-iOS/Demos/config.xcconfig | 2 +- Xcode/SDL/Info-Framework.plist | 4 +- Xcode/SDL/SDL.xcodeproj/project.pbxproj | 126 +-- .../xcschemes/Framework-iOS.xcscheme | 4 +- .../xcschemes/xcFramework-iOS.xcscheme | 4 +- Xcode/SDL/{SDL2 => SDL3}/Info.plist | 0 Xcode/SDL/pkg-support/SDL.info | 2 +- .../resources/CMake/sdl2-config.cmake | 69 -- ...ersion.cmake => sdl3-config-version.cmake} | 6 +- .../resources/CMake/sdl3-config.cmake | 69 ++ Xcode/SDL/pkg-support/resources/ReadMe.txt | 10 +- Xcode/SDL/pkg-support/resources/SDL_DS_Store | Bin 15364 -> 15365 bytes .../SDLTest/SDLTest.xcodeproj/project.pbxproj | 66 +- Xcode/SDLTest/config.xcconfig | 6 +- android-project-ant/jni/src/Android.mk | 2 +- android-project-ant/jni/src/Android_static.mk | 2 +- android-project/app/jni/src/Android.mk | 2 +- android-project/app/jni/src/CMakeLists.txt | 4 +- .../main/java/org/libsdl/app/SDLActivity.java | 18 +- build-scripts/android-prefab.sh | 4 +- build-scripts/androidbuildlibs.sh | 2 +- build-scripts/emscripten-buildbot.sh | 6 +- build-scripts/nacl-buildbot.sh | 8 +- build-scripts/naclbuild.sh | 12 +- build-scripts/raspberrypi-buildbot.sh | 14 +- build-scripts/windows-buildbot-zipper.bat | 6 +- cmake/macros.cmake | 2 +- cmake/sdlchecks.cmake | 58 +- cmake/test/CMakeLists.txt | 84 +- cmake/test/jni/Android.mk | 6 +- cmake/test/main_cli.c | 2 +- cmake/test/main_gui.c | 4 +- cmake/test/main_lib.c | 2 +- cmake/test/test_pkgconfig.sh | 6 +- cmake/test/test_sdlconfig.sh | 6 +- configure | 64 +- configure.ac | 44 +- docs/README-android.md | 8 +- docs/README-cmake.md | 30 +- docs/README-dynapi.md | 24 +- docs/README-emscripten.md | 4 +- docs/README-gdk.md | 20 +- docs/README-ios.md | 8 +- docs/README-kmsbsd.md | 2 +- docs/README-n3ds.md | 2 +- docs/README-ngage.md | 4 +- docs/README-os2.md | 13 +- docs/README-ps2.md | 6 +- docs/README-psp.md | 6 +- docs/README-raspberrypi.md | 4 +- docs/README-riscos.md | 6 +- docs/README-visualc.md | 16 +- docs/README-winrt.md | 6 +- docs/doxyfile | 8 +- include/SDL.h | 2 +- include/SDL_audio.h | 2 +- include/SDL_hints.h | 2 +- include/SDL_main.h | 2 +- include/SDL_test.h | 2 +- include/SDL_test_assert.h | 2 +- include/SDL_test_common.h | 2 +- include/SDL_test_compare.h | 2 +- include/SDL_test_crc32.h | 2 +- include/SDL_test_font.h | 2 +- include/SDL_test_fuzzer.h | 2 +- include/SDL_test_harness.h | 2 +- include/SDL_test_images.h | 2 +- include/SDL_test_log.h | 2 +- include/SDL_test_md5.h | 2 +- include/SDL_test_memory.h | 2 +- include/SDL_test_random.h | 2 +- include/SDL_thread.h | 8 +- include/SDL_version.h | 6 +- .../cmake/sdl2-config-version.cmake | 19 - mingw/pkg-support/cmake/sdl2-config.cmake | 19 - .../cmake/sdl3-config-version.cmake | 19 + mingw/pkg-support/cmake/sdl3-config.cmake | 19 + sdl2-config.cmake.in | 206 ----- ...n.cmake.in => sdl3-config-version.cmake.in | 2 +- sdl3-config.cmake.in | 206 +++++ sdl2-config.in => sdl3-config.in | 4 +- sdl2.m4 => sdl3.m4 | 76 +- sdl2.pc.in => sdl3.pc.in | 4 +- src/SDL_internal.h | 2 +- src/audio/emscripten/SDL_emscriptenaudio.c | 134 +-- src/audio/qsa/SDL_qsa_audio.c | 2 +- src/core/linux/SDL_ibus.c | 2 +- src/dynapi/SDL2.exports | 869 ------------------ src/dynapi/SDL3.exports | 869 ++++++++++++++++++ src/dynapi/SDL_dynapi.c | 16 +- src/dynapi/gendynapi.pl | 8 +- src/main/windows/version.rc | 10 +- ...cur => SDL3-WinRTResource_BlankCursor.cur} | Bin ...nRTResources.rc => SDL3-WinRTResources.rc} | 2 +- src/stdlib/SDL_mslibc.c | 2 +- .../emscripten/SDL_emscriptenframebuffer.c | 36 +- src/video/haiku/SDL_bmessagebox.cc | 2 +- src/video/kmsdrm/SDL_kmsdrmopengles.c | 2 +- src/video/kmsdrm/SDL_kmsdrmvideo.c | 2 +- src/video/os2/SDL_os2video.c | 4 +- src/video/raspberry/SDL_rpiopengles.c | 2 +- src/video/windows/SDL_windowswindow.c | 3 +- src/video/winrt/SDL_winrtmouse.cpp | 4 +- src/video/x11/SDL_x11video.c | 2 +- test/CMakeLists.txt | 40 +- test/Makefile.in | 4 +- test/Makefile.os2 | 2 +- test/Makefile.w32 | 2 +- test/acinclude.m4 | 54 +- test/configure | 108 +-- test/configure.ac | 20 +- test/nacl/Makefile | 4 +- test/testautomation_audio.c | 2 +- test/testver.c | 6 +- test/watcom.mif | 8 +- visualtest/COPYING.txt | 2 +- visualtest/acinclude.m4 | 54 +- visualtest/configure | 86 +- visualtest/configure.ac | 6 +- 146 files changed, 2633 insertions(+), 2635 deletions(-) delete mode 100644 SDL2Config.cmake.in rename SDL2.spec.in => SDL3.spec.in (97%) create mode 100644 SDL3Config.cmake.in delete mode 100644 VisualC/pkg-support/cmake/sdl2-config.cmake rename VisualC/pkg-support/cmake/{sdl2-config-version.cmake => sdl3-config-version.cmake} (92%) create mode 100644 VisualC/pkg-support/cmake/sdl3-config.cmake rename Xcode/SDL/{SDL2 => SDL3}/Info.plist (100%) delete mode 100644 Xcode/SDL/pkg-support/resources/CMake/sdl2-config.cmake rename Xcode/SDL/pkg-support/resources/CMake/{sdl2-config-version.cmake => sdl3-config-version.cmake} (94%) create mode 100644 Xcode/SDL/pkg-support/resources/CMake/sdl3-config.cmake delete mode 100644 mingw/pkg-support/cmake/sdl2-config-version.cmake delete mode 100644 mingw/pkg-support/cmake/sdl2-config.cmake create mode 100644 mingw/pkg-support/cmake/sdl3-config-version.cmake create mode 100644 mingw/pkg-support/cmake/sdl3-config.cmake delete mode 100644 sdl2-config.cmake.in rename sdl2-config-version.cmake.in => sdl3-config-version.cmake.in (81%) create mode 100644 sdl3-config.cmake.in rename sdl2-config.in => sdl3-config.in (94%) rename sdl2.m4 => sdl3.m4 (73%) rename sdl2.pc.in => sdl3.pc.in (86%) delete mode 100644 src/dynapi/SDL2.exports create mode 100644 src/dynapi/SDL3.exports rename src/main/winrt/{SDL2-WinRTResource_BlankCursor.cur => SDL3-WinRTResource_BlankCursor.cur} (100%) rename src/main/winrt/{SDL2-WinRTResources.rc => SDL3-WinRTResources.rc} (54%) diff --git a/.editorconfig b/.editorconfig index 636c544533..5f3849ca43 100644 --- a/.editorconfig +++ b/.editorconfig @@ -16,7 +16,7 @@ indent_style = space indent_size = 4 indent_style = space -[{CMakeLists.txt,sdl2-config*.cmake.in,cmake/*.cmake}] +[{CMakeLists.txt,sdl3-config*.cmake.in,cmake/*.cmake}] indent_size = 2 indent_style = space diff --git a/Android.mk b/Android.mk index 06146cd40c..658e15951c 100644 --- a/Android.mk +++ b/Android.mk @@ -8,7 +8,7 @@ LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) -LOCAL_MODULE := SDL2 +LOCAL_MODULE := SDL3 LOCAL_C_INCLUDES := $(LOCAL_PATH)/include @@ -97,9 +97,9 @@ include $(BUILD_SHARED_LIBRARY) # ########################### -LOCAL_MODULE := SDL2_static +LOCAL_MODULE := SDL3_static -LOCAL_MODULE_FILENAME := libSDL2 +LOCAL_MODULE_FILENAME := libSDL3 LOCAL_LDLIBS := @@ -120,9 +120,9 @@ include $(CLEAR_VARS) LOCAL_C_INCLUDES := $(LOCAL_PATH)/include -LOCAL_MODULE := SDL2_main +LOCAL_MODULE := SDL3_main -LOCAL_MODULE_FILENAME := libSDL2main +LOCAL_MODULE_FILENAME := libSDL3main include $(BUILD_STATIC_LIBRARY) diff --git a/CMakeLists.txt b/CMakeLists.txt index 021b66cd57..60a4782ae5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,12 +3,12 @@ if(${CMAKE_CURRENT_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_BINARY_DIR}) endif() cmake_minimum_required(VERSION 3.0.0) -project(SDL2 C CXX) +project(SDL3 C CXX) if(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR) - set(SDL2_SUBPROJECT OFF) + set(SDL3_SUBPROJECT OFF) else() - set(SDL2_SUBPROJECT ON) + set(SDL3_SUBPROJECT ON) endif() if (HAIKU) @@ -46,7 +46,7 @@ if(POLICY CMP0054) endif() # !!! FIXME: this should probably do "MACOSX_RPATH ON" as a target property -# !!! FIXME: for the SDL2 shared library (so you get an +# !!! FIXME: for the SDL shared library (so you get an # !!! FIXME: install_name ("soname") of "@rpath/libSDL-whatever.dylib" # !!! FIXME: instead of "/usr/local/lib/libSDL-whatever.dylib"), but I'm # !!! FIXME: punting for now and leaving the existing behavior. Until this @@ -71,10 +71,10 @@ include(GNUInstallDirs) find_package(PkgConfig) -list(APPEND CMAKE_MODULE_PATH "${SDL2_SOURCE_DIR}/cmake") -include(${SDL2_SOURCE_DIR}/cmake/macros.cmake) -include(${SDL2_SOURCE_DIR}/cmake/sdlchecks.cmake) -include(${SDL2_SOURCE_DIR}/cmake/CheckCPUArchitecture.cmake) +list(APPEND CMAKE_MODULE_PATH "${SDL3_SOURCE_DIR}/cmake") +include(${SDL3_SOURCE_DIR}/cmake/macros.cmake) +include(${SDL3_SOURCE_DIR}/cmake/sdlchecks.cmake) +include(${SDL3_SOURCE_DIR}/cmake/CheckCPUArchitecture.cmake) # Enable large file support on 32-bit glibc, so that we can access files # with large inode numbers @@ -84,8 +84,8 @@ if (LIBC_IS_GLIBC AND CMAKE_SIZEOF_VOID_P EQUAL 4) endif() # See docs/release_checklist.md -set(SDL_MAJOR_VERSION 2) -set(SDL_MINOR_VERSION 26) +set(SDL_MAJOR_VERSION 3) +set(SDL_MINOR_VERSION 0) set(SDL_MICRO_VERSION 0) set(SDL_VERSION "${SDL_MAJOR_VERSION}.${SDL_MINOR_VERSION}.${SDL_MICRO_VERSION}") @@ -98,15 +98,15 @@ mark_as_advanced(CMAKE_IMPORT_LIBRARY_SUFFIX SDL_CMAKE_DEBUG_POSTFIX) # Calculate a libtool-like version number math(EXPR SDL_BINARY_AGE "${SDL_MINOR_VERSION} * 100 + ${SDL_MICRO_VERSION}") if(SDL_MINOR_VERSION MATCHES "[02468]$") - # Stable branch, 2.24.1 -> libSDL2-2.0.so.0.2400.1 + # Stable branch, 3.24.1 -> libSDL3-3.0.so.0.2400.1 set(SDL_INTERFACE_AGE ${SDL_MICRO_VERSION}) else() - # Development branch, 2.23.1 -> libSDL2-2.0.so.0.2301.0 + # Development branch, 3.23.1 -> libSDL3-3.0.so.0.2301.0 set(SDL_INTERFACE_AGE 0) endif() # Increment this if there is an incompatible change - but if that happens, -# we should rename the library from SDL2 to SDL3, at which point this would +# we should rename the library from SDL3 to SDL4, at which point this would # reset to 0 anyway. set(LT_MAJOR "0") @@ -114,10 +114,10 @@ math(EXPR LT_AGE "${SDL_BINARY_AGE} - ${SDL_INTERFACE_AGE}") math(EXPR LT_CURRENT "${LT_MAJOR} + ${LT_AGE}") set(LT_REVISION "${SDL_INTERFACE_AGE}") # For historical reasons, the library name redundantly includes the major -# version twice: libSDL2-2.0.so.0. +# version twice: libSDL3-3.0.so.0. # TODO: in SDL 3, set the OUTPUT_NAME to plain SDL3, which will simplify # it to libSDL3.so.0 -set(LT_RELEASE "2.0") +set(LT_RELEASE "3.0") set(LT_VERSION "${LT_MAJOR}.${LT_AGE}.${LT_REVISION}") # The following should match the versions in the Xcode project file. @@ -146,7 +146,7 @@ else() set(ARCH_64 FALSE) set(PROCESSOR_ARCH "x86") endif() -set(LIBNAME SDL2) +set(LIBNAME SDL3) if(NOT LIBTYPE) set(LIBTYPE SHARED) endif() @@ -325,9 +325,9 @@ if(MSVC) endif() endif() -# Those are used for pkg-config and friends, so that the sdl2.pc, sdl2-config, +# Those are used for pkg-config and friends, so that the sdl3.pc, sdl3-config, # etc. are created correctly. -set(SDL_LIBS "-lSDL2") +set(SDL_LIBS "-lSDL3") set(SDL_CFLAGS ) # When building shared lib for Windows with MinGW, @@ -358,13 +358,13 @@ endif() # General includes target_compile_definitions(sdl-build-options INTERFACE "-DUSING_GENERATED_CONFIG_H") -target_include_directories(sdl-build-options BEFORE INTERFACE "${SDL2_BINARY_DIR}/include" "${SDL2_BINARY_DIR}/include-config-$>") +target_include_directories(sdl-build-options BEFORE INTERFACE "${SDL3_BINARY_DIR}/include" "${SDL3_BINARY_DIR}/include-config-$>") # Note: The clang toolset for Visual Studio does not support the '-idirafter' option. if(USE_GCC OR (USE_CLANG AND NOT MSVC_CLANG)) # !!! FIXME: do we _need_ to mess with CMAKE_C_FLAGS here? - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -idirafter \"${SDL2_SOURCE_DIR}/src/video/khronos\"") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -idirafter \"${SDL3_SOURCE_DIR}/src/video/khronos\"") else() - target_include_directories(sdl-build-options INTERFACE "${SDL2_SOURCE_DIR}/src/video/khronos") + target_include_directories(sdl-build-options INTERFACE "${SDL3_SOURCE_DIR}/src/video/khronos") endif() # All these ENABLED_BY_DEFAULT vars will default to ON if not specified, so @@ -427,9 +427,9 @@ foreach(_SUB ${SDL_SUBSYSTEMS}) endforeach() # Allow some projects to be built conditionally. -set_option(SDL2_DISABLE_SDL2MAIN "Disable building/installation of SDL2main" OFF) -set_option(SDL2_DISABLE_INSTALL "Disable installation of SDL2" ${SDL2_SUBPROJECT}) -set_option(SDL2_DISABLE_UNINSTALL "Disable uninstallation of SDL2" OFF) +set_option(SDL3_DISABLE_SDL3MAIN "Disable building/installation of SDL3main" OFF) +set_option(SDL3_DISABLE_INSTALL "Disable installation of SDL3" ${SDL3_SUBPROJECT}) +set_option(SDL3_DISABLE_UNINSTALL "Disable uninstallation of SDL3" OFF) option_string(SDL_ASSERTIONS "Enable internal sanity checks (auto/disabled/release/enabled/paranoid)" "auto") #set_option(SDL_DEPENDENCY_TRACKING "Use gcc -MMD -MT dependency tracking" ON) @@ -519,7 +519,7 @@ option(SDL_WERROR "Enable -Werror" OFF) option(SDL_SHARED "Build a shared version of the library" ${SDL_SHARED_ENABLED_BY_DEFAULT}) option(SDL_STATIC "Build a static version of the library" ${SDL_STATIC_ENABLED_BY_DEFAULT}) -option(SDL_TEST "Build the SDL2_test library" ${SDL_TEST_ENABLED_BY_DEFAULT}) +option(SDL_TEST "Build the SDL3_test library" ${SDL_TEST_ENABLED_BY_DEFAULT}) dep_option(SDL_STATIC_PIC "Static version of the library should be built with Position Independent Code" "${CMAKE_POSITION_INDEPENDENT_CODE}" "SDL_STATIC" OFF) dep_option(SDL_TESTS "Build the test directory" OFF SDL_TEST OFF) @@ -562,28 +562,28 @@ endif() # General source files file(GLOB SOURCE_FILES - ${SDL2_SOURCE_DIR}/src/*.c - ${SDL2_SOURCE_DIR}/src/atomic/*.c - ${SDL2_SOURCE_DIR}/src/audio/*.c - ${SDL2_SOURCE_DIR}/src/cpuinfo/*.c - ${SDL2_SOURCE_DIR}/src/dynapi/*.c - ${SDL2_SOURCE_DIR}/src/events/*.c - ${SDL2_SOURCE_DIR}/src/file/*.c - ${SDL2_SOURCE_DIR}/src/joystick/*.c - ${SDL2_SOURCE_DIR}/src/haptic/*.c - ${SDL2_SOURCE_DIR}/src/hidapi/*.c - ${SDL2_SOURCE_DIR}/src/libm/*.c - ${SDL2_SOURCE_DIR}/src/locale/*.c - ${SDL2_SOURCE_DIR}/src/misc/*.c - ${SDL2_SOURCE_DIR}/src/power/*.c - ${SDL2_SOURCE_DIR}/src/render/*.c - ${SDL2_SOURCE_DIR}/src/render/*/*.c - ${SDL2_SOURCE_DIR}/src/sensor/*.c - ${SDL2_SOURCE_DIR}/src/stdlib/*.c - ${SDL2_SOURCE_DIR}/src/thread/*.c - ${SDL2_SOURCE_DIR}/src/timer/*.c - ${SDL2_SOURCE_DIR}/src/video/*.c - ${SDL2_SOURCE_DIR}/src/video/yuv2rgb/*.c) + ${SDL3_SOURCE_DIR}/src/*.c + ${SDL3_SOURCE_DIR}/src/atomic/*.c + ${SDL3_SOURCE_DIR}/src/audio/*.c + ${SDL3_SOURCE_DIR}/src/cpuinfo/*.c + ${SDL3_SOURCE_DIR}/src/dynapi/*.c + ${SDL3_SOURCE_DIR}/src/events/*.c + ${SDL3_SOURCE_DIR}/src/file/*.c + ${SDL3_SOURCE_DIR}/src/joystick/*.c + ${SDL3_SOURCE_DIR}/src/haptic/*.c + ${SDL3_SOURCE_DIR}/src/hidapi/*.c + ${SDL3_SOURCE_DIR}/src/libm/*.c + ${SDL3_SOURCE_DIR}/src/locale/*.c + ${SDL3_SOURCE_DIR}/src/misc/*.c + ${SDL3_SOURCE_DIR}/src/power/*.c + ${SDL3_SOURCE_DIR}/src/render/*.c + ${SDL3_SOURCE_DIR}/src/render/*/*.c + ${SDL3_SOURCE_DIR}/src/sensor/*.c + ${SDL3_SOURCE_DIR}/src/stdlib/*.c + ${SDL3_SOURCE_DIR}/src/thread/*.c + ${SDL3_SOURCE_DIR}/src/timer/*.c + ${SDL3_SOURCE_DIR}/src/video/*.c + ${SDL3_SOURCE_DIR}/src/video/yuv2rgb/*.c) set(SDL_DEFAULT_ASSERT_LEVEL_CONFIGURED 1) @@ -924,7 +924,7 @@ if(SDL_ASSEMBLY) if(ARMSIMD_FOUND) set(HAVE_ARMSIMD TRUE) set(SDL_ARM_SIMD_BLITTERS 1) - file(GLOB ARMSIMD_SOURCES ${SDL2_SOURCE_DIR}/src/video/arm/pixman-arm-simd*.S) + file(GLOB ARMSIMD_SOURCES ${SDL3_SOURCE_DIR}/src/video/arm/pixman-arm-simd*.S) list(APPEND SOURCE_FILES ${ARMSIMD_SOURCES}) set(WARN_ABOUT_ARM_SIMD_ASM_MIT TRUE) endif() @@ -952,7 +952,7 @@ if(SDL_ASSEMBLY) if(ARMNEON_FOUND) set(HAVE_ARMNEON TRUE) set(SDL_ARM_NEON_BLITTERS 1) - file(GLOB ARMNEON_SOURCES ${SDL2_SOURCE_DIR}/src/video/arm/pixman-arm-neon*.S) + file(GLOB ARMNEON_SOURCES ${SDL3_SOURCE_DIR}/src/video/arm/pixman-arm-neon*.S) list(APPEND SOURCE_FILES ${ARMNEON_SOURCES}) set(WARN_ABOUT_ARM_NEON_ASM_MIT TRUE) endif() @@ -1141,14 +1141,14 @@ if(SDL_AUDIO) # CheckDummyAudio/CheckDiskAudio - valid for all platforms if(SDL_DUMMYAUDIO) set(SDL_AUDIO_DRIVER_DUMMY 1) - file(GLOB DUMMYAUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/dummy/*.c) + file(GLOB DUMMYAUDIO_SOURCES ${SDL3_SOURCE_DIR}/src/audio/dummy/*.c) list(APPEND SOURCE_FILES ${DUMMYAUDIO_SOURCES}) set(HAVE_DUMMYAUDIO TRUE) set(HAVE_SDL_AUDIO TRUE) endif() if(SDL_DISKAUDIO) set(SDL_AUDIO_DRIVER_DISK 1) - file(GLOB DISKAUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/disk/*.c) + file(GLOB DISKAUDIO_SOURCES ${SDL3_SOURCE_DIR}/src/audio/disk/*.c) list(APPEND SOURCE_FILES ${DISKAUDIO_SOURCES}) set(HAVE_DISKAUDIO TRUE) set(HAVE_SDL_AUDIO TRUE) @@ -1161,7 +1161,7 @@ if(UNIX OR APPLE) CheckDLOPEN() if(SDL_LOADSO AND HAVE_DLOPEN) set(SDL_LOADSO_DLOPEN 1) - file(GLOB DLOPEN_SOURCES ${SDL2_SOURCE_DIR}/src/loadso/dlopen/*.c) + file(GLOB DLOPEN_SOURCES ${SDL3_SOURCE_DIR}/src/loadso/dlopen/*.c) list(APPEND SOURCE_FILES ${DLOPEN_SOURCES}) set(HAVE_SDL_LOADSO TRUE) endif() @@ -1175,7 +1175,7 @@ if(SDL_JOYSTICK) if(SDL_VIRTUAL_JOYSTICK) set(HAVE_VIRTUAL_JOYSTICK TRUE) set(SDL_JOYSTICK_VIRTUAL 1) - file(GLOB JOYSTICK_VIRTUAL_SOURCES ${SDL2_SOURCE_DIR}/src/joystick/virtual/*.c) + file(GLOB JOYSTICK_VIRTUAL_SOURCES ${SDL3_SOURCE_DIR}/src/joystick/virtual/*.c) list(APPEND SOURCE_FILES ${JOYSTICK_VIRTUAL_SOURCES}) endif() endif() @@ -1183,14 +1183,14 @@ endif() if(SDL_VIDEO) if(SDL_DUMMYVIDEO) set(SDL_VIDEO_DRIVER_DUMMY 1) - file(GLOB VIDEO_DUMMY_SOURCES ${SDL2_SOURCE_DIR}/src/video/dummy/*.c) + file(GLOB VIDEO_DUMMY_SOURCES ${SDL3_SOURCE_DIR}/src/video/dummy/*.c) list(APPEND SOURCE_FILES ${VIDEO_DUMMY_SOURCES}) set(HAVE_DUMMYVIDEO TRUE) set(HAVE_SDL_VIDEO TRUE) endif() if(SDL_OFFSCREEN) set(SDL_VIDEO_DRIVER_OFFSCREEN 1) - file(GLOB VIDEO_OFFSCREEN_SOURCES ${SDL2_SOURCE_DIR}/src/video/offscreen/*.c) + file(GLOB VIDEO_OFFSCREEN_SOURCES ${SDL3_SOURCE_DIR}/src/video/offscreen/*.c) list(APPEND SOURCE_FILES ${VIDEO_OFFSCREEN_SOURCES}) set(HAVE_OFFSCREEN TRUE) set(HAVE_SDL_VIDEO TRUE) @@ -1199,12 +1199,12 @@ endif() # Platform-specific options and settings if(ANDROID) - file(GLOB ANDROID_CORE_SOURCES ${SDL2_SOURCE_DIR}/src/core/android/*.c) + file(GLOB ANDROID_CORE_SOURCES ${SDL3_SOURCE_DIR}/src/core/android/*.c) list(APPEND SOURCE_FILES ${ANDROID_CORE_SOURCES} ${ANDROID_NDK}/sources/android/cpufeatures/cpu-features.c) set_property(SOURCE "${ANDROID_NDK}/sources/android/cpufeatures/cpu-features.c" APPEND_STRING PROPERTY COMPILE_FLAGS " -Wno-declaration-after-statement") if(SDL_MISC) - file(GLOB ANDROID_MISC_SOURCES ${SDL2_SOURCE_DIR}/src/misc/android/*.c) + file(GLOB ANDROID_MISC_SOURCES ${SDL3_SOURCE_DIR}/src/misc/android/*.c) list(APPEND SOURCE_FILES ${ANDROID_MISC_SOURCES}) set(HAVE_SDL_MISC TRUE) endif() @@ -1217,39 +1217,39 @@ if(ANDROID) set(CMAKE_REQUIRED_FLAGS "-Werror=unused-command-line-argument") check_c_compiler_flag(-marm HAVE_ARM_MODE) if(HAVE_ARM_MODE) - set_property(SOURCE "${SDL2_SOURCE_DIR}/src/atomic/SDL_spinlock.c" APPEND_STRING PROPERTY COMPILE_FLAGS " -marm") + set_property(SOURCE "${SDL3_SOURCE_DIR}/src/atomic/SDL_spinlock.c" APPEND_STRING PROPERTY COMPILE_FLAGS " -marm") endif() cmake_pop_check_state() - file(GLOB ANDROID_MAIN_SOURCES ${SDL2_SOURCE_DIR}/src/main/android/*.c) + file(GLOB ANDROID_MAIN_SOURCES ${SDL3_SOURCE_DIR}/src/main/android/*.c) list(APPEND SDLMAIN_SOURCES ${ANDROID_MAIN_SOURCES}) if(SDL_AUDIO) set(SDL_AUDIO_DRIVER_ANDROID 1) - file(GLOB ANDROID_AUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/android/*.c) + file(GLOB ANDROID_AUDIO_SOURCES ${SDL3_SOURCE_DIR}/src/audio/android/*.c) list(APPEND SOURCE_FILES ${ANDROID_AUDIO_SOURCES}) set(SDL_AUDIO_DRIVER_OPENSLES 1) - file(GLOB OPENSLES_AUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/openslES/*.c) + file(GLOB OPENSLES_AUDIO_SOURCES ${SDL3_SOURCE_DIR}/src/audio/openslES/*.c) list(APPEND SOURCE_FILES ${OPENSLES_AUDIO_SOURCES}) list(APPEND EXTRA_LIBS ${ANDROID_DL_LIBRARY} OpenSLES) set(SDL_AUDIO_DRIVER_AAUDIO 1) - file(GLOB AAUDIO_AUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/aaudio/*.c) + file(GLOB AAUDIO_AUDIO_SOURCES ${SDL3_SOURCE_DIR}/src/audio/aaudio/*.c) list(APPEND SOURCE_FILES ${AAUDIO_AUDIO_SOURCES}) set(HAVE_SDL_AUDIO TRUE) endif() if(SDL_FILESYSTEM) set(SDL_FILESYSTEM_ANDROID 1) - file(GLOB ANDROID_FILESYSTEM_SOURCES ${SDL2_SOURCE_DIR}/src/filesystem/android/*.c) + file(GLOB ANDROID_FILESYSTEM_SOURCES ${SDL3_SOURCE_DIR}/src/filesystem/android/*.c) list(APPEND SOURCE_FILES ${ANDROID_FILESYSTEM_SOURCES}) set(HAVE_SDL_FILESYSTEM TRUE) endif() if(SDL_HAPTIC) set(SDL_HAPTIC_ANDROID 1) - file(GLOB ANDROID_HAPTIC_SOURCES ${SDL2_SOURCE_DIR}/src/haptic/android/*.c) + file(GLOB ANDROID_HAPTIC_SOURCES ${SDL3_SOURCE_DIR}/src/haptic/android/*.c) list(APPEND SOURCE_FILES ${ANDROID_HAPTIC_SOURCES}) set(HAVE_SDL_HAPTIC TRUE) endif() @@ -1258,42 +1258,42 @@ if(ANDROID) endif() if(SDL_JOYSTICK) set(SDL_JOYSTICK_ANDROID 1) - file(GLOB ANDROID_JOYSTICK_SOURCES ${SDL2_SOURCE_DIR}/src/joystick/android/*.c ${SDL2_SOURCE_DIR}/src/joystick/steam/*.c) + file(GLOB ANDROID_JOYSTICK_SOURCES ${SDL3_SOURCE_DIR}/src/joystick/android/*.c ${SDL3_SOURCE_DIR}/src/joystick/steam/*.c) list(APPEND SOURCE_FILES ${ANDROID_JOYSTICK_SOURCES}) set(HAVE_SDL_JOYSTICK TRUE) endif() if(SDL_LOADSO) set(SDL_LOADSO_DLOPEN 1) - file(GLOB LOADSO_SOURCES ${SDL2_SOURCE_DIR}/src/loadso/dlopen/*.c) + file(GLOB LOADSO_SOURCES ${SDL3_SOURCE_DIR}/src/loadso/dlopen/*.c) list(APPEND SOURCE_FILES ${LOADSO_SOURCES}) set(HAVE_SDL_LOADSO TRUE) endif() if(SDL_POWER) set(SDL_POWER_ANDROID 1) - file(GLOB ANDROID_POWER_SOURCES ${SDL2_SOURCE_DIR}/src/power/android/*.c) + file(GLOB ANDROID_POWER_SOURCES ${SDL3_SOURCE_DIR}/src/power/android/*.c) list(APPEND SOURCE_FILES ${ANDROID_POWER_SOURCES}) set(HAVE_SDL_POWER TRUE) endif() if(SDL_LOCALE) - file(GLOB ANDROID_LOCALE_SOURCES ${SDL2_SOURCE_DIR}/src/locale/android/*.c) + file(GLOB ANDROID_LOCALE_SOURCES ${SDL3_SOURCE_DIR}/src/locale/android/*.c) list(APPEND SOURCE_FILES ${ANDROID_LOCALE_SOURCES}) set(HAVE_SDL_LOCALE TRUE) endif() if(SDL_TIMERS) set(SDL_TIMER_UNIX 1) - file(GLOB TIMER_SOURCES ${SDL2_SOURCE_DIR}/src/timer/unix/*.c) + file(GLOB TIMER_SOURCES ${SDL3_SOURCE_DIR}/src/timer/unix/*.c) list(APPEND SOURCE_FILES ${TIMER_SOURCES}) set(HAVE_SDL_TIMERS TRUE) endif() if(SDL_SENSOR) set(SDL_SENSOR_ANDROID 1) set(HAVE_SDL_SENSORS TRUE) - file(GLOB ANDROID_SENSOR_SOURCES ${SDL2_SOURCE_DIR}/src/sensor/android/*.c) + file(GLOB ANDROID_SENSOR_SOURCES ${SDL3_SOURCE_DIR}/src/sensor/android/*.c) list(APPEND SOURCE_FILES ${ANDROID_SENSOR_SOURCES}) endif() if(SDL_VIDEO) set(SDL_VIDEO_DRIVER_ANDROID 1) - file(GLOB ANDROID_VIDEO_SOURCES ${SDL2_SOURCE_DIR}/src/video/android/*.c) + file(GLOB ANDROID_VIDEO_SOURCES ${SDL3_SOURCE_DIR}/src/video/android/*.c) list(APPEND SOURCE_FILES ${ANDROID_VIDEO_SOURCES}) set(HAVE_SDL_VIDEO TRUE) @@ -1340,42 +1340,42 @@ elseif(EMSCRIPTEN) target_compile_options(sdl-build-options INTERFACE "-Wno-warn-absolute-paths") if(SDL_MISC) - file(GLOB EMSRIPTEN_MISC_SOURCES ${SDL2_SOURCE_DIR}/src/misc/emscripten/*.c) + file(GLOB EMSRIPTEN_MISC_SOURCES ${SDL3_SOURCE_DIR}/src/misc/emscripten/*.c) list(APPEND SOURCE_FILES ${EMSRIPTEN_MISC_SOURCES}) set(HAVE_SDL_MISC TRUE) endif() if(SDL_AUDIO) set(SDL_AUDIO_DRIVER_EMSCRIPTEN 1) - file(GLOB EM_AUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/emscripten/*.c) + file(GLOB EM_AUDIO_SOURCES ${SDL3_SOURCE_DIR}/src/audio/emscripten/*.c) list(APPEND SOURCE_FILES ${EM_AUDIO_SOURCES}) set(HAVE_SDL_AUDIO TRUE) endif() if(SDL_FILESYSTEM) set(SDL_FILESYSTEM_EMSCRIPTEN 1) - file(GLOB EM_FILESYSTEM_SOURCES ${SDL2_SOURCE_DIR}/src/filesystem/emscripten/*.c) + file(GLOB EM_FILESYSTEM_SOURCES ${SDL3_SOURCE_DIR}/src/filesystem/emscripten/*.c) list(APPEND SOURCE_FILES ${EM_FILESYSTEM_SOURCES}) set(HAVE_SDL_FILESYSTEM TRUE) endif() if(SDL_JOYSTICK) set(SDL_JOYSTICK_EMSCRIPTEN 1) - file(GLOB EM_JOYSTICK_SOURCES ${SDL2_SOURCE_DIR}/src/joystick/emscripten/*.c) + file(GLOB EM_JOYSTICK_SOURCES ${SDL3_SOURCE_DIR}/src/joystick/emscripten/*.c) list(APPEND SOURCE_FILES ${EM_JOYSTICK_SOURCES}) set(HAVE_SDL_JOYSTICK TRUE) endif() if(SDL_POWER) set(SDL_POWER_EMSCRIPTEN 1) - file(GLOB EM_POWER_SOURCES ${SDL2_SOURCE_DIR}/src/power/emscripten/*.c) + file(GLOB EM_POWER_SOURCES ${SDL3_SOURCE_DIR}/src/power/emscripten/*.c) list(APPEND SOURCE_FILES ${EM_POWER_SOURCES}) set(HAVE_SDL_POWER TRUE) endif() if(SDL_LOCALE) - file(GLOB LOCALE_SOURCES ${SDL2_SOURCE_DIR}/src/locale/emscripten/*.c) + file(GLOB LOCALE_SOURCES ${SDL3_SOURCE_DIR}/src/locale/emscripten/*.c) list(APPEND SOURCE_FILES ${LOCALE_SOURCES}) set(HAVE_SDL_LOCALE TRUE) endif() if(SDL_TIMERS) set(SDL_TIMER_UNIX 1) - file(GLOB TIMER_SOURCES ${SDL2_SOURCE_DIR}/src/timer/unix/*.c) + file(GLOB TIMER_SOURCES ${SDL3_SOURCE_DIR}/src/timer/unix/*.c) list(APPEND SOURCE_FILES ${TIMER_SOURCES}) set(HAVE_SDL_TIMERS TRUE) @@ -1385,7 +1385,7 @@ elseif(EMSCRIPTEN) endif() if(SDL_VIDEO) set(SDL_VIDEO_DRIVER_EMSCRIPTEN 1) - file(GLOB EM_VIDEO_SOURCES ${SDL2_SOURCE_DIR}/src/video/emscripten/*.c) + file(GLOB EM_VIDEO_SOURCES ${SDL3_SOURCE_DIR}/src/video/emscripten/*.c) list(APPEND SOURCE_FILES ${EM_VIDEO_SOURCES}) set(HAVE_SDL_VIDEO TRUE) @@ -1408,17 +1408,17 @@ elseif(UNIX AND NOT APPLE AND NOT RISCOS AND NOT HAIKU) if(SDL_AUDIO) if(SYSV5 OR SOLARIS OR HPUX) set(SDL_AUDIO_DRIVER_SUNAUDIO 1) - file(GLOB SUN_AUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/sun/*.c) + file(GLOB SUN_AUDIO_SOURCES ${SDL3_SOURCE_DIR}/src/audio/sun/*.c) list(APPEND SOURCE_FILES ${SUN_AUDIO_SOURCES}) set(HAVE_SDL_AUDIO TRUE) elseif(NETBSD) set(SDL_AUDIO_DRIVER_NETBSD 1) - file(GLOB NETBSD_AUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/netbsd/*.c) + file(GLOB NETBSD_AUDIO_SOURCES ${SDL3_SOURCE_DIR}/src/audio/netbsd/*.c) list(APPEND SOURCE_FILES ${NETBSD_AUDIO_SOURCES}) set(HAVE_SDL_AUDIO TRUE) elseif(AIX) set(SDL_AUDIO_DRIVER_PAUDIO 1) - file(GLOB AIX_AUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/paudio/*.c) + file(GLOB AIX_AUDIO_SOURCES ${SDL3_SOURCE_DIR}/src/audio/paudio/*.c) list(APPEND SOURCE_FILES ${AIX_AUDIO_SOURCES}) set(HAVE_SDL_AUDIO TRUE) endif() @@ -1455,7 +1455,7 @@ elseif(UNIX AND NOT APPLE AND NOT RISCOS AND NOT HAIKU) endif() if(UNIX) - file(GLOB CORE_UNIX_SOURCES ${SDL2_SOURCE_DIR}/src/core/unix/*.c) + file(GLOB CORE_UNIX_SOURCES ${SDL3_SOURCE_DIR}/src/core/unix/*.c) list(APPEND SOURCE_FILES ${CORE_UNIX_SOURCES}) check_c_source_compiles(" @@ -1493,7 +1493,7 @@ elseif(UNIX AND NOT APPLE AND NOT RISCOS AND NOT HAIKU) if(SDL_HAPTIC AND HAVE_INPUT_EVENTS) set(SDL_HAPTIC_LINUX 1) - file(GLOB HAPTIC_SOURCES ${SDL2_SOURCE_DIR}/src/haptic/linux/*.c) + file(GLOB HAPTIC_SOURCES ${SDL3_SOURCE_DIR}/src/haptic/linux/*.c) list(APPEND SOURCE_FILES ${HAPTIC_SOURCES}) set(HAVE_SDL_HAPTIC TRUE) endif() @@ -1561,38 +1561,38 @@ elseif(UNIX AND NOT APPLE AND NOT RISCOS AND NOT HAIKU) endif() if(HAVE_DBUS_DBUS_H) - list(APPEND SOURCE_FILES "${SDL2_SOURCE_DIR}/src/core/linux/SDL_dbus.c") + list(APPEND SOURCE_FILES "${SDL3_SOURCE_DIR}/src/core/linux/SDL_dbus.c") endif() if(SDL_USE_IME) - list(APPEND SOURCE_FILES "${SDL2_SOURCE_DIR}/src/core/linux/SDL_ime.c") + list(APPEND SOURCE_FILES "${SDL3_SOURCE_DIR}/src/core/linux/SDL_ime.c") endif() if(HAVE_IBUS_IBUS_H) - list(APPEND SOURCE_FILES "${SDL2_SOURCE_DIR}/src/core/linux/SDL_ibus.c") + list(APPEND SOURCE_FILES "${SDL3_SOURCE_DIR}/src/core/linux/SDL_ibus.c") endif() if(HAVE_FCITX) - list(APPEND SOURCE_FILES "${SDL2_SOURCE_DIR}/src/core/linux/SDL_fcitx.c") + list(APPEND SOURCE_FILES "${SDL3_SOURCE_DIR}/src/core/linux/SDL_fcitx.c") endif() if(HAVE_LIBUDEV_H) - list(APPEND SOURCE_FILES "${SDL2_SOURCE_DIR}/src/core/linux/SDL_udev.c") + list(APPEND SOURCE_FILES "${SDL3_SOURCE_DIR}/src/core/linux/SDL_udev.c") endif() if(HAVE_INPUT_EVENTS) - list(APPEND SOURCE_FILES "${SDL2_SOURCE_DIR}/src/core/linux/SDL_evdev.c") - list(APPEND SOURCE_FILES "${SDL2_SOURCE_DIR}/src/core/linux/SDL_evdev_kbd.c") + list(APPEND SOURCE_FILES "${SDL3_SOURCE_DIR}/src/core/linux/SDL_evdev.c") + list(APPEND SOURCE_FILES "${SDL3_SOURCE_DIR}/src/core/linux/SDL_evdev_kbd.c") endif() if(HAVE_INPUT_KBIO) - list(APPEND SOURCE_FILES "${SDL2_SOURCE_DIR}/src/core/freebsd/SDL_evdev_kbd_freebsd.c") + list(APPEND SOURCE_FILES "${SDL3_SOURCE_DIR}/src/core/freebsd/SDL_evdev_kbd_freebsd.c") endif() # Always compiled for Linux, unconditionally: - list(APPEND SOURCE_FILES "${SDL2_SOURCE_DIR}/src/core/linux/SDL_evdev_capabilities.c") - list(APPEND SOURCE_FILES "${SDL2_SOURCE_DIR}/src/core/linux/SDL_threadprio.c") - list(APPEND SOURCE_FILES "${SDL2_SOURCE_DIR}/src/core/linux/SDL_sandbox.c") + list(APPEND SOURCE_FILES "${SDL3_SOURCE_DIR}/src/core/linux/SDL_evdev_capabilities.c") + list(APPEND SOURCE_FILES "${SDL3_SOURCE_DIR}/src/core/linux/SDL_threadprio.c") + list(APPEND SOURCE_FILES "${SDL3_SOURCE_DIR}/src/core/linux/SDL_sandbox.c") # src/core/unix/*.c is included in a generic if(UNIX) section, elsewhere. endif() @@ -1607,7 +1607,7 @@ elseif(UNIX AND NOT APPLE AND NOT RISCOS AND NOT HAIKU) endif() if(LINUX AND HAVE_LINUX_INPUT_H AND NOT ANDROID) set(SDL_JOYSTICK_LINUX 1) - file(GLOB JOYSTICK_SOURCES ${SDL2_SOURCE_DIR}/src/joystick/linux/*.c ${SDL2_SOURCE_DIR}/src/joystick/steam/*.c) + file(GLOB JOYSTICK_SOURCES ${SDL3_SOURCE_DIR}/src/joystick/linux/*.c ${SDL3_SOURCE_DIR}/src/joystick/steam/*.c) list(APPEND SOURCE_FILES ${JOYSTICK_SOURCES}) set(HAVE_SDL_JOYSTICK TRUE) endif() @@ -1634,7 +1634,7 @@ elseif(UNIX AND NOT APPLE AND NOT RISCOS AND NOT HAIKU) endif() if(SDL_MISC) - file(GLOB MISC_SOURCES ${SDL2_SOURCE_DIR}/src/misc/unix/*.c) + file(GLOB MISC_SOURCES ${SDL3_SOURCE_DIR}/src/misc/unix/*.c) list(APPEND SOURCE_FILES ${MISC_SOURCES}) set(HAVE_SDL_MISC TRUE) endif() @@ -1642,28 +1642,28 @@ elseif(UNIX AND NOT APPLE AND NOT RISCOS AND NOT HAIKU) if(SDL_POWER) if(LINUX) set(SDL_POWER_LINUX 1) - file(GLOB POWER_SOURCES ${SDL2_SOURCE_DIR}/src/power/linux/*.c) + file(GLOB POWER_SOURCES ${SDL3_SOURCE_DIR}/src/power/linux/*.c) list(APPEND SOURCE_FILES ${POWER_SOURCES}) set(HAVE_SDL_POWER TRUE) endif() endif() if(SDL_LOCALE) - file(GLOB LOCALE_SOURCES ${SDL2_SOURCE_DIR}/src/locale/unix/*.c) + file(GLOB LOCALE_SOURCES ${SDL3_SOURCE_DIR}/src/locale/unix/*.c) list(APPEND SOURCE_FILES ${LOCALE_SOURCES}) set(HAVE_SDL_LOCALE TRUE) endif() if(SDL_FILESYSTEM) set(SDL_FILESYSTEM_UNIX 1) - file(GLOB FILESYSTEM_SOURCES ${SDL2_SOURCE_DIR}/src/filesystem/unix/*.c) + file(GLOB FILESYSTEM_SOURCES ${SDL3_SOURCE_DIR}/src/filesystem/unix/*.c) list(APPEND SOURCE_FILES ${FILESYSTEM_SOURCES}) set(HAVE_SDL_FILESYSTEM TRUE) endif() if(SDL_TIMERS) set(SDL_TIMER_UNIX 1) - file(GLOB TIMER_SOURCES ${SDL2_SOURCE_DIR}/src/timer/unix/*.c) + file(GLOB TIMER_SOURCES ${SDL3_SOURCE_DIR}/src/timer/unix/*.c) list(APPEND SOURCE_FILES ${TIMER_SOURCES}) set(HAVE_SDL_TIMERS TRUE) endif() @@ -1693,11 +1693,11 @@ elseif(WINDOWS) #include int main(int argc, char **argv) { return 0; }" HAVE_WIN32_CC) - file(GLOB CORE_SOURCES ${SDL2_SOURCE_DIR}/src/core/windows/*.c) + file(GLOB CORE_SOURCES ${SDL3_SOURCE_DIR}/src/core/windows/*.c) list(APPEND SOURCE_FILES ${CORE_SOURCES}) if(WINDOWS_STORE) - file(GLOB WINRT_SOURCE_FILES ${SDL2_SOURCE_DIR}/src/core/winrt/*.c ${SDL2_SOURCE_DIR}/src/core/winrt/*.cpp) + file(GLOB WINRT_SOURCE_FILES ${SDL3_SOURCE_DIR}/src/core/winrt/*.c ${SDL3_SOURCE_DIR}/src/core/winrt/*.cpp) list(APPEND SOURCE_FILES ${WINRT_SOURCE_FILES}) endif() @@ -1711,9 +1711,9 @@ elseif(WINDOWS) if(SDL_MISC) if(WINDOWS_STORE) - file(GLOB MISC_SOURCES ${SDL2_SOURCE_DIR}/src/misc/winrt/*.cpp) + file(GLOB MISC_SOURCES ${SDL3_SOURCE_DIR}/src/misc/winrt/*.cpp) else() - file(GLOB MISC_SOURCES ${SDL2_SOURCE_DIR}/src/misc/windows/*.c) + file(GLOB MISC_SOURCES ${SDL3_SOURCE_DIR}/src/misc/windows/*.c) endif() list(APPEND SOURCE_FILES ${MISC_SOURCES}) set(HAVE_SDL_MISC TRUE) @@ -1793,14 +1793,14 @@ elseif(WINDOWS) if(SDL_AUDIO) if(NOT WINDOWS_STORE) set(SDL_AUDIO_DRIVER_WINMM 1) - file(GLOB WINMM_AUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/winmm/*.c) + file(GLOB WINMM_AUDIO_SOURCES ${SDL3_SOURCE_DIR}/src/audio/winmm/*.c) list(APPEND SOURCE_FILES ${WINMM_AUDIO_SOURCES}) set(HAVE_SDL_AUDIO TRUE) endif() if(HAVE_DSOUND_H AND NOT WINDOWS_STORE) set(SDL_AUDIO_DRIVER_DSOUND 1) - file(GLOB DSOUND_AUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/directsound/*.c) + file(GLOB DSOUND_AUDIO_SOURCES ${SDL3_SOURCE_DIR}/src/audio/directsound/*.c) list(APPEND SOURCE_FILES ${DSOUND_AUDIO_SOURCES}) set(HAVE_SDL_AUDIO TRUE) endif() @@ -1808,9 +1808,9 @@ elseif(WINDOWS) if(SDL_WASAPI AND HAVE_AUDIOCLIENT_H AND HAVE_MMDEVICEAPI_H) set(SDL_AUDIO_DRIVER_WASAPI 1) set(HAVE_WASAPI TRUE) - file(GLOB WASAPI_AUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/wasapi/*.c) + file(GLOB WASAPI_AUDIO_SOURCES ${SDL3_SOURCE_DIR}/src/audio/wasapi/*.c) if(WINDOWS_STORE) - list(APPEND WASAPI_AUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/wasapi/SDL_wasapi_winrt.cpp) + list(APPEND WASAPI_AUDIO_SOURCES ${SDL3_SOURCE_DIR}/src/audio/wasapi/SDL_wasapi_winrt.cpp) endif() list(APPEND SOURCE_FILES ${WASAPI_AUDIO_SOURCES}) set(HAVE_SDL_AUDIO TRUE) @@ -1825,13 +1825,13 @@ elseif(WINDOWS) if(WINDOWS_STORE) set(SDL_VIDEO_DRIVER_WINRT 1) file(GLOB WIN_VIDEO_SOURCES - ${SDL2_SOURCE_DIR}/src/video/winrt/*.c - ${SDL2_SOURCE_DIR}/src/video/winrt/*.cpp - ${SDL2_SOURCE_DIR}/src/render/direct3d11/*.cpp + ${SDL3_SOURCE_DIR}/src/video/winrt/*.c + ${SDL3_SOURCE_DIR}/src/video/winrt/*.cpp + ${SDL3_SOURCE_DIR}/src/render/direct3d11/*.cpp ) else() set(SDL_VIDEO_DRIVER_WINDOWS 1) - file(GLOB WIN_VIDEO_SOURCES ${SDL2_SOURCE_DIR}/src/video/windows/*.c) + file(GLOB WIN_VIDEO_SOURCES ${SDL3_SOURCE_DIR}/src/video/windows/*.c) endif() list(APPEND SOURCE_FILES ${WIN_VIDEO_SOURCES}) @@ -1854,38 +1854,38 @@ elseif(WINDOWS) set(SDL_THREAD_GENERIC_COND_SUFFIX 1) set(SDL_THREAD_WINDOWS 1) list(APPEND SOURCE_FILES - ${SDL2_SOURCE_DIR}/src/thread/generic/SDL_syscond.c - ${SDL2_SOURCE_DIR}/src/thread/windows/SDL_syscond_cv.c - ${SDL2_SOURCE_DIR}/src/thread/windows/SDL_sysmutex.c - ${SDL2_SOURCE_DIR}/src/thread/windows/SDL_syssem.c - ${SDL2_SOURCE_DIR}/src/thread/windows/SDL_systhread.c - ${SDL2_SOURCE_DIR}/src/thread/windows/SDL_systls.c) + ${SDL3_SOURCE_DIR}/src/thread/generic/SDL_syscond.c + ${SDL3_SOURCE_DIR}/src/thread/windows/SDL_syscond_cv.c + ${SDL3_SOURCE_DIR}/src/thread/windows/SDL_sysmutex.c + ${SDL3_SOURCE_DIR}/src/thread/windows/SDL_syssem.c + ${SDL3_SOURCE_DIR}/src/thread/windows/SDL_systhread.c + ${SDL3_SOURCE_DIR}/src/thread/windows/SDL_systls.c) set(HAVE_SDL_THREADS TRUE) endif() if(SDL_SENSOR AND HAVE_SENSORSAPI_H AND NOT WINDOWS_STORE) set(SDL_SENSOR_WINDOWS 1) set(HAVE_SDL_SENSORS TRUE) - file(GLOB WINDOWS_SENSOR_SOURCES ${SDL2_SOURCE_DIR}/src/sensor/windows/*.c) + file(GLOB WINDOWS_SENSOR_SOURCES ${SDL3_SOURCE_DIR}/src/sensor/windows/*.c) list(APPEND SOURCE_FILES ${WINDOWS_SENSOR_SOURCES}) endif() if(SDL_POWER) if(WINDOWS_STORE) set(SDL_POWER_WINRT 1) - list(APPEND SOURCE_FILES ${SDL2_SOURCE_DIR}/src/power/winrt/SDL_syspower.cpp) + list(APPEND SOURCE_FILES ${SDL3_SOURCE_DIR}/src/power/winrt/SDL_syspower.cpp) else() set(SDL_POWER_WINDOWS 1) - list(APPEND SOURCE_FILES ${SDL2_SOURCE_DIR}/src/power/windows/SDL_syspower.c) + list(APPEND SOURCE_FILES ${SDL3_SOURCE_DIR}/src/power/windows/SDL_syspower.c) set(HAVE_SDL_POWER TRUE) endif() endif() if(SDL_LOCALE) if(WINDOWS_STORE) - file(GLOB LOCALE_SOURCES ${SDL2_SOURCE_DIR}/src/locale/winrt/*.c) + file(GLOB LOCALE_SOURCES ${SDL3_SOURCE_DIR}/src/locale/winrt/*.c) else() - file(GLOB LOCALE_SOURCES ${SDL2_SOURCE_DIR}/src/locale/windows/*.c) + file(GLOB LOCALE_SOURCES ${SDL3_SOURCE_DIR}/src/locale/windows/*.c) endif() list(APPEND SOURCE_FILES ${LOCALE_SOURCES}) set(HAVE_SDL_LOCALE TRUE) @@ -1894,9 +1894,9 @@ elseif(WINDOWS) if(SDL_FILESYSTEM) set(SDL_FILESYSTEM_WINDOWS 1) if(WINDOWS_STORE) - file(GLOB FILESYSTEM_SOURCES ${SDL2_SOURCE_DIR}/src/filesystem/winrt/*.cpp) + file(GLOB FILESYSTEM_SOURCES ${SDL3_SOURCE_DIR}/src/filesystem/winrt/*.cpp) else() - file(GLOB FILESYSTEM_SOURCES ${SDL2_SOURCE_DIR}/src/filesystem/windows/*.c) + file(GLOB FILESYSTEM_SOURCES ${SDL3_SOURCE_DIR}/src/filesystem/windows/*.c) endif() list(APPEND SOURCE_FILES ${FILESYSTEM_SOURCES}) set(HAVE_SDL_FILESYSTEM TRUE) @@ -1918,19 +1918,19 @@ elseif(WINDOWS) if(SDL_TIMERS) set(SDL_TIMER_WINDOWS 1) - file(GLOB TIMER_SOURCES ${SDL2_SOURCE_DIR}/src/timer/windows/*.c) + file(GLOB TIMER_SOURCES ${SDL3_SOURCE_DIR}/src/timer/windows/*.c) list(APPEND SOURCE_FILES ${TIMER_SOURCES}) set(HAVE_SDL_TIMERS TRUE) endif() if(SDL_LOADSO) set(SDL_LOADSO_WINDOWS 1) - file(GLOB LOADSO_SOURCES ${SDL2_SOURCE_DIR}/src/loadso/windows/*.c) + file(GLOB LOADSO_SOURCES ${SDL3_SOURCE_DIR}/src/loadso/windows/*.c) list(APPEND SOURCE_FILES ${LOADSO_SOURCES}) set(HAVE_SDL_LOADSO TRUE) endif() - file(GLOB CORE_SOURCES ${SDL2_SOURCE_DIR}/src/core/windows/*.c) + file(GLOB CORE_SOURCES ${SDL3_SOURCE_DIR}/src/core/windows/*.c) list(APPEND SOURCE_FILES ${CORE_SOURCES}) if(SDL_VIDEO) @@ -1959,7 +1959,7 @@ elseif(WINDOWS) endif() if(SDL_JOYSTICK) - file(GLOB JOYSTICK_SOURCES ${SDL2_SOURCE_DIR}/src/joystick/windows/*.c) + file(GLOB JOYSTICK_SOURCES ${SDL3_SOURCE_DIR}/src/joystick/windows/*.c) list(APPEND SOURCE_FILES ${JOYSTICK_SOURCES}) if(NOT WINDOWS_STORE) @@ -1982,7 +1982,7 @@ elseif(WINDOWS) if(SDL_HAPTIC) if((HAVE_DINPUT_H OR HAVE_XINPUT_H) AND NOT WINDOWS_STORE) - file(GLOB HAPTIC_SOURCES ${SDL2_SOURCE_DIR}/src/haptic/windows/*.c) + file(GLOB HAPTIC_SOURCES ${SDL3_SOURCE_DIR}/src/haptic/windows/*.c) if(HAVE_DINPUT_H) set(SDL_HAPTIC_DINPUT 1) endif() @@ -1990,7 +1990,7 @@ elseif(WINDOWS) set(SDL_HAPTIC_XINPUT 1) endif() else() - file(GLOB HAPTIC_SOURCES ${SDL2_SOURCE_DIR}/src/haptic/dummy/*.c) + file(GLOB HAPTIC_SOURCES ${SDL3_SOURCE_DIR}/src/haptic/dummy/*.c) set(SDL_HAPTIC_DUMMY 1) endif() list(APPEND SOURCE_FILES ${HAPTIC_SOURCES}) @@ -1998,13 +1998,13 @@ elseif(WINDOWS) endif() endif() - file(GLOB VERSION_SOURCES ${SDL2_SOURCE_DIR}/src/main/windows/*.rc) - file(GLOB SDLMAIN_SOURCES ${SDL2_SOURCE_DIR}/src/main/windows/*.c) + file(GLOB VERSION_SOURCES ${SDL3_SOURCE_DIR}/src/main/windows/*.rc) + file(GLOB SDLMAIN_SOURCES ${SDL3_SOURCE_DIR}/src/main/windows/*.c) if(MINGW OR CYGWIN) - if(NOT SDL2_DISABLE_SDL2MAIN) + if(NOT SDL3_DISABLE_SDL3MAIN) list(APPEND SDL_CFLAGS "-Dmain=SDL_main") - list(INSERT SDL_LIBS 0 "-lSDL2main") - endif(NOT SDL2_DISABLE_SDL2MAIN) + list(INSERT SDL_LIBS 0 "-lSDL3main") + endif(NOT SDL3_DISABLE_SDL3MAIN) list(INSERT SDL_LIBS 0 "-lmingw32" "-mwindows") endif() @@ -2024,20 +2024,20 @@ elseif(APPLE) # Requires the darwin file implementation if(SDL_FILE) - file(GLOB EXTRA_SOURCES ${SDL2_SOURCE_DIR}/src/file/cocoa/*.m) + file(GLOB EXTRA_SOURCES ${SDL3_SOURCE_DIR}/src/file/cocoa/*.m) list(APPEND SOURCE_FILES ${EXTRA_SOURCES}) set(HAVE_SDL_FILE TRUE) endif() if(IOS OR TVOS) - file(GLOB SDLMAIN_SOURCES ${SDL2_SOURCE_DIR}/src/main/uikit/*.c) + file(GLOB SDLMAIN_SOURCES ${SDL3_SOURCE_DIR}/src/main/uikit/*.c) endif() if(SDL_MISC) if(IOS OR TVOS) - file(GLOB MISC_SOURCES ${SDL2_SOURCE_DIR}/src/misc/ios/*.m) + file(GLOB MISC_SOURCES ${SDL3_SOURCE_DIR}/src/misc/ios/*.m) else() - file(GLOB MISC_SOURCES ${SDL2_SOURCE_DIR}/src/misc/macosx/*.m) + file(GLOB MISC_SOURCES ${SDL3_SOURCE_DIR}/src/misc/macosx/*.m) endif() list(APPEND SOURCE_FILES ${MISC_SOURCES}) set(HAVE_SDL_MISC TRUE) @@ -2045,7 +2045,7 @@ elseif(APPLE) if(SDL_AUDIO) set(SDL_AUDIO_DRIVER_COREAUDIO 1) - file(GLOB AUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/coreaudio/*.m) + file(GLOB AUDIO_SOURCES ${SDL3_SOURCE_DIR}/src/audio/coreaudio/*.m) list(APPEND SOURCE_FILES ${AUDIO_SOURCES}) set(HAVE_SDL_AUDIO TRUE) set(SDL_FRAMEWORK_COREAUDIO 1) @@ -2058,9 +2058,9 @@ elseif(APPLE) endif() if(SDL_JOYSTICK) - file(GLOB MFI_JOYSTICK_SOURCES ${SDL2_SOURCE_DIR}/src/joystick/iphoneos/*.m) + file(GLOB MFI_JOYSTICK_SOURCES ${SDL3_SOURCE_DIR}/src/joystick/iphoneos/*.m) if(IOS OR TVOS) - file(GLOB JOYSTICK_SOURCES ${SDL2_SOURCE_DIR}/src/joystick/steam/*.c) + file(GLOB JOYSTICK_SOURCES ${SDL3_SOURCE_DIR}/src/joystick/steam/*.c) set(SDL_JOYSTICK_MFI 1) if(IOS) set(SDL_FRAMEWORK_COREMOTION 1) @@ -2068,7 +2068,7 @@ elseif(APPLE) set(SDL_FRAMEWORK_GAMECONTROLLER 1) set(SDL_FRAMEWORK_COREHAPTICS 1) else() - file(GLOB JOYSTICK_SOURCES ${SDL2_SOURCE_DIR}/src/joystick/darwin/*.c) + file(GLOB JOYSTICK_SOURCES ${SDL3_SOURCE_DIR}/src/joystick/darwin/*.c) set_property(SOURCE ${MFI_JOYSTICK_SOURCES} APPEND_STRING PROPERTY COMPILE_FLAGS " -fobjc-weak") check_objc_source_compiles(" #include @@ -2104,10 +2104,10 @@ elseif(APPLE) if(SDL_HAPTIC) if (IOS OR TVOS) - file(GLOB HAPTIC_SOURCES ${SDL2_SOURCE_DIR}/src/haptic/dummy/*.c) + file(GLOB HAPTIC_SOURCES ${SDL3_SOURCE_DIR}/src/haptic/dummy/*.c) set(SDL_HAPTIC_DUMMY 1) else() - file(GLOB HAPTIC_SOURCES ${SDL2_SOURCE_DIR}/src/haptic/darwin/*.c) + file(GLOB HAPTIC_SOURCES ${SDL3_SOURCE_DIR}/src/haptic/darwin/*.c) set(SDL_HAPTIC_IOKIT 1) set(SDL_FRAMEWORK_IOKIT 1) set(SDL_FRAMEWORK_FF 1) @@ -2118,10 +2118,10 @@ elseif(APPLE) if(SDL_POWER) if (IOS OR TVOS) - file(GLOB POWER_SOURCES ${SDL2_SOURCE_DIR}/src/power/uikit/*.m) + file(GLOB POWER_SOURCES ${SDL3_SOURCE_DIR}/src/power/uikit/*.m) set(SDL_POWER_UIKIT 1) else() - file(GLOB POWER_SOURCES ${SDL2_SOURCE_DIR}/src/power/macosx/*.c) + file(GLOB POWER_SOURCES ${SDL3_SOURCE_DIR}/src/power/macosx/*.c) set(SDL_POWER_MACOSX 1) set(SDL_FRAMEWORK_IOKIT 1) endif() @@ -2130,21 +2130,21 @@ elseif(APPLE) endif() if(SDL_LOCALE) - file(GLOB LOCALE_SOURCES ${SDL2_SOURCE_DIR}/src/locale/macosx/*.m) + file(GLOB LOCALE_SOURCES ${SDL3_SOURCE_DIR}/src/locale/macosx/*.m) list(APPEND SOURCE_FILES ${LOCALE_SOURCES}) set(HAVE_SDL_LOCALE TRUE) endif() if(SDL_TIMERS) set(SDL_TIMER_UNIX 1) - file(GLOB TIMER_SOURCES ${SDL2_SOURCE_DIR}/src/timer/unix/*.c) + file(GLOB TIMER_SOURCES ${SDL3_SOURCE_DIR}/src/timer/unix/*.c) list(APPEND SOURCE_FILES ${TIMER_SOURCES}) set(HAVE_SDL_TIMERS TRUE) endif(SDL_TIMERS) if(SDL_FILESYSTEM) set(SDL_FILESYSTEM_COCOA 1) - file(GLOB FILESYSTEM_SOURCES ${SDL2_SOURCE_DIR}/src/filesystem/cocoa/*.m) + file(GLOB FILESYSTEM_SOURCES ${SDL3_SOURCE_DIR}/src/filesystem/cocoa/*.m) list(APPEND SOURCE_FILES ${FILESYSTEM_SOURCES}) set(HAVE_SDL_FILESYSTEM TRUE) endif() @@ -2153,7 +2153,7 @@ elseif(APPLE) if(IOS) set(SDL_SENSOR_COREMOTION 1) set(HAVE_SDL_SENSORS TRUE) - file(GLOB SENSOR_SOURCES ${SDL2_SOURCE_DIR}/src/sensor/coremotion/*.m) + file(GLOB SENSOR_SOURCES ${SDL3_SOURCE_DIR}/src/sensor/coremotion/*.m) list(APPEND SOURCE_FILES ${SENSOR_SOURCES}) endif() endif() @@ -2167,7 +2167,7 @@ elseif(APPLE) set(SDL_FRAMEWORK_UIKIT 1) set(SDL_IPHONE_KEYBOARD 1) set(SDL_IPHONE_LAUNCHSCREEN 1) - file(GLOB UIKITVIDEO_SOURCES ${SDL2_SOURCE_DIR}/src/video/uikit/*.m) + file(GLOB UIKITVIDEO_SOURCES ${SDL3_SOURCE_DIR}/src/video/uikit/*.m) list(APPEND SOURCE_FILES ${UIKITVIDEO_SOURCES}) set(HAVE_SDL_VIDEO TRUE) else() @@ -2215,7 +2215,7 @@ elseif(APPLE) set(HAVE_METAL TRUE) endif() if(SDL_RENDER_METAL) - file(GLOB RENDER_METAL_SOURCES ${SDL2_SOURCE_DIR}/src/render/metal/*.m) + file(GLOB RENDER_METAL_SOURCES ${SDL3_SOURCE_DIR}/src/render/metal/*.m) list(APPEND SOURCE_FILES ${RENDER_METAL_SOURCES}) set(SDL_VIDEO_RENDER_METAL 1) set(HAVE_RENDER_METAL TRUE) @@ -2299,27 +2299,27 @@ elseif(APPLE) elseif(HAIKU) if(SDL_AUDIO) set(SDL_AUDIO_DRIVER_HAIKU 1) - file(GLOB HAIKU_AUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/haiku/*.cc) + file(GLOB HAIKU_AUDIO_SOURCES ${SDL3_SOURCE_DIR}/src/audio/haiku/*.cc) list(APPEND SOURCE_FILES ${HAIKU_AUDIO_SOURCES}) set(HAVE_SDL_AUDIO TRUE) endif() if(SDL_JOYSTICK) set(SDL_JOYSTICK_HAIKU 1) - file(GLOB HAIKU_JOYSTICK_SOURCES ${SDL2_SOURCE_DIR}/src/joystick/haiku/*.cc) + file(GLOB HAIKU_JOYSTICK_SOURCES ${SDL3_SOURCE_DIR}/src/joystick/haiku/*.cc) list(APPEND SOURCE_FILES ${HAIKU_JOYSTICK_SOURCES}) set(HAVE_SDL_JOYSTICK TRUE) endif() if(SDL_MISC) - file(GLOB MISC_SOURCES ${SDL2_SOURCE_DIR}/src/misc/haiku/*.cc) + file(GLOB MISC_SOURCES ${SDL3_SOURCE_DIR}/src/misc/haiku/*.cc) list(APPEND SOURCE_FILES ${MISC_SOURCES}) set(HAVE_SDL_MISC TRUE) endif() if(SDL_VIDEO) set(SDL_VIDEO_DRIVER_HAIKU 1) - file(GLOB HAIKUVIDEO_SOURCES ${SDL2_SOURCE_DIR}/src/video/haiku/*.cc) + file(GLOB HAIKUVIDEO_SOURCES ${SDL3_SOURCE_DIR}/src/video/haiku/*.cc) list(APPEND SOURCE_FILES ${HAIKUVIDEO_SOURCES}) set(HAVE_SDL_VIDEO TRUE) @@ -2335,32 +2335,32 @@ elseif(HAIKU) if(SDL_FILESYSTEM) set(SDL_FILESYSTEM_HAIKU 1) - file(GLOB FILESYSTEM_SOURCES ${SDL2_SOURCE_DIR}/src/filesystem/haiku/*.cc) + file(GLOB FILESYSTEM_SOURCES ${SDL3_SOURCE_DIR}/src/filesystem/haiku/*.cc) list(APPEND SOURCE_FILES ${FILESYSTEM_SOURCES}) set(HAVE_SDL_FILESYSTEM TRUE) endif() if(SDL_TIMERS) set(SDL_TIMER_HAIKU 1) - file(GLOB TIMER_SOURCES ${SDL2_SOURCE_DIR}/src/timer/haiku/*.c) + file(GLOB TIMER_SOURCES ${SDL3_SOURCE_DIR}/src/timer/haiku/*.c) list(APPEND SOURCE_FILES ${TIMER_SOURCES}) set(HAVE_SDL_TIMERS TRUE) endif() if(SDL_POWER) set(SDL_POWER_HAIKU 1) - file(GLOB HAIKU_POWER_SOURCES ${SDL2_SOURCE_DIR}/src/power/haiku/*.c) + file(GLOB HAIKU_POWER_SOURCES ${SDL3_SOURCE_DIR}/src/power/haiku/*.c) list(APPEND SOURCE_FILES ${HAIKU_POWER_SOURCES}) set(HAVE_SDL_POWER TRUE) endif() if(SDL_LOCALE) - file(GLOB LOCALE_SOURCES ${SDL2_SOURCE_DIR}/src/locale/haiku/*.cc) + file(GLOB LOCALE_SOURCES ${SDL3_SOURCE_DIR}/src/locale/haiku/*.cc) list(APPEND SOURCE_FILES ${LOCALE_SOURCES}) set(HAVE_SDL_LOCALE TRUE) endif() - file(GLOB MAIN_SOURCES ${SDL2_SOURCE_DIR}/src/main/haiku/*.cc) + file(GLOB MAIN_SOURCES ${SDL3_SOURCE_DIR}/src/main/haiku/*.cc) list(APPEND SOURCE_FILES ${MAIN_SOURCES}) CheckPTHREAD() @@ -2368,28 +2368,28 @@ elseif(HAIKU) elseif(RISCOS) if(SDL_MISC) - file(GLOB MISC_SOURCES ${SDL2_SOURCE_DIR}/src/misc/riscos/*.c) + file(GLOB MISC_SOURCES ${SDL3_SOURCE_DIR}/src/misc/riscos/*.c) list(APPEND SOURCE_FILES ${MISC_SOURCES}) set(HAVE_SDL_MISC TRUE) endif() if(SDL_VIDEO) set(SDL_VIDEO_DRIVER_RISCOS 1) - file(GLOB RISCOSVIDEO_SOURCES ${SDL2_SOURCE_DIR}/src/video/riscos/*.c) + file(GLOB RISCOSVIDEO_SOURCES ${SDL3_SOURCE_DIR}/src/video/riscos/*.c) list(APPEND SOURCE_FILES ${RISCOSVIDEO_SOURCES}) set(HAVE_SDL_VIDEO TRUE) endif() if(SDL_FILESYSTEM) set(SDL_FILESYSTEM_RISCOS 1) - file(GLOB FILESYSTEM_SOURCES ${SDL2_SOURCE_DIR}/src/filesystem/riscos/*.c) + file(GLOB FILESYSTEM_SOURCES ${SDL3_SOURCE_DIR}/src/filesystem/riscos/*.c) list(APPEND SOURCE_FILES ${FILESYSTEM_SOURCES}) set(HAVE_SDL_FILESYSTEM TRUE) endif() if(SDL_TIMERS) set(SDL_TIMER_UNIX 1) - file(GLOB TIMER_SOURCES ${SDL2_SOURCE_DIR}/src/timer/unix/*.c) + file(GLOB TIMER_SOURCES ${SDL3_SOURCE_DIR}/src/timer/unix/*.c) list(APPEND SOURCE_FILES ${TIMER_SOURCES}) set(HAVE_SDL_TIMERS TRUE) @@ -2410,70 +2410,70 @@ elseif(VITA) set(CMAKE_REQUIRED_FLAGS "-Werror=unused-command-line-argument") check_c_compiler_flag(-marm HAVE_ARM_MODE) if(HAVE_ARM_MODE) - set_property(SOURCE "${SDL2_SOURCE_DIR}/src/atomic/SDL_spinlock.c" APPEND_STRING PROPERTY COMPILE_FLAGS " -marm") + set_property(SOURCE "${SDL3_SOURCE_DIR}/src/atomic/SDL_spinlock.c" APPEND_STRING PROPERTY COMPILE_FLAGS " -marm") endif() cmake_pop_check_state() if(SDL_MISC) - file(GLOB MISC_SOURCES ${SDL2_SOURCE_DIR}/src/misc/vita/*.c) + file(GLOB MISC_SOURCES ${SDL3_SOURCE_DIR}/src/misc/vita/*.c) list(APPEND SOURCE_FILES ${MISC_SOURCES}) set(HAVE_SDL_MISC TRUE) endif() if(SDL_AUDIO) set(SDL_AUDIO_DRIVER_VITA 1) - file(GLOB VITA_AUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/vita/*.c) + file(GLOB VITA_AUDIO_SOURCES ${SDL3_SOURCE_DIR}/src/audio/vita/*.c) list(APPEND SOURCE_FILES ${VITA_AUDIO_SOURCES}) set(HAVE_SDL_AUDIO TRUE) endif() if(SDL_FILESYSTEM) set(SDL_FILESYSTEM_VITA 1) - file(GLOB VITA_FILESYSTEM_SOURCES ${SDL2_SOURCE_DIR}/src/filesystem/vita/*.c) + file(GLOB VITA_FILESYSTEM_SOURCES ${SDL3_SOURCE_DIR}/src/filesystem/vita/*.c) list(APPEND SOURCE_FILES ${VITA_FILESYSTEM_SOURCES}) set(HAVE_SDL_FILESYSTEM TRUE) endif() if(SDL_JOYSTICK) set(SDL_JOYSTICK_VITA 1) - file(GLOB VITA_JOYSTICK_SOURCES ${SDL2_SOURCE_DIR}/src/joystick/vita/*.c) + file(GLOB VITA_JOYSTICK_SOURCES ${SDL3_SOURCE_DIR}/src/joystick/vita/*.c) list(APPEND SOURCE_FILES ${VITA_JOYSTICK_SOURCES}) set(HAVE_SDL_JOYSTICK TRUE) endif() if(SDL_POWER) set(SDL_POWER_VITA 1) - file(GLOB VITA_POWER_SOURCES ${SDL2_SOURCE_DIR}/src/power/vita/*.c) + file(GLOB VITA_POWER_SOURCES ${SDL3_SOURCE_DIR}/src/power/vita/*.c) list(APPEND SOURCE_FILES ${VITA_POWER_SOURCES}) set(HAVE_SDL_POWER TRUE) endif() if(SDL_THREADS) set(SDL_THREAD_VITA 1) list(APPEND SOURCE_FILES - ${SDL2_SOURCE_DIR}/src/thread/vita/SDL_sysmutex.c - ${SDL2_SOURCE_DIR}/src/thread/vita/SDL_syssem.c - ${SDL2_SOURCE_DIR}/src/thread/vita/SDL_systhread.c - ${SDL2_SOURCE_DIR}/src/thread/vita/SDL_syscond.c - ${SDL2_SOURCE_DIR}/src/thread/generic/SDL_systls.c) + ${SDL3_SOURCE_DIR}/src/thread/vita/SDL_sysmutex.c + ${SDL3_SOURCE_DIR}/src/thread/vita/SDL_syssem.c + ${SDL3_SOURCE_DIR}/src/thread/vita/SDL_systhread.c + ${SDL3_SOURCE_DIR}/src/thread/vita/SDL_syscond.c + ${SDL3_SOURCE_DIR}/src/thread/generic/SDL_systls.c) set(HAVE_SDL_THREADS TRUE) endif() if(SDL_LOCALE) - file(GLOB LOCALE_SOURCES ${SDL2_SOURCE_DIR}/src/locale/vita/*.c) + file(GLOB LOCALE_SOURCES ${SDL3_SOURCE_DIR}/src/locale/vita/*.c) list(APPEND SOURCE_FILES ${LOCALE_SOURCES}) set(HAVE_SDL_LOCALE TRUE) endif() if(SDL_TIMERS) set(SDL_TIMER_VITA 1) - file(GLOB TIMER_SOURCES ${SDL2_SOURCE_DIR}/src/timer/vita/*.c) + file(GLOB TIMER_SOURCES ${SDL3_SOURCE_DIR}/src/timer/vita/*.c) list(APPEND SOURCE_FILES ${TIMER_SOURCES}) set(HAVE_SDL_TIMERS TRUE) endif() if(SDL_SENSOR) set(SDL_SENSOR_VITA 1) set(HAVE_SDL_SENSORS TRUE) - file(GLOB VITA_SENSOR_SOURCES ${SDL2_SOURCE_DIR}/src/sensor/vita/*.c) + file(GLOB VITA_SENSOR_SOURCES ${SDL3_SOURCE_DIR}/src/sensor/vita/*.c) list(APPEND SOURCE_FILES ${VITA_SENSOR_SOURCES}) endif() if(SDL_VIDEO) set(SDL_VIDEO_DRIVER_VITA 1) - file(GLOB VITA_VIDEO_SOURCES ${SDL2_SOURCE_DIR}/src/video/vita/*.c) + file(GLOB VITA_VIDEO_SOURCES ${SDL3_SOURCE_DIR}/src/video/vita/*.c) list(APPEND SOURCE_FILES ${VITA_VIDEO_SOURCES}) set(HAVE_SDL_VIDEO TRUE) @@ -2564,65 +2564,65 @@ elseif(VITA) set(HAVE_ARMSIMD TRUE) # set(SDL_ARM_SIMD_BLITTERS 1) -# file(GLOB ARMSIMD_SOURCES ${SDL2_SOURCE_DIR}/src/video/arm/pixman-arm-simd*.S) +# file(GLOB ARMSIMD_SOURCES ${SDL3_SOURCE_DIR}/src/video/arm/pixman-arm-simd*.S) # list(APPEND SOURCE_FILES ${ARMSIMD_SOURCES}) set(HAVE_ARMNEON TRUE) # set(SDL_ARM_NEON_BLITTERS 1) -# file(GLOB ARMNEON_SOURCES ${SDL2_SOURCE_DIR}/src/video/arm/pixman-arm-neon*.S) +# file(GLOB ARMNEON_SOURCES ${SDL3_SOURCE_DIR}/src/video/arm/pixman-arm-neon*.S) # list(APPEND SOURCE_FILES ${ARMNEON_SOURCES}) -# set_property(SOURCE ${SDL2_SOURCE_DIR}/src/video/arm/pixman-arm-simd-asm.S PROPERTY LANGUAGE C) -# set_property(SOURCE ${SDL2_SOURCE_DIR}/src/video/arm/pixman-arm-neon-asm.S PROPERTY LANGUAGE C) +# set_property(SOURCE ${SDL3_SOURCE_DIR}/src/video/arm/pixman-arm-simd-asm.S PROPERTY LANGUAGE C) +# set_property(SOURCE ${SDL3_SOURCE_DIR}/src/video/arm/pixman-arm-neon-asm.S PROPERTY LANGUAGE C) target_compile_definitions(sdl-build-options INTERFACE "-D__VITA__") # CheckPTHREAD() elseif(PSP) - file(GLOB PSP_MAIN_SOURCES ${SDL2_SOURCE_DIR}/src/main/psp/*.c) + file(GLOB PSP_MAIN_SOURCES ${SDL3_SOURCE_DIR}/src/main/psp/*.c) list(APPEND SDLMAIN_SOURCES ${PSP_MAIN_SOURCES}) if(SDL_AUDIO) set(SDL_AUDIO_DRIVER_PSP 1) - file(GLOB PSP_AUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/psp/*.c) + file(GLOB PSP_AUDIO_SOURCES ${SDL3_SOURCE_DIR}/src/audio/psp/*.c) list(APPEND SOURCE_FILES ${PSP_AUDIO_SOURCES}) set(HAVE_SDL_AUDIO TRUE) endif() if(SDL_FILESYSTEM) set(SDL_FILESYSTEM_PSP 1) - file(GLOB PSP_FILESYSTEM_SOURCES ${SDL2_SOURCE_DIR}/src/filesystem/psp/*.c) + file(GLOB PSP_FILESYSTEM_SOURCES ${SDL3_SOURCE_DIR}/src/filesystem/psp/*.c) list(APPEND SOURCE_FILES ${PSP_FILESYSTEM_SOURCES}) set(HAVE_SDL_FILESYSTEM TRUE) endif() if(SDL_JOYSTICK) set(SDL_JOYSTICK_PSP 1) - file(GLOB PSP_JOYSTICK_SOURCES ${SDL2_SOURCE_DIR}/src/joystick/psp/*.c) + file(GLOB PSP_JOYSTICK_SOURCES ${SDL3_SOURCE_DIR}/src/joystick/psp/*.c) list(APPEND SOURCE_FILES ${PSP_JOYSTICK_SOURCES}) set(HAVE_SDL_JOYSTICK TRUE) endif() if(SDL_POWER) set(SDL_POWER_PSP 1) - file(GLOB PSP_POWER_SOURCES ${SDL2_SOURCE_DIR}/src/power/psp/*.c) + file(GLOB PSP_POWER_SOURCES ${SDL3_SOURCE_DIR}/src/power/psp/*.c) list(APPEND SOURCE_FILES ${PSP_POWER_SOURCES}) set(HAVE_SDL_POWER TRUE) endif() if(SDL_THREADS) set(SDL_THREAD_PSP 1) - file(GLOB PSP_THREAD_SOURCES ${SDL2_SOURCE_DIR}/src/thread/generic/SDL_systls.c ${SDL2_SOURCE_DIR}/src/thread/psp/*.c) + file(GLOB PSP_THREAD_SOURCES ${SDL3_SOURCE_DIR}/src/thread/generic/SDL_systls.c ${SDL3_SOURCE_DIR}/src/thread/psp/*.c) list(APPEND SOURCE_FILES ${PSP_THREAD_SOURCES}) set(HAVE_SDL_THREADS TRUE) endif() if(SDL_TIMERS) set(SDL_TIMER_PSP 1) - file(GLOB PSP_TIMER_SOURCES ${SDL2_SOURCE_DIR}/src/timer/psp/*.c) + file(GLOB PSP_TIMER_SOURCES ${SDL3_SOURCE_DIR}/src/timer/psp/*.c) list(APPEND SOURCE_FILES ${PSP_TIMER_SOURCES}) set(HAVE_SDL_TIMERS TRUE) endif() if(SDL_VIDEO) set(SDL_VIDEO_DRIVER_PSP 1) set(SDL_VIDEO_RENDER_PSP 1) - file(GLOB PSP_VIDEO_SOURCES ${SDL2_SOURCE_DIR}/src/video/psp/*.c) + file(GLOB PSP_VIDEO_SOURCES ${SDL3_SOURCE_DIR}/src/video/psp/*.c) list(APPEND SOURCE_FILES ${PSP_VIDEO_SOURCES}) set(SDL_VIDEO_OPENGL 1) set(HAVE_SDL_VIDEO TRUE) @@ -2640,50 +2640,50 @@ elseif(PSP) pspctrl psppower ) - if(NOT SDL2_DISABLE_SDL2MAIN) - list(INSERT SDL_LIBS 0 "-lSDL2main") - endif(NOT SDL2_DISABLE_SDL2MAIN) + if(NOT SDL3_DISABLE_SDL3MAIN) + list(INSERT SDL_LIBS 0 "-lSDL3main") + endif(NOT SDL3_DISABLE_SDL3MAIN) elseif(PS2) list(APPEND EXTRA_CFLAGS "-DPS2" "-D__PS2__" "-I$ENV{PS2SDK}/ports/include" "-I$ENV{PS2DEV}/gsKit/include") - file(GLOB PS2_MAIN_SOURCES ${SDL2_SOURCE_DIR}/src/main/ps2/*.c) + file(GLOB PS2_MAIN_SOURCES ${SDL3_SOURCE_DIR}/src/main/ps2/*.c) set(SDLMAIN_SOURCES ${SDLMAIN_SOURCES} ${PS2_MAIN_SOURCES}) if(SDL_AUDIO) set(SDL_AUDIO_DRIVER_PS2 1) - file(GLOB PS2_AUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/ps2/*.c) + file(GLOB PS2_AUDIO_SOURCES ${SDL3_SOURCE_DIR}/src/audio/ps2/*.c) set(SOURCE_FILES ${SOURCE_FILES} ${PS2_AUDIO_SOURCES}) set(HAVE_SDL_AUDIO TRUE) endif() if(SDL_FILESYSTEM) set(SDL_FILESYSTEM_PS2 1) - file(GLOB PS2_FILESYSTEM_SOURCES ${SDL2_SOURCE_DIR}/src/filesystem/ps2/*.c) + file(GLOB PS2_FILESYSTEM_SOURCES ${SDL3_SOURCE_DIR}/src/filesystem/ps2/*.c) list(APPEND SOURCE_FILES ${PS2_FILESYSTEM_SOURCES}) set(HAVE_SDL_FILESYSTEM TRUE) endif() if(SDL_JOYSTICK) set(SDL_JOYSTICK_PS2 1) - file(GLOB PS2_JOYSTICK_SOURCES ${SDL2_SOURCE_DIR}/src/joystick/ps2/*.c) + file(GLOB PS2_JOYSTICK_SOURCES ${SDL3_SOURCE_DIR}/src/joystick/ps2/*.c) list(APPEND SOURCE_FILES ${PS2_JOYSTICK_SOURCES}) set(HAVE_SDL_JOYSTICK TRUE) endif() if(SDL_THREADS) set(SDL_THREAD_PS2 1) - file(GLOB PS2_THREAD_SOURCES ${SDL2_SOURCE_DIR}/src/thread/generic/SDL_systls.c ${SDL2_SOURCE_DIR}/src/thread/generic/SDL_sysmutex.c ${SDL2_SOURCE_DIR}/src/thread/ps2/*.c) + file(GLOB PS2_THREAD_SOURCES ${SDL3_SOURCE_DIR}/src/thread/generic/SDL_systls.c ${SDL3_SOURCE_DIR}/src/thread/generic/SDL_sysmutex.c ${SDL3_SOURCE_DIR}/src/thread/ps2/*.c) list(APPEND SOURCE_FILES ${PS2_THREAD_SOURCES}) set(HAVE_SDL_THREADS TRUE) endif() if(SDL_TIMERS) set(SDL_TIMER_PS2 1) - file(GLOB PS2_TIMER_SOURCES ${SDL2_SOURCE_DIR}/src/timer/ps2/*.c) + file(GLOB PS2_TIMER_SOURCES ${SDL3_SOURCE_DIR}/src/timer/ps2/*.c) list(APPEND SOURCE_FILES ${PS2_TIMER_SOURCES}) set(HAVE_SDL_TIMERS TRUE) endif() if(SDL_VIDEO) set(SDL_VIDEO_DRIVER_PS2 1) set(SDL_VIDEO_RENDER_PS2 1) - file(GLOB PS2_VIDEO_SOURCES ${SDL2_SOURCE_DIR}/src/video/ps2/*.c ${SDL2_SOURCE_DIR}/src/render/ps2/*.c) + file(GLOB PS2_VIDEO_SOURCES ${SDL3_SOURCE_DIR}/src/video/ps2/*.c ${SDL3_SOURCE_DIR}/src/render/ps2/*.c) list(APPEND SOURCE_FILES ${PS2_VIDEO_SOURCES}) set(SDL_VIDEO_OPENGL 0) set(HAVE_SDL_VIDEO TRUE) @@ -2699,57 +2699,57 @@ elseif(PS2) elseif(OS2) list(APPEND EXTRA_CFLAGS "-DOS2EMX_PLAIN_CHAR") - file(GLOB CORE_SOURCES ${SDL2_SOURCE_DIR}/src/core/os2/*.c) + file(GLOB CORE_SOURCES ${SDL3_SOURCE_DIR}/src/core/os2/*.c) list(APPEND SOURCE_FILES ${CORE_SOURCES}) if(NOT (HAVE_ICONV AND HAVE_ICONV_H)) - file(GLOB CORE_SOURCES ${SDL2_SOURCE_DIR}/src/core/os2/geniconv/*.c) + file(GLOB CORE_SOURCES ${SDL3_SOURCE_DIR}/src/core/os2/geniconv/*.c) list(APPEND SOURCE_FILES ${CORE_SOURCES}) endif() if(SDL_THREADS) set(SDL_THREAD_OS2 1) - file(GLOB OS2_THREAD_SOURCES ${SDL2_SOURCE_DIR}/src/thread/os2/*.c) + file(GLOB OS2_THREAD_SOURCES ${SDL3_SOURCE_DIR}/src/thread/os2/*.c) list(APPEND SOURCE_FILES ${OS2_THREAD_SOURCES}) set(HAVE_SDL_THREADS TRUE) endif() if(SDL_TIMERS) set(SDL_TIMER_UNIX 1) - file(GLOB OS2_TIMER_SOURCES ${SDL2_SOURCE_DIR}/src/timer/os2/*.c) + file(GLOB OS2_TIMER_SOURCES ${SDL3_SOURCE_DIR}/src/timer/os2/*.c) list(APPEND SOURCE_FILES ${OS2_TIMER_SOURCES}) set(HAVE_SDL_TIMERS TRUE) endif() if(SDL_LOADSO) set(SDL_LOADSO_OS2 1) - file(GLOB OS2_LOADSO_SOURCES ${SDL2_SOURCE_DIR}/src/loadso/os2/*.c) + file(GLOB OS2_LOADSO_SOURCES ${SDL3_SOURCE_DIR}/src/loadso/os2/*.c) list(APPEND SOURCE_FILES ${OS2_LOADSO_SOURCES}) set(HAVE_SDL_LOADSO TRUE) endif() if(SDL_FILESYSTEM) set(SDL_FILESYSTEM_OS2 1) - file(GLOB FILESYSTEM_SOURCES ${SDL2_SOURCE_DIR}/src/filesystem/os2/*.c) + file(GLOB FILESYSTEM_SOURCES ${SDL3_SOURCE_DIR}/src/filesystem/os2/*.c) list(APPEND SOURCE_FILES ${FILESYSTEM_SOURCES}) set(HAVE_SDL_FILESYSTEM TRUE) endif() if(SDL_LOCALE) - file(GLOB LOCALE_SOURCES ${SDL2_SOURCE_DIR}/src/locale/unix/*.c) + file(GLOB LOCALE_SOURCES ${SDL3_SOURCE_DIR}/src/locale/unix/*.c) list(APPEND SOURCE_FILES ${LOCALE_SOURCES}) set(HAVE_SDL_LOCALE TRUE) endif() if(SDL_VIDEO) set(SDL_VIDEO_DRIVER_OS2 1) - file(GLOB OS2_VIDEO_SOURCES ${SDL2_SOURCE_DIR}/src/video/os2/*.c) + file(GLOB OS2_VIDEO_SOURCES ${SDL3_SOURCE_DIR}/src/video/os2/*.c) list(APPEND SOURCE_FILES ${OS2_VIDEO_SOURCES}) set(HAVE_SDL_VIDEO TRUE) endif() if(SDL_AUDIO) set(SDL_AUDIO_DRIVER_OS2 1) - file(GLOB OS2_AUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/os2/*.c) + file(GLOB OS2_AUDIO_SOURCES ${SDL3_SOURCE_DIR}/src/audio/os2/*.c) list(APPEND SOURCE_FILES ${OS2_AUDIO_SOURCES}) set(HAVE_SDL_AUDIO TRUE) list(APPEND EXTRA_LIBS mmpm2) @@ -2757,7 +2757,7 @@ elseif(OS2) if(SDL_JOYSTICK) set(SDL_JOYSTICK_OS2 1) - file(GLOB OS2_JOYSTICK_SOURCES ${SDL2_SOURCE_DIR}/src/joystick/os2/*.c) + file(GLOB OS2_JOYSTICK_SOURCES ${SDL3_SOURCE_DIR}/src/joystick/os2/*.c) list(APPEND SOURCE_FILES ${OS2_JOYSTICK_SOURCES}) set(HAVE_SDL_JOYSTICK TRUE) endif() @@ -2767,74 +2767,74 @@ elseif(OS2) endif() elseif(N3DS) - file(GLOB N3DS_MAIN_SOURCES ${SDL2_SOURCE_DIR}/src/main/n3ds/*.c) + file(GLOB N3DS_MAIN_SOURCES ${SDL3_SOURCE_DIR}/src/main/n3ds/*.c) set(SDLMAIN_SOURCES ${SDLMAIN_SOURCES} ${N3DS_MAIN_SOURCES}) if(SDL_AUDIO) set(SDL_AUDIO_DRIVER_N3DS 1) - file(GLOB N3DS_AUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/n3ds/*.c) + file(GLOB N3DS_AUDIO_SOURCES ${SDL3_SOURCE_DIR}/src/audio/n3ds/*.c) list(APPEND SOURCE_FILES ${N3DS_AUDIO_SOURCES}) set(HAVE_SDL_AUDIO TRUE) endif() if(SDL_FILESYSTEM) set(SDL_FILESYSTEM_N3DS 1) - file(GLOB N3DS_FILESYSTEM_SOURCES ${SDL2_SOURCE_DIR}/src/filesystem/n3ds/*.c) + file(GLOB N3DS_FILESYSTEM_SOURCES ${SDL3_SOURCE_DIR}/src/filesystem/n3ds/*.c) list(APPEND SOURCE_FILES ${N3DS_FILESYSTEM_SOURCES}) set(HAVE_SDL_FILESYSTEM TRUE) endif() if(SDL_JOYSTICK) set(SDL_JOYSTICK_N3DS 1) - file(GLOB N3DS_JOYSTICK_SOURCES ${SDL2_SOURCE_DIR}/src/joystick/n3ds/*.c) + file(GLOB N3DS_JOYSTICK_SOURCES ${SDL3_SOURCE_DIR}/src/joystick/n3ds/*.c) list(APPEND SOURCE_FILES ${N3DS_JOYSTICK_SOURCES}) set(HAVE_SDL_JOYSTICK TRUE) endif() if(SDL_POWER) set(SDL_POWER_N3DS 1) - file(GLOB N3DS_POWER_SOURCES ${SDL2_SOURCE_DIR}/src/power/n3ds/*.c) + file(GLOB N3DS_POWER_SOURCES ${SDL3_SOURCE_DIR}/src/power/n3ds/*.c) list(APPEND SOURCE_FILES ${N3DS_POWER_SOURCES}) set(HAVE_SDL_POWER TRUE) endif() if(SDL_THREADS) set(SDL_THREAD_N3DS 1) - file(GLOB N3DS_THREAD_SOURCES ${SDL2_SOURCE_DIR}/src/thread/n3ds/*.c) - list(APPEND SOURCE_FILES ${N3DS_THREAD_SOURCES} ${SDL2_SOURCE_DIR}/src/thread/generic/SDL_systls.c) + file(GLOB N3DS_THREAD_SOURCES ${SDL3_SOURCE_DIR}/src/thread/n3ds/*.c) + list(APPEND SOURCE_FILES ${N3DS_THREAD_SOURCES} ${SDL3_SOURCE_DIR}/src/thread/generic/SDL_systls.c) set(HAVE_SDL_THREADS TRUE) endif() if(SDL_TIMERS) set(SDL_TIMER_N3DS 1) - file(GLOB N3DS_TIMER_SOURCES ${SDL2_SOURCE_DIR}/src/timer/n3ds/*.c) + file(GLOB N3DS_TIMER_SOURCES ${SDL3_SOURCE_DIR}/src/timer/n3ds/*.c) list(APPEND SOURCE_FILES ${N3DS_TIMER_SOURCES}) set(HAVE_SDL_TIMERS TRUE) endif() if(SDL_SENSOR) set(SDL_SENSOR_N3DS 1) - file(GLOB N3DS_SENSOR_SOURCES ${SDL2_SOURCE_DIR}/src/sensor/n3ds/*.c) + file(GLOB N3DS_SENSOR_SOURCES ${SDL3_SOURCE_DIR}/src/sensor/n3ds/*.c) list(APPEND SOURCE_FILES ${N3DS_SENSOR_SOURCES}) set(HAVE_SDL_SENSORS TRUE) endif() if(SDL_VIDEO) set(SDL_VIDEO_DRIVER_N3DS 1) - file(GLOB N3DS_VIDEO_SOURCES ${SDL2_SOURCE_DIR}/src/video/n3ds/*.c) + file(GLOB N3DS_VIDEO_SOURCES ${SDL3_SOURCE_DIR}/src/video/n3ds/*.c) list(APPEND SOURCE_FILES ${N3DS_VIDEO_SOURCES}) set(HAVE_SDL_VIDEO TRUE) endif() if(SDL_LOCALE) - file(GLOB N3DS_LOCALE_SOURCES ${SDL2_SOURCE_DIR}/src/locale/n3ds/*.c) + file(GLOB N3DS_LOCALE_SOURCES ${SDL3_SOURCE_DIR}/src/locale/n3ds/*.c) list(APPEND SOURCE_FILES ${N3DS_LOCALE_SOURCES}) set(HAVE_SDL_LOCALE TRUE) endif() # Requires the n3ds file implementation if(SDL_FILE) - file(GLOB N3DS_FILE_SOURCES ${SDL2_SOURCE_DIR}/src/file/n3ds/*.c) + file(GLOB N3DS_FILE_SOURCES ${SDL3_SOURCE_DIR}/src/file/n3ds/*.c) list(APPEND SOURCE_FILES ${N3DS_FILE_SOURCES}) set(HAVE_SDL_FILE TRUE) else() @@ -2861,47 +2861,47 @@ CheckLibSampleRate() # src/X/*.c does not get included. if(NOT HAVE_SDL_AUDIO) set(SDL_AUDIO_DRIVER_DUMMY 1) - file(GLOB AUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/dummy/*.c) + file(GLOB AUDIO_SOURCES ${SDL3_SOURCE_DIR}/src/audio/dummy/*.c) list(APPEND SOURCE_FILES ${AUDIO_SOURCES}) endif() if(NOT HAVE_SDL_VIDEO) set(SDL_VIDEO_DRIVER_DUMMY 1) - file(GLOB VIDEO_SOURCES ${SDL2_SOURCE_DIR}/src/video/dummy/*.c) + file(GLOB VIDEO_SOURCES ${SDL3_SOURCE_DIR}/src/video/dummy/*.c) list(APPEND SOURCE_FILES ${VIDEO_SOURCES}) endif() if(NOT HAVE_SDL_JOYSTICK) set(SDL_JOYSTICK_DUMMY 1) - file(GLOB JOYSTICK_SOURCES ${SDL2_SOURCE_DIR}/src/joystick/dummy/*.c) + file(GLOB JOYSTICK_SOURCES ${SDL3_SOURCE_DIR}/src/joystick/dummy/*.c) list(APPEND SOURCE_FILES ${JOYSTICK_SOURCES}) endif() if(NOT HAVE_SDL_HAPTIC) set(SDL_HAPTIC_DUMMY 1) - file(GLOB HAPTIC_SOURCES ${SDL2_SOURCE_DIR}/src/haptic/dummy/*.c) + file(GLOB HAPTIC_SOURCES ${SDL3_SOURCE_DIR}/src/haptic/dummy/*.c) list(APPEND SOURCE_FILES ${HAPTIC_SOURCES}) endif() if(NOT HAVE_SDL_SENSORS) set(SDL_SENSOR_DUMMY 1) - file(GLOB SENSORS_SOURCES ${SDL2_SOURCE_DIR}/src/sensor/dummy/*.c) + file(GLOB SENSORS_SOURCES ${SDL3_SOURCE_DIR}/src/sensor/dummy/*.c) list(APPEND SOURCE_FILES ${SENSORS_SOURCES}) endif() if(NOT HAVE_SDL_LOADSO) set(SDL_LOADSO_DUMMY 1) - file(GLOB LOADSO_SOURCES ${SDL2_SOURCE_DIR}/src/loadso/dummy/*.c) + file(GLOB LOADSO_SOURCES ${SDL3_SOURCE_DIR}/src/loadso/dummy/*.c) list(APPEND SOURCE_FILES ${LOADSO_SOURCES}) endif() if(NOT HAVE_SDL_FILESYSTEM) set(SDL_FILESYSTEM_DUMMY 1) - file(GLOB FILESYSTEM_SOURCES ${SDL2_SOURCE_DIR}/src/filesystem/dummy/*.c) + file(GLOB FILESYSTEM_SOURCES ${SDL3_SOURCE_DIR}/src/filesystem/dummy/*.c) list(APPEND SOURCE_FILES ${FILESYSTEM_SOURCES}) endif() if(NOT HAVE_SDL_LOCALE) set(SDL_LOCALE_DUMMY 1) - file(GLOB LOCALE_SOURCES ${SDL2_SOURCE_DIR}/src/locale/dummy/*.c) + file(GLOB LOCALE_SOURCES ${SDL3_SOURCE_DIR}/src/locale/dummy/*.c) list(APPEND SOURCE_FILES ${LOCALE_SOURCES}) endif() if(NOT HAVE_SDL_MISC) set(SDL_MISC_DUMMY 1) - file(GLOB MISC_SOURCES ${SDL2_SOURCE_DIR}/src/misc/dummy/*.c) + file(GLOB MISC_SOURCES ${SDL3_SOURCE_DIR}/src/misc/dummy/*.c) list(APPEND SOURCE_FILES ${MISC_SOURCES}) endif() @@ -2910,7 +2910,7 @@ if(NOT HAVE_SDL_THREADS) # The emscripten platform has been carefully vetted to work without threads if (EMSCRIPTEN) set(SDL_THREADS_DISABLED 1) - file(GLOB THREADS_SOURCES ${SDL2_SOURCE_DIR}/src/thread/generic/*.c) + file(GLOB THREADS_SOURCES ${SDL3_SOURCE_DIR}/src/thread/generic/*.c) list(APPEND SOURCE_FILES ${THREADS_SOURCES}) else() message_error("Threads are needed by many SDL subsystems and may not be disabled") @@ -2918,12 +2918,12 @@ if(NOT HAVE_SDL_THREADS) endif() if(NOT HAVE_SDL_TIMERS) set(SDL_TIMER_DUMMY 1) - file(GLOB TIMER_SOURCES ${SDL2_SOURCE_DIR}/src/timer/dummy/*.c) + file(GLOB TIMER_SOURCES ${SDL3_SOURCE_DIR}/src/timer/dummy/*.c) list(APPEND SOURCE_FILES ${TIMER_SOURCES}) endif() if(NOT SDLMAIN_SOURCES) - file(GLOB SDLMAIN_SOURCES ${SDL2_SOURCE_DIR}/src/main/dummy/*.c) + file(GLOB SDLMAIN_SOURCES ${SDL3_SOURCE_DIR}/src/main/dummy/*.c) endif() # Append the -MMD -MT flags @@ -2935,15 +2935,15 @@ endif() # config variables may contain generator expression, so we need to generate SDL_config.h in 2 steps: # 1. replace all `#cmakedefine`'s and `@abc@` -configure_file("${SDL2_SOURCE_DIR}/include/SDL_config.h.cmake" - "${SDL2_BINARY_DIR}/SDL_config.h.intermediate") +configure_file("${SDL3_SOURCE_DIR}/include/SDL_config.h.cmake" + "${SDL3_BINARY_DIR}/SDL_config.h.intermediate") # 2. Create the "include-config-${CMAKE_BUILD_TYPE}" folder (fails on older CMake versions when it does not exist) string(TOLOWER "${CMAKE_BUILD_TYPE}" lower_build_type) execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_CURRENT_BINARY_DIR}/include-config-${lower_build_type}") # 3. generate SDL_config in an build_type-dependent folder (which should be first in the include search path) file(GENERATE - OUTPUT "${SDL2_BINARY_DIR}/include-config-$>/SDL_config.h" - INPUT "${SDL2_BINARY_DIR}/SDL_config.h.intermediate") + OUTPUT "${SDL3_BINARY_DIR}/include-config-$>/SDL_config.h" + INPUT "${SDL3_BINARY_DIR}/SDL_config.h.intermediate") # Prepare the flags and remove duplicates if(EXTRA_LDFLAGS) @@ -2992,32 +2992,32 @@ else() set(SDL_REVISION "SDL-${SDL_VERSION}-no-vcs") endif() -configure_file("${SDL2_SOURCE_DIR}/include/SDL_revision.h.cmake" - "${SDL2_BINARY_DIR}/include/SDL_revision.h") +configure_file("${SDL3_SOURCE_DIR}/include/SDL_revision.h.cmake" + "${SDL3_BINARY_DIR}/include/SDL_revision.h") -# Copy all non-generated headers to "${SDL2_BINARY_DIR}/include" +# Copy all non-generated headers to "${SDL3_BINARY_DIR}/include" # This is done to avoid the inclusion of a pre-generated SDL_config.h -file(GLOB SDL2_INCLUDE_FILES ${SDL2_SOURCE_DIR}/include/*.h) -set(SDL2_COPIED_INCLUDE_FILES) -foreach(_hdr IN LISTS SDL2_INCLUDE_FILES) +file(GLOB SDL3_INCLUDE_FILES ${SDL3_SOURCE_DIR}/include/*.h) +set(SDL3_COPIED_INCLUDE_FILES) +foreach(_hdr IN LISTS SDL3_INCLUDE_FILES) if(_hdr MATCHES ".*(SDL_config|SDL_revision).*") - list(REMOVE_ITEM SDL2_INCLUDE_FILES "${_hdr}") + list(REMOVE_ITEM SDL3_INCLUDE_FILES "${_hdr}") else() get_filename_component(_name "${_hdr}" NAME) - set(_bin_hdr "${SDL2_BINARY_DIR}/include/${_name}") - list(APPEND SDL2_COPIED_INCLUDE_FILES "${_bin_hdr}") + set(_bin_hdr "${SDL3_BINARY_DIR}/include/${_name}") + list(APPEND SDL3_COPIED_INCLUDE_FILES "${_bin_hdr}") add_custom_command(OUTPUT "${_bin_hdr}" COMMAND ${CMAKE_COMMAND} -E copy_if_different "${_hdr}" "${_bin_hdr}" DEPENDS "${_hdr}") endif() endforeach() -list(APPEND SDL_GENERATED_HEADERS ${SDL2_COPIED_INCLUDE_FILES}) +list(APPEND SDL_GENERATED_HEADERS ${SDL3_COPIED_INCLUDE_FILES}) if(CMAKE_STATIC_LIBRARY_PREFIX STREQUAL "" AND CMAKE_STATIC_LIBRARY_SUFFIX STREQUAL ".lib") # Avoid conflict between the dll import library and the static library - set(sdl_static_libname "SDL2-static") + set(sdl_static_libname "SDL3-static") else() - set(sdl_static_libname "SDL2") + set(sdl_static_libname "SDL3") endif() set(prefix ${CMAKE_INSTALL_PREFIX}) @@ -3055,24 +3055,24 @@ listtostr(SDL_LIBS _SDL_LIBS) set(SDL_LIBS ${_SDL_LIBS}) listtostr(SDL_CFLAGS _SDL_CFLAGS "") set(SDL_CFLAGS ${_SDL_CFLAGS}) -string(REGEX REPLACE "-lSDL2( |$)" "-l${sdl_static_libname} " SDL_STATIC_LIBS "${SDL_STATIC_LIBS}") +string(REGEX REPLACE "-lSDL3( |$)" "-l${sdl_static_libname} " SDL_STATIC_LIBS "${SDL_STATIC_LIBS}") if(NOT SDL_SHARED) - string(REGEX REPLACE "-lSDL2( |$)" "-l${sdl_static_libname} " SDL_LIBS "${SDL_LIBS}") + string(REGEX REPLACE "-lSDL3( |$)" "-l${sdl_static_libname} " SDL_LIBS "${SDL_LIBS}") endif() -if(SDL_STATIC AND SDL_SHARED AND NOT sdl_static_libname STREQUAL "SDL2") - message(STATUS "\"pkg-config --static --libs sdl2\" will return invalid information") +if(SDL_STATIC AND SDL_SHARED AND NOT sdl_static_libname STREQUAL "SDL3") + message(STATUS "\"pkg-config --static --libs sdl3\" will return invalid information") endif() # MESSAGE(STATUS "SDL_LIBS: ${SDL_LIBS}") # MESSAGE(STATUS "SDL_STATIC_LIBS: ${SDL_STATIC_LIBS}") -configure_file("${SDL2_SOURCE_DIR}/sdl2.pc.in" - "${SDL2_BINARY_DIR}/sdl2.pc" @ONLY) -configure_file("${SDL2_SOURCE_DIR}/sdl2-config.in" - "${SDL2_BINARY_DIR}/sdl2-config" @ONLY) -configure_file("${SDL2_SOURCE_DIR}/SDL2.spec.in" - "${SDL2_BINARY_DIR}/SDL2.spec" @ONLY) +configure_file("${SDL3_SOURCE_DIR}/sdl3.pc.in" + "${SDL3_BINARY_DIR}/sdl3.pc" @ONLY) +configure_file("${SDL3_SOURCE_DIR}/sdl3-config.in" + "${SDL3_BINARY_DIR}/sdl3-config" @ONLY) +configure_file("${SDL3_SOURCE_DIR}/SDL3.spec.in" + "${SDL3_BINARY_DIR}/SDL3.spec" @ONLY) macro(check_add_debug_flag FLAG SUFFIX) check_c_compiler_flag(${FLAG} HAS_C_FLAG_${SUFFIX}) @@ -3162,7 +3162,7 @@ add_custom_target(sdl_headers_copy ##### Info output ##### message(STATUS "") -message(STATUS "SDL2 was configured with the following options:") +message(STATUS "SDL3 was configured with the following options:") message(STATUS "") message(STATUS "Platform: ${CMAKE_SYSTEM}") message(STATUS "64-bit: ${ARCH_64}") @@ -3229,27 +3229,27 @@ endif() # Ensure that the extra cflags are used at compile time set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} ${EXTRA_CFLAGS_BUILD}") -if(NOT WINDOWS_STORE AND NOT SDL2_DISABLE_SDL2MAIN) +if(NOT WINDOWS_STORE AND NOT SDL3_DISABLE_SDL3MAIN) # Build SDLmain - add_library(SDL2main STATIC ${SDLMAIN_SOURCES}) - add_dependencies(SDL2main sdl_headers_copy) + add_library(SDL3main STATIC ${SDLMAIN_SOURCES}) + add_dependencies(SDL3main sdl_headers_copy) # alias target for in-tree builds - add_library(SDL2::SDL2main ALIAS SDL2main) - target_include_directories(SDL2main BEFORE PRIVATE "${SDL2_BINARY_DIR}/include" PRIVATE "${SDL2_BINARY_DIR}/include-config-$>") - target_include_directories(SDL2main PUBLIC "$" $ $) + add_library(SDL3::SDL3main ALIAS SDL3main) + target_include_directories(SDL3main BEFORE PRIVATE "${SDL3_BINARY_DIR}/include" PRIVATE "${SDL3_BINARY_DIR}/include-config-$>") + target_include_directories(SDL3main PUBLIC "$" $ $) if (WIN32) - target_link_libraries(SDL2main PRIVATE shell32) + target_link_libraries(SDL3main PRIVATE shell32) endif() if(MINGW OR CYGWIN) cmake_minimum_required(VERSION 3.13) if(CMAKE_SIZEOF_VOID_P EQUAL 4) - target_link_options(SDL2main PUBLIC "$<$,EXECUTABLE>:-Wl,--undefined=_WinMain@16>") + target_link_options(SDL3main PUBLIC "$<$,EXECUTABLE>:-Wl,--undefined=_WinMain@16>") else() - target_link_options(SDL2main PUBLIC "$<$,EXECUTABLE>:-Wl,--undefined=WinMain>") + target_link_options(SDL3main PUBLIC "$<$,EXECUTABLE>:-Wl,--undefined=WinMain>") endif() endif() if (NOT ANDROID) - set_target_properties(SDL2main PROPERTIES DEBUG_POSTFIX "${SDL_CMAKE_DEBUG_POSTFIX}") + set_target_properties(SDL3main PROPERTIES DEBUG_POSTFIX "${SDL_CMAKE_DEBUG_POSTFIX}") endif() endif() @@ -3275,98 +3275,98 @@ if(APPLE) endif() if(SDL_SHARED) - add_library(SDL2 SHARED ${SOURCE_FILES} ${VERSION_SOURCES}) - add_dependencies(SDL2 sdl_headers_copy) + add_library(SDL3 SHARED ${SOURCE_FILES} ${VERSION_SOURCES}) + add_dependencies(SDL3 sdl_headers_copy) # alias target for in-tree builds - add_library(SDL2::SDL2 ALIAS SDL2) - set_target_properties(SDL2 PROPERTIES POSITION_INDEPENDENT_CODE TRUE) + add_library(SDL3::SDL3 ALIAS SDL3) + set_target_properties(SDL3 PROPERTIES POSITION_INDEPENDENT_CODE TRUE) if(NOT SDL_LIBC) check_cpu_architecture(x86 HAS_X86) if(HAS_X86) # FIXME: should be added for all architectures (missing symbols for ARM) - target_link_libraries(SDL2 PRIVATE "-nodefaultlib:MSVCRT") + target_link_libraries(SDL3 PRIVATE "-nodefaultlib:MSVCRT") endif() endif() if(APPLE) # FIXME: Remove SOVERSION in SDL3 - set_target_properties(SDL2 PROPERTIES + set_target_properties(SDL3 PROPERTIES MACOSX_RPATH 1 SOVERSION 0 - OUTPUT_NAME "SDL2-${LT_RELEASE}") + OUTPUT_NAME "SDL3-${LT_RELEASE}") elseif(UNIX AND NOT ANDROID) - set_target_properties(SDL2 PROPERTIES + set_target_properties(SDL3 PROPERTIES VERSION ${LT_VERSION} SOVERSION ${LT_MAJOR} - OUTPUT_NAME "SDL2-${LT_RELEASE}") + OUTPUT_NAME "SDL3-${LT_RELEASE}") else() if(WINDOWS OR CYGWIN) - set_target_properties(SDL2 PROPERTIES + set_target_properties(SDL3 PROPERTIES DEFINE_SYMBOL DLL_EXPORT) elseif(OS2) - set_target_properties(SDL2 PROPERTIES + set_target_properties(SDL3 PROPERTIES DEFINE_SYMBOL BUILD_SDL) endif() - set_target_properties(SDL2 PROPERTIES + set_target_properties(SDL3 PROPERTIES VERSION ${SDL_VERSION} SOVERSION ${LT_REVISION} - OUTPUT_NAME "SDL2") + OUTPUT_NAME "SDL3") endif() # Note: The clang toolset for Visual Studio does not support /NODEFAULTLIB. if(MSVC AND NOT SDL_LIBC AND NOT MSVC_CLANG AND NOT CMAKE_GENERATOR_PLATFORM STREQUAL "ARM") # Don't try to link with the default set of libraries. if(NOT WINDOWS_STORE) - set_target_properties(SDL2 PROPERTIES LINK_FLAGS_RELEASE "/NODEFAULTLIB") - set_target_properties(SDL2 PROPERTIES LINK_FLAGS_DEBUG "/NODEFAULTLIB") + set_target_properties(SDL3 PROPERTIES LINK_FLAGS_RELEASE "/NODEFAULTLIB") + set_target_properties(SDL3 PROPERTIES LINK_FLAGS_DEBUG "/NODEFAULTLIB") endif() - set_target_properties(SDL2 PROPERTIES STATIC_LIBRARY_FLAGS "/NODEFAULTLIB") + set_target_properties(SDL3 PROPERTIES STATIC_LIBRARY_FLAGS "/NODEFAULTLIB") endif() # FIXME: if CMAKE_VERSION >= 3.13, use target_link_options for EXTRA_LDFLAGS - target_link_libraries(SDL2 PRIVATE ${EXTRA_LIBS} ${EXTRA_LDFLAGS} ${EXTRA_LDFLAGS_BUILD}) - target_include_directories(SDL2 PUBLIC - "$" - "$>>" + target_link_libraries(SDL3 PRIVATE ${EXTRA_LIBS} ${EXTRA_LDFLAGS} ${EXTRA_LDFLAGS_BUILD}) + target_include_directories(SDL3 PUBLIC + "$" + "$>>" "$" - "$") + "$") # This picks up all the compiler options and such we've accumulated up to here. - target_link_libraries(SDL2 PRIVATE $) + target_link_libraries(SDL3 PRIVATE $) if(MINGW OR CYGWIN) if(NOT CMAKE_VERSION VERSION_LESS "3.13") - target_link_options(SDL2 PRIVATE -static-libgcc) + target_link_options(SDL3 PRIVATE -static-libgcc) endif() endif() if(NOT ANDROID) - set_target_properties(SDL2 PROPERTIES DEBUG_POSTFIX "${SDL_CMAKE_DEBUG_POSTFIX}") + set_target_properties(SDL3 PROPERTIES DEBUG_POSTFIX "${SDL_CMAKE_DEBUG_POSTFIX}") endif() # Use `Compatible Interface Properties` to allow consumers to enforce a shared/static library - set_property(TARGET SDL2 PROPERTY INTERFACE_SDL2_SHARED TRUE) - set_property(TARGET SDL2 APPEND PROPERTY COMPATIBLE_INTERFACE_BOOL SDL2_SHARED) + set_property(TARGET SDL3 PROPERTY INTERFACE_SDL3_SHARED TRUE) + set_property(TARGET SDL3 APPEND PROPERTY COMPATIBLE_INTERFACE_BOOL SDL3_SHARED) endif() if(SDL_STATIC) - add_library(SDL2-static STATIC ${SOURCE_FILES}) - add_dependencies(SDL2-static sdl_headers_copy) + add_library(SDL3-static STATIC ${SOURCE_FILES}) + add_dependencies(SDL3-static sdl_headers_copy) # alias target for in-tree builds - add_library(SDL2::SDL2-static ALIAS SDL2-static) - set_target_properties(SDL2-static PROPERTIES + add_library(SDL3::SDL3-static ALIAS SDL3-static) + set_target_properties(SDL3-static PROPERTIES OUTPUT_NAME "${sdl_static_libname}" POSITION_INDEPENDENT_CODE "${SDL_STATIC_PIC}") - target_compile_definitions(SDL2-static PRIVATE SDL_STATIC_LIB) + target_compile_definitions(SDL3-static PRIVATE SDL_STATIC_LIB) # TODO: Win32 platforms keep the same suffix .lib for import and static # libraries - do we need to consider this? - target_link_libraries(SDL2-static PRIVATE ${EXTRA_LIBS} ${EXTRA_LDFLAGS}) - target_include_directories(SDL2-static PUBLIC - "$" - "$>>" + target_link_libraries(SDL3-static PRIVATE ${EXTRA_LIBS} ${EXTRA_LDFLAGS}) + target_include_directories(SDL3-static PUBLIC + "$" + "$>>" "$" - "$") + "$") # This picks up all the compiler options and such we've accumulated up to here. - target_link_libraries(SDL2-static PRIVATE $) + target_link_libraries(SDL3-static PRIVATE $) if(NOT ANDROID) - set_target_properties(SDL2-static PROPERTIES DEBUG_POSTFIX "${SDL_CMAKE_DEBUG_POSTFIX}") + set_target_properties(SDL3-static PROPERTIES DEBUG_POSTFIX "${SDL_CMAKE_DEBUG_POSTFIX}") endif() # Use `Compatible Interface Properties` to allow consumers to enforce a shared/static library - set_property(TARGET SDL2-static PROPERTY INTERFACE_SDL2_SHARED FALSE) - set_property(TARGET SDL2-static APPEND PROPERTY COMPATIBLE_INTERFACE_BOOL SDL2_SHARED) + set_property(TARGET SDL3-static PROPERTY INTERFACE_SDL3_SHARED FALSE) + set_property(TARGET SDL3-static APPEND PROPERTY COMPATIBLE_INTERFACE_BOOL SDL3_SHARED) endif() set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DSDL_BUILD_MAJOR_VERSION=${SDL_MAJOR_VERSION}") @@ -3376,45 +3376,45 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DSDL_BUILD_MICRO_VERSION=${SDL_MICRO_VERSIO ##### Tests ##### if(SDL_TEST) - file(GLOB TEST_SOURCES ${SDL2_SOURCE_DIR}/src/test/*.c) - add_library(SDL2_test STATIC ${TEST_SOURCES}) - add_dependencies(SDL2_test sdl_headers_copy) - add_library(SDL2::SDL2test ALIAS SDL2_test) - set_target_properties(SDL2_test PROPERTIES - EXPORT_NAME SDL2test) - target_include_directories(SDL2_test PUBLIC - "$" - "$>>" + file(GLOB TEST_SOURCES ${SDL3_SOURCE_DIR}/src/test/*.c) + add_library(SDL3_test STATIC ${TEST_SOURCES}) + add_dependencies(SDL3_test sdl_headers_copy) + add_library(SDL3::SDL3test ALIAS SDL3_test) + set_target_properties(SDL3_test PROPERTIES + EXPORT_NAME SDL3test) + target_include_directories(SDL3_test PUBLIC + "$" + "$>>" "$" - "$") - target_link_libraries(SDL2_test PRIVATE ${EXTRA_TEST_LIBS}) + "$") + target_link_libraries(SDL3_test PRIVATE ${EXTRA_TEST_LIBS}) endif() ##### Installation targets ##### -if(NOT SDL2_DISABLE_INSTALL) +if(NOT SDL3_DISABLE_INSTALL) if(SDL_SHARED) - install(TARGETS SDL2 EXPORT SDL2Targets + install(TARGETS SDL3 EXPORT SDL3Targets LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") endif() - if(NOT WINDOWS_STORE AND NOT SDL2_DISABLE_SDL2MAIN) - install(TARGETS SDL2main EXPORT SDL2mainTargets + if(NOT WINDOWS_STORE AND NOT SDL3_DISABLE_SDL3MAIN) + install(TARGETS SDL3main EXPORT SDL3mainTargets LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") endif() if(SDL_STATIC) - install(TARGETS SDL2-static EXPORT SDL2staticTargets + install(TARGETS SDL3-static EXPORT SDL3staticTargets LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") endif() if(SDL_TEST) - install(TARGETS SDL2_test EXPORT SDL2testTargets + install(TARGETS SDL3_test EXPORT SDL3testTargets LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") @@ -3423,85 +3423,85 @@ if(NOT SDL2_DISABLE_INSTALL) ##### Export files ##### if (WINDOWS AND NOT MINGW) set(SDL_INSTALL_CMAKEDIR_DEFAULT "cmake") - set(LICENSES_PREFIX "licenses/SDL2") + set(LICENSES_PREFIX "licenses/SDL3") else () - set(SDL_INSTALL_CMAKEDIR_DEFAULT "${CMAKE_INSTALL_LIBDIR}/cmake/SDL2") + set(SDL_INSTALL_CMAKEDIR_DEFAULT "${CMAKE_INSTALL_LIBDIR}/cmake/SDL3") set(LICENSES_PREFIX "${CMAKE_INSTALL_DATAROOTDIR}/licenses/${PROJECT_NAME}") endif () - set(SDL_INSTALL_CMAKEDIR "${SDL_INSTALL_CMAKEDIR_DEFAULT}" CACHE STRING "Location where to install SDL2Config.cmake") + set(SDL_INSTALL_CMAKEDIR "${SDL_INSTALL_CMAKEDIR_DEFAULT}" CACHE STRING "Location where to install SDL3Config.cmake") include(CMakePackageConfigHelpers) - configure_package_config_file(SDL2Config.cmake.in "${CMAKE_CURRENT_BINARY_DIR}/SDL2Config.cmake" + configure_package_config_file(SDL3Config.cmake.in "${CMAKE_CURRENT_BINARY_DIR}/SDL3Config.cmake" PATH_VARS CMAKE_INSTALL_PREFIX CMAKE_INSTALL_FULL_BINDIR CMAKE_INSTALL_FULL_INCLUDEDIR CMAKE_INSTALL_FULL_LIBDIR INSTALL_DESTINATION "${SDL_INSTALL_CMAKEDIR}" ) - write_basic_package_version_file("${CMAKE_CURRENT_BINARY_DIR}/SDL2ConfigVersion.cmake" + write_basic_package_version_file("${CMAKE_CURRENT_BINARY_DIR}/SDL3ConfigVersion.cmake" VERSION ${SDL_VERSION} COMPATIBILITY AnyNewerVersion ) if(SDL_SHARED) - install(EXPORT SDL2Targets - FILE SDL2Targets.cmake - NAMESPACE SDL2:: + install(EXPORT SDL3Targets + FILE SDL3Targets.cmake + NAMESPACE SDL3:: DESTINATION "${SDL_INSTALL_CMAKEDIR}" ) if(ANDROID AND NOT CMAKE_VERSION VERSION_LESS 3.7) - install(EXPORT_ANDROID_MK SDL2Targets - DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/ndk-modules/SDL2") + install(EXPORT_ANDROID_MK SDL3Targets + DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/ndk-modules/SDL3") endif() endif() - if(NOT WINDOWS_STORE AND NOT SDL2_DISABLE_SDL2MAIN) - install(EXPORT SDL2mainTargets - FILE SDL2mainTargets.cmake - NAMESPACE SDL2:: + if(NOT WINDOWS_STORE AND NOT SDL3_DISABLE_SDL3MAIN) + install(EXPORT SDL3mainTargets + FILE SDL3mainTargets.cmake + NAMESPACE SDL3:: DESTINATION "${SDL_INSTALL_CMAKEDIR}" ) if(ANDROID AND NOT CMAKE_VERSION VERSION_LESS 3.7) - install(EXPORT_ANDROID_MK SDL2mainTargets - DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/ndk-modules/SDL2main") + install(EXPORT_ANDROID_MK SDL3mainTargets + DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/ndk-modules/SDL3main") endif() endif() if(SDL_STATIC) - install(EXPORT SDL2staticTargets - FILE SDL2staticTargets.cmake - NAMESPACE SDL2:: + install(EXPORT SDL3staticTargets + FILE SDL3staticTargets.cmake + NAMESPACE SDL3:: DESTINATION "${SDL_INSTALL_CMAKEDIR}" ) if(ANDROID AND NOT CMAKE_VERSION VERSION_LESS 3.7) - install(EXPORT_ANDROID_MK SDL2staticTargets - DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/ndk-modules/SDL2-static") + install(EXPORT_ANDROID_MK SDL3staticTargets + DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/ndk-modules/SDL3-static") endif() endif() if(SDL_TEST) - install(EXPORT SDL2testTargets - FILE SDL2testTargets.cmake - NAMESPACE SDL2:: + install(EXPORT SDL3testTargets + FILE SDL3testTargets.cmake + NAMESPACE SDL3:: DESTINATION "${SDL_INSTALL_CMAKEDIR}" ) if(ANDROID AND NOT CMAKE_VERSION VERSION_LESS 3.7) - install(EXPORT_ANDROID_MK SDL2testTargets - DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/ndk-modules/SDL2test") + install(EXPORT_ANDROID_MK SDL3testTargets + DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/ndk-modules/SDL3test") endif() endif() install( FILES - ${CMAKE_CURRENT_BINARY_DIR}/SDL2Config.cmake - ${CMAKE_CURRENT_BINARY_DIR}/SDL2ConfigVersion.cmake + ${CMAKE_CURRENT_BINARY_DIR}/SDL3Config.cmake + ${CMAKE_CURRENT_BINARY_DIR}/SDL3ConfigVersion.cmake DESTINATION "${SDL_INSTALL_CMAKEDIR}" COMPONENT Devel ) install( FILES - ${SDL2_INCLUDE_FILES} - "${SDL2_BINARY_DIR}/include/SDL_revision.h" - "${SDL2_BINARY_DIR}/include-config-$>/SDL_config.h" - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/SDL2) + ${SDL3_INCLUDE_FILES} + "${SDL3_BINARY_DIR}/include/SDL_revision.h" + "${SDL3_BINARY_DIR}/include-config-$>/SDL_config.h" + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/SDL3) string(TOUPPER "${CMAKE_BUILD_TYPE}" UPPER_BUILD_TYPE) if (UPPER_BUILD_TYPE MATCHES DEBUG) @@ -3513,32 +3513,32 @@ if(NOT SDL2_DISABLE_INSTALL) install(FILES "LICENSE.txt" DESTINATION "${LICENSES_PREFIX}") if(FREEBSD) # FreeBSD uses ${PREFIX}/libdata/pkgconfig - install(FILES ${SDL2_BINARY_DIR}/sdl2.pc DESTINATION "libdata/pkgconfig") + install(FILES ${SDL3_BINARY_DIR}/sdl3.pc DESTINATION "libdata/pkgconfig") else() - install(FILES ${SDL2_BINARY_DIR}/sdl2.pc + install(FILES ${SDL3_BINARY_DIR}/sdl3.pc DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig") endif() if(NOT (WINDOWS OR CYGWIN) OR MINGW) if(SDL_SHARED) set(SOEXT ${CMAKE_SHARED_LIBRARY_SUFFIX}) # ".so", ".dylib", etc. - get_target_property(SONAME SDL2 OUTPUT_NAME) + get_target_property(SONAME SDL3 OUTPUT_NAME) if(NOT ANDROID AND NOT MINGW AND NOT OS2) install(CODE " execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink - \"lib${SONAME}${SOPOSTFIX}${SOEXT}\" \"libSDL2${SOPOSTFIX}${SOEXT}\" - WORKING_DIRECTORY \"${SDL2_BINARY_DIR}\")") - install(FILES ${SDL2_BINARY_DIR}/libSDL2${SOPOSTFIX}${SOEXT} DESTINATION "${CMAKE_INSTALL_LIBDIR}") + \"lib${SONAME}${SOPOSTFIX}${SOEXT}\" \"libSDL3${SOPOSTFIX}${SOEXT}\" + WORKING_DIRECTORY \"${SDL3_BINARY_DIR}\")") + install(FILES ${SDL3_BINARY_DIR}/libSDL3${SOPOSTFIX}${SOEXT} DESTINATION "${CMAKE_INSTALL_LIBDIR}") endif() endif() - install(PROGRAMS ${SDL2_BINARY_DIR}/sdl2-config DESTINATION "${CMAKE_INSTALL_BINDIR}") + install(PROGRAMS ${SDL3_BINARY_DIR}/sdl3-config DESTINATION "${CMAKE_INSTALL_BINDIR}") # TODO: what about the .spec file? Is it only needed for RPM creation? - install(FILES "${SDL2_SOURCE_DIR}/sdl2.m4" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/aclocal") + install(FILES "${SDL3_SOURCE_DIR}/sdl3.m4" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/aclocal") endif() endif() ##### Uninstall target ##### -if(NOT SDL2_DISABLE_UNINSTALL) +if(NOT SDL3_DISABLE_UNINSTALL) if(NOT TARGET uninstall) configure_file( "${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in" @@ -3561,7 +3561,7 @@ endif() ##### Fix Objective C builds ##### set(CMAKE_OBJC_FLAGS "${CMAKE_OBJC_FLAGS} ${CMAKE_C_FLAGS}") -# Make sure SDL2::SDL2 always exists -if(TARGET SDL2::SDL2-static AND NOT TARGET SDL2::SDL2) - add_library(SDL2::SDL2 ALIAS SDL2-static) +# Make sure SDL3::SDL3 always exists +if(TARGET SDL3::SDL3-static AND NOT TARGET SDL3::SDL3) + add_library(SDL3::SDL3 ALIAS SDL3-static) endif() diff --git a/Makefile.in b/Makefile.in index d4eeee4028..f72a044c2a 100644 --- a/Makefile.in +++ b/Makefile.in @@ -13,7 +13,7 @@ datarootdir = @datarootdir@ datadir = @datadir@ auxdir = @ac_aux_dir@ distpath = $(srcdir)/.. -distdir = SDL2-@SDL_VERSION@ +distdir = SDL3-@SDL_VERSION@ distfile = $(distdir).tar.gz @SET_MAKE@ @@ -34,25 +34,25 @@ LINKER = @LINKER@ LIBTOOLLINKERTAG = @LIBTOOLLINKERTAG@ SDL_VENDOR_INFO = @SDL_VENDOR_INFO@ -TARGET = libSDL2.la +TARGET = libSDL3.la OBJECTS = @OBJECTS@ GEN_HEADERS = @GEN_HEADERS@ GEN_OBJECTS = @GEN_OBJECTS@ VERSION_OBJECTS = @VERSION_OBJECTS@ -SDLMAIN_TARGET = libSDL2main.la +SDLMAIN_TARGET = libSDL3main.la SDLMAIN_OBJECTS = @SDLMAIN_OBJECTS@ -SDLTEST_TARGET = libSDL2_test.la +SDLTEST_TARGET = libSDL3_test.la SDLTEST_OBJECTS = @SDLTEST_OBJECTS@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ WAYLAND_SCANNER_CODE_MODE = @WAYLAND_SCANNER_CODE_MODE@ -INSTALL_SDL2_CONFIG = @INSTALL_SDL2_CONFIG@ +INSTALL_SDL3_CONFIG = @INSTALL_SDL3_CONFIG@ -SRC_DIST = *.md *.txt acinclude Android.mk autogen.sh android-project build-scripts cmake cmake_uninstall.cmake.in configure configure.ac docs include Makefile.* mingw sdl2-config.cmake.in sdl2-config-version.cmake.in sdl2-config.in sdl2.m4 sdl2.pc.in SDL2.spec.in SDL2Config.cmake.in src test VisualC VisualC-WinRT Xcode Xcode-iOS wayland-protocols -GEN_DIST = SDL2.spec +SRC_DIST = *.md *.txt acinclude Android.mk autogen.sh android-project build-scripts cmake cmake_uninstall.cmake.in configure configure.ac docs include Makefile.* mingw sdl3-config.cmake.in sdl3-config-version.cmake.in sdl3-config.in sdl3.m4 sdl3.pc.in SDL3.spec.in SDL3Config.cmake.in src test VisualC VisualC-WinRT Xcode Xcode-iOS wayland-protocols +GEN_DIST = SDL3.spec ifneq ($V,1) RUN_CMD_AR = @echo " AR " $@; @@ -168,21 +168,21 @@ $(objects)/$(SDLTEST_TARGET): $(SDLTEST_OBJECTS) install: all install-bin install-hdrs install-lib install-data install-bin: -ifeq ($(INSTALL_SDL2_CONFIG),TRUE) +ifeq ($(INSTALL_SDL3_CONFIG),TRUE) $(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(bindir) - $(INSTALL) -m 755 sdl2-config $(DESTDIR)$(bindir)/sdl2-config + $(INSTALL) -m 755 sdl3-config $(DESTDIR)$(bindir)/sdl3-config endif install-hdrs: update-revision - $(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(includedir)/SDL2 + $(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(includedir)/SDL3 for file in $(HDRS) $(SDLTEST_HDRS); do \ - $(INSTALL) -m 644 $(srcdir)/include/$$file $(DESTDIR)$(includedir)/SDL2/$$file; \ + $(INSTALL) -m 644 $(srcdir)/include/$$file $(DESTDIR)$(includedir)/SDL3/$$file; \ done - $(INSTALL) -m 644 include/SDL_config.h $(DESTDIR)$(includedir)/SDL2/SDL_config.h + $(INSTALL) -m 644 include/SDL_config.h $(DESTDIR)$(includedir)/SDL3/SDL_config.h if test -f include/SDL_revision.h; then \ - $(INSTALL) -m 644 include/SDL_revision.h $(DESTDIR)$(includedir)/SDL2/SDL_revision.h; \ + $(INSTALL) -m 644 include/SDL_revision.h $(DESTDIR)$(includedir)/SDL3/SDL_revision.h; \ else \ - $(INSTALL) -m 644 $(srcdir)/include/SDL_revision.h $(DESTDIR)$(includedir)/SDL2/SDL_revision.h; \ + $(INSTALL) -m 644 $(srcdir)/include/SDL_revision.h $(DESTDIR)$(includedir)/SDL3/SDL_revision.h; \ fi install-lib: $(objects)/$(TARGET) $(objects)/$(SDLMAIN_TARGET) $(objects)/$(SDLTEST_TARGET) @@ -192,34 +192,34 @@ install-lib: $(objects)/$(TARGET) $(objects)/$(SDLMAIN_TARGET) $(objects)/$(SDLT $(LIBTOOL) --mode=install $(INSTALL) $(objects)/$(SDLTEST_TARGET) $(DESTDIR)$(libdir)/$(SDLTEST_TARGET) install-data: $(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(datadir)/aclocal - $(INSTALL) -m 644 $(srcdir)/sdl2.m4 $(DESTDIR)$(datadir)/aclocal/sdl2.m4 + $(INSTALL) -m 644 $(srcdir)/sdl3.m4 $(DESTDIR)$(datadir)/aclocal/sdl3.m4 $(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(libdir)/pkgconfig - $(INSTALL) -m 644 sdl2.pc $(DESTDIR)$(libdir)/pkgconfig -ifeq ($(INSTALL_SDL2_CONFIG),TRUE) - $(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(libdir)/cmake/SDL2 - $(INSTALL) -m 644 sdl2-config.cmake $(DESTDIR)$(libdir)/cmake/SDL2 - $(INSTALL) -m 644 sdl2-config-version.cmake $(DESTDIR)$(libdir)/cmake/SDL2 + $(INSTALL) -m 644 sdl3.pc $(DESTDIR)$(libdir)/pkgconfig +ifeq ($(INSTALL_SDL3_CONFIG),TRUE) + $(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(libdir)/cmake/SDL3 + $(INSTALL) -m 644 sdl3-config.cmake $(DESTDIR)$(libdir)/cmake/SDL3 + $(INSTALL) -m 644 sdl3-config-version.cmake $(DESTDIR)$(libdir)/cmake/SDL3 endif uninstall: uninstall-bin uninstall-hdrs uninstall-lib uninstall-data uninstall-bin: - rm -f $(DESTDIR)$(bindir)/sdl2-config + rm -f $(DESTDIR)$(bindir)/sdl3-config uninstall-hdrs: for file in $(HDRS) $(SDLTEST_HDRS); do \ - rm -f $(DESTDIR)$(includedir)/SDL2/$$file; \ + rm -f $(DESTDIR)$(includedir)/SDL3/$$file; \ done - rm -f $(DESTDIR)$(includedir)/SDL2/SDL_config.h - rm -f $(DESTDIR)$(includedir)/SDL2/SDL_revision.h - -rmdir $(DESTDIR)$(includedir)/SDL2 + rm -f $(DESTDIR)$(includedir)/SDL3/SDL_config.h + rm -f $(DESTDIR)$(includedir)/SDL3/SDL_revision.h + -rmdir $(DESTDIR)$(includedir)/SDL3 uninstall-lib: $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$(TARGET) rm -f $(DESTDIR)$(libdir)/$(SDLMAIN_TARGET) rm -f $(DESTDIR)$(libdir)/$(SDLTEST_TARGET) uninstall-data: - rm -f $(DESTDIR)$(datadir)/aclocal/sdl2.m4 - rm -f $(DESTDIR)$(libdir)/pkgconfig/sdl2.pc - rm -f $(DESTDIR)$(libdir)/cmake/SDL2/sdl2-config.cmake - rm -f $(DESTDIR)$(libdir)/cmake/SDL2/sdl2-config-version.cmake + rm -f $(DESTDIR)$(datadir)/aclocal/sdl3.m4 + rm -f $(DESTDIR)$(libdir)/pkgconfig/sdl3.pc + rm -f $(DESTDIR)$(libdir)/cmake/SDL3/sdl3-config.cmake + rm -f $(DESTDIR)$(libdir)/cmake/SDL3/sdl3-config-version.cmake clean: rm -rf $(objects) @@ -227,7 +227,7 @@ clean: if test -f test/Makefile; then (cd test; $(MAKE) $@); fi distclean: clean - rm -f Makefile Makefile.rules sdl2-config + rm -f Makefile Makefile.rules sdl3-config rm -f config.status config.cache config.log libtool rm -rf $(srcdir)/autom4te* find $(srcdir) \( \ diff --git a/Makefile.minimal b/Makefile.minimal index 97ce201ea3..0a69413ddf 100644 --- a/Makefile.minimal +++ b/Makefile.minimal @@ -5,8 +5,8 @@ CFLAGS = -g -O2 $(INCLUDE) AR = ar RANLIB = ranlib -TARGET = libSDL2.a -TESTTARGET = libSDL2_test.a +TARGET = libSDL3.a +TESTTARGET = libSDL3_test.a SOURCES = \ src/*.c \ diff --git a/Makefile.os2 b/Makefile.os2 index 2e38ed0d47..0cefb4b3eb 100644 --- a/Makefile.os2 +++ b/Makefile.os2 @@ -1,4 +1,4 @@ -# Open Watcom makefile to build SDL2.dll for OS/2 +# Open Watcom makefile to build SDL3.dll for OS/2 # wmake -f Makefile.os2 # # If you have GNU libiconv installed (iconv2.dll), you @@ -12,9 +12,9 @@ # # To error out upon warnings: wmake -f Makefile.os2 ENABLE_WERROR=1 -LIBNAME = SDL2 -MAJOR_VERSION = 2 -MINOR_VERSION = 26 +LIBNAME = SDL3 +MAJOR_VERSION = 3 +MINOR_VERSION = 0 MICRO_VERSION = 0 VERSION = $(MAJOR_VERSION).$(MINOR_VERSION).$(MICRO_VERSION) DESCRIPTION = Simple DirectMedia Layer 2 @@ -30,8 +30,8 @@ LNKFILE = $(LIBNAME).lnk INCPATH = -I"$(%WATCOM)/h/os2" -I"$(%WATCOM)/h" INCPATH+= -Iinclude -LIBM = SDL2libm.lib -TLIB = SDL2test.lib +LIBM = SDL3libm.lib +TLIB = SDL3test.lib LIBS = mmpm2.lib $(LIBM) CFLAGS = -bt=os2 -d0 -q -bm -5s -fp5 -fpi87 -sg -oeatxhn -ei # Debug options: @@ -162,7 +162,7 @@ $(LIBICONV_LIB): "src/core/os2/iconv2.lbc" @echo * Creating: $@ wlib -q -b -n -c -pa -s -t -zld -ii -io $@ @$< -# SDL2libm +# SDL3libm MSRCS= e_atan2.c e_exp.c e_fmod.c e_log10.c e_log.c e_pow.c e_rem_pio2.c e_sqrt.c & k_cos.c k_rem_pio2.c k_sin.c k_tan.c & s_atan.c s_copysign.c s_cos.c s_fabs.c s_floor.c s_scalbn.c s_sin.c s_tan.c @@ -216,7 +216,7 @@ $(LIBM): build_libm $(MOBJS) @echo * Creating: $@ wlib -q -b -n -c -pa -s -t -zld -ii -io $@ $(MOBJS) -# SDL2test +# SDL3test TSRCS = SDL_test_assert.c SDL_test_common.c SDL_test_compare.c & SDL_test_crc32.c SDL_test_font.c SDL_test_fuzzer.c SDL_test_harness.c & SDL_test_imageBlit.c SDL_test_imageBlitBlend.c SDL_test_imageFace.c & diff --git a/Makefile.pandora b/Makefile.pandora index fe2249979d..4e6465eb58 100644 --- a/Makefile.pandora +++ b/Makefile.pandora @@ -10,7 +10,7 @@ CFLAGS = -O3 -march=armv7-a -mcpu=cortex-a8 -mtune=cortex-a8 -mfloat-abi=softfp -mfpu=neon -ftree-vectorize -ffast-math -fomit-frame-pointer -fno-strict-aliasing -fsingle-precision-constant \ -I./include -I$(PNDSDK)/usr/include -TARGET = libSDL2.a +TARGET = libSDL3.a SOURCES = ./src/*.c \ diff --git a/Makefile.w32 b/Makefile.w32 index 82609036b9..b89a44e578 100644 --- a/Makefile.w32 +++ b/Makefile.w32 @@ -1,11 +1,11 @@ -# Open Watcom makefile to build SDL2.dll for Win32 +# Open Watcom makefile to build SDL3.dll for Win32 # wmake -f Makefile.w32 # # To error out upon warnings: wmake -f Makefile.w32 ENABLE_WERROR=1 -LIBNAME = SDL2 -MAJOR_VERSION = 2 -MINOR_VERSION = 26 +LIBNAME = SDL3 +MAJOR_VERSION = 3 +MINOR_VERSION = 0 MICRO_VERSION = 0 VERSION = $(MAJOR_VERSION).$(MINOR_VERSION).$(MICRO_VERSION) @@ -19,8 +19,8 @@ INCPATH = -I"$(%WATCOM)/h/nt" -I"$(%WATCOM)/h/nt/directx" -I"$(%WATCOM)/h" INCPATH+= -Iinclude INCPATH+= -I"src/video/khronos" -LIBM = SDL2libm.lib -TLIB = SDL2test.lib +LIBM = SDL3libm.lib +TLIB = SDL3test.lib # user32.lib, gdi32.lib, ole32.lib and oleaut32.lib are actually # among the default libraries in wlink.lnk for nt_dll linkage... LIBS = user32.lib gdi32.lib winmm.lib imm32.lib ole32.lib oleaut32.lib shell32.lib setupapi.lib version.lib uuid.lib dxguid.lib $(LIBM) @@ -147,7 +147,7 @@ SDL_RLEaccel.obj: SDL_RLEaccel.c SDL_malloc.obj: SDL_malloc.c wcc386 $(CFLAGS_DLL) -wcd=201 -fo=$^@ $< -# SDL2libm +# SDL3libm MSRCS= e_atan2.c e_exp.c e_fmod.c e_log10.c e_log.c e_pow.c e_rem_pio2.c e_sqrt.c & k_cos.c k_rem_pio2.c k_sin.c k_tan.c & s_atan.c s_copysign.c s_cos.c s_fabs.c s_floor.c s_scalbn.c s_sin.c s_tan.c @@ -201,7 +201,7 @@ $(LIBM): build_libm $(MOBJS) @echo * Creating: $@ wlib -q -b -n -c -pa -s -t -zld -ii -io $@ $(MOBJS) -# SDL2test +# SDL3test TSRCS = SDL_test_assert.c SDL_test_common.c SDL_test_compare.c & SDL_test_crc32.c SDL_test_font.c SDL_test_fuzzer.c SDL_test_harness.c & SDL_test_imageBlit.c SDL_test_imageBlitBlend.c SDL_test_imageFace.c & @@ -257,7 +257,7 @@ $(LNKFILE): Makefile.w32 @for %i in ($(OBJS)) do @%append $@ FILE %i @for %i in ($(LIBS)) do @%append $@ LIB %i @%append $@ OPTION RESOURCE=$(RCOBJS) - @%append $@ EXPORT=src/dynapi/SDL2.exports + @%append $@ EXPORT=src/dynapi/SDL3.exports @%append $@ OPTION QUIET @%append $@ OPTION IMPF=$(EXPFILE) @%append $@ OPTION MAP=$(LIBHOME)/$^&.map diff --git a/README.md b/README.md index fa7f7ba0b5..fac8663cb5 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ -# Simple DirectMedia Layer (SDL) Version 2.0 +# Simple DirectMedia Layer (SDL) Version 3.0 https://www.libsdl.org/ diff --git a/SDL2Config.cmake.in b/SDL2Config.cmake.in deleted file mode 100644 index 8c18aa5d44..0000000000 --- a/SDL2Config.cmake.in +++ /dev/null @@ -1,65 +0,0 @@ -# sdl2 cmake project-config input for CMakeLists.txt script - -include(FeatureSummary) -set_package_properties(SDL2 PROPERTIES - URL "https://www.libsdl.org/" - DESCRIPTION "low level access to audio, keyboard, mouse, joystick, and graphics hardware" -) - -@PACKAGE_INIT@ - -set(SDL2_FOUND TRUE) - -if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/SDL2Targets.cmake") - include("${CMAKE_CURRENT_LIST_DIR}/SDL2Targets.cmake") - set(SDL2_SDL2_FOUND TRUE) -endif() -if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/SDL2staticTargets.cmake") - if(ANDROID) - enable_language(CXX) - endif() - include("${CMAKE_CURRENT_LIST_DIR}/SDL2staticTargets.cmake") - set(SDL2_SDL2-static_FOUND TRUE) -endif() -if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/SDL2mainTargets.cmake") - include("${CMAKE_CURRENT_LIST_DIR}/SDL2mainTargets.cmake") - set(SDL2_SDL2main_FOUND TRUE) -endif() -if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/SDL2testTargets.cmake") - include("${CMAKE_CURRENT_LIST_DIR}/SDL2testTargets.cmake") - set(SDL2_SDL2test_FOUND TRUE) -endif() - -check_required_components(SDL2) - -# Create SDL2::SDL2 alias for static-only builds -if(TARGET SDL2::SDL2-static AND NOT TARGET SDL2::SDL2) - if(CMAKE_VERSION VERSION_LESS "3.18") - # FIXME: Aliasing local targets is not supported on CMake < 3.18, so make it global. - add_library(SDL2::SDL2 INTERFACE IMPORTED) - set_target_properties(SDL2::SDL2 PROPERTIES INTERFACE_LINK_LIBRARIES "SDL2::SDL2-static") - else() - add_library(SDL2::SDL2 ALIAS SDL2::SDL2-static) - endif() -endif() - -# For compatibility with autotools sdl2-config.cmake, provide SDL2_* variables. - -set(SDL2_PREFIX "@PACKAGE_CMAKE_INSTALL_PREFIX@") -set(SDL2_EXEC_PREFIX "@PACKAGE_CMAKE_INSTALL_PREFIX@") -set(SDL2_INCLUDE_DIR "@PACKAGE_CMAKE_INSTALL_FULL_INCLUDEDIR@/SDL2") -set(SDL2_INCLUDE_DIRS "@PACKAGE_CMAKE_INSTALL_FULL_INCLUDEDIR@;@PACKAGE_CMAKE_INSTALL_FULL_INCLUDEDIR@/SDL2") -set(SDL2_BINDIR "@PACKAGE_CMAKE_INSTALL_FULL_BINDIR@") -set(SDL2_LIBDIR "@PACKAGE_CMAKE_INSTALL_FULL_LIBDIR@") -set(SDL2_LIBRARIES SDL2::SDL2) -set(SDL2_STATIC_LIBRARIES SDL2::SDL2-static) -set(SDL2_STATIC_PRIVATE_LIBS) - -set(SDL2MAIN_LIBRARY) -if(TARGET SDL2::SDL2main) - set(SDL2MAIN_LIBRARY SDL2::SDL2main) - list(INSERT SDL2_LIBRARIES 0 SDL2::SDL2main) - list(INSERT SDL2_STATIC_LIBRARIES 0 SDL2::SDL2main) -endif() - -set(SDL2TEST_LIBRARY SDL2::SDL2test) \ No newline at end of file diff --git a/SDL2.spec.in b/SDL3.spec.in similarity index 97% rename from SDL2.spec.in rename to SDL3.spec.in index 812d2d861a..533af702cb 100644 --- a/SDL2.spec.in +++ b/SDL3.spec.in @@ -1,5 +1,5 @@ Summary: Simple DirectMedia Layer -Name: SDL2 +Name: SDL3 Version: @SDL_VERSION@ Release: 2 Source: http://www.libsdl.org/release/%{name}-%{version}.tar.gz @@ -9,7 +9,7 @@ Group: System Environment/Libraries BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot Prefix: %{_prefix} %ifos linux -Provides: libSDL2-2.0.so.0 +Provides: libSDL3-3.0.so.0 %endif %define __defattr %defattr(-,root,root) @@ -75,7 +75,7 @@ rm -rf $RPM_BUILD_ROOT %{_libdir}/lib*.%{__soext} %{_includedir}/*/*.h %{_libdir}/cmake/* -%{_libdir}/pkgconfig/SDL2/* +%{_libdir}/pkgconfig/SDL3/* %{_datadir}/aclocal/* %changelog diff --git a/SDL3Config.cmake.in b/SDL3Config.cmake.in new file mode 100644 index 0000000000..52dcfb1982 --- /dev/null +++ b/SDL3Config.cmake.in @@ -0,0 +1,65 @@ +# SDL cmake project-config input for CMakeLists.txt script + +include(FeatureSummary) +set_package_properties(SDL3 PROPERTIES + URL "https://www.libsdl.org/" + DESCRIPTION "low level access to audio, keyboard, mouse, joystick, and graphics hardware" +) + +@PACKAGE_INIT@ + +set(SDL3_FOUND TRUE) + +if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/SDL3Targets.cmake") + include("${CMAKE_CURRENT_LIST_DIR}/SDL3Targets.cmake") + set(SDL3_SDL3_FOUND TRUE) +endif() +if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/SDL3staticTargets.cmake") + if(ANDROID) + enable_language(CXX) + endif() + include("${CMAKE_CURRENT_LIST_DIR}/SDL3staticTargets.cmake") + set(SDL3_SDL3-static_FOUND TRUE) +endif() +if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/SDL3mainTargets.cmake") + include("${CMAKE_CURRENT_LIST_DIR}/SDL3mainTargets.cmake") + set(SDL3_SDL3main_FOUND TRUE) +endif() +if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/SDL3testTargets.cmake") + include("${CMAKE_CURRENT_LIST_DIR}/SDL3testTargets.cmake") + set(SDL3_SDL3test_FOUND TRUE) +endif() + +check_required_components(SDL3) + +# Create SDL3::SDL3 alias for static-only builds +if(TARGET SDL3::SDL3-static AND NOT TARGET SDL3::SDL3) + if(CMAKE_VERSION VERSION_LESS "3.18") + # FIXME: Aliasing local targets is not supported on CMake < 3.18, so make it global. + add_library(SDL3::SDL3 INTERFACE IMPORTED) + set_target_properties(SDL3::SDL3 PROPERTIES INTERFACE_LINK_LIBRARIES "SDL3::SDL3-static") + else() + add_library(SDL3::SDL3 ALIAS SDL3::SDL3-static) + endif() +endif() + +# For compatibility with autotools sdl3-config.cmake, provide SDL3_* variables. + +set(SDL3_PREFIX "@PACKAGE_CMAKE_INSTALL_PREFIX@") +set(SDL3_EXEC_PREFIX "@PACKAGE_CMAKE_INSTALL_PREFIX@") +set(SDL3_INCLUDE_DIR "@PACKAGE_CMAKE_INSTALL_FULL_INCLUDEDIR@/SDL3") +set(SDL3_INCLUDE_DIRS "@PACKAGE_CMAKE_INSTALL_FULL_INCLUDEDIR@;@PACKAGE_CMAKE_INSTALL_FULL_INCLUDEDIR@/SDL3") +set(SDL3_BINDIR "@PACKAGE_CMAKE_INSTALL_FULL_BINDIR@") +set(SDL3_LIBDIR "@PACKAGE_CMAKE_INSTALL_FULL_LIBDIR@") +set(SDL3_LIBRARIES SDL3::SDL3) +set(SDL3_STATIC_LIBRARIES SDL3::SDL3-static) +set(SDL3_STATIC_PRIVATE_LIBS) + +set(SDL3MAIN_LIBRARY) +if(TARGET SDL3::SDL3main) + set(SDL3MAIN_LIBRARY SDL3::SDL3main) + list(INSERT SDL3_LIBRARIES 0 SDL3::SDL3main) + list(INSERT SDL3_STATIC_LIBRARIES 0 SDL3::SDL3main) +endif() + +set(SDL3TEST_LIBRARY SDL3::SDL3test) diff --git a/VisualC-GDK/SDL.sln b/VisualC-GDK/SDL.sln index 2584219500..827c9ff4bd 100644 --- a/VisualC-GDK/SDL.sln +++ b/VisualC-GDK/SDL.sln @@ -4,13 +4,13 @@ VisualStudioVersion = 17.1.32414.318 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{D69D5741-611F-4E14-8541-1FEE94F50B5A}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL2", "SDL\SDL.vcxproj", "{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL3", "SDL\SDL.vcxproj", "{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL2main", "SDLmain\SDLmain.vcxproj", "{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL3main", "SDLmain\SDLmain.vcxproj", "{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testsprite2", "tests\testsprite2\testsprite2.vcxproj", "{40FB7794-D3C3-4CFE-BCF4-A80C96635682}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL2test", "SDLtest\SDLtest.vcxproj", "{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL3test", "SDLtest\SDLtest.vcxproj", "{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testgamecontroller", "tests\testgamecontroller\testgamecontroller.vcxproj", "{55812185-D13C-4022-9C81-32E0F4A08305}" EndProject diff --git a/VisualC-GDK/SDL/SDL.vcxproj b/VisualC-GDK/SDL/SDL.vcxproj index c8208b41f7..b183f62256 100644 --- a/VisualC-GDK/SDL/SDL.vcxproj +++ b/VisualC-GDK/SDL/SDL.vcxproj @@ -27,7 +27,7 @@ - SDL2 + SDL3 {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} SDL 10.0 diff --git a/VisualC-GDK/SDLmain/SDLmain.vcxproj b/VisualC-GDK/SDLmain/SDLmain.vcxproj index a2c05b1c39..df88a77417 100644 --- a/VisualC-GDK/SDLmain/SDLmain.vcxproj +++ b/VisualC-GDK/SDLmain/SDLmain.vcxproj @@ -30,7 +30,7 @@ - SDL2main + SDL3main {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} SDLmain 10.0 @@ -208,4 +208,4 @@ - \ No newline at end of file + diff --git a/VisualC-GDK/SDLtest/SDLtest.vcxproj b/VisualC-GDK/SDLtest/SDLtest.vcxproj index c2e9348c3e..9ed131a382 100644 --- a/VisualC-GDK/SDLtest/SDLtest.vcxproj +++ b/VisualC-GDK/SDLtest/SDLtest.vcxproj @@ -27,7 +27,7 @@ - SDL2test + SDL3test {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} SDLtest 10.0 @@ -223,4 +223,4 @@ - \ No newline at end of file + diff --git a/VisualC-WinRT/SDL-UWP.sln b/VisualC-WinRT/SDL-UWP.sln index 472c4f01b7..62f9f04172 100644 --- a/VisualC-WinRT/SDL-UWP.sln +++ b/VisualC-WinRT/SDL-UWP.sln @@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 14 VisualStudioVersion = 14.0.25420.1 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL2-UWP", "SDL-UWP.vcxproj", "{89E9B32E-A86A-47C3-A948-D2B1622925CE}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL3-UWP", "SDL-UWP.vcxproj", "{89E9B32E-A86A-47C3-A948-D2B1622925CE}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/VisualC-WinRT/SDL-UWP.vcxproj b/VisualC-WinRT/SDL-UWP.vcxproj index 9d7c013514..a34357e733 100644 --- a/VisualC-WinRT/SDL-UWP.vcxproj +++ b/VisualC-WinRT/SDL-UWP.vcxproj @@ -349,8 +349,8 @@ {89e9b32e-a86a-47c3-a948-d2b1622925ce} DynamicLibrary - SDL2-UWP - SDL2 + SDL3-UWP + SDL3 en-US 14.0 true @@ -439,42 +439,42 @@ false false - SDL2 + SDL3 false false - SDL2 + SDL3 false false - SDL2 + SDL3 false false - SDL2 + SDL3 false false - SDL2 + SDL3 false false - SDL2 + SDL3 false false - SDL2 + SDL3 false false - SDL2 + SDL3 diff --git a/VisualC/SDL.sln b/VisualC/SDL.sln index 87b2cf5207..ebb836d473 100644 --- a/VisualC/SDL.sln +++ b/VisualC/SDL.sln @@ -2,9 +2,9 @@ Microsoft Visual Studio Solution File, Format Version 11.00 # Visual Studio 2010 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{D69D5741-611F-4E14-8541-1FEE94F50B5A}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL2", "SDL\SDL.vcxproj", "{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL3", "SDL\SDL.vcxproj", "{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL2main", "SDLmain\SDLmain.vcxproj", "{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL3main", "SDLmain\SDLmain.vcxproj", "{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "checkkeys", "tests\checkkeys\checkkeys.vcxproj", "{26828762-C95D-4637-9CB1-7F0979523813}" EndProject @@ -40,7 +40,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testshape", "tests\testshap EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testsprite2", "tests\testsprite2\testsprite2.vcxproj", "{40FB7794-D3C3-4CFE-BCF4-A80C96635682}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL2test", "SDLtest\SDLtest.vcxproj", "{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL3test", "SDLtest\SDLtest.vcxproj", "{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testgamecontroller", "tests\testgamecontroller\testgamecontroller.vcxproj", "{55812185-D13C-4022-9C81-32E0F4A08305}" EndProject diff --git a/VisualC/SDL/SDL.vcxproj b/VisualC/SDL/SDL.vcxproj index 2c85790e2c..64f1341a4e 100644 --- a/VisualC/SDL/SDL.vcxproj +++ b/VisualC/SDL/SDL.vcxproj @@ -19,7 +19,7 @@ - SDL2 + SDL3 {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} SDL 10.0 diff --git a/VisualC/SDLmain/SDLmain.vcxproj b/VisualC/SDLmain/SDLmain.vcxproj index ad63dc6c61..6da048b699 100644 --- a/VisualC/SDLmain/SDLmain.vcxproj +++ b/VisualC/SDLmain/SDLmain.vcxproj @@ -19,7 +19,7 @@ - SDL2main + SDL3main {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} SDLmain 10.0 diff --git a/VisualC/SDLtest/SDLtest.vcxproj b/VisualC/SDLtest/SDLtest.vcxproj index 042baf1314..3faca9916e 100644 --- a/VisualC/SDLtest/SDLtest.vcxproj +++ b/VisualC/SDLtest/SDLtest.vcxproj @@ -19,7 +19,7 @@ - SDL2test + SDL3test {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} SDLtest 10.0 diff --git a/VisualC/pkg-support/cmake/sdl2-config.cmake b/VisualC/pkg-support/cmake/sdl2-config.cmake deleted file mode 100644 index 1a25259c0e..0000000000 --- a/VisualC/pkg-support/cmake/sdl2-config.cmake +++ /dev/null @@ -1,111 +0,0 @@ -# SDL2 CMake configuration file: -# This file is meant to be placed in a cmake subfolder of SDL2-devel-2.x.y-VC - -cmake_minimum_required(VERSION 3.0) - -include(FeatureSummary) -set_package_properties(SDL2 PROPERTIES - URL "https://www.libsdl.org/" - DESCRIPTION "low level access to audio, keyboard, mouse, joystick, and graphics hardware" -) - -# Copied from `configure_package_config_file` -macro(set_and_check _var _file) - set(${_var} "${_file}") - if(NOT EXISTS "${_file}") - message(FATAL_ERROR "File or directory ${_file} referenced by variable ${_var} does not exist !") - endif() -endmacro() - -# Copied from `configure_package_config_file` -macro(check_required_components _NAME) - foreach(comp ${${_NAME}_FIND_COMPONENTS}) - if(NOT ${_NAME}_${comp}_FOUND) - if(${_NAME}_FIND_REQUIRED_${comp}) - set(${_NAME}_FOUND FALSE) - endif() - endif() - endforeach() -endmacro() - -set(SDL2_FOUND TRUE) - -if(CMAKE_SIZEOF_VOID_P STREQUAL "4") - set(_sdl_arch_subdir "x86") -elseif(CMAKE_SIZEOF_VOID_P STREQUAL "8") - set(_sdl_arch_subdir "x64") -else() - set(SDL2_FOUND FALSE) - return() -endif() - -# For compatibility with autotools sdl2-config.cmake, provide SDL2_* variables. - -set_and_check(SDL2_PREFIX "${CMAKE_CURRENT_LIST_DIR}/..") -set_and_check(SDL2_EXEC_PREFIX "${CMAKE_CURRENT_LIST_DIR}/..") -set_and_check(SDL2_INCLUDE_DIR "${SDL2_PREFIX}/include") -set(SDL2_INCLUDE_DIRS "${SDL2_INCLUDE_DIR}") -set_and_check(SDL2_BINDIR "${SDL2_PREFIX}/lib/${_sdl_arch_subdir}") -set_and_check(SDL2_LIBDIR "${SDL2_PREFIX}/lib/${_sdl_arch_subdir}") - -set(SDL2_LIBRARIES SDL2::SDL2main SDL2::SDL2) -set(SDL2MAIN_LIBRARY SDL2::SDL2main) -set(SDL2TEST_LIBRARY SDL2::SDL2test) - - -# All targets are created, even when some might not be requested though COMPONENTS. -# This is done for compatibility with CMake generated SDL2-target.cmake files. - -set(_sdl2_library "${SDL2_LIBDIR}/SDL2.lib") -set(_sdl2_dll_library "${SDL2_BINDIR}/SDL2.dll") -if(EXISTS "${_sdl2_library}" AND EXISTS "${_sdl2_dll_library}") - if(NOT TARGET SDL2::SDL2) - add_library(SDL2::SDL2 SHARED IMPORTED) - set_target_properties(SDL2::SDL2 - PROPERTIES - INTERFACE_INCLUDE_DIRECTORIES "${SDL2_INCLUDE_DIRS}" - IMPORTED_IMPLIB "${_sdl2_library}" - IMPORTED_LOCATION "${_sdl2_dll_library}" - COMPATIBLE_INTERFACE_BOOL "SDL2_SHARED" - INTERFACE_SDL2_SHARED "ON" - ) - endif() - set(SDL2_SDL2_FOUND TRUE) -else() - set(SDL2_SDL2_FOUND FALSE) -endif() -unset(_sdl2_library) -unset(_sdl2_dll_library) - -set(_sdl2main_library "${SDL2_LIBDIR}/SDL2main.lib") -if(EXISTS "${_sdl2main_library}") - if(NOT TARGET SDL2::SDL2main) - add_library(SDL2::SDL2main STATIC IMPORTED) - set_target_properties(SDL2::SDL2main - PROPERTIES - IMPORTED_LOCATION "${_sdl2main_library}" - ) - endif() - set(SDL2_SDL2main_FOUND TRUE) -else() - set(SDL2_SDL2_FOUND FALSE) -endif() -unset(_sdl2main_library) - -set(_sdl2test_library "${SDL2_LIBDIR}/SDL2test.lib") -if(EXISTS "${_sdl2test_library}") - if(NOT TARGET SDL2::SDL2test) - add_library(SDL2::SDL2test STATIC IMPORTED) - set_target_properties(SDL2::SDL2test - PROPERTIES - INTERFACE_INCLUDE_DIRECTORIES "${SDL2_INCLUDE_DIRS}" - IMPORTED_LOCATION "${_sdl2test_library}" - ) - endif() - set(SDL2_SDL2test_FOUND TRUE) -else() - set(SDL2_SDL2_FOUND FALSE) -endif() -unset(_sdl2test_library) - -check_required_components(SDL2) diff --git a/VisualC/pkg-support/cmake/sdl2-config-version.cmake b/VisualC/pkg-support/cmake/sdl3-config-version.cmake similarity index 92% rename from VisualC/pkg-support/cmake/sdl2-config-version.cmake rename to VisualC/pkg-support/cmake/sdl3-config-version.cmake index 42bb6e7431..500e88fdbf 100644 --- a/VisualC/pkg-support/cmake/sdl2-config-version.cmake +++ b/VisualC/pkg-support/cmake/sdl3-config-version.cmake @@ -1,10 +1,10 @@ # based on the files generated by CMake's write_basic_package_version_file -# SDL2 CMake version configuration file: -# This file is meant to be placed in a cmake subfolder of SDL2-devel-2.x.y-VC +# SDL CMake version configuration file: +# This file is meant to be placed in a cmake subfolder of SDL3-devel-3.x.y-VC if(NOT EXISTS "${CMAKE_CURRENT_LIST_DIR}/../include/SDL_version.h") - message(AUTHOR_WARNING "Could not find SDL_version.h. This script is meant to be placed in the root of SDL2-devel-2.x.y-VC") + message(AUTHOR_WARNING "Could not find SDL_version.h. This script is meant to be placed in the root of SDL3-devel-3.x.y-VC") return() endif() diff --git a/VisualC/pkg-support/cmake/sdl3-config.cmake b/VisualC/pkg-support/cmake/sdl3-config.cmake new file mode 100644 index 0000000000..c35d6b873d --- /dev/null +++ b/VisualC/pkg-support/cmake/sdl3-config.cmake @@ -0,0 +1,111 @@ +# SDL CMake configuration file: +# This file is meant to be placed in a cmake subfolder of SDL3-devel-3.x.y-VC + +cmake_minimum_required(VERSION 3.0) + +include(FeatureSummary) +set_package_properties(SDL3 PROPERTIES + URL "https://www.libsdl.org/" + DESCRIPTION "low level access to audio, keyboard, mouse, joystick, and graphics hardware" +) + +# Copied from `configure_package_config_file` +macro(set_and_check _var _file) + set(${_var} "${_file}") + if(NOT EXISTS "${_file}") + message(FATAL_ERROR "File or directory ${_file} referenced by variable ${_var} does not exist !") + endif() +endmacro() + +# Copied from `configure_package_config_file` +macro(check_required_components _NAME) + foreach(comp ${${_NAME}_FIND_COMPONENTS}) + if(NOT ${_NAME}_${comp}_FOUND) + if(${_NAME}_FIND_REQUIRED_${comp}) + set(${_NAME}_FOUND FALSE) + endif() + endif() + endforeach() +endmacro() + +set(SDL3_FOUND TRUE) + +if(CMAKE_SIZEOF_VOID_P STREQUAL "4") + set(_sdl_arch_subdir "x86") +elseif(CMAKE_SIZEOF_VOID_P STREQUAL "8") + set(_sdl_arch_subdir "x64") +else() + set(SDL3_FOUND FALSE) + return() +endif() + +# For compatibility with autotools sdl3-config.cmake, provide SDL3_* variables. + +set_and_check(SDL3_PREFIX "${CMAKE_CURRENT_LIST_DIR}/..") +set_and_check(SDL3_EXEC_PREFIX "${CMAKE_CURRENT_LIST_DIR}/..") +set_and_check(SDL3_INCLUDE_DIR "${SDL3_PREFIX}/include") +set(SDL3_INCLUDE_DIRS "${SDL3_INCLUDE_DIR}") +set_and_check(SDL3_BINDIR "${SDL3_PREFIX}/lib/${_sdl_arch_subdir}") +set_and_check(SDL3_LIBDIR "${SDL3_PREFIX}/lib/${_sdl_arch_subdir}") + +set(SDL3_LIBRARIES SDL3::SDL3main SDL3::SDL3) +set(SDL3MAIN_LIBRARY SDL3::SDL3main) +set(SDL3TEST_LIBRARY SDL3::SDL3test) + + +# All targets are created, even when some might not be requested though COMPONENTS. +# This is done for compatibility with CMake generated SDL3-target.cmake files. + +set(_sdl3_library "${SDL3_LIBDIR}/SDL3.lib") +set(_sdl3_dll_library "${SDL3_BINDIR}/SDL3.dll") +if(EXISTS "${_sdl3_library}" AND EXISTS "${_sdl3_dll_library}") + if(NOT TARGET SDL3::SDL3) + add_library(SDL3::SDL3 SHARED IMPORTED) + set_target_properties(SDL3::SDL3 + PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${SDL3_INCLUDE_DIRS}" + IMPORTED_IMPLIB "${_sdl3_library}" + IMPORTED_LOCATION "${_sdl3_dll_library}" + COMPATIBLE_INTERFACE_BOOL "SDL3_SHARED" + INTERFACE_SDL3_SHARED "ON" + ) + endif() + set(SDL3_SDL3_FOUND TRUE) +else() + set(SDL3_SDL3_FOUND FALSE) +endif() +unset(_sdl3_library) +unset(_sdl3_dll_library) + +set(_sdl3main_library "${SDL3_LIBDIR}/SDL3main.lib") +if(EXISTS "${_sdl3main_library}") + if(NOT TARGET SDL3::SDL3main) + add_library(SDL3::SDL3main STATIC IMPORTED) + set_target_properties(SDL3::SDL3main + PROPERTIES + IMPORTED_LOCATION "${_sdl3main_library}" + ) + endif() + set(SDL3_SDL3main_FOUND TRUE) +else() + set(SDL3_SDL3_FOUND FALSE) +endif() +unset(_sdl3main_library) + +set(_sdl3test_library "${SDL3_LIBDIR}/SDL3test.lib") +if(EXISTS "${_sdl3test_library}") + if(NOT TARGET SDL3::SDL3test) + add_library(SDL3::SDL3test STATIC IMPORTED) + set_target_properties(SDL3::SDL3test + PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${SDL3_INCLUDE_DIRS}" + IMPORTED_LOCATION "${_sdl3test_library}" + ) + endif() + set(SDL3_SDL3test_FOUND TRUE) +else() + set(SDL3_SDL3_FOUND FALSE) +endif() +unset(_sdl3test_library) + +check_required_components(SDL3) diff --git a/Xcode-iOS/Demos/Demos.xcodeproj/project.pbxproj b/Xcode-iOS/Demos/Demos.xcodeproj/project.pbxproj index 8fc664b8ca..0104d6e0b4 100644 --- a/Xcode-iOS/Demos/Demos.xcodeproj/project.pbxproj +++ b/Xcode-iOS/Demos/Demos.xcodeproj/project.pbxproj @@ -7,14 +7,14 @@ objects = { /* Begin PBXBuildFile section */ - F3A497102555EE4800E92A8B /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F3A495992555ED0500E92A8B /* libSDL2.a */; }; - F3A4972F2555EE8A00E92A8B /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F3A495992555ED0500E92A8B /* libSDL2.a */; }; - F3A497422555EEBE00E92A8B /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F3A495992555ED0500E92A8B /* libSDL2.a */; }; - F3A497442555EECD00E92A8B /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F3A495992555ED0500E92A8B /* libSDL2.a */; }; - F3A497462555EEDF00E92A8B /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F3A4959B2555ED0500E92A8B /* libSDL2.a */; }; - F3A497492555EF0B00E92A8B /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F3A495992555ED0500E92A8B /* libSDL2.a */; }; - F3A4974B2555EF1B00E92A8B /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F3A495992555ED0500E92A8B /* libSDL2.a */; }; - F3A4974E2555EF9F00E92A8B /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F3A495992555ED0500E92A8B /* libSDL2.a */; }; + F3A497102555EE4800E92A8B /* libSDL3.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F3A495992555ED0500E92A8B /* libSDL3.a */; }; + F3A4972F2555EE8A00E92A8B /* libSDL3.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F3A495992555ED0500E92A8B /* libSDL3.a */; }; + F3A497422555EEBE00E92A8B /* libSDL3.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F3A495992555ED0500E92A8B /* libSDL3.a */; }; + F3A497442555EECD00E92A8B /* libSDL3.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F3A495992555ED0500E92A8B /* libSDL3.a */; }; + F3A497462555EEDF00E92A8B /* libSDL3.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F3A4959B2555ED0500E92A8B /* libSDL3.a */; }; + F3A497492555EF0B00E92A8B /* libSDL3.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F3A495992555ED0500E92A8B /* libSDL3.a */; }; + F3A4974B2555EF1B00E92A8B /* libSDL3.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F3A495992555ED0500E92A8B /* libSDL3.a */; }; + F3A4974E2555EF9F00E92A8B /* libSDL3.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F3A495992555ED0500E92A8B /* libSDL3.a */; }; FA30DEB01BBF5A8F009C397F /* common.c in Sources */ = {isa = PBXBuildFile; fileRef = FD77A0060E26BC0500F39101 /* common.c */; }; FA30DEB11BBF5A93009C397F /* happy.c in Sources */ = {isa = PBXBuildFile; fileRef = FD77A0080E26BC0500F39101 /* happy.c */; }; FA30DEB31BBF5AD7009C397F /* icon.bmp in Resources */ = {isa = PBXBuildFile; fileRef = FDB651CC0E43D19800F688B5 /* icon.bmp */; }; @@ -188,7 +188,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - F3A497102555EE4800E92A8B /* libSDL2.a in Frameworks */, + F3A497102555EE4800E92A8B /* libSDL3.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -196,7 +196,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - F3A497462555EEDF00E92A8B /* libSDL2.a in Frameworks */, + F3A497462555EEDF00E92A8B /* libSDL3.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -204,7 +204,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - F3A497442555EECD00E92A8B /* libSDL2.a in Frameworks */, + F3A497442555EECD00E92A8B /* libSDL3.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -212,7 +212,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - F3A4972F2555EE8A00E92A8B /* libSDL2.a in Frameworks */, + F3A4972F2555EE8A00E92A8B /* libSDL3.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -220,7 +220,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - F3A497492555EF0B00E92A8B /* libSDL2.a in Frameworks */, + F3A497492555EF0B00E92A8B /* libSDL3.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -228,7 +228,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - F3A4974E2555EF9F00E92A8B /* libSDL2.a in Frameworks */, + F3A4974E2555EF9F00E92A8B /* libSDL3.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -236,7 +236,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - F3A497422555EEBE00E92A8B /* libSDL2.a in Frameworks */, + F3A497422555EEBE00E92A8B /* libSDL3.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -244,7 +244,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - F3A4974B2555EF1B00E92A8B /* libSDL2.a in Frameworks */, + F3A4974B2555EF1B00E92A8B /* libSDL3.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -292,17 +292,17 @@ F3A495812555ED0400E92A8B /* Products */ = { isa = PBXGroup; children = ( - F3A495912555ED0500E92A8B /* SDL2.framework */, - F3A495932555ED0500E92A8B /* SDL2.framework */, - F3A495952555ED0500E92A8B /* SDL2.framework */, - F3C17D9228E4355900E1A26D /* SDL2.framework */, - F3A495972555ED0500E92A8B /* libSDL2.a */, - F3A495992555ED0500E92A8B /* libSDL2.a */, - F3A4959B2555ED0500E92A8B /* libSDL2.a */, - F3A4959D2555ED0500E92A8B /* libSDL2.dylib */, - F3A4959F2555ED0500E92A8B /* libSDL2.dylib */, - F3A495A12555ED0500E92A8B /* libSDL2.dylib */, - F3A495A32555ED0500E92A8B /* SDL2 */, + F3A495912555ED0500E92A8B /* SDL3.framework */, + F3A495932555ED0500E92A8B /* SDL3.framework */, + F3A495952555ED0500E92A8B /* SDL3.framework */, + F3C17D9228E4355900E1A26D /* SDL3.framework */, + F3A495972555ED0500E92A8B /* libSDL3.a */, + F3A495992555ED0500E92A8B /* libSDL3.a */, + F3A4959B2555ED0500E92A8B /* libSDL3.a */, + F3A4959D2555ED0500E92A8B /* libSDL3.dylib */, + F3A4959F2555ED0500E92A8B /* libSDL3.dylib */, + F3A495A12555ED0500E92A8B /* libSDL3.dylib */, + F3A495A32555ED0500E92A8B /* SDL3 */, ); name = Products; sourceTree = ""; @@ -565,80 +565,80 @@ /* End PBXProject section */ /* Begin PBXReferenceProxy section */ - F3A495912555ED0500E92A8B /* SDL2.framework */ = { + F3A495912555ED0500E92A8B /* SDL3.framework */ = { isa = PBXReferenceProxy; fileType = wrapper.framework; - path = SDL2.framework; + path = SDL3.framework; remoteRef = F3A495902555ED0500E92A8B /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - F3A495932555ED0500E92A8B /* SDL2.framework */ = { + F3A495932555ED0500E92A8B /* SDL3.framework */ = { isa = PBXReferenceProxy; fileType = wrapper.framework; - path = SDL2.framework; + path = SDL3.framework; remoteRef = F3A495922555ED0500E92A8B /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - F3A495952555ED0500E92A8B /* SDL2.framework */ = { + F3A495952555ED0500E92A8B /* SDL3.framework */ = { isa = PBXReferenceProxy; fileType = wrapper.framework; - path = SDL2.framework; + path = SDL3.framework; remoteRef = F3A495942555ED0500E92A8B /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - F3A495972555ED0500E92A8B /* libSDL2.a */ = { + F3A495972555ED0500E92A8B /* libSDL3.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; - path = libSDL2.a; + path = libSDL3.a; remoteRef = F3A495962555ED0500E92A8B /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - F3A495992555ED0500E92A8B /* libSDL2.a */ = { + F3A495992555ED0500E92A8B /* libSDL3.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; - path = libSDL2.a; + path = libSDL3.a; remoteRef = F3A495982555ED0500E92A8B /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - F3A4959B2555ED0500E92A8B /* libSDL2.a */ = { + F3A4959B2555ED0500E92A8B /* libSDL3.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; - path = libSDL2.a; + path = libSDL3.a; remoteRef = F3A4959A2555ED0500E92A8B /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - F3A4959D2555ED0500E92A8B /* libSDL2.dylib */ = { + F3A4959D2555ED0500E92A8B /* libSDL3.dylib */ = { isa = PBXReferenceProxy; fileType = "compiled.mach-o.dylib"; - path = libSDL2.dylib; + path = libSDL3.dylib; remoteRef = F3A4959C2555ED0500E92A8B /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - F3A4959F2555ED0500E92A8B /* libSDL2.dylib */ = { + F3A4959F2555ED0500E92A8B /* libSDL3.dylib */ = { isa = PBXReferenceProxy; fileType = "compiled.mach-o.dylib"; - path = libSDL2.dylib; + path = libSDL3.dylib; remoteRef = F3A4959E2555ED0500E92A8B /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - F3A495A12555ED0500E92A8B /* libSDL2.dylib */ = { + F3A495A12555ED0500E92A8B /* libSDL3.dylib */ = { isa = PBXReferenceProxy; fileType = "compiled.mach-o.dylib"; - path = libSDL2.dylib; + path = libSDL3.dylib; remoteRef = F3A495A02555ED0500E92A8B /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - F3A495A32555ED0500E92A8B /* SDL2 */ = { + F3A495A32555ED0500E92A8B /* SDL3 */ = { isa = PBXReferenceProxy; fileType = "compiled.mach-o.executable"; - path = SDL2; + path = SDL3; remoteRef = F3A495A22555ED0500E92A8B /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - F3C17D9228E4355900E1A26D /* SDL2.framework */ = { + F3C17D9228E4355900E1A26D /* SDL3.framework */ = { isa = PBXReferenceProxy; fileType = wrapper.framework; - path = SDL2.framework; + path = SDL3.framework; remoteRef = F3C17D9128E4355900E1A26D /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; diff --git a/Xcode-iOS/Demos/README b/Xcode-iOS/Demos/README index da6fb74908..d0f4ea179a 100644 --- a/Xcode-iOS/Demos/README +++ b/Xcode-iOS/Demos/README @@ -2,7 +2,7 @@ About the iPhone OS Demo Applications ============================================================================== -Demos.xcodeproj contains several targets for iPhone oriented SDL demos. These demos are written strictly using SDL 2.0 calls. All the demos except for Fireworks (which requires OpenGL ES) should work on platforms other than iPhone OS, though you'll need to write your own compile script. +Demos.xcodeproj contains several targets for iPhone oriented SDL demos. These demos are written strictly using SDL 3.0 calls. All the demos except for Fireworks (which requires OpenGL ES) should work on platforms other than iPhone OS, though you'll need to write your own compile script. Common files: diff --git a/Xcode-iOS/Demos/config.xcconfig b/Xcode-iOS/Demos/config.xcconfig index 5639172909..5b7da52714 100644 --- a/Xcode-iOS/Demos/config.xcconfig +++ b/Xcode-iOS/Demos/config.xcconfig @@ -9,6 +9,6 @@ // Include any optional config for this build #include? "build.xcconfig" -CONFIG_FRAMEWORK_LDFLAGS[sdk=macos*] = $(inherited) -framework SDL2 -framework AudioToolbox -framework Carbon -framework Cocoa -framework CoreAudio -framework CoreHaptics -framework CoreVideo -framework ForceFeedback -framework GameController -framework IOKit -framework Metal +CONFIG_FRAMEWORK_LDFLAGS[sdk=macos*] = $(inherited) -framework SDL3 -framework AudioToolbox -framework Carbon -framework Cocoa -framework CoreAudio -framework CoreHaptics -framework CoreVideo -framework ForceFeedback -framework GameController -framework IOKit -framework Metal CONFIG_FRAMEWORK_LDFLAGS[sdk=iphone*] = $(inherited) -framework AVFoundation -framework AudioToolbox -framework CoreGraphics -framework CoreHaptics -framework CoreMotion -framework Foundation -framework GameController -framework Metal -framework OpenGLES -framework QuartzCore -framework UIKit CONFIG_FRAMEWORK_LDFLAGS[sdk=appletv*] = $(inherited) -framework AVFoundation -framework AudioToolbox -framework CoreGraphics -framework CoreHaptics -framework Foundation -framework GameController -framework Metal -framework OpenGLES -framework QuartzCore -framework UIKit diff --git a/Xcode/SDL/Info-Framework.plist b/Xcode/SDL/Info-Framework.plist index 09bae6c16e..65acdef217 100644 --- a/Xcode/SDL/Info-Framework.plist +++ b/Xcode/SDL/Info-Framework.plist @@ -19,10 +19,10 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 2.26.0 + 3.0.0 CFBundleSignature SDLX CFBundleVersion - 2.26.0 + 3.0.0 diff --git a/Xcode/SDL/SDL.xcodeproj/project.pbxproj b/Xcode/SDL/SDL.xcodeproj/project.pbxproj index b59a594fb8..40b04d63f1 100644 --- a/Xcode/SDL/SDL.xcodeproj/project.pbxproj +++ b/Xcode/SDL/SDL.xcodeproj/project.pbxproj @@ -3704,8 +3704,8 @@ A1BB8B6227F6CF330057CFA8 /* SDL_list.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_list.h; sourceTree = ""; }; A7381E931D8B69C300B177DD /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = System/Library/Frameworks/AudioToolbox.framework; sourceTree = SDKROOT; }; A7381E951D8B69D600B177DD /* CoreAudio.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreAudio.framework; path = System/Library/Frameworks/CoreAudio.framework; sourceTree = SDKROOT; }; - A75FCEB323E25AB700529352 /* libSDL2.dylib */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; path = libSDL2.dylib; sourceTree = BUILT_PRODUCTS_DIR; }; - A75FD06C23E25AC700529352 /* libSDL2.dylib */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; path = libSDL2.dylib; sourceTree = BUILT_PRODUCTS_DIR; }; + A75FCEB323E25AB700529352 /* libSDL3.dylib */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; path = libSDL3.dylib; sourceTree = BUILT_PRODUCTS_DIR; }; + A75FD06C23E25AC700529352 /* libSDL3.dylib */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; path = libSDL3.dylib; sourceTree = BUILT_PRODUCTS_DIR; }; A75FDAA523E2792500529352 /* hid.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = hid.m; sourceTree = ""; }; A75FDAAC23E2795C00529352 /* SDL_hidapi_steam.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_hidapi_steam.c; sourceTree = ""; }; A75FDAB923E28A7A00529352 /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; }; @@ -3723,11 +3723,11 @@ A75FDBA723E4CB6F00529352 /* LICENSE.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = LICENSE.txt; sourceTree = ""; }; A75FDBC323EA380300529352 /* SDL_hidapi_rumble.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_hidapi_rumble.h; sourceTree = ""; }; A75FDBC423EA380300529352 /* SDL_hidapi_rumble.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_hidapi_rumble.c; sourceTree = ""; }; - A769B23D23E259AE00872273 /* libSDL2.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libSDL2.a; sourceTree = BUILT_PRODUCTS_DIR; }; + A769B23D23E259AE00872273 /* libSDL3.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libSDL3.a; sourceTree = BUILT_PRODUCTS_DIR; }; A77E6EB3167AB0A90010E40B /* SDL_gamecontroller.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_gamecontroller.h; sourceTree = ""; }; - A7D88B5423E2437C00DCD162 /* SDL2.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SDL2.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - A7D88D1523E24BED00DCD162 /* SDL2.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SDL2.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - A7D88E5423E24D3B00DCD162 /* libSDL2.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libSDL2.a; sourceTree = BUILT_PRODUCTS_DIR; }; + A7D88B5423E2437C00DCD162 /* SDL3.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SDL3.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + A7D88D1523E24BED00DCD162 /* SDL3.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SDL3.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + A7D88E5423E24D3B00DCD162 /* libSDL3.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libSDL3.a; sourceTree = BUILT_PRODUCTS_DIR; }; A7D8A57023E2513D00DCD162 /* SDL_dataqueue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_dataqueue.h; sourceTree = ""; }; A7D8A57123E2513D00DCD162 /* SDL.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL.c; sourceTree = ""; }; A7D8A57323E2513D00DCD162 /* SDL_spinlock.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_spinlock.c; sourceTree = ""; }; @@ -4098,11 +4098,11 @@ AAC070F8195606770073DCDF /* SDL_opengles2_khrplatform.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_opengles2_khrplatform.h; sourceTree = ""; }; AADA5B8616CCAB3000107CF7 /* SDL_bits.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_bits.h; sourceTree = ""; }; BECDF66B0761BA81005FE872 /* Info-Framework.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Info-Framework.plist"; sourceTree = ""; }; - BECDF66C0761BA81005FE872 /* SDL2.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SDL2.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - BECDF6B30761BA81005FE872 /* libSDL2.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libSDL2.a; sourceTree = BUILT_PRODUCTS_DIR; }; - BECDF6BE0761BA81005FE872 /* SDL2 */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = SDL2; sourceTree = BUILT_PRODUCTS_DIR; }; - DB31407717554B71006C0E22 /* libSDL2.dylib */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; path = libSDL2.dylib; sourceTree = BUILT_PRODUCTS_DIR; }; - E2D187CF28A5673500D2B4F1 /* SDL2.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SDL2.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + BECDF66C0761BA81005FE872 /* SDL3.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SDL3.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + BECDF6B30761BA81005FE872 /* libSDL3.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libSDL3.a; sourceTree = BUILT_PRODUCTS_DIR; }; + BECDF6BE0761BA81005FE872 /* SDL3 */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = SDL3; sourceTree = BUILT_PRODUCTS_DIR; }; + DB31407717554B71006C0E22 /* libSDL3.dylib */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; path = libSDL3.dylib; sourceTree = BUILT_PRODUCTS_DIR; }; + E2D187CF28A5673500D2B4F1 /* SDL3.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SDL3.framework; sourceTree = BUILT_PRODUCTS_DIR; }; E2D187D228A5673500D2B4F1 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; F31A92C628D4CB39003BFD6A /* SDL_offscreenopengles.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_offscreenopengles.h; sourceTree = ""; }; F31A92C728D4CB39003BFD6A /* SDL_offscreenopengles.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_offscreenopengles.c; sourceTree = ""; }; @@ -4386,17 +4386,17 @@ 034768DDFF38A45A11DB9C8B /* Products */ = { isa = PBXGroup; children = ( - BECDF66C0761BA81005FE872 /* SDL2.framework */, - BECDF6B30761BA81005FE872 /* libSDL2.a */, - BECDF6BE0761BA81005FE872 /* SDL2 */, - DB31407717554B71006C0E22 /* libSDL2.dylib */, - A7D88B5423E2437C00DCD162 /* SDL2.framework */, - A7D88D1523E24BED00DCD162 /* SDL2.framework */, - A7D88E5423E24D3B00DCD162 /* libSDL2.a */, - A769B23D23E259AE00872273 /* libSDL2.a */, - A75FCEB323E25AB700529352 /* libSDL2.dylib */, - A75FD06C23E25AC700529352 /* libSDL2.dylib */, - E2D187CF28A5673500D2B4F1 /* SDL2.framework */, + BECDF66C0761BA81005FE872 /* SDL3.framework */, + BECDF6B30761BA81005FE872 /* libSDL3.a */, + BECDF6BE0761BA81005FE872 /* SDL3 */, + DB31407717554B71006C0E22 /* libSDL3.dylib */, + A7D88B5423E2437C00DCD162 /* SDL3.framework */, + A7D88D1523E24BED00DCD162 /* SDL3.framework */, + A7D88E5423E24D3B00DCD162 /* libSDL3.a */, + A769B23D23E259AE00872273 /* libSDL3.a */, + A75FCEB323E25AB700529352 /* libSDL3.dylib */, + A75FD06C23E25AC700529352 /* libSDL3.dylib */, + E2D187CF28A5673500D2B4F1 /* SDL3.framework */, ); name = Products; sourceTree = ""; @@ -4408,7 +4408,7 @@ F59C70FC00D5CB5801000001 /* pkg-support */, 0153844A006D81B07F000001 /* Public Headers */, 08FB77ACFE841707C02AAC07 /* Library Source */, - E2D187D028A5673500D2B4F1 /* SDL2 */, + E2D187D028A5673500D2B4F1 /* SDL3 */, 034768DDFF38A45A11DB9C8B /* Products */, BECDF66B0761BA81005FE872 /* Info-Framework.plist */, 564624341FF821B70074AC87 /* Frameworks */, @@ -5344,12 +5344,12 @@ path = events; sourceTree = ""; }; - E2D187D028A5673500D2B4F1 /* SDL2 */ = { + E2D187D028A5673500D2B4F1 /* SDL3 */ = { isa = PBXGroup; children = ( E2D187D228A5673500D2B4F1 /* Info.plist */, ); - path = SDL2; + path = SDL3; sourceTree = ""; }; F3ADAB8C2576F08500A6B1D9 /* ios */ = { @@ -7299,13 +7299,13 @@ ); buildRules = ( ); - comments = "This produces libSDL2.dylib, which is the shared build of SDL."; + comments = "This produces libSDL3.dylib, which is the shared build of SDL."; dependencies = ( ); name = "Shared Library-iOS"; productInstallPath = /usr/local/lib; productName = "Shared Library"; - productReference = A75FCEB323E25AB700529352 /* libSDL2.dylib */; + productReference = A75FCEB323E25AB700529352 /* libSDL3.dylib */; productType = "com.apple.product-type.library.dynamic"; }; A75FCEB423E25AC700529352 /* Shared Library-tvOS */ = { @@ -7319,13 +7319,13 @@ ); buildRules = ( ); - comments = "This produces libSDL2.dylib, which is the shared build of SDL."; + comments = "This produces libSDL3.dylib, which is the shared build of SDL."; dependencies = ( ); name = "Shared Library-tvOS"; productInstallPath = /usr/local/lib; productName = "Shared Library"; - productReference = A75FD06C23E25AC700529352 /* libSDL2.dylib */; + productReference = A75FD06C23E25AC700529352 /* libSDL3.dylib */; productType = "com.apple.product-type.library.dynamic"; }; A769B08223E259AE00872273 /* Static Library-tvOS */ = { @@ -7345,7 +7345,7 @@ name = "Static Library-tvOS"; productInstallPath = /usr/local/lib; productName = "Static Library"; - productReference = A769B23D23E259AE00872273 /* libSDL2.a */; + productReference = A769B23D23E259AE00872273 /* libSDL3.a */; productType = "com.apple.product-type.library.static"; }; A7D88A1423E2437C00DCD162 /* Framework-iOS */ = { @@ -7367,7 +7367,7 @@ name = "Framework-iOS"; productInstallPath = "@executable_path/../Frameworks"; productName = SDL; - productReference = A7D88B5423E2437C00DCD162 /* SDL2.framework */; + productReference = A7D88B5423E2437C00DCD162 /* SDL3.framework */; productType = "com.apple.product-type.framework"; }; A7D88BC923E24BED00DCD162 /* Framework-tvOS */ = { @@ -7389,7 +7389,7 @@ name = "Framework-tvOS"; productInstallPath = "@executable_path/../Frameworks"; productName = SDL; - productReference = A7D88D1523E24BED00DCD162 /* SDL2.framework */; + productReference = A7D88D1523E24BED00DCD162 /* SDL3.framework */; productType = "com.apple.product-type.framework"; }; A7D88D1723E24D3B00DCD162 /* Static Library-iOS */ = { @@ -7409,7 +7409,7 @@ name = "Static Library-iOS"; productInstallPath = /usr/local/lib; productName = "Static Library"; - productReference = A7D88E5423E24D3B00DCD162 /* libSDL2.a */; + productReference = A7D88E5423E24D3B00DCD162 /* libSDL3.a */; productType = "com.apple.product-type.library.static"; }; BECDF5FE0761BA81005FE872 /* Framework */ = { @@ -7431,7 +7431,7 @@ name = Framework; productInstallPath = "@executable_path/../Frameworks"; productName = SDL; - productReference = BECDF66C0761BA81005FE872 /* SDL2.framework */; + productReference = BECDF66C0761BA81005FE872 /* SDL3.framework */; productType = "com.apple.product-type.framework"; }; BECDF66D0761BA81005FE872 /* Static Library */ = { @@ -7451,7 +7451,7 @@ name = "Static Library"; productInstallPath = /usr/local/lib; productName = "Static Library"; - productReference = BECDF6B30761BA81005FE872 /* libSDL2.a */; + productReference = BECDF6B30761BA81005FE872 /* libSDL3.a */; productType = "com.apple.product-type.library.static"; }; BECDF6BB0761BA81005FE872 /* Standard DMG */ = { @@ -7468,7 +7468,7 @@ name = "Standard DMG"; productInstallPath = /usr/local/bin; productName = "Standard Package"; - productReference = BECDF6BE0761BA81005FE872 /* SDL2 */; + productReference = BECDF6BE0761BA81005FE872 /* SDL3 */; productType = "com.apple.product-type.tool"; }; DB313F7217554B71006C0E22 /* Shared Library */ = { @@ -7482,13 +7482,13 @@ ); buildRules = ( ); - comments = "This produces libSDL2.dylib, which is the shared build of SDL."; + comments = "This produces libSDL3.dylib, which is the shared build of SDL."; dependencies = ( ); name = "Shared Library"; productInstallPath = /usr/local/lib; productName = "Shared Library"; - productReference = DB31407717554B71006C0E22 /* libSDL2.dylib */; + productReference = DB31407717554B71006C0E22 /* libSDL3.dylib */; productType = "com.apple.product-type.library.dynamic"; }; E2D187CE28A5673500D2B4F1 /* xcFramework-iOS */ = { @@ -7506,8 +7506,8 @@ dependencies = ( ); name = "xcFramework-iOS"; - productName = SDL2; - productReference = E2D187CF28A5673500D2B4F1 /* SDL2.framework */; + productName = SDL3; + productReference = E2D187CF28A5673500D2B4F1 /* SDL3.framework */; productType = "com.apple.product-type.framework"; }; /* End PBXNativeTarget section */ @@ -7645,7 +7645,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "# Sign framework\nif [ \"$SDL_CODESIGN_IDENTITY\" != \"\" ]; then\n codesign --force --deep --sign \"$SDL_CODESIGN_IDENTITY\" $TARGET_BUILD_DIR/SDL2.framework/Versions/A || exit $?\nfi\n\n# clean up the framework, remove headers, extra files\nmkdir -p build/dmg-tmp\ncp -a $TARGET_BUILD_DIR/SDL2.framework build/dmg-tmp/\n\ncp pkg-support/resources/License.txt build/dmg-tmp\ncp pkg-support/resources/ReadMe.txt build/dmg-tmp\n\n# remove the .DS_Store files if any (we may want to provide one in the future for fancy .dmgs)\nfind build/dmg-tmp -name .DS_Store -exec rm -f \"{}\" \\;\n\n# for fancy .dmg\nmkdir -p build/dmg-tmp/.logo\ncp pkg-support/resources/SDL_DS_Store build/dmg-tmp/.DS_Store\ncp pkg-support/sdl_logo.pdf build/dmg-tmp/.logo\n\n# create the dmg\nhdiutil create -ov -fs HFS+ -volname SDL2 -srcfolder build/dmg-tmp build/SDL2.dmg\n\n# clean up\nrm -rf build/dmg-tmp\n"; + shellScript = "# Sign framework\nif [ \"$SDL_CODESIGN_IDENTITY\" != \"\" ]; then\n codesign --force --deep --sign \"$SDL_CODESIGN_IDENTITY\" $TARGET_BUILD_DIR/SDL3.framework/Versions/A || exit $?\nfi\n\n# clean up the framework, remove headers, extra files\nmkdir -p build/dmg-tmp\ncp -a $TARGET_BUILD_DIR/SDL3.framework build/dmg-tmp/\n\ncp pkg-support/resources/License.txt build/dmg-tmp\ncp pkg-support/resources/ReadMe.txt build/dmg-tmp\n\n# remove the .DS_Store files if any (we may want to provide one in the future for fancy .dmgs)\nfind build/dmg-tmp -name .DS_Store -exec rm -f \"{}\" \\;\n\n# for fancy .dmg\nmkdir -p build/dmg-tmp/.logo\ncp pkg-support/resources/SDL_DS_Store build/dmg-tmp/.DS_Store\ncp pkg-support/sdl_logo.pdf build/dmg-tmp/.logo\n\n# create the dmg\nhdiutil create -ov -fs HFS+ -volname SDL3 -srcfolder build/dmg-tmp build/SDL3.dmg\n\n# clean up\nrm -rf build/dmg-tmp\n"; }; E2D187E728A5685000D2B4F1 /* ShellScript */ = { isa = PBXShellScriptBuildPhase; @@ -7662,7 +7662,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "# Build an xcframework with both device and simulator files for all platforms.\n# Adapted from an answer in\n# https://developer.apple.com/forums/thread/666335?answerId=685927022#685927022\n\nif [ \"$XCODE_VERSION_ACTUAL\" -lt 1100 ]\nthen\n\techo \"error: Building an xcframework requires Xcode 11 minimum.\"\n\texit 1\nfi\n\nSCHEME_NAME=\"Framework-iOS\"\nFRAMEWORK_NAME=\"SDL2\"\nPROJECT_NAME=\"SDL\"\n\nSIMULATOR_ARCHIVE_PATH=\"${BUILD_DIR}/${CONFIGURATION}/${FRAMEWORK_NAME}-iphonesimulator.xcarchive\"\nDEVICE_ARCHIVE_PATH=\"${BUILD_DIR}/${CONFIGURATION}/${FRAMEWORK_NAME}-iphoneos.xcarchive\"\n\nOUTPUT_DIR=\"./Products/\"\n\n# Simulator xcarchive (arm64, i386, x86_64)\nxcodebuild archive \\\n\tONLY_ACTIVE_ARCH=NO \\\n\t-scheme ${SCHEME_NAME} \\\n\t-project \"${PROJECT_NAME}.xcodeproj\" \\\n\t-archivePath ${SIMULATOR_ARCHIVE_PATH} \\\n\t-sdk iphonesimulator \\\n\tBUILD_LIBRARY_FOR_DISTRIBUTION=YES \\\n\tSKIP_INSTALL=NO\n\n# Device xcarchive (arm64, armv7)\nxcodebuild archive \\\n\t-scheme ${SCHEME_NAME} \\\n\t-project \"${PROJECT_NAME}.xcodeproj\" \\\n\t-archivePath ${DEVICE_ARCHIVE_PATH} \\\n\t-sdk iphoneos \\\n\tBUILD_LIBRARY_FOR_DISTRIBUTION=YES \\\n\tSKIP_INSTALL=NO\n\n# Clean-up any existing instance of this xcframework from the Products directory\nrm -rf \"${OUTPUT_DIR}${FRAMEWORK_NAME}.xcframework\"\n\n# Create final xcframework\nxcodebuild -create-xcframework \\\n\t-framework \"${DEVICE_ARCHIVE_PATH}\"/Products/Library/Frameworks/${FRAMEWORK_NAME}.framework \\\n\t-framework \"${SIMULATOR_ARCHIVE_PATH}\"/Products/Library/Frameworks/${FRAMEWORK_NAME}.framework \\\n\t-output ${OUTPUT_DIR}/${FRAMEWORK_NAME}.xcframework\n\n# Ensure git doesn't pick up on our Products folder. \nrm -rf ${OUTPUT_DIR}/.gitignore\necho \"*\" >> ${OUTPUT_DIR}/.gitignore\n"; + shellScript = "# Build an xcframework with both device and simulator files for all platforms.\n# Adapted from an answer in\n# https://developer.apple.com/forums/thread/666335?answerId=685927022#685927022\n\nif [ \"$XCODE_VERSION_ACTUAL\" -lt 1100 ]\nthen\n\techo \"error: Building an xcframework requires Xcode 11 minimum.\"\n\texit 1\nfi\n\nSCHEME_NAME=\"Framework-iOS\"\nFRAMEWORK_NAME=\"SDL3\"\nPROJECT_NAME=\"SDL\"\n\nSIMULATOR_ARCHIVE_PATH=\"${BUILD_DIR}/${CONFIGURATION}/${FRAMEWORK_NAME}-iphonesimulator.xcarchive\"\nDEVICE_ARCHIVE_PATH=\"${BUILD_DIR}/${CONFIGURATION}/${FRAMEWORK_NAME}-iphoneos.xcarchive\"\n\nOUTPUT_DIR=\"./Products/\"\n\n# Simulator xcarchive (arm64, i386, x86_64)\nxcodebuild archive \\\n\tONLY_ACTIVE_ARCH=NO \\\n\t-scheme ${SCHEME_NAME} \\\n\t-project \"${PROJECT_NAME}.xcodeproj\" \\\n\t-archivePath ${SIMULATOR_ARCHIVE_PATH} \\\n\t-sdk iphonesimulator \\\n\tBUILD_LIBRARY_FOR_DISTRIBUTION=YES \\\n\tSKIP_INSTALL=NO\n\n# Device xcarchive (arm64, armv7)\nxcodebuild archive \\\n\t-scheme ${SCHEME_NAME} \\\n\t-project \"${PROJECT_NAME}.xcodeproj\" \\\n\t-archivePath ${DEVICE_ARCHIVE_PATH} \\\n\t-sdk iphoneos \\\n\tBUILD_LIBRARY_FOR_DISTRIBUTION=YES \\\n\tSKIP_INSTALL=NO\n\n# Clean-up any existing instance of this xcframework from the Products directory\nrm -rf \"${OUTPUT_DIR}${FRAMEWORK_NAME}.xcframework\"\n\n# Create final xcframework\nxcodebuild -create-xcframework \\\n\t-framework \"${DEVICE_ARCHIVE_PATH}\"/Products/Library/Frameworks/${FRAMEWORK_NAME}.framework \\\n\t-framework \"${SIMULATOR_ARCHIVE_PATH}\"/Products/Library/Frameworks/${FRAMEWORK_NAME}.framework \\\n\t-output ${OUTPUT_DIR}/${FRAMEWORK_NAME}.xcframework\n\n# Ensure git doesn't pick up on our Products folder. \nrm -rf ${OUTPUT_DIR}/.gitignore\necho \"*\" >> ${OUTPUT_DIR}/.gitignore\n"; }; F3ED8106281DB8A500C33C5B /* Convert SDL includes to SDL Framework includes */ = { isa = PBXShellScriptBuildPhase; @@ -7680,7 +7680,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "cd \"$BUILT_PRODUCTS_DIR/$PUBLIC_HEADERS_FOLDER_PATH\"\nsed -i '' -e 's,#include \"\\(.*\\)\",#include ,' *.h\n"; + shellScript = "cd \"$BUILT_PRODUCTS_DIR/$PUBLIC_HEADERS_FOLDER_PATH\"\nsed -i '' -e 's,#include \"\\(.*\\)\",#include ,' *.h\n"; }; F3ED8107281DB8E600C33C5B /* Convert SDL includes to SDL Framework includes */ = { isa = PBXShellScriptBuildPhase; @@ -7698,7 +7698,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "cd \"$BUILT_PRODUCTS_DIR/$PUBLIC_HEADERS_FOLDER_PATH\"\nsed -i '' -e 's,#include \"\\(.*\\)\",#include ,' *.h\n"; + shellScript = "cd \"$BUILT_PRODUCTS_DIR/$PUBLIC_HEADERS_FOLDER_PATH\"\nsed -i '' -e 's,#include \"\\(.*\\)\",#include ,' *.h\n"; }; F3ED8108281DB8F200C33C5B /* Convert SDL includes to SDL Framework includes */ = { isa = PBXShellScriptBuildPhase; @@ -7716,7 +7716,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "cd \"$BUILT_PRODUCTS_DIR/$PUBLIC_HEADERS_FOLDER_PATH\"\nsed -i '' -e 's,#include \"\\(.*\\)\",#include ,' *.h\n"; + shellScript = "cd \"$BUILT_PRODUCTS_DIR/$PUBLIC_HEADERS_FOLDER_PATH\"\nsed -i '' -e 's,#include \"\\(.*\\)\",#include ,' *.h\n"; }; /* End PBXShellScriptBuildPhase section */ @@ -9528,8 +9528,8 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEPLOYMENT_POSTPROCESSING = YES; - DYLIB_COMPATIBILITY_VERSION = 2601.0.0; - DYLIB_CURRENT_VERSION = 2601.0.0; + DYLIB_COMPATIBILITY_VERSION = 1.0.0; + DYLIB_CURRENT_VERSION = 1.0.0; DYLIB_INSTALL_NAME_BASE = "@rpath"; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_ALTIVEC_EXTENSIONS = YES; @@ -9559,8 +9559,8 @@ "@loader_path/Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 10.9; - PRODUCT_BUNDLE_IDENTIFIER = org.libsdl.SDL2; - PRODUCT_NAME = SDL2; + PRODUCT_BUNDLE_IDENTIFIER = org.libsdl.SDL3; + PRODUCT_NAME = SDL3; STRIP_STYLE = "non-global"; TVOS_DEPLOYMENT_TARGET = 9.0; }; @@ -9570,7 +9570,7 @@ isa = XCBuildConfiguration; buildSettings = { CLANG_LINK_OBJC_RUNTIME = NO; - MARKETING_VERSION = 2.0.17; + MARKETING_VERSION = 3.0.0; OTHER_LDFLAGS = "-liconv"; }; name = Release; @@ -9613,8 +9613,8 @@ CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; DEBUG_INFORMATION_FORMAT = dwarf; - DYLIB_COMPATIBILITY_VERSION = 2601.0.0; - DYLIB_CURRENT_VERSION = 2601.0.0; + DYLIB_COMPATIBILITY_VERSION = 1.0.0; + DYLIB_CURRENT_VERSION = 1.0.0; DYLIB_INSTALL_NAME_BASE = "@rpath"; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; @@ -9645,8 +9645,8 @@ ); MACOSX_DEPLOYMENT_TARGET = 10.9; ONLY_ACTIVE_ARCH = NO; - PRODUCT_BUNDLE_IDENTIFIER = org.libsdl.SDL2; - PRODUCT_NAME = SDL2; + PRODUCT_BUNDLE_IDENTIFIER = org.libsdl.SDL3; + PRODUCT_NAME = SDL3; STRIP_INSTALLED_PRODUCT = NO; TVOS_DEPLOYMENT_TARGET = 9.0; }; @@ -9656,7 +9656,7 @@ isa = XCBuildConfiguration; buildSettings = { CLANG_LINK_OBJC_RUNTIME = NO; - MARKETING_VERSION = 2.0.17; + MARKETING_VERSION = 3.0.0; OTHER_LDFLAGS = "-liconv"; }; name = Debug; @@ -9862,8 +9862,8 @@ CURRENT_PROJECT_VERSION = 1; DEFINES_MODULE = YES; DEVELOPMENT_TEAM = ""; - DYLIB_COMPATIBILITY_VERSION = 2601.0.0; - DYLIB_CURRENT_VERSION = 2601.0.0; + DYLIB_COMPATIBILITY_VERSION = 1.0.0; + DYLIB_CURRENT_VERSION = 1.0.0; DYLIB_INSTALL_NAME_BASE = "@rpath"; GCC_C_LANGUAGE_STANDARD = gnu11; GCC_DYNAMIC_NO_PIC = NO; @@ -9873,7 +9873,7 @@ ); GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - INFOPLIST_FILE = SDL2/Info.plist; + INFOPLIST_FILE = SDL3/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; IPHONEOS_DEPLOYMENT_TARGET = 12.1; LD_RUNPATH_SEARCH_PATHS = ( @@ -9885,7 +9885,7 @@ MTL_FAST_MATH = YES; OTHER_LDFLAGS = "-liconv"; PRODUCT_BUNDLE_IDENTIFIER = ""; - PRODUCT_NAME = SDL2; + PRODUCT_NAME = SDL3; SDKROOT = iphoneos; SKIP_INSTALL = NO; SUPPORTS_MACCATALYST = NO; @@ -9914,14 +9914,14 @@ CURRENT_PROJECT_VERSION = 1; DEFINES_MODULE = YES; DEVELOPMENT_TEAM = ""; - DYLIB_COMPATIBILITY_VERSION = 2601.0.0; - DYLIB_CURRENT_VERSION = 2601.0.0; + DYLIB_COMPATIBILITY_VERSION = 1.0.0; + DYLIB_CURRENT_VERSION = 1.0.0; DYLIB_INSTALL_NAME_BASE = "@rpath"; ENABLE_NS_ASSERTIONS = NO; GCC_C_LANGUAGE_STANDARD = gnu11; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - INFOPLIST_FILE = SDL2/Info.plist; + INFOPLIST_FILE = SDL3/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; IPHONEOS_DEPLOYMENT_TARGET = 12.1; LD_RUNPATH_SEARCH_PATHS = ( @@ -9933,7 +9933,7 @@ MTL_FAST_MATH = YES; OTHER_LDFLAGS = "-liconv"; PRODUCT_BUNDLE_IDENTIFIER = ""; - PRODUCT_NAME = SDL2; + PRODUCT_NAME = SDL3; SDKROOT = iphoneos; SKIP_INSTALL = NO; SUPPORTS_MACCATALYST = NO; diff --git a/Xcode/SDL/SDL.xcodeproj/xcshareddata/xcschemes/Framework-iOS.xcscheme b/Xcode/SDL/SDL.xcodeproj/xcshareddata/xcschemes/Framework-iOS.xcscheme index b797feacb8..9c01052f2a 100644 --- a/Xcode/SDL/SDL.xcodeproj/xcshareddata/xcschemes/Framework-iOS.xcscheme +++ b/Xcode/SDL/SDL.xcodeproj/xcshareddata/xcschemes/Framework-iOS.xcscheme @@ -15,7 +15,7 @@ @@ -51,7 +51,7 @@ diff --git a/Xcode/SDL/SDL.xcodeproj/xcshareddata/xcschemes/xcFramework-iOS.xcscheme b/Xcode/SDL/SDL.xcodeproj/xcshareddata/xcschemes/xcFramework-iOS.xcscheme index 82b4643736..36ddd8e2ae 100644 --- a/Xcode/SDL/SDL.xcodeproj/xcshareddata/xcschemes/xcFramework-iOS.xcscheme +++ b/Xcode/SDL/SDL.xcodeproj/xcshareddata/xcschemes/xcFramework-iOS.xcscheme @@ -15,7 +15,7 @@ @@ -51,7 +51,7 @@ diff --git a/Xcode/SDL/SDL2/Info.plist b/Xcode/SDL/SDL3/Info.plist similarity index 100% rename from Xcode/SDL/SDL2/Info.plist rename to Xcode/SDL/SDL3/Info.plist diff --git a/Xcode/SDL/pkg-support/SDL.info b/Xcode/SDL/pkg-support/SDL.info index f08facd234..c60abf3a3a 100644 --- a/Xcode/SDL/pkg-support/SDL.info +++ b/Xcode/SDL/pkg-support/SDL.info @@ -1,4 +1,4 @@ -Title SDL 2.0.0 +Title SDL 3.0.0 Version 1 Description SDL Library for Mac OS X (http://www.libsdl.org) DefaultLocation /Library/Frameworks diff --git a/Xcode/SDL/pkg-support/resources/CMake/sdl2-config.cmake b/Xcode/SDL/pkg-support/resources/CMake/sdl2-config.cmake deleted file mode 100644 index 28c34bc705..0000000000 --- a/Xcode/SDL/pkg-support/resources/CMake/sdl2-config.cmake +++ /dev/null @@ -1,69 +0,0 @@ -# SDL2 CMake configuration file: -# This file is meant to be placed in Resources/CMake of a SDL2 framework - -# INTERFACE_LINK_OPTIONS needs CMake 3.12 -cmake_minimum_required(VERSION 3.12) - -include(FeatureSummary) -set_package_properties(SDL2 PROPERTIES - URL "https://www.libsdl.org/" - DESCRIPTION "low level access to audio, keyboard, mouse, joystick, and graphics hardware" -) - -# Copied from `configure_package_config_file` -macro(set_and_check _var _file) - set(${_var} "${_file}") - if(NOT EXISTS "${_file}") - message(FATAL_ERROR "File or directory ${_file} referenced by variable ${_var} does not exist !") - endif() -endmacro() - -# Copied from `configure_package_config_file` -macro(check_required_components _NAME) - foreach(comp ${${_NAME}_FIND_COMPONENTS}) - if(NOT ${_NAME}_${comp}_FOUND) - if(${_NAME}_FIND_REQUIRED_${comp}) - set(${_NAME}_FOUND FALSE) - endif() - endif() - endforeach() -endmacro() - -set(SDL2_FOUND TRUE) - -string(REGEX REPLACE "SDL2\\.framework.*" "SDL2.framework" SDL2_FRAMEWORK_PATH "${CMAKE_CURRENT_LIST_DIR}") -string(REGEX REPLACE "SDL2\\.framework.*" "" SDL2_FRAMEWORK_PARENT_PATH "${CMAKE_CURRENT_LIST_DIR}") - -# For compatibility with autotools sdl2-config.cmake, provide SDL2_* variables. - -set_and_check(SDL2_PREFIX "${SDL2_FRAMEWORK_PATH}") -set_and_check(SDL2_EXEC_PREFIX "${SDL2_FRAMEWORK_PATH}") -set_and_check(SDL2_INCLUDE_DIR "${SDL2_FRAMEWORK_PATH}/Headers") -set(SDL2_INCLUDE_DIRS "${SDL2_INCLUDE_DIR};${SDL2_FRAMEWORK_PATH}") -set_and_check(SDL2_BINDIR "${SDL2_FRAMEWORK_PATH}") -set_and_check(SDL2_LIBDIR "${SDL2_FRAMEWORK_PATH}") - -set(SDL2_LIBRARIES "SDL2::SDL2") - -# All targets are created, even when some might not be requested though COMPONENTS. -# This is done for compatibility with CMake generated SDL2-target.cmake files. - -if(NOT TARGET SDL2::SDL2) - add_library(SDL2::SDL2 INTERFACE IMPORTED) - set_target_properties(SDL2::SDL2 - PROPERTIES - INTERFACE_COMPILE_OPTIONS "SHELL:-F \"${SDL2_FRAMEWORK_PARENT_PATH}\"" - INTERFACE_INCLUDE_DIRECTORIES "${SDL2_INCLUDE_DIRS}" - INTERFACE_LINK_OPTIONS "SHELL:-F \"${SDL2_FRAMEWORK_PARENT_PATH}\";SHELL:-framework SDL2" - COMPATIBLE_INTERFACE_BOOL "SDL2_SHARED" - INTERFACE_SDL2_SHARED "ON" - ) -endif() -set(SDL2_SDL2_FOUND TRUE) - -if(NOT TARGET SDL2::SDL2main) - add_library(SDL2::SDL2main INTERFACE IMPORTED) -endif() -set(SDL2_SDL2main_FOUND TRUE) - -check_required_components(SDL2) diff --git a/Xcode/SDL/pkg-support/resources/CMake/sdl2-config-version.cmake b/Xcode/SDL/pkg-support/resources/CMake/sdl3-config-version.cmake similarity index 94% rename from Xcode/SDL/pkg-support/resources/CMake/sdl2-config-version.cmake rename to Xcode/SDL/pkg-support/resources/CMake/sdl3-config-version.cmake index feea76e5f7..6dbcf12988 100644 --- a/Xcode/SDL/pkg-support/resources/CMake/sdl2-config-version.cmake +++ b/Xcode/SDL/pkg-support/resources/CMake/sdl3-config-version.cmake @@ -1,10 +1,10 @@ # based on the files generated by CMake's write_basic_package_version_file -# SDL2 CMake version configuration file: -# This file is meant to be placed in Resources/CMake of a SDL2 framework +# SDL CMake version configuration file: +# This file is meant to be placed in Resources/CMake of a SDL3 framework if(NOT EXISTS "${CMAKE_CURRENT_LIST_DIR}/../../Headers/SDL_version.h") - message(AUTHOR_WARNING "Could not find SDL_version.h. This script is meant to be placed in the Resources/CMake directory of SDL2.framework") + message(AUTHOR_WARNING "Could not find SDL_version.h. This script is meant to be placed in the Resources/CMake directory of SDL3.framework") return() endif() diff --git a/Xcode/SDL/pkg-support/resources/CMake/sdl3-config.cmake b/Xcode/SDL/pkg-support/resources/CMake/sdl3-config.cmake new file mode 100644 index 0000000000..c62043a2e2 --- /dev/null +++ b/Xcode/SDL/pkg-support/resources/CMake/sdl3-config.cmake @@ -0,0 +1,69 @@ +# SDL CMake configuration file: +# This file is meant to be placed in Resources/CMake of a SDL3 framework + +# INTERFACE_LINK_OPTIONS needs CMake 3.12 +cmake_minimum_required(VERSION 3.12) + +include(FeatureSummary) +set_package_properties(SDL3 PROPERTIES + URL "https://www.libsdl.org/" + DESCRIPTION "low level access to audio, keyboard, mouse, joystick, and graphics hardware" +) + +# Copied from `configure_package_config_file` +macro(set_and_check _var _file) + set(${_var} "${_file}") + if(NOT EXISTS "${_file}") + message(FATAL_ERROR "File or directory ${_file} referenced by variable ${_var} does not exist !") + endif() +endmacro() + +# Copied from `configure_package_config_file` +macro(check_required_components _NAME) + foreach(comp ${${_NAME}_FIND_COMPONENTS}) + if(NOT ${_NAME}_${comp}_FOUND) + if(${_NAME}_FIND_REQUIRED_${comp}) + set(${_NAME}_FOUND FALSE) + endif() + endif() + endforeach() +endmacro() + +set(SDL3_FOUND TRUE) + +string(REGEX REPLACE "SDL3\\.framework.*" "SDL3.framework" SDL3_FRAMEWORK_PATH "${CMAKE_CURRENT_LIST_DIR}") +string(REGEX REPLACE "SDL3\\.framework.*" "" SDL3_FRAMEWORK_PARENT_PATH "${CMAKE_CURRENT_LIST_DIR}") + +# For compatibility with autotools sdl3-config.cmake, provide SDL3_* variables. + +set_and_check(SDL3_PREFIX "${SDL3_FRAMEWORK_PATH}") +set_and_check(SDL3_EXEC_PREFIX "${SDL3_FRAMEWORK_PATH}") +set_and_check(SDL3_INCLUDE_DIR "${SDL3_FRAMEWORK_PATH}/Headers") +set(SDL3_INCLUDE_DIRS "${SDL3_INCLUDE_DIR};${SDL3_FRAMEWORK_PATH}") +set_and_check(SDL3_BINDIR "${SDL3_FRAMEWORK_PATH}") +set_and_check(SDL3_LIBDIR "${SDL3_FRAMEWORK_PATH}") + +set(SDL3_LIBRARIES "SDL3::SDL3") + +# All targets are created, even when some might not be requested though COMPONENTS. +# This is done for compatibility with CMake generated SDL3-target.cmake files. + +if(NOT TARGET SDL3::SDL3) + add_library(SDL3::SDL3 INTERFACE IMPORTED) + set_target_properties(SDL3::SDL3 + PROPERTIES + INTERFACE_COMPILE_OPTIONS "SHELL:-F \"${SDL3_FRAMEWORK_PARENT_PATH}\"" + INTERFACE_INCLUDE_DIRECTORIES "${SDL3_INCLUDE_DIRS}" + INTERFACE_LINK_OPTIONS "SHELL:-F \"${SDL3_FRAMEWORK_PARENT_PATH}\";SHELL:-framework SDL3" + COMPATIBLE_INTERFACE_BOOL "SDL3_SHARED" + INTERFACE_SDL3_SHARED "ON" + ) +endif() +set(SDL3_SDL3_FOUND TRUE) + +if(NOT TARGET SDL3::SDL3main) + add_library(SDL3::SDL3main INTERFACE IMPORTED) +endif() +set(SDL3_SDL3main_FOUND TRUE) + +check_required_components(SDL3) diff --git a/Xcode/SDL/pkg-support/resources/ReadMe.txt b/Xcode/SDL/pkg-support/resources/ReadMe.txt index 9f495913c6..9e2976c601 100644 --- a/Xcode/SDL/pkg-support/resources/ReadMe.txt +++ b/Xcode/SDL/pkg-support/resources/ReadMe.txt @@ -15,20 +15,20 @@ contains both the SDL runtime component and development header files. To Install: -Copy the SDL2.framework to /Library/Frameworks +Copy the SDL3.framework to /Library/Frameworks You may alternatively install it in /Library/Frameworks if your access privileges are not high enough. Use in CMake projects: -SDL2.framework can be used in CMake projects using the following pattern: +SDL3.framework can be used in CMake projects using the following pattern: ``` -find_package(SDL2 REQUIRED COMPONENTS SDL2) +find_package(SDL3 REQUIRED COMPONENTS SDL3) add_executable(my_game ${MY_SOURCES}) -target_link_libraries(my_game PRIVATE SDL2::SDL2) +target_link_libraries(my_game PRIVATE SDL3::SDL3) ``` -If SDL2.framework is installed in a non-standard location, +If SDL3.framework is installed in a non-standard location, please refer to the following link for ways to configure CMake: https://cmake.org/cmake/help/latest/command/find_package.html#config-mode-search-procedure diff --git a/Xcode/SDL/pkg-support/resources/SDL_DS_Store b/Xcode/SDL/pkg-support/resources/SDL_DS_Store index 5658d15e4f13fbfd8a786e55c8b7a04cd1229cf8..99e0b237aef593f57ba9edeb417f27a0c07cee93 100644 GIT binary patch delta 86 zcmZpvXsy`bCd6nwu~2++oX|o><4M99jK-5Qg{?V^b&JaNQgYKL7Mf0eD7>7}cygym nHly+8uOgcm8I3ou5StC6TqK?_F&b~yl&<3j397}2GI9X`<qe;RUj7F0)g{?V^bc@RMQgYKL7Mf0eD7>7}XmY1W lHlxwzuOgcm8I3lt5StC6TqK?_F&b^wl&<3j397}20syTr8+rf$ diff --git a/Xcode/SDLTest/SDLTest.xcodeproj/project.pbxproj b/Xcode/SDLTest/SDLTest.xcodeproj/project.pbxproj index 1d5183a7da..051c920068 100644 --- a/Xcode/SDLTest/SDLTest.xcodeproj/project.pbxproj +++ b/Xcode/SDLTest/SDLTest.xcodeproj/project.pbxproj @@ -1222,17 +1222,17 @@ 003FA63B093FFD41000C53B3 /* Products */ = { isa = PBXGroup; children = ( - 003FA643093FFD41000C53B3 /* SDL2.framework */, - F3C17C5D28E3FB2900E1A26D /* SDL2.framework */, - F3C17C5F28E3FB2900E1A26D /* SDL2.framework */, - F3C17C6128E3FB2900E1A26D /* SDL2.framework */, - 003FA645093FFD41000C53B3 /* libSDL2.a */, - F3C17C6328E3FB2900E1A26D /* libSDL2.a */, - F3C17C6528E3FB2900E1A26D /* libSDL2.a */, - DB1D40D717B3F30D00D74CFC /* libSDL2.dylib */, - F3C17C6728E3FB2900E1A26D /* libSDL2.dylib */, - F3C17C6928E3FB2900E1A26D /* libSDL2.dylib */, - 003FA649093FFD41000C53B3 /* SDL2 */, + 003FA643093FFD41000C53B3 /* SDL3.framework */, + F3C17C5D28E3FB2900E1A26D /* SDL3.framework */, + F3C17C5F28E3FB2900E1A26D /* SDL3.framework */, + F3C17C6128E3FB2900E1A26D /* SDL3.framework */, + 003FA645093FFD41000C53B3 /* libSDL3.a */, + F3C17C6328E3FB2900E1A26D /* libSDL3.a */, + F3C17C6528E3FB2900E1A26D /* libSDL3.a */, + DB1D40D717B3F30D00D74CFC /* libSDL3.dylib */, + F3C17C6728E3FB2900E1A26D /* libSDL3.dylib */, + F3C17C6928E3FB2900E1A26D /* libSDL3.dylib */, + 003FA649093FFD41000C53B3 /* SDL3 */, ); name = Products; sourceTree = ""; @@ -2298,80 +2298,80 @@ /* End PBXProject section */ /* Begin PBXReferenceProxy section */ - 003FA643093FFD41000C53B3 /* SDL2.framework */ = { + 003FA643093FFD41000C53B3 /* SDL3.framework */ = { isa = PBXReferenceProxy; fileType = wrapper.framework; - path = SDL2.framework; + path = SDL3.framework; remoteRef = 003FA642093FFD41000C53B3 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 003FA645093FFD41000C53B3 /* libSDL2.a */ = { + 003FA645093FFD41000C53B3 /* libSDL3.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; - path = libSDL2.a; + path = libSDL3.a; remoteRef = 003FA644093FFD41000C53B3 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 003FA649093FFD41000C53B3 /* SDL2 */ = { + 003FA649093FFD41000C53B3 /* SDL3 */ = { isa = PBXReferenceProxy; fileType = "compiled.mach-o.executable"; - path = SDL2; + path = SDL3; remoteRef = 003FA648093FFD41000C53B3 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - DB1D40D717B3F30D00D74CFC /* libSDL2.dylib */ = { + DB1D40D717B3F30D00D74CFC /* libSDL3.dylib */ = { isa = PBXReferenceProxy; fileType = "compiled.mach-o.dylib"; - path = libSDL2.dylib; + path = libSDL3.dylib; remoteRef = DB1D40D617B3F30D00D74CFC /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - F3C17C5D28E3FB2900E1A26D /* SDL2.framework */ = { + F3C17C5D28E3FB2900E1A26D /* SDL3.framework */ = { isa = PBXReferenceProxy; fileType = wrapper.framework; - path = SDL2.framework; + path = SDL3.framework; remoteRef = F3C17C5C28E3FB2900E1A26D /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - F3C17C5F28E3FB2900E1A26D /* SDL2.framework */ = { + F3C17C5F28E3FB2900E1A26D /* SDL3.framework */ = { isa = PBXReferenceProxy; fileType = wrapper.framework; - path = SDL2.framework; + path = SDL3.framework; remoteRef = F3C17C5E28E3FB2900E1A26D /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - F3C17C6128E3FB2900E1A26D /* SDL2.framework */ = { + F3C17C6128E3FB2900E1A26D /* SDL3.framework */ = { isa = PBXReferenceProxy; fileType = wrapper.framework; - path = SDL2.framework; + path = SDL3.framework; remoteRef = F3C17C6028E3FB2900E1A26D /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - F3C17C6328E3FB2900E1A26D /* libSDL2.a */ = { + F3C17C6328E3FB2900E1A26D /* libSDL3.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; - path = libSDL2.a; + path = libSDL3.a; remoteRef = F3C17C6228E3FB2900E1A26D /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - F3C17C6528E3FB2900E1A26D /* libSDL2.a */ = { + F3C17C6528E3FB2900E1A26D /* libSDL3.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; - path = libSDL2.a; + path = libSDL3.a; remoteRef = F3C17C6428E3FB2900E1A26D /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - F3C17C6728E3FB2900E1A26D /* libSDL2.dylib */ = { + F3C17C6728E3FB2900E1A26D /* libSDL3.dylib */ = { isa = PBXReferenceProxy; fileType = "compiled.mach-o.dylib"; - path = libSDL2.dylib; + path = libSDL3.dylib; remoteRef = F3C17C6628E3FB2900E1A26D /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - F3C17C6928E3FB2900E1A26D /* libSDL2.dylib */ = { + F3C17C6928E3FB2900E1A26D /* libSDL3.dylib */ = { isa = PBXReferenceProxy; fileType = "compiled.mach-o.dylib"; - path = libSDL2.dylib; + path = libSDL3.dylib; remoteRef = F3C17C6828E3FB2900E1A26D /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; diff --git a/Xcode/SDLTest/config.xcconfig b/Xcode/SDLTest/config.xcconfig index a73eec4d7e..1e6a3ff4b7 100644 --- a/Xcode/SDLTest/config.xcconfig +++ b/Xcode/SDLTest/config.xcconfig @@ -9,6 +9,6 @@ // Include any optional config for this build #include? "build.xcconfig" -CONFIG_FRAMEWORK_LDFLAGS[sdk=macos*] = $(inherited) -framework SDL2 -framework AudioToolbox -framework Carbon -framework Cocoa -framework CoreAudio -framework CoreHaptics -framework CoreVideo -framework ForceFeedback -framework GameController -framework IOKit -framework Metal -CONFIG_FRAMEWORK_LDFLAGS[sdk=iphone*] = $(inherited) -framework SDL2 -framework AVFoundation -framework AudioToolbox -framework CoreGraphics -framework CoreHaptics -framework CoreMotion -framework Foundation -framework GameController -framework Metal -framework OpenGLES -framework QuartzCore -framework UIKit -CONFIG_FRAMEWORK_LDFLAGS[sdk=appletv*] = $(inherited) -framework SDL2 -framework AVFoundation -framework AudioToolbox -framework CoreGraphics -framework CoreHaptics -framework Foundation -framework GameController -framework Metal -framework OpenGLES -framework QuartzCore -framework UIKit +CONFIG_FRAMEWORK_LDFLAGS[sdk=macos*] = $(inherited) -framework SDL3 -framework AudioToolbox -framework Carbon -framework Cocoa -framework CoreAudio -framework CoreHaptics -framework CoreVideo -framework ForceFeedback -framework GameController -framework IOKit -framework Metal +CONFIG_FRAMEWORK_LDFLAGS[sdk=iphone*] = $(inherited) -framework SDL3 -framework AVFoundation -framework AudioToolbox -framework CoreGraphics -framework CoreHaptics -framework CoreMotion -framework Foundation -framework GameController -framework Metal -framework OpenGLES -framework QuartzCore -framework UIKit +CONFIG_FRAMEWORK_LDFLAGS[sdk=appletv*] = $(inherited) -framework SDL3 -framework AVFoundation -framework AudioToolbox -framework CoreGraphics -framework CoreHaptics -framework Foundation -framework GameController -framework Metal -framework OpenGLES -framework QuartzCore -framework UIKit diff --git a/android-project-ant/jni/src/Android.mk b/android-project-ant/jni/src/Android.mk index 1adcb6e9aa..7ed3d6de25 100644 --- a/android-project-ant/jni/src/Android.mk +++ b/android-project-ant/jni/src/Android.mk @@ -11,7 +11,7 @@ LOCAL_C_INCLUDES := $(LOCAL_PATH)/$(SDL_PATH)/include # Add your application source files here... LOCAL_SRC_FILES := YourSourceHere.c -LOCAL_SHARED_LIBRARIES := SDL2 +LOCAL_SHARED_LIBRARIES := SDL3 LOCAL_LDLIBS := -lGLESv1_CM -lGLESv2 -llog diff --git a/android-project-ant/jni/src/Android_static.mk b/android-project-ant/jni/src/Android_static.mk index faed669c0e..e49ca4d319 100644 --- a/android-project-ant/jni/src/Android_static.mk +++ b/android-project-ant/jni/src/Android_static.mk @@ -6,7 +6,7 @@ LOCAL_MODULE := main LOCAL_SRC_FILES := YourSourceHere.c -LOCAL_STATIC_LIBRARIES := SDL2_static +LOCAL_STATIC_LIBRARIES := SDL3_static include $(BUILD_SHARED_LIBRARY) $(call import-module,SDL)LOCAL_PATH := $(call my-dir) diff --git a/android-project/app/jni/src/Android.mk b/android-project/app/jni/src/Android.mk index 04e006ae9d..982f661703 100644 --- a/android-project/app/jni/src/Android.mk +++ b/android-project/app/jni/src/Android.mk @@ -11,7 +11,7 @@ LOCAL_C_INCLUDES := $(LOCAL_PATH)/$(SDL_PATH)/include # Add your application source files here... LOCAL_SRC_FILES := YourSourceHere.c -LOCAL_SHARED_LIBRARIES := SDL2 +LOCAL_SHARED_LIBRARIES := SDL3 LOCAL_LDLIBS := -lGLESv1_CM -lGLESv2 -lOpenSLES -llog -landroid diff --git a/android-project/app/jni/src/CMakeLists.txt b/android-project/app/jni/src/CMakeLists.txt index fb021f9f8f..aaac0c80d6 100644 --- a/android-project/app/jni/src/CMakeLists.txt +++ b/android-project/app/jni/src/CMakeLists.txt @@ -2,12 +2,12 @@ cmake_minimum_required(VERSION 3.6) project(MY_APP) -find_library(SDL2 SDL2) +find_library(SDL3 SDL3) add_library(main SHARED) target_sources(main PRIVATE YourSourceHere.c) -target_link_libraries(main SDL2) +target_link_libraries(main SDL3) diff --git a/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java b/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java index 90e3ac60b6..0472e18507 100644 --- a/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java +++ b/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java @@ -59,8 +59,8 @@ import java.util.Locale; */ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityChangeListener { private static final String TAG = "SDL"; - private static final int SDL_MAJOR_VERSION = 2; - private static final int SDL_MINOR_VERSION = 26; + private static final int SDL_MAJOR_VERSION = 3; + private static final int SDL_MINOR_VERSION = 0; private static final int SDL_MICRO_VERSION = 0; /* // Display InputType.SOURCE/CLASS of events and devices @@ -263,17 +263,17 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh * This method is called by SDL before loading the native shared libraries. * It can be overridden to provide names of shared libraries to be loaded. * The default implementation returns the defaults. It never returns null. - * An array returned by a new implementation must at least contain "SDL2". + * An array returned by a new implementation must at least contain "SDL3". * Also keep in mind that the order the libraries are loaded may matter. - * @return names of shared libraries to be loaded (e.g. "SDL2", "main"). + * @return names of shared libraries to be loaded (e.g. "SDL3", "main"). */ protected String[] getLibraries() { return new String[] { - "SDL2", - // "SDL2_image", - // "SDL2_mixer", - // "SDL2_net", - // "SDL2_ttf", + "SDL3", + // "SDL3_image", + // "SDL3_mixer", + // "SDL3_net", + // "SDL3_ttf", "main" }; } diff --git a/build-scripts/android-prefab.sh b/build-scripts/android-prefab.sh index aef588eeb1..25201c9099 100755 --- a/build-scripts/android-prefab.sh +++ b/build-scripts/android-prefab.sh @@ -61,8 +61,8 @@ build_cmake_projects() { -DSDL_STATIC=ON \ -DSDL_STATIC_PIC=ON \ -DSDL_TEST=ON \ - -DSDL2_DISABLE_SDL2MAIN=OFF \ - -DSDL2_DISABLE_INSTALL=OFF \ + -DSDL3_DISABLE_SDL3MAIN=OFF \ + -DSDL3_DISABLE_INSTALL=OFF \ -DCMAKE_INSTALL_PREFIX="${build_root}/build_${android_abi}/prefix" \ -DCMAKE_INSTALL_INCLUDEDIR=include \ -DCMAKE_INSTALL_LIBDIR=lib \ diff --git a/build-scripts/androidbuildlibs.sh b/build-scripts/androidbuildlibs.sh index dc72172936..39df9e551b 100755 --- a/build-scripts/androidbuildlibs.sh +++ b/build-scripts/androidbuildlibs.sh @@ -69,5 +69,5 @@ ndk-build \ APP_BUILD_SCRIPT=Android.mk \ APP_ABI="armeabi-v7a arm64-v8a x86 x86_64" \ APP_PLATFORM=android-16 \ - APP_MODULES="SDL2 SDL2_main" \ + APP_MODULES="SDL3 SDL3_main" \ $ndk_args diff --git a/build-scripts/emscripten-buildbot.sh b/build-scripts/emscripten-buildbot.sh index 8538c45aec..c8b201755d 100755 --- a/build-scripts/emscripten-buildbot.sh +++ b/build-scripts/emscripten-buildbot.sh @@ -55,7 +55,7 @@ mkdir buildbot pushd buildbot echo "Configuring..." -emconfigure ../configure --host=wasm32-unknown-emscripten --disable-assembly --disable-threads --disable-cpuinfo CFLAGS="-s USE_SDL=0 -O2 -Wno-warn-absolute-paths -Wdeclaration-after-statement -Werror=declaration-after-statement" --prefix="$PWD/emscripten-sdl2-installed" || exit $? +emconfigure ../configure --host=wasm32-unknown-emscripten --disable-assembly --disable-threads --disable-cpuinfo CFLAGS="-s USE_SDL=0 -O2 -Wno-warn-absolute-paths -Wdeclaration-after-statement -Werror=declaration-after-statement" --prefix="$PWD/emscripten-sdl3-installed" || exit $? echo "Building..." emmake $MAKE || exit $? @@ -64,9 +64,9 @@ echo "Moving things around..." emmake $MAKE install || exit $? # Fix up a few things to a real install path -perl -w -pi -e "s#$PWD/emscripten-sdl2-installed#/usr/local#g;" ./emscripten-sdl2-installed/lib/libSDL2.la ./emscripten-sdl2-installed/lib/pkgconfig/sdl2.pc ./emscripten-sdl2-installed/bin/sdl2-config +perl -w -pi -e "s#$PWD/emscripten-sdl3-installed#/usr/local#g;" ./emscripten-sdl3-installed/lib/libSDL3.la ./emscripten-sdl3-installed/lib/pkgconfig/sdl3.pc ./emscripten-sdl3-installed/bin/sdl3-config mkdir -p ./usr -mv ./emscripten-sdl2-installed ./usr/local +mv ./emscripten-sdl3-installed ./usr/local tar -cJvvf $TARBALL usr popd diff --git a/build-scripts/nacl-buildbot.sh b/build-scripts/nacl-buildbot.sh index 73aae9eaf4..efd345b9ac 100755 --- a/build-scripts/nacl-buildbot.sh +++ b/build-scripts/nacl-buildbot.sh @@ -1,6 +1,6 @@ #!/bin/bash -# This is the script buildbot.libsdl.org uses to cross-compile SDL2 from +# This is the script buildbot.libsdl.org uses to cross-compile SDL3 from # amd64 Linux to NaCl. # PLEASE NOTE that we have reports that SDL built with pepper_49 (current @@ -44,13 +44,13 @@ export AR="$NACL_SDK_ROOT/toolchain/linux_pnacl/bin/pnacl-ar" export LD="$NACL_SDK_ROOT/toolchain/linux_pnacl/bin/pnacl-ar" export RANLIB="$NACL_SDK_ROOT/toolchain/linux_pnacl/bin/pnacl-ranlib" -../configure --host=pnacl --prefix=$PWD/nacl-sdl2-installed +../configure --host=pnacl --prefix=$PWD/nacl-sdl3-installed $MAKE $MAKE install # Fix up a few things to a real install path -perl -w -pi -e "s#$PWD/nacl-sdl2-installed#/usr/local#g;" ./nacl-sdl2-installed/lib/libSDL2.la ./nacl-sdl2-installed/lib/pkgconfig/sdl2.pc ./nacl-sdl2-installed/bin/sdl2-config +perl -w -pi -e "s#$PWD/nacl-sdl3-installed#/usr/local#g;" ./nacl-sdl3-installed/lib/libSDL3.la ./nacl-sdl3-installed/lib/pkgconfig/sdl3.pc ./nacl-sdl3-installed/bin/sdl3-config mkdir -p ./usr -mv ./nacl-sdl2-installed ./usr/local +mv ./nacl-sdl3-installed ./usr/local popd tar -cJvvf $TARBALL -C $BUILDBOTDIR usr diff --git a/build-scripts/naclbuild.sh b/build-scripts/naclbuild.sh index db745f9e31..ad284d0e95 100755 --- a/build-scripts/naclbuild.sh +++ b/build-scripts/naclbuild.sh @@ -39,7 +39,7 @@ CURDIR=`pwd -P` SDLPATH="$( cd "$(dirname "$0")/.." ; pwd -P )" BUILDPATH="$SDLPATH/build/nacl" TESTBUILDPATH="$BUILDPATH/test" -SDL2_STATIC="$BUILDPATH/build/.libs/libSDL2.a" +SDL3_STATIC="$BUILDPATH/build/.libs/libSDL3.a" mkdir -p $BUILDPATH mkdir -p $TESTBUILDPATH @@ -73,8 +73,8 @@ $SDLPATH/configure --host=pnacl --prefix $TESTBUILDPATH make -j$NCPUS CFLAGS="$CFLAGS -I./include" make install -if [ ! -f "$SDL2_STATIC" ]; then - echo "Build failed! $SDL2_STATIC" +if [ ! -f "$SDL3_STATIC" ]; then + echo "Build failed! $SDL3_STATIC" exit 1 fi @@ -83,7 +83,7 @@ cp -f $SDLPATH/test/nacl/* $TESTBUILDPATH # Some tests need these resource files cp -f $SDLPATH/test/*.bmp $TESTBUILDPATH cp -f $SDLPATH/test/*.wav $TESTBUILDPATH -cp -f $SDL2_STATIC $TESTBUILDPATH +cp -f $SDL3_STATIC $TESTBUILDPATH # Copy user sources _SOURCES=($SOURCES) @@ -94,8 +94,8 @@ done export SOURCES="$SOURCES" cd $TESTBUILDPATH -make -j$NCPUS CONFIG="Release" CFLAGS="$CFLAGS -I$TESTBUILDPATH/include/SDL2 -I$SDLPATH/include" -make -j$NCPUS CONFIG="Debug" CFLAGS="$CFLAGS -I$TESTBUILDPATH/include/SDL2 -I$SDLPATH/include" +make -j$NCPUS CONFIG="Release" CFLAGS="$CFLAGS -I$TESTBUILDPATH/include/SDL3 -I$SDLPATH/include" +make -j$NCPUS CONFIG="Debug" CFLAGS="$CFLAGS -I$TESTBUILDPATH/include/SDL3 -I$SDLPATH/include" echo echo "Run the test with: " diff --git a/build-scripts/raspberrypi-buildbot.sh b/build-scripts/raspberrypi-buildbot.sh index 9486198926..677c0cdc01 100755 --- a/build-scripts/raspberrypi-buildbot.sh +++ b/build-scripts/raspberrypi-buildbot.sh @@ -1,13 +1,13 @@ #!/bin/bash -# This is the script buildbot.libsdl.org uses to cross-compile SDL2 from +# This is the script buildbot.libsdl.org uses to cross-compile SDL3 from # x86 Linux to Raspberry Pi. # The final tarball can be unpacked in the root directory of a RPi, -# so the SDL2 install lands in /usr/local. Run ldconfig, and then -# you should be able to build and run SDL2-based software on your +# so the SDL3 install lands in /usr/local. Run ldconfig, and then +# you should be able to build and run SDL3-based software on your # Pi. Standard configure scripts should be able to find SDL and -# build against it, and sdl2-config should work correctly on the +# build against it, and sdl3-config should work correctly on the # actual device. TARBALL="$1" @@ -42,13 +42,13 @@ SYSROOT="/opt/rpi-sysroot" export CC="ccache /opt/rpi-tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-gcc --sysroot=$SYSROOT -I$SYSROOT/opt/vc/include -I$SYSROOT/usr/include -I$SYSROOT/opt/vc/include/interface/vcos/pthreads -I$SYSROOT/opt/vc/include/interface/vmcs_host/linux -L$SYSROOT/opt/vc/lib" # -L$SYSROOT/usr/lib/arm-linux-gnueabihf" # !!! FIXME: shouldn't have to --disable-* things here. -../configure --with-sysroot=$SYSROOT --host=arm-raspberry-linux-gnueabihf --prefix=$PWD/rpi-sdl2-installed --disable-pulseaudio --disable-esd --disable-video-wayland +../configure --with-sysroot=$SYSROOT --host=arm-raspberry-linux-gnueabihf --prefix=$PWD/rpi-sdl3-installed --disable-pulseaudio --disable-esd --disable-video-wayland $MAKE $MAKE install # Fix up a few things to a real install path on a real Raspberry Pi... -perl -w -pi -e "s#$PWD/rpi-sdl2-installed#/usr/local#g;" ./rpi-sdl2-installed/lib/libSDL2.la ./rpi-sdl2-installed/lib/pkgconfig/sdl2.pc ./rpi-sdl2-installed/bin/sdl2-config +perl -w -pi -e "s#$PWD/rpi-sdl3-installed#/usr/local#g;" ./rpi-sdl3-installed/lib/libSDL3.la ./rpi-sdl3-installed/lib/pkgconfig/sdl3.pc ./rpi-sdl3-installed/bin/sdl3-config mkdir -p ./usr -mv ./rpi-sdl2-installed ./usr/local +mv ./rpi-sdl3-installed ./usr/local tar -cJvvf $TARBALL usr popd diff --git a/build-scripts/windows-buildbot-zipper.bat b/build-scripts/windows-buildbot-zipper.bat index 5bbc4658b4..c1242680d6 100644 --- a/build-scripts/windows-buildbot-zipper.bat +++ b/build-scripts/windows-buildbot-zipper.bat @@ -16,9 +16,9 @@ mkdir zipper\SDL mkdir zipper\SDL\include mkdir zipper\SDL\lib copy include\*.h include\ -copy %2\%1\Release\SDL2.dll zipper\SDL\lib\ -copy %2\%1\Release\SDL2.lib zipper\SDL\lib\ -copy %2\%1\Release\SDL2main.lib zipper\SDL\lib\ +copy %2\%1\Release\SDL3.dll zipper\SDL\lib\ +copy %2\%1\Release\SDL3.lib zipper\SDL\lib\ +copy %2\%1\Release\SDL3main.lib zipper\SDL\lib\ cd zipper zip -9r ..\%3 SDL cd .. diff --git a/cmake/macros.cmake b/cmake/macros.cmake index 6f6c329714..c703abf6b3 100644 --- a/cmake/macros.cmake +++ b/cmake/macros.cmake @@ -92,7 +92,7 @@ macro(LISTTOSTRREV _LIST _OUTPUT) endforeach() endmacro() -if(CMAKE_VERSION VERSION_LESS 3.16.0 OR SDL2_SUBPROJECT) +if(CMAKE_VERSION VERSION_LESS 3.16.0 OR SDL3_SUBPROJECT) # - CMake versions <3.16 do not support the OBJC language # - When SDL is built as a subproject and when the main project does not enable OBJC, # CMake fails due to missing internal CMake variables (CMAKE_OBJC_COMPILE_OBJECT) diff --git a/cmake/sdlchecks.cmake b/cmake/sdlchecks.cmake index 3686f01d96..462fdd4ba9 100644 --- a/cmake/sdlchecks.cmake +++ b/cmake/sdlchecks.cmake @@ -65,7 +65,7 @@ macro(CheckOSS) if(HAVE_OSS_SYS_SOUNDCARD_H) set(HAVE_OSS TRUE) - file(GLOB OSS_SOURCES ${SDL2_SOURCE_DIR}/src/audio/dsp/*.c) + file(GLOB OSS_SOURCES ${SDL3_SOURCE_DIR}/src/audio/dsp/*.c) set(SDL_AUDIO_DRIVER_OSS 1) list(APPEND SOURCE_FILES ${OSS_SOURCES}) if(NETBSD) @@ -89,7 +89,7 @@ macro(CheckALSA) endif() if(HAVE_LIBASOUND) set(HAVE_ALSA TRUE) - file(GLOB ALSA_SOURCES ${SDL2_SOURCE_DIR}/src/audio/alsa/*.c) + file(GLOB ALSA_SOURCES ${SDL3_SOURCE_DIR}/src/audio/alsa/*.c) list(APPEND SOURCE_FILES ${ALSA_SOURCES}) set(SDL_AUDIO_DRIVER_ALSA 1) if(SDL_ALSA_SHARED AND NOT HAVE_SDL_LOADSO) @@ -117,7 +117,7 @@ macro(CheckPipewire) pkg_check_modules(PKG_PIPEWIRE libpipewire-0.3>=0.3.20) if(PKG_PIPEWIRE_FOUND) set(HAVE_PIPEWIRE TRUE) - file(GLOB PIPEWIRE_SOURCES ${SDL2_SOURCE_DIR}/src/audio/pipewire/*.c) + file(GLOB PIPEWIRE_SOURCES ${SDL3_SOURCE_DIR}/src/audio/pipewire/*.c) list(APPEND SOURCE_FILES ${PIPEWIRE_SOURCES}) set(SDL_AUDIO_DRIVER_PIPEWIRE 1) list(APPEND EXTRA_CFLAGS ${PKG_PIPEWIRE_CFLAGS}) @@ -146,7 +146,7 @@ macro(CheckPulseAudio) pkg_check_modules(PKG_PULSEAUDIO libpulse-simple) if(PKG_PULSEAUDIO_FOUND) set(HAVE_PULSEAUDIO TRUE) - file(GLOB PULSEAUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/pulseaudio/*.c) + file(GLOB PULSEAUDIO_SOURCES ${SDL3_SOURCE_DIR}/src/audio/pulseaudio/*.c) list(APPEND SOURCE_FILES ${PULSEAUDIO_SOURCES}) set(SDL_AUDIO_DRIVER_PULSEAUDIO 1) list(APPEND EXTRA_CFLAGS ${PKG_PULSEAUDIO_CFLAGS}) @@ -175,7 +175,7 @@ macro(CheckJACK) pkg_check_modules(PKG_JACK jack) if(PKG_JACK_FOUND) set(HAVE_JACK TRUE) - file(GLOB JACK_SOURCES ${SDL2_SOURCE_DIR}/src/audio/jack/*.c) + file(GLOB JACK_SOURCES ${SDL3_SOURCE_DIR}/src/audio/jack/*.c) list(APPEND SOURCE_FILES ${JACK_SOURCES}) set(SDL_AUDIO_DRIVER_JACK 1) list(APPEND EXTRA_CFLAGS ${PKG_JACK_CFLAGS}) @@ -204,7 +204,7 @@ macro(CheckESD) pkg_check_modules(PKG_ESD esound) if(PKG_ESD_FOUND) set(HAVE_ESD TRUE) - file(GLOB ESD_SOURCES ${SDL2_SOURCE_DIR}/src/audio/esd/*.c) + file(GLOB ESD_SOURCES ${SDL3_SOURCE_DIR}/src/audio/esd/*.c) list(APPEND SOURCE_FILES ${ESD_SOURCES}) set(SDL_AUDIO_DRIVER_ESD 1) list(APPEND EXTRA_CFLAGS ${PKG_ESD_CFLAGS}) @@ -237,7 +237,7 @@ macro(CheckARTS) list(APPEND EXTRA_CFLAGS ${ARTS_CFLAGS}) execute_process(CMD_ARTSLIBS ${ARTS_CONFIG} --libs OUTPUT_VARIABLE ARTS_LIBS OUTPUT_STRIP_TRAILING_WHITESPACE) - file(GLOB ARTS_SOURCES ${SDL2_SOURCE_DIR}/src/audio/arts/*.c) + file(GLOB ARTS_SOURCES ${SDL3_SOURCE_DIR}/src/audio/arts/*.c) list(APPEND SOURCE_FILES ${ARTS_SOURCES}) set(SDL_AUDIO_DRIVER_ARTS 1) set(HAVE_ARTS TRUE) @@ -269,7 +269,7 @@ macro(CheckNAS) find_library(D_NAS_LIB audio) if(HAVE_NAS_H AND D_NAS_LIB) set(HAVE_NAS TRUE) - file(GLOB NAS_SOURCES ${SDL2_SOURCE_DIR}/src/audio/nas/*.c) + file(GLOB NAS_SOURCES ${SDL3_SOURCE_DIR}/src/audio/nas/*.c) list(APPEND SOURCE_FILES ${NAS_SOURCES}) set(SDL_AUDIO_DRIVER_NAS 1) if(SDL_NAS_SHARED AND NOT HAVE_SDL_LOADSO) @@ -297,7 +297,7 @@ macro(CheckSNDIO) pkg_check_modules(PKG_SNDIO sndio) if(PKG_SNDIO_FOUND) set(HAVE_SNDIO TRUE) - file(GLOB SNDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/sndio/*.c) + file(GLOB SNDIO_SOURCES ${SDL3_SOURCE_DIR}/src/audio/sndio/*.c) list(APPEND SOURCE_FILES ${SNDIO_SOURCES}) set(SDL_AUDIO_DRIVER_SNDIO 1) list(APPEND EXTRA_CFLAGS ${PKG_SNDIO_CFLAGS}) @@ -326,7 +326,7 @@ macro(CheckFusionSound) pkg_check_modules(PKG_FUSIONSOUND fusionsound>=1.0.0) if(PKG_FUSIONSOUND_FOUND) set(HAVE_FUSIONSOUND TRUE) - file(GLOB FUSIONSOUND_SOURCES ${SDL2_SOURCE_DIR}/src/audio/fusionsound/*.c) + file(GLOB FUSIONSOUND_SOURCES ${SDL3_SOURCE_DIR}/src/audio/fusionsound/*.c) list(APPEND SOURCE_FILES ${FUSIONSOUND_SOURCES}) set(SDL_AUDIO_DRIVER_FUSIONSOUND 1) list(APPEND EXTRA_CFLAGS ${PKG_FUSIONSOUND_CFLAGS}) @@ -442,7 +442,7 @@ macro(CheckX11) set(HAVE_X11 TRUE) set(HAVE_SDL_VIDEO TRUE) - file(GLOB X11_SOURCES ${SDL2_SOURCE_DIR}/src/video/x11/*.c) + file(GLOB X11_SOURCES ${SDL3_SOURCE_DIR}/src/video/x11/*.c) list(APPEND SOURCE_FILES ${X11_SOURCES}) set(SDL_VIDEO_DRIVER_X11 1) @@ -662,17 +662,17 @@ macro(CheckWayland) set(HAVE_WAYLAND TRUE) set(HAVE_SDL_VIDEO TRUE) - file(GLOB WAYLAND_SOURCES ${SDL2_SOURCE_DIR}/src/video/wayland/*.c) + file(GLOB WAYLAND_SOURCES ${SDL3_SOURCE_DIR}/src/video/wayland/*.c) list(APPEND SOURCE_FILES ${WAYLAND_SOURCES}) # We have to generate some protocol interface code for some unstable Wayland features. file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/wayland-generated-protocols") target_include_directories(sdl-build-options INTERFACE "${CMAKE_CURRENT_BINARY_DIR}/wayland-generated-protocols") - file(GLOB WAYLAND_PROTOCOLS_XML RELATIVE "${SDL2_SOURCE_DIR}/wayland-protocols/" "${SDL2_SOURCE_DIR}/wayland-protocols/*.xml") + file(GLOB WAYLAND_PROTOCOLS_XML RELATIVE "${SDL3_SOURCE_DIR}/wayland-protocols/" "${SDL3_SOURCE_DIR}/wayland-protocols/*.xml") foreach(_XML ${WAYLAND_PROTOCOLS_XML}) string(REGEX REPLACE "\\.xml$" "" _PROTL "${_XML}") - WaylandProtocolGen("${WAYLAND_SCANNER}" "${WAYLAND_SCANNER_CODE_MODE}" "${SDL2_SOURCE_DIR}/wayland-protocols/${_XML}" "${_PROTL}") + WaylandProtocolGen("${WAYLAND_SCANNER}" "${WAYLAND_SCANNER_CODE_MODE}" "${SDL3_SOURCE_DIR}/wayland-protocols/${_XML}" "${_PROTL}") endforeach() if(SDL_WAYLAND_QT_TOUCH) @@ -731,7 +731,7 @@ macro(CheckCOCOA) set(HAVE_COCOA TRUE) endif() if(HAVE_COCOA) - file(GLOB COCOA_SOURCES ${SDL2_SOURCE_DIR}/src/video/cocoa/*.m) + file(GLOB COCOA_SOURCES ${SDL3_SOURCE_DIR}/src/video/cocoa/*.m) list(APPEND SOURCE_FILES ${COCOA_SOURCES}) set(SDL_VIDEO_DRIVER_COCOA 1) set(HAVE_SDL_VIDEO TRUE) @@ -749,7 +749,7 @@ macro(CheckDirectFB) pkg_check_modules(PKG_DIRECTFB directfb>=1.0.0) if(PKG_DIRECTFB_FOUND) set(HAVE_DIRECTFB TRUE) - file(GLOB DIRECTFB_SOURCES ${SDL2_SOURCE_DIR}/src/video/directfb/*.c) + file(GLOB DIRECTFB_SOURCES ${SDL3_SOURCE_DIR}/src/video/directfb/*.c) list(APPEND SOURCE_FILES ${DIRECTFB_SOURCES}) set(SDL_VIDEO_DRIVER_DIRECTFB 1) set(SDL_VIDEO_RENDER_DIRECTFB 1) @@ -786,7 +786,7 @@ macro(CheckVivante) set(HAVE_VIVANTE TRUE) set(HAVE_SDL_VIDEO TRUE) - file(GLOB VIVANTE_SOURCES ${SDL2_SOURCE_DIR}/src/video/vivante/*.c) + file(GLOB VIVANTE_SOURCES ${SDL3_SOURCE_DIR}/src/video/vivante/*.c) list(APPEND SOURCE_FILES ${VIVANTE_SOURCES}) set(SDL_VIDEO_DRIVER_VIVANTE 1) if(HAVE_VIVANTE_VDK) @@ -1000,17 +1000,17 @@ macro(CheckPTHREAD) endif() set(SOURCE_FILES ${SOURCE_FILES} - ${SDL2_SOURCE_DIR}/src/thread/pthread/SDL_systhread.c - ${SDL2_SOURCE_DIR}/src/thread/pthread/SDL_sysmutex.c # Can be faked, if necessary - ${SDL2_SOURCE_DIR}/src/thread/pthread/SDL_syscond.c # Can be faked, if necessary - ${SDL2_SOURCE_DIR}/src/thread/pthread/SDL_systls.c + ${SDL3_SOURCE_DIR}/src/thread/pthread/SDL_systhread.c + ${SDL3_SOURCE_DIR}/src/thread/pthread/SDL_sysmutex.c # Can be faked, if necessary + ${SDL3_SOURCE_DIR}/src/thread/pthread/SDL_syscond.c # Can be faked, if necessary + ${SDL3_SOURCE_DIR}/src/thread/pthread/SDL_systls.c ) if(HAVE_PTHREADS_SEM) set(SOURCE_FILES ${SOURCE_FILES} - ${SDL2_SOURCE_DIR}/src/thread/pthread/SDL_syssem.c) + ${SDL3_SOURCE_DIR}/src/thread/pthread/SDL_syssem.c) else() set(SOURCE_FILES ${SOURCE_FILES} - ${SDL2_SOURCE_DIR}/src/thread/generic/SDL_syssem.c) + ${SDL3_SOURCE_DIR}/src/thread/generic/SDL_syssem.c) endif() set(HAVE_SDL_THREADS TRUE) endif() @@ -1147,7 +1147,7 @@ macro(CheckUSBHID) set(SDL_HAVE_MACHINE_JOYSTICK_H 1) endif() set(SDL_JOYSTICK_USBHID 1) - file(GLOB BSD_JOYSTICK_SOURCES ${SDL2_SOURCE_DIR}/src/joystick/bsd/*.c) + file(GLOB BSD_JOYSTICK_SOURCES ${SDL3_SOURCE_DIR}/src/joystick/bsd/*.c) list(APPEND SOURCE_FILES ${BSD_JOYSTICK_SOURCES}) list(APPEND EXTRA_CFLAGS ${USB_CFLAGS}) list(APPEND EXTRA_LIBS ${USB_LIBS}) @@ -1191,10 +1191,10 @@ macro(CheckHIDAPI) if(HAVE_HIDAPI) if(ANDROID) - list(APPEND SOURCE_FILES ${SDL2_SOURCE_DIR}/src/hidapi/android/hid.cpp) + list(APPEND SOURCE_FILES ${SDL3_SOURCE_DIR}/src/hidapi/android/hid.cpp) endif() if(IOS OR TVOS) - list(APPEND SOURCE_FILES ${SDL2_SOURCE_DIR}/src/hidapi/ios/hid.m) + list(APPEND SOURCE_FILES ${SDL3_SOURCE_DIR}/src/hidapi/ios/hid.m) set(SDL_FRAMEWORK_COREBLUETOOTH 1) endif() set(HAVE_SDL_HIDAPI TRUE) @@ -1203,7 +1203,7 @@ macro(CheckHIDAPI) set(SDL_JOYSTICK_HIDAPI 1) set(HAVE_SDL_JOYSTICK TRUE) set(HAVE_HIDAPI_JOYSTICK TRUE) - file(GLOB HIDAPI_JOYSTICK_SOURCES ${SDL2_SOURCE_DIR}/src/joystick/hidapi/*.c) + file(GLOB HIDAPI_JOYSTICK_SOURCES ${SDL3_SOURCE_DIR}/src/joystick/hidapi/*.c) list(APPEND SOURCE_FILES ${HIDAPI_JOYSTICK_SOURCES}) endif() else() @@ -1244,7 +1244,7 @@ macro(CheckRPI) if(SDL_VIDEO AND HAVE_RPI) set(HAVE_SDL_VIDEO TRUE) set(SDL_VIDEO_DRIVER_RPI 1) - file(GLOB VIDEO_RPI_SOURCES ${SDL2_SOURCE_DIR}/src/video/raspberry/*.c) + file(GLOB VIDEO_RPI_SOURCES ${SDL3_SOURCE_DIR}/src/video/raspberry/*.c) list(APPEND SOURCE_FILES ${VIDEO_RPI_SOURCES}) list(APPEND EXTRA_LIBS ${VIDEO_RPI_LIBRARIES}) # !!! FIXME: shouldn't be using CMAKE_C_FLAGS, right? @@ -1269,7 +1269,7 @@ macro(CheckKMSDRM) set(HAVE_KMSDRM TRUE) set(HAVE_SDL_VIDEO TRUE) - file(GLOB KMSDRM_SOURCES ${SDL2_SOURCE_DIR}/src/video/kmsdrm/*.c) + file(GLOB KMSDRM_SOURCES ${SDL3_SOURCE_DIR}/src/video/kmsdrm/*.c) list(APPEND SOURCE_FILES ${KMSDRM_SOURCES}) list(APPEND EXTRA_CFLAGS ${PKG_KMSDRM_CFLAGS}) diff --git a/cmake/test/CMakeLists.txt b/cmake/test/CMakeLists.txt index 388e86c54c..d4e488c542 100644 --- a/cmake/test/CMakeLists.txt +++ b/cmake/test/CMakeLists.txt @@ -16,109 +16,109 @@ endif() cmake_policy(SET CMP0074 NEW) -# Override CMAKE_FIND_ROOT_PATH_MODE to allow search for SDL2 outside of sysroot +# Override CMAKE_FIND_ROOT_PATH_MODE to allow search for SDL3 outside of sysroot set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE NEVER) include(FeatureSummary) -option(TEST_SHARED "Test linking to shared SDL2 library" ON) +option(TEST_SHARED "Test linking to shared SDL3 library" ON) add_feature_info("TEST_SHARED" TEST_SHARED "Test linking with shared library") -option(TEST_STATIC "Test linking to static SDL2 library" ON) +option(TEST_STATIC "Test linking to static SDL3 library" ON) add_feature_info("TEST_STATIC" TEST_STATIC "Test linking with static library") if(TEST_SHARED) - find_package(SDL2 REQUIRED CONFIG COMPONENTS SDL2) + find_package(SDL3 REQUIRED CONFIG COMPONENTS SDL3) if(EMSCRIPTEN OR (WIN32 AND NOT WINDOWS_STORE)) - find_package(SDL2 REQUIRED CONFIG COMPONENTS SDL2main) + find_package(SDL3 REQUIRED CONFIG COMPONENTS SDL3main) endif() add_executable(gui-shared WIN32 main_gui.c) - if(TARGET SDL2::SDL2main) - target_link_libraries(gui-shared PRIVATE SDL2::SDL2main) + if(TARGET SDL3::SDL3main) + target_link_libraries(gui-shared PRIVATE SDL3::SDL3main) endif() - target_link_libraries(gui-shared PRIVATE SDL2::SDL2) + target_link_libraries(gui-shared PRIVATE SDL3::SDL3) if(WIN32) add_custom_command(TARGET gui-shared POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy_if_different "$" "$" + COMMAND ${CMAKE_COMMAND} -E copy_if_different "$" "$" ) endif() add_library(sharedlib-shared SHARED main_lib.c) - target_link_libraries(sharedlib-shared PRIVATE SDL2::SDL2) + target_link_libraries(sharedlib-shared PRIVATE SDL3::SDL3) generate_export_header(sharedlib-shared EXPORT_MACRO_NAME MYLIBRARY_EXPORT) target_compile_definitions(sharedlib-shared PRIVATE "EXPORT_HEADER=\"${CMAKE_CURRENT_BINARY_DIR}/sharedlib-shared_export.h\"") set_target_properties(sharedlib-shared PROPERTIES C_VISIBILITY_PRESET "hidden") add_executable(gui-shared-vars WIN32 main_gui.c) - target_link_libraries(gui-shared-vars PRIVATE ${SDL2_LIBRARIES}) - target_include_directories(gui-shared-vars PRIVATE ${SDL2_INCLUDE_DIRS}) + target_link_libraries(gui-shared-vars PRIVATE ${SDL3_LIBRARIES}) + target_include_directories(gui-shared-vars PRIVATE ${SDL3_INCLUDE_DIRS}) add_executable(cli-shared main_cli.c) - target_link_libraries(cli-shared PRIVATE SDL2::SDL2) + target_link_libraries(cli-shared PRIVATE SDL3::SDL3) if(WIN32) add_custom_command(TARGET cli-shared POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy_if_different "$" "$" + COMMAND ${CMAKE_COMMAND} -E copy_if_different "$" "$" ) endif() - # SDL2_LIBRARIES does not support creating a cli SDL2 application - # (it is possible that SDL2main is a stub, but we don't know for sure) - if(NOT TARGET SDL2::SDL2main) + # SDL3_LIBRARIES does not support creating a cli SDL3 application + # (it is possible that SDL3main is a stub, but we don't know for sure) + if(NOT TARGET SDL3::SDL3main) add_executable(cli-shared-vars main_cli.c) - target_link_libraries(cli-shared-vars PRIVATE ${SDL2_LIBRARIES}) - target_include_directories(cli-shared-vars PRIVATE ${SDL2_INCLUDE_DIRS}) + target_link_libraries(cli-shared-vars PRIVATE ${SDL3_LIBRARIES}) + target_include_directories(cli-shared-vars PRIVATE ${SDL3_INCLUDE_DIRS}) endif() add_library(sharedlib-shared-vars SHARED main_lib.c) - target_link_libraries(sharedlib-shared-vars PRIVATE ${SDL2_LIBRARIES}) - target_include_directories(sharedlib-shared-vars PRIVATE ${SDL2_INCLUDE_DIRS}) + target_link_libraries(sharedlib-shared-vars PRIVATE ${SDL3_LIBRARIES}) + target_include_directories(sharedlib-shared-vars PRIVATE ${SDL3_INCLUDE_DIRS}) generate_export_header(sharedlib-shared-vars EXPORT_MACRO_NAME MYLIBRARY_EXPORT) target_compile_definitions(sharedlib-shared-vars PRIVATE "EXPORT_HEADER=\"${CMAKE_CURRENT_BINARY_DIR}/sharedlib-shared-vars_export.h\"") set_target_properties(sharedlib-shared-vars PROPERTIES C_VISIBILITY_PRESET "hidden") endif() if(TEST_STATIC) - find_package(SDL2 REQUIRED CONFIG COMPONENTS SDL2-static) + find_package(SDL3 REQUIRED CONFIG COMPONENTS SDL3-static) if(EMSCRIPTEN OR (WIN32 AND NOT WINDOWS_STORE)) - find_package(SDL2 REQUIRED CONFIG COMPONENTS SDL2main) + find_package(SDL3 REQUIRED CONFIG COMPONENTS SDL3main) endif() add_executable(gui-static WIN32 main_gui.c) - if(TARGET SDL2::SDL2main) - target_link_libraries(gui-static PRIVATE SDL2::SDL2main) + if(TARGET SDL3::SDL3main) + target_link_libraries(gui-static PRIVATE SDL3::SDL3main) endif() - target_link_libraries(gui-static PRIVATE SDL2::SDL2-static) + target_link_libraries(gui-static PRIVATE SDL3::SDL3-static) option(SDL_STATIC_PIC "SDL static library has been built with PIC") if(SDL_STATIC_PIC OR WIN32) add_library(sharedlib-static SHARED main_lib.c) - target_link_libraries(sharedlib-static PRIVATE SDL2::SDL2-static) + target_link_libraries(sharedlib-static PRIVATE SDL3::SDL3-static) generate_export_header(sharedlib-static EXPORT_MACRO_NAME MYLIBRARY_EXPORT) target_compile_definitions(sharedlib-static PRIVATE "EXPORT_HEADER=\"${CMAKE_CURRENT_BINARY_DIR}/sharedlib-static_export.h\"") set_target_properties(sharedlib-static PROPERTIES C_VISIBILITY_PRESET "hidden") endif() add_executable(gui-static-vars WIN32 main_gui.c) - target_link_libraries(gui-static-vars PRIVATE ${SDL2MAIN_LIBRARY} ${SDL2_STATIC_LIBRARIES}) - target_include_directories(gui-static-vars PRIVATE ${SDL2_INCLUDE_DIRS}) + target_link_libraries(gui-static-vars PRIVATE ${SDL3MAIN_LIBRARY} ${SDL3_STATIC_LIBRARIES}) + target_include_directories(gui-static-vars PRIVATE ${SDL3_INCLUDE_DIRS}) add_executable(cli-static main_cli.c) - target_link_libraries(cli-static PRIVATE SDL2::SDL2-static) + target_link_libraries(cli-static PRIVATE SDL3::SDL3-static) - # SDL2_LIBRARIES does not support creating a cli SDL2 application (when SDL2::SDL2main is available) - # (it is possible that SDL2main is a stub, but we don't know for sure) - if(NOT TARGET SDL2::SDL2main) + # SDL3_LIBRARIES does not support creating a cli SDL3 application (when SDL3::SDL3main is available) + # (it is possible that SDL3main is a stub, but we don't know for sure) + if(NOT TARGET SDL3::SDL3main) add_executable(cli-static-vars main_cli.c) - target_link_libraries(cli-static-vars PRIVATE ${SDL2_STATIC_LIBRARIES}) - target_include_directories(cli-static-vars PRIVATE ${SDL2_INCLUDE_DIRS}) + target_link_libraries(cli-static-vars PRIVATE ${SDL3_STATIC_LIBRARIES}) + target_include_directories(cli-static-vars PRIVATE ${SDL3_INCLUDE_DIRS}) endif() endif() -message(STATUS "SDL2_PREFIX: ${SDL2_PREFIX}") -message(STATUS "SDL2_INCLUDE_DIR: ${SDL2_INCLUDE_DIR}") -message(STATUS "SDL2_INCLUDE_DIRS: ${SDL2_INCLUDE_DIRS}") -message(STATUS "SDL2_LIBRARIES: ${SDL2_LIBRARIES}") -message(STATUS "SDL2_STATIC_LIBRARIES: ${SDL2_STATIC_LIBRARIES}") -message(STATUS "SDL2MAIN_LIBRARY: ${SDL2MAIN_LIBRARY}") -message(STATUS "SDL2TEST_LIBRARY: ${SDL2TEST_LIBRARY}") +message(STATUS "SDL3_PREFIX: ${SDL3_PREFIX}") +message(STATUS "SDL3_INCLUDE_DIR: ${SDL3_INCLUDE_DIR}") +message(STATUS "SDL3_INCLUDE_DIRS: ${SDL3_INCLUDE_DIRS}") +message(STATUS "SDL3_LIBRARIES: ${SDL3_LIBRARIES}") +message(STATUS "SDL3_STATIC_LIBRARIES: ${SDL3_STATIC_LIBRARIES}") +message(STATUS "SDL3MAIN_LIBRARY: ${SDL3MAIN_LIBRARY}") +message(STATUS "SDL3TEST_LIBRARY: ${SDL3TEST_LIBRARY}") feature_summary(WHAT ALL) diff --git a/cmake/test/jni/Android.mk b/cmake/test/jni/Android.mk index c4956d6859..3934988571 100644 --- a/cmake/test/jni/Android.mk +++ b/cmake/test/jni/Android.mk @@ -4,8 +4,8 @@ include $(CLEAR_VARS) LOCAL_MODULE := main_gui_androidmk LOCAL_SRC_FILES := ../main_gui.c -LOCAL_SHARED_LIBRARIES += SDL2 +LOCAL_SHARED_LIBRARIES += SDL3 include $(BUILD_SHARED_LIBRARY) -$(call import-module,SDL2main) -$(call import-module,SDL2) +$(call import-module,SDL3main) +$(call import-module,SDL3) diff --git a/cmake/test/main_cli.c b/cmake/test/main_cli.c index f6b0836061..2bbedde88e 100644 --- a/cmake/test/main_cli.c +++ b/cmake/test/main_cli.c @@ -5,7 +5,7 @@ int main(int argc, char *argv[]) { SDL_SetMainReady(); if (SDL_Init(0) < 0) { - fprintf(stderr, "could not initialize sdl2: %s\n", SDL_GetError()); + fprintf(stderr, "Could not initialize SDL: %s\n", SDL_GetError()); return 1; } SDL_Delay(100); diff --git a/cmake/test/main_gui.c b/cmake/test/main_gui.c index 4ffe9be1c4..3ba0adbeef 100644 --- a/cmake/test/main_gui.c +++ b/cmake/test/main_gui.c @@ -5,11 +5,11 @@ int main(int argc, char *argv[]) { SDL_Window *window = NULL; SDL_Surface *screenSurface = NULL; if (SDL_Init(SDL_INIT_VIDEO) < 0) { - fprintf(stderr, "could not initialize sdl2: %s\n", SDL_GetError()); + fprintf(stderr, "Could not initialize SDL: %s\n", SDL_GetError()); return 1; } window = SDL_CreateWindow( - "hello_sdl2", + "Hello SDL", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 640, 480, SDL_WINDOW_SHOWN diff --git a/cmake/test/main_lib.c b/cmake/test/main_lib.c index 9801ed56c5..0f8928b8d9 100644 --- a/cmake/test/main_lib.c +++ b/cmake/test/main_lib.c @@ -17,7 +17,7 @@ int MYLIBRARY_EXPORT mylibrary_work(void); int mylibrary_init(void) { SDL_SetMainReady(); if (SDL_Init(0) < 0) { - fprintf(stderr, "could not initialize sdl2: %s\n", SDL_GetError()); + fprintf(stderr, "Could not initialize SDL: %s\n", SDL_GetError()); return 1; } return 0; diff --git a/cmake/test/test_pkgconfig.sh b/cmake/test/test_pkgconfig.sh index 7afc00b096..c2aa3408cf 100755 --- a/cmake/test/test_pkgconfig.sh +++ b/cmake/test/test_pkgconfig.sh @@ -25,9 +25,9 @@ set -e # Get the canonical path of the folder containing this script testdir=$(cd -P -- "$(dirname -- "$0")" && printf '%s\n' "$(pwd -P)") -CFLAGS="$( pkg-config sdl2 --cflags )" -LDFLAGS="$( pkg-config sdl2 --libs )" -STATIC_LDFLAGS="$( pkg-config sdl2 --libs --static )" +CFLAGS="$( pkg-config sdl3 --cflags )" +LDFLAGS="$( pkg-config sdl3 --libs )" +STATIC_LDFLAGS="$( pkg-config sdl3 --libs --static )" compile_cmd="$CC -c "$testdir/main_gui.c" -o main_gui_pkgconfig.c.o $CFLAGS $EXTRA_CFLAGS" link_cmd="$CC main_gui_pkgconfig.c.o -o ${EXEPREFIX}main_gui_pkgconfig${EXESUFFIX} $LDFLAGS $EXTRA_LDFLAGS" diff --git a/cmake/test/test_sdlconfig.sh b/cmake/test/test_sdlconfig.sh index 8de5421dc9..67b62f5c2e 100755 --- a/cmake/test/test_sdlconfig.sh +++ b/cmake/test/test_sdlconfig.sh @@ -25,9 +25,9 @@ set -e # Get the canonical path of the folder containing this script testdir=$(cd -P -- "$(dirname -- "$0")" && printf '%s\n' "$(pwd -P)") -CFLAGS="$( sdl2-config --cflags )" -LDFLAGS="$( sdl2-config --libs )" -STATIC_LDFLAGS="$( sdl2-config --static-libs )" +CFLAGS="$( sdl3-config --cflags )" +LDFLAGS="$( sdl3-config --libs )" +STATIC_LDFLAGS="$( sdl3-config --static-libs )" compile_cmd="$CC -c "$testdir/main_gui.c" -o main_gui_sdlconfig.c.o $CFLAGS $EXTRA_CFLAGS" link_cmd="$CC main_gui_sdlconfig.c.o -o ${EXEPREFIX}main_gui_sdlconfig${EXESUFFIX} $LDFLAGS $EXTRA_LDFLAGS" diff --git a/configure b/configure index 87c576def5..677132988f 100755 --- a/configure +++ b/configure @@ -684,7 +684,7 @@ SDL_CFLAGS bin_prefix_relpath cmake_prefix_relpath SDL_VENDOR_INFO -INSTALL_SDL2_CONFIG +INSTALL_SDL3_CONFIG LIBUSB_LIBS LIBUSB_CFLAGS IBUS_LIBS @@ -954,7 +954,7 @@ enable_backgrounding_signal enable_foregrounding_signal enable_joystick_virtual enable_render_d3d -enable_sdl2_config +enable_sdl3_config enable_vendor_info ' ac_precious_vars='build_alias @@ -1782,7 +1782,7 @@ Optional Features: --enable-joystick-virtual enable virtual joystick APIs [default=yes] --enable-render-d3d enable the Direct3D render driver [default=yes] - --enable-sdl2-config Install sdl2-config [default=yes] + --enable-sdl3-config Install sdl3-config [default=yes] --enable-vendor-info=STRING Add vendor info to SDL_REVISION @@ -3452,8 +3452,8 @@ ac_config_headers="$ac_config_headers include/SDL_config.h" orig_CFLAGS="$CFLAGS" # See docs/release_checklist.md -SDL_MAJOR_VERSION=2 -SDL_MINOR_VERSION=26 +SDL_MAJOR_VERSION=3 +SDL_MINOR_VERSION=0 SDL_MICRO_VERSION=0 SDL_VERSION=$SDL_MAJOR_VERSION.$SDL_MINOR_VERSION.$SDL_MICRO_VERSION @@ -13073,9 +13073,9 @@ CFLAGS=$lt_save_CFLAGS # For historical reasons, the library name redundantly includes the major -# version twice: libSDL2-2.0.so.0. +# version twice: libSDL3-3.0.so.0. # TODO: in SDL 3, stop using -release, which will simplify it to libSDL3.so.0 -LT_RELEASE=2.0 +LT_RELEASE=3.0 # Increment this if there is an incompatible change - but if that happens, # we should rename the library from SDL2 to SDL3, at which point this would # reset to 0 anyway. @@ -18276,7 +18276,7 @@ EXTRA_LDFLAGS="$BASE_LDFLAGS" # fi #done SDL_CFLAGS="$BASE_CFLAGS" -SDL_LIBS="-lSDL2" +SDL_LIBS="-lSDL3" if test "x$BASE_LDFLAGS" != x; then SDL_LIBS="$SDL_LIBS $BASE_LDFLAGS" fi @@ -28848,7 +28848,7 @@ printf "%s\n" "#define SDL_LOADSO_WINDOWS 1" >>confdefs.h VERSION_SOURCES="$srcdir/src/main/windows/*.rc" SDLMAIN_SOURCES="$srcdir/src/main/windows/*.c" SDL_CFLAGS="$SDL_CFLAGS -Dmain=SDL_main" - SDL_LIBS="-lSDL2main $SDL_LIBS -mwindows" + SDL_LIBS="-lSDL3main $SDL_LIBS -mwindows" # Check to see if this is a mingw or cygwin build have_mingw32= @@ -29464,29 +29464,29 @@ esac CheckVirtualJoystick -# Check whether to install sdl2-config -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to install sdl2-config" >&5 -printf %s "checking whether to install sdl2-config... " >&6; } -# Check whether --enable-sdl2-config was given. -if test ${enable_sdl2_config+y} +# Check whether to install sdl3-config +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to install sdl3-config" >&5 +printf %s "checking whether to install sdl3-config... " >&6; } +# Check whether --enable-sdl3-config was given. +if test ${enable_sdl3_config+y} then : - enableval=$enable_sdl2_config; case "${enableval}" in - yes) enable_sdl2_config="TRUE" ;; - no) enable_sdl2_config="FALSE" ;; - *) as_fn_error $? "bad value '${enableval}' for --enable-sdl2-config" "$LINENO" 5 ;; + enableval=$enable_sdl3_config; case "${enableval}" in + yes) enable_sdl3_config="TRUE" ;; + no) enable_sdl3_config="FALSE" ;; + *) as_fn_error $? "bad value '${enableval}' for --enable-sdl3-config" "$LINENO" 5 ;; esac else $as_nop - enable_sdl2_config="TRUE" + enable_sdl3_config="TRUE" fi -if test "$enable_sdl2_config" = "TRUE"; then +if test "$enable_sdl3_config" = "TRUE"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi -INSTALL_SDL2_CONFIG=$enable_sdl2_config +INSTALL_SDL3_CONFIG=$enable_sdl3_config # Check whether --enable-vendor-info was given. @@ -29700,7 +29700,7 @@ fi SDL_STATIC_LIBS="$EXTRA_LDFLAGS" -pkg_cmakedir='$libdir/cmake/SDL2' +pkg_cmakedir='$libdir/cmake/SDL3' for _lcl_i in pkg_cmakedir:prefix:cmake_prefix_relpath bindir:prefix:bin_prefix_relpath; do _lcl_from=\$`echo "$_lcl_i" | sed 's,:.*$,,'` _lcl_to=\$`echo "$_lcl_i" | sed 's,^[^:]*:,,' | sed 's,:[^:]*$,,'` @@ -29852,12 +29852,12 @@ $SDLTEST_DEPENDS $WAYLAND_PROTOCOLS_DEPENDS __EOF__ -ac_config_files="$ac_config_files Makefile:Makefile.in:Makefile.rules sdl2-config sdl2-config.cmake sdl2-config-version.cmake SDL2.spec sdl2.pc" +ac_config_files="$ac_config_files Makefile:Makefile.in:Makefile.rules sdl3-config sdl3-config.cmake sdl3-config-version.cmake SDL3.spec sdl3.pc" -ac_config_commands="$ac_config_commands sdl2_config" +ac_config_commands="$ac_config_commands sdl3_config" -SUMMARY="SDL2 Configure Summary:\n" +SUMMARY="SDL3 Configure Summary:\n" if test x$enable_shared = xyes; then SUMMARY="${SUMMARY}Building Shared Libraries\n" fi @@ -31093,12 +31093,12 @@ do "include/SDL_config.h") CONFIG_HEADERS="$CONFIG_HEADERS include/SDL_config.h" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile:Makefile.in:Makefile.rules" ;; - "sdl2-config") CONFIG_FILES="$CONFIG_FILES sdl2-config" ;; - "sdl2-config.cmake") CONFIG_FILES="$CONFIG_FILES sdl2-config.cmake" ;; - "sdl2-config-version.cmake") CONFIG_FILES="$CONFIG_FILES sdl2-config-version.cmake" ;; - "SDL2.spec") CONFIG_FILES="$CONFIG_FILES SDL2.spec" ;; - "sdl2.pc") CONFIG_FILES="$CONFIG_FILES sdl2.pc" ;; - "sdl2_config") CONFIG_COMMANDS="$CONFIG_COMMANDS sdl2_config" ;; + "sdl3-config") CONFIG_FILES="$CONFIG_FILES sdl3-config" ;; + "sdl3-config.cmake") CONFIG_FILES="$CONFIG_FILES sdl3-config.cmake" ;; + "sdl3-config-version.cmake") CONFIG_FILES="$CONFIG_FILES sdl3-config-version.cmake" ;; + "SDL3.spec") CONFIG_FILES="$CONFIG_FILES SDL3.spec" ;; + "sdl3.pc") CONFIG_FILES="$CONFIG_FILES sdl3.pc" ;; + "sdl3_config") CONFIG_COMMANDS="$CONFIG_COMMANDS sdl3_config" ;; "summary") CONFIG_COMMANDS="$CONFIG_COMMANDS summary" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; @@ -32522,7 +32522,7 @@ compiler_lib_search_path=$lt_compiler_lib_search_path_CXX _LT_EOF ;; - "sdl2_config":C) chmod a+x sdl2-config ;; + "sdl3_config":C) chmod a+x sdl3-config ;; "summary":C) printf "$SUMMARY" ;; esac diff --git a/configure.ac b/configure.ac index cc30f9a164..9d2cc2934a 100644 --- a/configure.ac +++ b/configure.ac @@ -11,18 +11,18 @@ orig_CFLAGS="$CFLAGS" dnl Set various version strings - taken gratefully from the GTk sources # See docs/release_checklist.md -SDL_MAJOR_VERSION=2 -SDL_MINOR_VERSION=26 +SDL_MAJOR_VERSION=3 +SDL_MINOR_VERSION=0 SDL_MICRO_VERSION=0 SDL_VERSION=$SDL_MAJOR_VERSION.$SDL_MINOR_VERSION.$SDL_MICRO_VERSION SDL_BINARY_AGE=`expr $SDL_MINOR_VERSION \* 100 + $SDL_MICRO_VERSION` AS_CASE(["$SDL_MINOR_VERSION"], [*@<:@02468@:>@], - dnl Stable branch, 2.24.1 -> libSDL2-2.0.so.0.2400.1 + dnl Stable branch, 3.24.1 -> libSDL3-3.0.so.0.2400.1 [SDL_INTERFACE_AGE="$SDL_MICRO_VERSION"], [*], - dnl Development branch, 2.23.1 -> libSDL2-2.0.so.0.2301.0 + dnl Development branch, 3.23.1 -> libSDL3-3.0.so.0.2301.0 [SDL_INTERFACE_AGE=0]) AC_SUBST(SDL_MAJOR_VERSION) @@ -37,9 +37,9 @@ LT_INIT([win32-dll]) LT_LANG([Windows Resource]) # For historical reasons, the library name redundantly includes the major -# version twice: libSDL2-2.0.so.0. +# version twice: libSDL3-3.0.so.0. # TODO: in SDL 3, stop using -release, which will simplify it to libSDL3.so.0 -LT_RELEASE=2.0 +LT_RELEASE=3.0 # Increment this if there is an incompatible change - but if that happens, # we should rename the library from SDL2 to SDL3, at which point this would # reset to 0 anyway. @@ -162,7 +162,7 @@ EXTRA_LDFLAGS="$BASE_LDFLAGS" # fi #done SDL_CFLAGS="$BASE_CFLAGS" -SDL_LIBS="-lSDL2" +SDL_LIBS="-lSDL3" if test "x$BASE_LDFLAGS" != x; then SDL_LIBS="$SDL_LIBS $BASE_LDFLAGS" fi @@ -4168,7 +4168,7 @@ case "$host" in VERSION_SOURCES="$srcdir/src/main/windows/*.rc" SDLMAIN_SOURCES="$srcdir/src/main/windows/*.c" SDL_CFLAGS="$SDL_CFLAGS -Dmain=SDL_main" - SDL_LIBS="-lSDL2main $SDL_LIBS -mwindows" + SDL_LIBS="-lSDL3main $SDL_LIBS -mwindows" # Check to see if this is a mingw or cygwin build have_mingw32= @@ -4670,21 +4670,21 @@ esac dnl Permit use of virtual joystick APIs on any platform (subject to configure options) CheckVirtualJoystick -# Check whether to install sdl2-config -AC_MSG_CHECKING(whether to install sdl2-config) -AC_ARG_ENABLE([sdl2-config], - [AS_HELP_STRING([--enable-sdl2-config],[Install sdl2-config [default=yes]])], +# Check whether to install sdl3-config +AC_MSG_CHECKING(whether to install sdl3-config) +AC_ARG_ENABLE([sdl3-config], + [AS_HELP_STRING([--enable-sdl3-config],[Install sdl3-config [default=yes]])], [case "${enableval}" in - yes) enable_sdl2_config="TRUE" ;; - no) enable_sdl2_config="FALSE" ;; - *) AC_MSG_ERROR([bad value '${enableval}' for --enable-sdl2-config]) ;; - esac], [enable_sdl2_config="TRUE"]) -if test "$enable_sdl2_config" = "TRUE"; then + yes) enable_sdl3_config="TRUE" ;; + no) enable_sdl3_config="FALSE" ;; + *) AC_MSG_ERROR([bad value '${enableval}' for --enable-sdl3-config]) ;; + esac], [enable_sdl3_config="TRUE"]) +if test "$enable_sdl3_config" = "TRUE"; then AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) fi -AC_SUBST([INSTALL_SDL2_CONFIG], [$enable_sdl2_config]) +AC_SUBST([INSTALL_SDL3_CONFIG], [$enable_sdl3_config]) AC_ARG_ENABLE([vendor-info], [AS_HELP_STRING([--enable-vendor-info=STRING], [Add vendor info to SDL_REVISION])], @@ -4850,7 +4850,7 @@ SDL_STATIC_LIBS="$EXTRA_LDFLAGS" dnl Calculate the location of the prefix, relative to the cmake folder dnl Calculate the location of the prefix, relative to bindir -pkg_cmakedir='$libdir/cmake/SDL2' +pkg_cmakedir='$libdir/cmake/SDL3' AX_COMPUTE_RELATIVE_PATHS([pkg_cmakedir:prefix:cmake_prefix_relpath bindir:prefix:bin_prefix_relpath]) AC_SUBST([cmake_prefix_relpath]) AC_SUBST([bin_prefix_relpath]) @@ -4914,11 +4914,11 @@ $WAYLAND_PROTOCOLS_DEPENDS __EOF__ AC_CONFIG_FILES([ - Makefile:Makefile.in:Makefile.rules sdl2-config sdl2-config.cmake sdl2-config-version.cmake SDL2.spec sdl2.pc + Makefile:Makefile.in:Makefile.rules sdl3-config sdl3-config.cmake sdl3-config-version.cmake SDL3.spec sdl3.pc ]) -AC_CONFIG_COMMANDS([sdl2_config],[chmod a+x sdl2-config]) +AC_CONFIG_COMMANDS([sdl3_config],[chmod a+x sdl3-config]) -SUMMARY="SDL2 Configure Summary:\n" +SUMMARY="SDL3 Configure Summary:\n" if test x$enable_shared = xyes; then SUMMARY="${SUMMARY}Building Shared Libraries\n" fi diff --git a/docs/README-android.md b/docs/README-android.md index a247e57210..03d2d87780 100644 --- a/docs/README-android.md +++ b/docs/README-android.md @@ -86,8 +86,8 @@ If you already have a project that uses CMake, the instructions change somewhat: 2. Edit "/app/build.gradle" to comment out or remove sections containing ndk-build and uncomment the cmake sections. Add arguments to the CMake invocation as needed. 3. Edit "/app/jni/CMakeLists.txt" to include your project (it defaults to - adding the "src" subdirectory). Note that you'll have SDL2, SDL2main and SDL2-static - as targets in your project, so you should have "target_link_libraries(yourgame SDL2 SDL2main)" + adding the "src" subdirectory). Note that you'll have SDL3, SDL3main and SDL3-static + as targets in your project, so you should have "target_link_libraries(yourgame SDL3 SDL3main)" in your CMakeLists.txt file. Also be aware that you should use add_library() instead of add_executable() for the target containing your "main" function. @@ -414,10 +414,10 @@ Graphics debugging ================================================================================ If you are developing on a compatible Tegra-based tablet, NVidia provides -Tegra Graphics Debugger at their website. Because SDL2 dynamically loads EGL +Tegra Graphics Debugger at their website. Because SDL3 dynamically loads EGL and GLES libraries, you must follow their instructions for installing the interposer library on a rooted device. The non-rooted instructions are not -compatible with applications that use SDL2 for video. +compatible with applications that use SDL3 for video. The Tegra Graphics Debugger is available from NVidia here: https://developer.nvidia.com/tegra-graphics-debugger diff --git a/docs/README-cmake.md b/docs/README-cmake.md index b10751c1a3..10e60b3651 100644 --- a/docs/README-cmake.md +++ b/docs/README-cmake.md @@ -57,24 +57,24 @@ option(MYGAME_VENDORED "Use vendored libraries" OFF) if(MYGAME_VENDORED) add_subdirectory(vendored/sdl EXCLUDE_FROM_ALL) else() - # 1. Look for a SDL2 package, 2. look for the SDL2 component and 3. fail if none can be found - find_package(SDL2 REQUIRED CONFIG REQUIRED COMPONENTS SDL2) + # 1. Look for a SDL3 package, 2. look for the SDL3 component and 3. fail if none can be found + find_package(SDL3 REQUIRED CONFIG REQUIRED COMPONENTS SDL3) - # 1. Look for a SDL2 package, 2. Look for the SDL2maincomponent and 3. DO NOT fail when SDL2main is not available - find_package(SDL2 REQUIRED CONFIG COMPONENTS SDL2main) + # 1. Look for a SDL3 package, 2. Look for the SDL3maincomponent and 3. DO NOT fail when SDL3main is not available + find_package(SDL3 REQUIRED CONFIG COMPONENTS SDL3main) endif() # Create your game executable target as usual add_executable(mygame WIN32 mygame.c) -# SDL2::SDL2main may or may not be available. It is e.g. required by Windows GUI applications -if(TARGET SDL2::SDL2main) - # It has an implicit dependency on SDL2 functions, so it MUST be added before SDL2::SDL2 (or SDL2::SDL2-static) - target_link_libraries(mygame PRIVATE SDL2::SDL2main) +# SDL3::SDL3main may or may not be available. It is e.g. required by Windows GUI applications +if(TARGET SDL3::SDL3main) + # It has an implicit dependency on SDL3 functions, so it MUST be added before SDL3::SDL3 (or SDL3::SDL3-static) + target_link_libraries(mygame PRIVATE SDL3::SDL3main) endif() -# Link to the actual SDL2 library. SDL2::SDL2 is the shared SDL library, SDL2::SDL2-static is the static SDL libarary. -target_link_libraries(mygame PRIVATE SDL2::SDL2) +# Link to the actual SDL3 library. SDL3::SDL3 is the shared SDL library, SDL3::SDL3-static is the static SDL libarary. +target_link_libraries(mygame PRIVATE SDL3::SDL3) ``` ### A system SDL library @@ -85,10 +85,10 @@ The following components are available, to be used as an argument of `find_packa | Component name | Description | |----------------|--------------------------------------------------------------------------------------------| -| SDL2 | The SDL2 shared library, available through the `SDL2::SDL2` target [^SDL_TARGET_EXCEPTION] | -| SDL2-static | The SDL2 static library, available through the `SDL2::SDL2-static` target | -| SDL2main | The SDL2main static library, available through the `SDL2::SDL2main` target | -| SDL2test | The SDL2test static library, available through the `SDL2::SDL2test` target | +| SDL3 | The SDL3 shared library, available through the `SDL3::SDL3` target [^SDL_TARGET_EXCEPTION] | +| SDL3-static | The SDL3 static library, available through the `SDL3::SDL3-static` target | +| SDL3main | The SDL3main static library, available through the `SDL3::SDL3main` target | +| SDL3test | The SDL3test static library, available through the `SDL3::SDL3test` target | ### Using a vendored SDL @@ -160,4 +160,4 @@ To use, set the following CMake variables when running CMake's configuration sta ``` -[^SDL_TARGET_EXCEPTION]: `SDL2::SDL2` can be an ALIAS to a static `SDL2::SDL2-static` target for multiple reasons. +[^SDL_TARGET_EXCEPTION]: `SDL3::SDL3` can be an ALIAS to a static `SDL3::SDL3-static` target for multiple reasons. diff --git a/docs/README-dynapi.md b/docs/README-dynapi.md index 47b726b1df..99f5074ee8 100644 --- a/docs/README-dynapi.md +++ b/docs/README-dynapi.md @@ -4,22 +4,22 @@ Originally posted on Ryan's Google+ account. Background: -- The Steam Runtime has (at least in theory) a really kick-ass build of SDL2, - but developers are shipping their own SDL2 with individual Steam games. - These games might stop getting updates, but a newer SDL2 might be needed later. +- The Steam Runtime has (at least in theory) a really kick-ass build of SDL, + but developers are shipping their own SDL with individual Steam games. + These games might stop getting updates, but a newer SDL might be needed later. Certainly we'll always be fixing bugs in SDL, even if a new video target isn't ever needed, and these fixes won't make it to a game shipping its own SDL. -- Even if we replace the SDL2 in those games with a compatible one, that is to +- Even if we replace the SDL in those games with a compatible one, that is to say, edit a developer's Steam depot (yuck!), there are developers that are - statically linking SDL2 that we can't do this for. We can't even force the - dynamic loader to ignore their SDL2 in this case, of course. -- If you don't ship an SDL2 with the game in some form, people that disabled the + statically linking SDL that we can't do this for. We can't even force the + dynamic loader to ignore their SDL in this case, of course. +- If you don't ship an SDL with the game in some form, people that disabled the Steam Runtime, or just tried to run the game from the command line instead of Steam might find themselves unable to run the game, due to a missing dependency. - If you want to ship on non-Steam platforms like GOG or Humble Bundle, or target - generic Linux boxes that may or may not have SDL2 installed, you have to ship + generic Linux boxes that may or may not have SDL installed, you have to ship the library or risk a total failure to launch. So now, you might have to have - a non-Steam build plus a Steam build (that is, one with and one without SDL2 + a non-Steam build plus a Steam build (that is, one with and one without SDL included), which is inconvenient if you could have had one universal build that works everywhere. - We like the zlib license, but the biggest complaint from the open source @@ -65,8 +65,8 @@ system's dynamic loader was supposed to do for us? Yes, but now we've got this level of indirection, we can do things like this: ```bash -export SDL_DYNAMIC_API=/my/actual/libSDL-2.0.so.0 -./MyGameThatIsStaticallyLinkedToSDL2 +export SDL_DYNAMIC_API=/my/actual/libSDL3.so.0 +./MyGameThatIsStaticallyLinkedToSDL ``` And now, this game that is statically linked to SDL, can still be overridden @@ -108,7 +108,7 @@ the jump table, and the size, in bytes, of the table. Now, we've got policy here: this table's layout never changes; new stuff gets added to the end. Therefore SDL_DYNAPI_entry() knows that it can provide all the needed functions if tablesize <= sizeof its own jump table. If tablesize is -bigger (say, SDL 2.0.4 is trying to load SDL 2.0.3), then we know to abort, but +bigger (say, SDL 3.0.4 is trying to load SDL 3.0.3), then we know to abort, but if it's smaller, we know we can provide the entire API that the caller needs. The version variable is a failsafe switch. diff --git a/docs/README-emscripten.md b/docs/README-emscripten.md index 5f8c277863..f73c6090eb 100644 --- a/docs/README-emscripten.md +++ b/docs/README-emscripten.md @@ -59,11 +59,11 @@ Or with cmake: To build one of the tests: $ cd test/ - $ emcc -O2 --js-opts 0 -g4 testdraw2.c -I../include ../build/.libs/libSDL2.a ../build/libSDL2_test.a -o a.html + $ emcc -O2 --js-opts 0 -g4 testdraw2.c -I../include ../build/.libs/libSDL3.a ../build/libSDL3_test.a -o a.html Uses GLES2 renderer or software -Some other SDL2 libraries can be easily built (assuming SDL2 is installed somewhere): +Some other SDL3 libraries can be easily built (assuming SDL3 is installed somewhere): SDL_mixer (http://www.libsdl.org/projects/SDL_mixer/): diff --git a/docs/README-gdk.md b/docs/README-gdk.md index 5f6b18be3f..e172adf07b 100644 --- a/docs/README-gdk.md +++ b/docs/README-gdk.md @@ -25,7 +25,7 @@ The Windows GDK port supports the full set of Win32 APIs, renderers, controllers * Initializing/uninitializing the game runtime, and initializing Xbox Live services * Creating a global task queue and setting it as the default for the process. When running any async operations, passing in `NULL` as the task queue will make the task get added to the global task queue. - * An implementation on `WinMain` that performs the above GDK setup (you should link against SDL2main.lib, as in Windows x64). If you are unable to do this, you can instead manually call `SDL_GDKRunApp` from your entry point, passing in your `SDL_main` function and `NULL` as the parameters. + * An implementation on `WinMain` that performs the above GDK setup (you should link against SDL3main.lib, as in Windows x64). If you are unable to do this, you can instead manually call `SDL_GDKRunApp` from your entry point, passing in your `SDL_main` function and `NULL` as the parameters. * Global task queue callbacks are dispatched during `SDL_PumpEvents` (which is also called internally if using `SDL_PollEvent`). * You can get the handle of the global task queue through `SDL_GDKGetTaskQueue`, if needed. When done with the queue, be sure to use `XTaskQueueCloseHandle` to decrement the reference count (otherwise it will cause a resource leak). @@ -36,8 +36,8 @@ The Windows GDK port supports the full set of Win32 APIs, renderers, controllers The included `VisualC-GDK/SDL.sln` solution includes the following targets for the Gaming.Desktop.x64 configuration: -* SDL2 (DLL) - This is the typical SDL2.dll, but for Gaming.Desktop.x64. -* SDL2main (lib) - This contains a drop-in implementation of `WinMain` that is used as the entry point for GDK programs. +* SDL3 (DLL) - This is the typical SDL3.dll, but for Gaming.Desktop.x64. +* SDL3main (lib) - This contains a drop-in implementation of `WinMain` that is used as the entry point for GDK programs. * tests/testgamecontroller - Standard SDL test program demonstrating controller functionality. * tests/testgdk - GDK-specific test program that demonstrates using the global task queue to login a user into Xbox Live. *NOTE*: As of the June 2022 GDK, you cannot test user logins without a valid Title ID and MSAAppId. You will need to manually change the identifiers in the `MicrosoftGame.config` to your valid IDs from Partner Center if you wish to test this. @@ -54,21 +54,21 @@ These steps assume you already have a game using SDL that runs on Windows x64 al In your game's existing Visual Studio Solution, go to Build > Configuration Manager. From the "Active solution platform" drop-down select "New...". From the drop-down list, select Gaming.Desktop.x64 and copy the settings from the x64 configuration. -### 2. Build SDL2 and SDL2main for GDK ### +### 2. Build SDL3 and SDL3main for GDK ### -Open `VisualC-GDK/SDL.sln` in Visual Studio, you need to build the SDL2 and SDL2main targets for the Gaming.Desktop.x64 platform (Release is recommended). You will need to copy/keep track of the `SDL2.dll`, `XCurl.dll` (which is output by Gaming.Desktop.x64), `SDL2.lib`, and `SDL2main.lib` output files for your game project. +Open `VisualC-GDK/SDL.sln` in Visual Studio, you need to build the SDL3 and SDL3main targets for the Gaming.Desktop.x64 platform (Release is recommended). You will need to copy/keep track of the `SDL3.dll`, `XCurl.dll` (which is output by Gaming.Desktop.x64), `SDL3.lib`, and `SDL3main.lib` output files for your game project. -*Alternatively*, you could setup your solution file to instead reference the SDL2/SDL2main project file targets from the SDL source, and add those projects as a dependency. This would mean that SDL2 and SDL2main would both be built when your game is built. +*Alternatively*, you could setup your solution file to instead reference the SDL3/SDL3main project file targets from the SDL source, and add those projects as a dependency. This would mean that SDL3 and SDL3main would both be built when your game is built. ### 3. Configuring Project Settings ### While the Gaming.Desktop.x64 configuration sets most of the required settings, there are some additional items to configure for your game project under the Gaming.Desktop.x64 Configuration: * Under C/C++ > General > Additional Include Directories, make sure the `SDL/include` path is referenced -* Under Linker > General > Additional Library Directories, make sure to reference the path where the newly-built SDL2.lib and SDL2main.lib are +* Under Linker > General > Additional Library Directories, make sure to reference the path where the newly-built SDL3.lib and SDL3main.lib are * Under Linker > Input > Additional Dependencies, you need the following: - * `SDL2.lib` - * `SDL2main.lib` (unless not using) + * `SDL3.lib` + * `SDL3main.lib` (unless not using) * `xgameruntime.lib` * `../Microsoft.Xbox.Services.141.GDK.C.Thunks.lib` * Note that in general, the GDK libraries depend on the MSVC C/C++ runtime, so there is no way to remove this dependency from a GDK program that links against GDK. @@ -81,7 +81,7 @@ Rather than using your own implementation of `WinMain`, it's recommended that yo The game will not launch in the debugger unless required DLLs are included in the directory that contains the game's .exe file. You need to make sure that the following files are copied into the directory: -* Your SDL2.dll +* Your SDL3.dll * "$(Console_GRDKExtLibRoot)Xbox.Services.API.C\DesignTime\CommonConfiguration\Neutral\Lib\Release\Microsoft.Xbox.Services.141.GDK.C.Thunks.dll" * XCurl.dll diff --git a/docs/README-ios.md b/docs/README-ios.md index e13f8baaec..d06e3b518e 100644 --- a/docs/README-ios.md +++ b/docs/README-ios.md @@ -20,7 +20,7 @@ Using the Simple DirectMedia Layer for iOS 3. Right click the project in the main view, select "Add Files...", and add the SDL project, Xcode/SDL/SDL.xcodeproj 4. Select the project in the main view, go to the "Info" tab and under "Custom iOS Target Properties" remove the line "Main storyboard file base name" 5. Select the project in the main view, go to the "Build Settings" tab, select "All", and edit "Header Search Path" and drag over the SDL "Public Headers" folder from the left -6. Select the project in the main view, go to the "Build Phases" tab, select "Link Binary With Libraries", and add SDL2.framework from "Framework-iOS" +6. Select the project in the main view, go to the "Build Phases" tab, select "Link Binary With Libraries", and add SDL3.framework from "Framework-iOS" 7. Select the project in the main view, go to the "General" tab, scroll down to "Frameworks, Libraries, and Embedded Content", and select "Embed & Sign" for the SDL library. 8. In the main view, expand SDL -> Library Source -> main -> uikit and drag SDL_uikit_main.c into your game files 9. Add the source files that you would normally have for an SDL program, making sure to have #include "SDL.h" at the top of the file containing your main() function. @@ -194,15 +194,15 @@ http://developer.apple.com/library/ios/#documentation/iPhone/Conceptual/iPhoneOS Notes -- xcFramework ============================================================================== -The SDL.xcodeproj file now includes a target to build SDL2.xcframework. An xcframework is a new (Xcode 11) uber-framework which can handle any combination of processor type and target OS platform. +The SDL.xcodeproj file now includes a target to build SDL3.xcframework. An xcframework is a new (Xcode 11) uber-framework which can handle any combination of processor type and target OS platform. In the past, iOS devices were always an ARM variant processor, and the simulator was always i386 or x86_64, and thus libraries could be combined into a single framework for both simulator and device. With the introduction of the Apple Silicon ARM-based machines, regular frameworks would collide as CPU type was no longer sufficient to differentiate the platform. So Apple created the new xcframework library package. -The xcframework target builds into a Products directory alongside the SDL.xcodeproj file, as SDL2.xcframework. This can be brought in to any iOS project and will function properly for both simulator and device, no matter their CPUs. Note that Intel Macs cannot cross-compile for Apple Silicon Macs. If you need AS compatibility, perform this build on an Apple Silicon Mac. +The xcframework target builds into a Products directory alongside the SDL.xcodeproj file, as SDL3.xcframework. This can be brought in to any iOS project and will function properly for both simulator and device, no matter their CPUs. Note that Intel Macs cannot cross-compile for Apple Silicon Macs. If you need AS compatibility, perform this build on an Apple Silicon Mac. This target requires Xcode 11 or later. The target will simply fail to build if attempted on older Xcodes. -In addition, on Apple platforms, main() cannot be in a dynamically loaded library. This means that iOS apps which used the statically-linked libSDL2.lib and now link with the xcframwork will need to define their own main() to call SDL_UIKitRunApp(), like this: +In addition, on Apple platforms, main() cannot be in a dynamically loaded library. This means that iOS apps which used the statically-linked libSDL3.lib and now link with the xcframwork will need to define their own main() to call SDL_UIKitRunApp(), like this: #ifndef SDL_MAIN_HANDLED #ifdef main diff --git a/docs/README-kmsbsd.md b/docs/README-kmsbsd.md index 01db5e8aaf..7604817071 100644 --- a/docs/README-kmsbsd.md +++ b/docs/README-kmsbsd.md @@ -8,7 +8,7 @@ WSCONS support has been brought back, but only as an input backend. It will not OpenBSD note: Note that the video backend assumes that the user has read/write permissions to the /dev/drm* devices. -SDL2 WSCONS input backend features +SDL WSCONS input backend features =================================================== 1. It is keymap-aware; it will work properly with different keymaps. 2. It has mouse support. diff --git a/docs/README-n3ds.md b/docs/README-n3ds.md index 66e194d0b3..1fa8e15a6e 100644 --- a/docs/README-n3ds.md +++ b/docs/README-n3ds.md @@ -22,6 +22,6 @@ cmake --install build ## Notes - Currently only software rendering is supported. -- SDL2main should be used to ensure ROMFS is enabled. +- SDL3main should be used to ensure ROMFS is enabled. - By default, the extra L2 cache and higher clock speeds of the New 2/3DS lineup are enabled. If you wish to turn it off, use `osSetSpeedupEnable(false)` in your main function. - `SDL_GetBasePath` returns the romfs root instead of the executable's directory. diff --git a/docs/README-ngage.md b/docs/README-ngage.md index 83c2e3384c..363760b992 100644 --- a/docs/README-ngage.md +++ b/docs/README-ngage.md @@ -1,7 +1,7 @@ Nokia N-Gage ============ -SDL2 port for Symbian S60v1 and v2 with a main focus on the Nokia N-Gage +SDL port for Symbian S60v1 and v2 with a main focus on the Nokia N-Gage (Classic and QD) by [Michael Fitzmayer](https://github.com/mupfdev). Compiling @@ -12,7 +12,7 @@ The library is included in the [toolchain](https://github.com/ngagesdk/ngage-toolchain) as a sub-module. -A complete example project based on SDL2 can be found in the GitHub +A complete example project based on SDL can be found in the GitHub account of the SDK: [Wordle](https://github.com/ngagesdk/wordle). Current level of implementation diff --git a/docs/README-os2.md b/docs/README-os2.md index 1815b944d0..3024f11251 100644 --- a/docs/README-os2.md +++ b/docs/README-os2.md @@ -42,24 +42,21 @@ Installing: - eComStation: - If you have previously installed SDL2, make a Backup copy of SDL2.dll + If you have previously installed SDL3, make a Backup copy of SDL3.dll located in D:\ecs\dll (where D: is disk on which installed eComStation). - Stop all programs running with SDL2. Copy SDL2.dll to D:\ecs\dll + Stop all programs running with SDL3. Copy SDL3.dll to D:\ecs\dll - OS/2: - Copy SDL2.dll to any directory on your LIBPATH. If you have a previous - version installed, close all SDL2 applications before replacing the old + Copy SDL3.dll to any directory on your LIBPATH. If you have a previous + version installed, close all SDL3 applications before replacing the old copy. Also make sure that any other older versions of DLLs are removed from your system. -Joysticks in SDL2: +Joysticks: ------------------ -The joystick code in SDL2 is a direct forward-port from the SDL-1.2 version. -Here is the original documentation from SDL-1.2: - The Joystick detection only works for standard joysticks (2 buttons, 2 axes and the like). Therefore, if you use a non-standard joystick, you should specify its features in the SDL_OS2_JOYSTICK environment variable in a batch diff --git a/docs/README-ps2.md b/docs/README-ps2.md index b27b57d1a1..095e5685bf 100644 --- a/docs/README-ps2.md +++ b/docs/README-ps2.md @@ -1,6 +1,6 @@ PS2 ====== -SDL2 port for the Sony Playstation 2 contributed by: +SDL port for the Sony Playstation 2 contributed by: - Francisco Javier Trujillo Mata @@ -9,7 +9,7 @@ Credit to - David G. F. for helping me with several issues and tests. ## Building -To build SDL2 library for the PS2, make sure you have the latest PS2Dev status and run: +To build SDL library for the PS2, make sure you have the latest PS2Dev status and run: ```bash cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=$PS2DEV/ps2sdk/ps2dev.cmake cmake --build build @@ -48,4 +48,4 @@ Remember to do a clean compilation everytime you enable or disable the `SDL_PS2_ ## To Do - PS2 Screen Keyboard - Dialogs -- Others \ No newline at end of file +- Others diff --git a/docs/README-psp.md b/docs/README-psp.md index 0c84f866bb..5d9b34f8d7 100644 --- a/docs/README-psp.md +++ b/docs/README-psp.md @@ -1,6 +1,6 @@ PSP ====== -SDL2 port for the Sony PSP contributed by: +SDL port for the Sony PSP contributed by: - Captian Lex - Francisco Javier Trujillo Mata - Wouter Wijsman @@ -11,7 +11,7 @@ Credit to Geecko for his PSP GU lib "Glib2d" ## Building -To build SDL2 library for the PSP, make sure you have the latest PSPDev status and run: +To build SDL library for the PSP, make sure you have the latest PSPDev status and run: ```bash cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=$PSPDEV/psp/share/pspdev.cmake cmake --build build @@ -33,4 +33,4 @@ cmake --install build ## To Do - PSP Screen Keyboard -- Dialogs \ No newline at end of file +- Dialogs diff --git a/docs/README-raspberrypi.md b/docs/README-raspberrypi.md index d2eddb862a..fe13a1be67 100644 --- a/docs/README-raspberrypi.md +++ b/docs/README-raspberrypi.md @@ -81,13 +81,13 @@ The final step is compiling SDL itself. export CC="/opt/rpi-tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-gcc --sysroot=$SYSROOT -I$SYSROOT/opt/vc/include -I$SYSROOT/usr/include -I$SYSROOT/opt/vc/include/interface/vcos/pthreads -I$SYSROOT/opt/vc/include/interface/vmcs_host/linux" cd mkdir -p build;cd build - LDFLAGS="-L$SYSROOT/opt/vc/lib" ../configure --with-sysroot=$SYSROOT --host=arm-raspberry-linux-gnueabihf --prefix=$PWD/rpi-sdl2-installed --disable-pulseaudio --disable-esd + LDFLAGS="-L$SYSROOT/opt/vc/lib" ../configure --with-sysroot=$SYSROOT --host=arm-raspberry-linux-gnueabihf --prefix=$PWD/rpi-sdl3-installed --disable-pulseaudio --disable-esd make make install To be able to deploy this to /usr/local in the Raspbian system you need to fix up a few paths: - perl -w -pi -e "s#$PWD/rpi-sdl2-installed#/usr/local#g;" ./rpi-sdl2-installed/lib/libSDL2.la ./rpi-sdl2-installed/lib/pkgconfig/sdl2.pc ./rpi-sdl2-installed/bin/sdl2-config + perl -w -pi -e "s#$PWD/rpi-sdl3-installed#/usr/local#g;" ./rpi-sdl3-installed/lib/libSDL3.la ./rpi-sdl3-installed/lib/pkgconfig/sdl3.pc ./rpi-sdl3-installed/bin/sdl3-config Apps don't work or poor video/audio performance ----------------------------------------------- diff --git a/docs/README-riscos.md b/docs/README-riscos.md index 76b27e0aa3..f7ddb2e202 100644 --- a/docs/README-riscos.md +++ b/docs/README-riscos.md @@ -12,15 +12,15 @@ Requirements: Compiling: ---------- -Currently, SDL2 for RISC OS only supports compiling with GCCSDK under Linux. Both the autoconf and CMake build systems are supported. +Currently, SDL for RISC OS only supports compiling with GCCSDK under Linux. Both the autoconf and CMake build systems are supported. -The following commands can be used to build SDL2 for RISC OS using autoconf: +The following commands can be used to build SDL for RISC OS using autoconf: ./configure --host=arm-unknown-riscos --prefix=$GCCSDK_INSTALL_ENV --disable-gcc-atomics make make install -The following commands can be used to build SDL2 for RISC OS using CMake: +The following commands can be used to build SDL for RISC OS using CMake: cmake -Bbuild-riscos -DCMAKE_TOOLCHAIN_FILE=$GCCSDK_INSTALL_ENV/toolchain-riscos.cmake -DRISCOS=ON -DCMAKE_INSTALL_PREFIX=$GCCSDK_INSTALL_ENV -DCMAKE_BUILD_TYPE=Release -DSDL_GCC_ATOMICS=OFF cmake --build build-riscos diff --git a/docs/README-visualc.md b/docs/README-visualc.md index 759752a561..04ab63ff89 100644 --- a/docs/README-visualc.md +++ b/docs/README-visualc.md @@ -27,9 +27,9 @@ You may get a few warnings, but you should not get any errors. Later, we will refer to the following `.lib` and `.dll` files that have just been generated: -- `./VisualC/Win32/Debug/SDL2.dll` or `./VisualC/Win32/Release/SDL2.dll` -- `./VisualC/Win32/Debug/SDL2.lib` or `./VisualC/Win32/Release/SDL2.lib` -- `./VisualC/Win32/Debug/SDL2main.lib` or `./VisualC/Win32/Release/SDL2main.lib` +- `./VisualC/Win32/Debug/SDL3.dll` or `./VisualC/Win32/Release/SDL3.dll` +- `./VisualC/Win32/Debug/SDL3.lib` or `./VisualC/Win32/Release/SDL3.lib` +- `./VisualC/Win32/Debug/SDL3main.lib` or `./VisualC/Win32/Release/SDL3main.lib` _Note for the `x64` versions, just replace `Win32` in the path with `x64`_ @@ -59,12 +59,12 @@ Now we're going to use the files that we had created earlier in the *Build SDL* Copy the following file into your Project directory: -- `SDL2.dll` +- `SDL3.dll` Add the following files to your project (It is not necessary to copy them to your project directory): -- `SDL2.lib` -- `SDL2main.lib` +- `SDL3.lib` +- `SDL3main.lib` To add them to your project, right click on your project, and select `Add files to project`. @@ -73,7 +73,7 @@ To add them to your project, right click on your project, and select and type the names of the libraries to link with in the "Additional Options:" box. Note: This must be done for each build configuration (e.g. Release,Debug).** -### Hello SDL2 +### Hello SDL Here's a sample SDL snippet to verify everything is setup in your IDE: @@ -88,7 +88,7 @@ Here's a sample SDL snippet to verify everything is setup in your IDE: SDL_Renderer* renderer = NULL; SDL_Init(SDL_INIT_VIDEO); - window = SDL_CreateWindow("SDL2 Test", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, WIDTH, HEIGHT, SDL_WINDOW_SHOWN); + window = SDL_CreateWindow("Hello SDL", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, WIDTH, HEIGHT, SDL_WINDOW_SHOWN); renderer = SDL_CreateRenderer(window, -1, SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC); SDL_DestroyRenderer(renderer); diff --git a/docs/README-winrt.md b/docs/README-winrt.md index c05c77e02d..68271cc655 100644 --- a/docs/README-winrt.md +++ b/docs/README-winrt.md @@ -272,8 +272,8 @@ To include these files for C/C++ projects: 2. navigate to the directory containing SDL's source code, then into its subdirectory, 'src/main/winrt/'. Select, then add, the following files: - `SDL_winrt_main_NonXAML.cpp` - - `SDL2-WinRTResources.rc` - - `SDL2-WinRTResource_BlankCursor.cur` + - `SDL3-WinRTResources.rc` + - `SDL3-WinRTResource_BlankCursor.cur` 3. right-click on the file `SDL_winrt_main_NonXAML.cpp` (as listed in your project), then click on "Properties...". 4. in the drop-down box next to "Configuration", choose, "All Configurations" @@ -287,7 +287,7 @@ app's project. This is to make sure that Visual C++'s linker builds a 'Windows Metadata' file (.winmd) for your app. Not doing so can lead to build errors.** For non-C++ projects, you will need to call SDL_WinRTRunApp from your language's -main function, and generate SDL2-WinRTResources.res manually by using `rc` via +main function, and generate SDL3-WinRTResources.res manually by using `rc` via the Developer Command Prompt and including it as a within the first block in your Visual Studio project file. diff --git a/docs/doxyfile b/docs/doxyfile index 7b80a3a8da..a9d837c320 100644 --- a/docs/doxyfile +++ b/docs/doxyfile @@ -31,7 +31,7 @@ PROJECT_NAME = SDL # This could be handy for archiving the generated documentation or # if some version control system is used. -PROJECT_NUMBER = 2.0 +PROJECT_NUMBER = 3.0 # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) # base path where the generated documentation will be put. @@ -868,14 +868,14 @@ GENERATE_DOCSET = NO # documentation sets from a single provider (such as a company or product suite) # can be grouped. -DOCSET_FEEDNAME = "SDL 2.0 Doxygen" +DOCSET_FEEDNAME = "SDL 3.0 Doxygen" # When GENERATE_DOCSET tag is set to YES, this tag specifies a string that # should uniquely identify the documentation set bundle. This should be a # reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen # will append .docset to the name. -DOCSET_BUNDLE_ID = org.libsdl.sdl20 +DOCSET_BUNDLE_ID = org.libsdl.sdl30 # If the GENERATE_HTMLHELP tag is set to YES, additional index files # will be generated that can be used as input for tools like the @@ -889,7 +889,7 @@ GENERATE_HTMLHELP = NO # can add a path in front of the file if the result should not be # written to the html output directory. -CHM_FILE = ./sdl20.chm +CHM_FILE = ./sdl30.chm # If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can # be used to specify the location (absolute path including file name) of diff --git a/include/SDL.h b/include/SDL.h index 12e7f31a28..90e173822f 100644 --- a/include/SDL.h +++ b/include/SDL.h @@ -146,7 +146,7 @@ extern DECLSPEC int SDLCALL SDL_Init(Uint32 flags); /** * Compatibility function to initialize the SDL library. * - * In SDL2, this function and SDL_Init() are interchangeable. + * This function and SDL_Init() are interchangeable. * * \param flags any of the flags used by SDL_Init(); see SDL_Init for details. * \returns 0 on success or a negative error code on failure; call diff --git a/include/SDL_audio.h b/include/SDL_audio.h index c42de3ed97..ee6c5e0922 100644 --- a/include/SDL_audio.h +++ b/include/SDL_audio.h @@ -1211,7 +1211,7 @@ extern DECLSPEC void SDLCALL SDL_MixAudioFormat(Uint8 * dst, * You should not call SDL_LockAudio() on the device before queueing; SDL * handles locking internally for this function. * - * Note that SDL2 does not support planar audio. You will need to resample + * Note that SDL does not support planar audio. You will need to resample * from planar audio formats into a non-planar one (see SDL_AudioFormat) * before queuing audio. * diff --git a/include/SDL_hints.h b/include/SDL_hints.h index 76a74f0ffd..a7ab663a8f 100644 --- a/include/SDL_hints.h +++ b/include/SDL_hints.h @@ -352,7 +352,7 @@ extern "C" { * \brief Disable giving back control to the browser automatically * when running with asyncify * - * With -s ASYNCIFY, SDL2 calls emscripten_sleep during operations + * With -s ASYNCIFY, SDL calls emscripten_sleep during operations * such as refreshing the screen or polling events. * * This hint only applies to the emscripten platform diff --git a/include/SDL_main.h b/include/SDL_main.h index 113d11de06..b35b075366 100644 --- a/include/SDL_main.h +++ b/include/SDL_main.h @@ -55,7 +55,7 @@ /* On GDK, SDL provides a main function that initializes the game runtime. Please note that #include'ing SDL_main.h is not enough to get a main() - function working. You must either link against SDL2main or, if not possible, + function working. You must either link against SDL3main or, if not possible, call the SDL_GDKRunApp function from your entry point. */ #define SDL_MAIN_NEEDED diff --git a/include/SDL_test.h b/include/SDL_test.h index 8cc9d616a3..ae4eb5b236 100644 --- a/include/SDL_test.h +++ b/include/SDL_test.h @@ -24,7 +24,7 @@ * * Include file for SDL test framework. * - * This code is a part of the SDL2_test library, not the main SDL library. + * This code is a part of the SDL test library, not the main SDL library. */ #ifndef SDL_test_h_ diff --git a/include/SDL_test_assert.h b/include/SDL_test_assert.h index 734230529e..dd820edef1 100644 --- a/include/SDL_test_assert.h +++ b/include/SDL_test_assert.h @@ -24,7 +24,7 @@ * * Include file for SDL test framework. * - * This code is a part of the SDL2_test library, not the main SDL library. + * This code is a part of the SDL test library, not the main SDL library. */ /* diff --git a/include/SDL_test_common.h b/include/SDL_test_common.h index b86520d324..0d43070965 100644 --- a/include/SDL_test_common.h +++ b/include/SDL_test_common.h @@ -24,7 +24,7 @@ * * Include file for SDL test framework. * - * This code is a part of the SDL2_test library, not the main SDL library. + * This code is a part of the SDL test library, not the main SDL library. */ /* Ported from original test\common.h file. */ diff --git a/include/SDL_test_compare.h b/include/SDL_test_compare.h index 8a7a07008f..400a9da891 100644 --- a/include/SDL_test_compare.h +++ b/include/SDL_test_compare.h @@ -24,7 +24,7 @@ * * Include file for SDL test framework. * - * This code is a part of the SDL2_test library, not the main SDL library. + * This code is a part of the SDL test library, not the main SDL library. */ /* diff --git a/include/SDL_test_crc32.h b/include/SDL_test_crc32.h index 049da74061..86f6ce661b 100644 --- a/include/SDL_test_crc32.h +++ b/include/SDL_test_crc32.h @@ -24,7 +24,7 @@ * * Include file for SDL test framework. * - * This code is a part of the SDL2_test library, not the main SDL library. + * This code is a part of the SDL test library, not the main SDL library. */ /* diff --git a/include/SDL_test_font.h b/include/SDL_test_font.h index 6e7247dd76..2f02ae937f 100644 --- a/include/SDL_test_font.h +++ b/include/SDL_test_font.h @@ -24,7 +24,7 @@ * * Include file for SDL test framework. * - * This code is a part of the SDL2_test library, not the main SDL library. + * This code is a part of the SDL test library, not the main SDL library. */ #ifndef SDL_test_font_h_ diff --git a/include/SDL_test_fuzzer.h b/include/SDL_test_fuzzer.h index bbe8eb8749..ea0d14b2fd 100644 --- a/include/SDL_test_fuzzer.h +++ b/include/SDL_test_fuzzer.h @@ -24,7 +24,7 @@ * * Include file for SDL test framework. * - * This code is a part of the SDL2_test library, not the main SDL library. + * This code is a part of the SDL test library, not the main SDL library. */ /* diff --git a/include/SDL_test_harness.h b/include/SDL_test_harness.h index 1fd4236bee..453fe336fc 100644 --- a/include/SDL_test_harness.h +++ b/include/SDL_test_harness.h @@ -24,7 +24,7 @@ * * Include file for SDL test framework. * - * This code is a part of the SDL2_test library, not the main SDL library. + * This code is a part of the SDL test library, not the main SDL library. */ /* diff --git a/include/SDL_test_images.h b/include/SDL_test_images.h index e2bfc3600e..6cc3aaa991 100644 --- a/include/SDL_test_images.h +++ b/include/SDL_test_images.h @@ -24,7 +24,7 @@ * * Include file for SDL test framework. * - * This code is a part of the SDL2_test library, not the main SDL library. + * This code is a part of the SDL test library, not the main SDL library. */ /* diff --git a/include/SDL_test_log.h b/include/SDL_test_log.h index e3d39ad279..5e670d151c 100644 --- a/include/SDL_test_log.h +++ b/include/SDL_test_log.h @@ -24,7 +24,7 @@ * * Include file for SDL test framework. * - * This code is a part of the SDL2_test library, not the main SDL library. + * This code is a part of the SDL test library, not the main SDL library. */ /* diff --git a/include/SDL_test_md5.h b/include/SDL_test_md5.h index 17b1d2be71..3005b8bcd2 100644 --- a/include/SDL_test_md5.h +++ b/include/SDL_test_md5.h @@ -24,7 +24,7 @@ * * Include file for SDL test framework. * - * This code is a part of the SDL2_test library, not the main SDL library. + * This code is a part of the SDL test library, not the main SDL library. */ /* diff --git a/include/SDL_test_memory.h b/include/SDL_test_memory.h index cc2edc1b9b..4158ce34e3 100644 --- a/include/SDL_test_memory.h +++ b/include/SDL_test_memory.h @@ -24,7 +24,7 @@ * * Include file for SDL test framework. * - * This code is a part of the SDL2_test library, not the main SDL library. + * This code is a part of the SDL test library, not the main SDL library. */ #ifndef SDL_test_memory_h_ diff --git a/include/SDL_test_random.h b/include/SDL_test_random.h index b1d6060cb2..6da8b9ef5d 100644 --- a/include/SDL_test_random.h +++ b/include/SDL_test_random.h @@ -24,7 +24,7 @@ * * Include file for SDL test framework. * - * This code is a part of the SDL2_test library, not the main SDL library. + * This code is a part of the SDL test library, not the main SDL library. */ /* diff --git a/include/SDL_thread.h b/include/SDL_thread.h index 7364f81371..6bedcb555d 100644 --- a/include/SDL_thread.h +++ b/include/SDL_thread.h @@ -94,15 +94,15 @@ typedef int (SDLCALL * SDL_ThreadFunction) (void *data); * * We compile SDL into a DLL. This means, that it's the DLL which * creates a new thread for the calling process with the SDL_CreateThread() - * API. There is a problem with this, that only the RTL of the SDL2.DLL will + * API. There is a problem with this, that only the RTL of the SDL3.DLL will * be initialized for those threads, and not the RTL of the calling * application! * * To solve this, we make a little hack here. * * We'll always use the caller's _beginthread() and _endthread() APIs to - * start a new thread. This way, if it's the SDL2.DLL which uses this API, - * then the RTL of SDL2.DLL will be used to create the new thread, and if it's + * start a new thread. This way, if it's the SDL3.DLL which uses this API, + * then the RTL of SDL3.DLL will be used to create the new thread, and if it's * the application, then the RTL of the application will be used. * * So, in short: @@ -147,7 +147,7 @@ SDL_CreateThreadWithStackSize(SDL_ThreadFunction fn, #elif defined(__OS2__) /* - * just like the windows case above: We compile SDL2 + * just like the windows case above: We compile SDL3 * into a dll with Watcom's runtime statically linked. */ #define SDL_PASSED_BEGINTHREAD_ENDTHREAD diff --git a/include/SDL_version.h b/include/SDL_version.h index e85fceb346..75cc891497 100644 --- a/include/SDL_version.h +++ b/include/SDL_version.h @@ -57,8 +57,8 @@ typedef struct SDL_version /* Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL */ -#define SDL_MAJOR_VERSION 2 -#define SDL_MINOR_VERSION 26 +#define SDL_MAJOR_VERSION 3 +#define SDL_MINOR_VERSION 0 #define SDL_PATCHLEVEL 0 /** @@ -84,7 +84,7 @@ typedef struct SDL_version } /* TODO: Remove this whole block in SDL 3 */ -#if SDL_MAJOR_VERSION < 3 +#if SDL_MAJOR_VERSION <= 3 /** * This macro turns the version numbers into a numeric value: * \verbatim diff --git a/mingw/pkg-support/cmake/sdl2-config-version.cmake b/mingw/pkg-support/cmake/sdl2-config-version.cmake deleted file mode 100644 index 9f7a8b34dc..0000000000 --- a/mingw/pkg-support/cmake/sdl2-config-version.cmake +++ /dev/null @@ -1,19 +0,0 @@ -# SDL2 CMake version configuration file: -# This file is meant to be placed in a cmake subfolder of SDL2-devel-2.x.y-mingw - -if(CMAKE_SIZEOF_VOID_P EQUAL 4) - set(sdl2_config_path "${CMAKE_CURRENT_LIST_DIR}/../i686-w64-mingw32/lib/cmake/SDL2/sdl2-config-version.cmake") -elseif(CMAKE_SIZEOF_VOID_P EQUAL 8) - set(sdl2_config_path "${CMAKE_CURRENT_LIST_DIR}/../x86_64-w64-mingw32/lib/cmake/SDL2/sdl2-config-version.cmake") -else() - set(PACKAGE_VERSION_UNSUITABLE TRUE) - return() -endif() - -if(NOT EXISTS "${sdl2_config_path}") - message(WARNING "${sdl2_config_path} does not exist: MinGW development package is corrupted") - set(PACKAGE_VERSION_UNSUITABLE TRUE) - return() -endif() - -include("${sdl2_config_path}") diff --git a/mingw/pkg-support/cmake/sdl2-config.cmake b/mingw/pkg-support/cmake/sdl2-config.cmake deleted file mode 100644 index 3c0799fbca..0000000000 --- a/mingw/pkg-support/cmake/sdl2-config.cmake +++ /dev/null @@ -1,19 +0,0 @@ -# SDL2 CMake configuration file: -# This file is meant to be placed in a cmake subfolder of SDL2-devel-2.x.y-mingw - -if(CMAKE_SIZEOF_VOID_P EQUAL 4) - set(sdl2_config_path "${CMAKE_CURRENT_LIST_DIR}/../i686-w64-mingw32/lib/cmake/SDL2/sdl2-config.cmake") -elseif(CMAKE_SIZEOF_VOID_P EQUAL 8) - set(sdl2_config_path "${CMAKE_CURRENT_LIST_DIR}/../x86_64-w64-mingw32/lib/cmake/SDL2/sdl2-config.cmake") -else() - set(SDL2_FOUND FALSE) - return() -endif() - -if(NOT EXISTS "${sdl2_config_path}") - message(WARNING "${sdl2_config_path} does not exist: MinGW development package is corrupted") - set(SDL2_FOUND FALSE) - return() -endif() - -include("${sdl2_config_path}") diff --git a/mingw/pkg-support/cmake/sdl3-config-version.cmake b/mingw/pkg-support/cmake/sdl3-config-version.cmake new file mode 100644 index 0000000000..2f2bdffd49 --- /dev/null +++ b/mingw/pkg-support/cmake/sdl3-config-version.cmake @@ -0,0 +1,19 @@ +# SDL3 CMake version configuration file: +# This file is meant to be placed in a cmake subfolder of SDL3-devel-2.x.y-mingw + +if(CMAKE_SIZEOF_VOID_P EQUAL 4) + set(sdl3_config_path "${CMAKE_CURRENT_LIST_DIR}/../i686-w64-mingw32/lib/cmake/SDL3/sdl3-config-version.cmake") +elseif(CMAKE_SIZEOF_VOID_P EQUAL 8) + set(sdl3_config_path "${CMAKE_CURRENT_LIST_DIR}/../x86_64-w64-mingw32/lib/cmake/SDL3/sdl3-config-version.cmake") +else() + set(PACKAGE_VERSION_UNSUITABLE TRUE) + return() +endif() + +if(NOT EXISTS "${sdl3_config_path}") + message(WARNING "${sdl3_config_path} does not exist: MinGW development package is corrupted") + set(PACKAGE_VERSION_UNSUITABLE TRUE) + return() +endif() + +include("${sdl3_config_path}") diff --git a/mingw/pkg-support/cmake/sdl3-config.cmake b/mingw/pkg-support/cmake/sdl3-config.cmake new file mode 100644 index 0000000000..291845f995 --- /dev/null +++ b/mingw/pkg-support/cmake/sdl3-config.cmake @@ -0,0 +1,19 @@ +# SDL3 CMake configuration file: +# This file is meant to be placed in a cmake subfolder of SDL3-devel-2.x.y-mingw + +if(CMAKE_SIZEOF_VOID_P EQUAL 4) + set(sdl3_config_path "${CMAKE_CURRENT_LIST_DIR}/../i686-w64-mingw32/lib/cmake/SDL3/sdl3-config.cmake") +elseif(CMAKE_SIZEOF_VOID_P EQUAL 8) + set(sdl3_config_path "${CMAKE_CURRENT_LIST_DIR}/../x86_64-w64-mingw32/lib/cmake/SDL3/sdl3-config.cmake") +else() + set(SDL3_FOUND FALSE) + return() +endif() + +if(NOT EXISTS "${sdl3_config_path}") + message(WARNING "${sdl3_config_path} does not exist: MinGW development package is corrupted") + set(SDL3_FOUND FALSE) + return() +endif() + +include("${sdl3_config_path}") diff --git a/sdl2-config.cmake.in b/sdl2-config.cmake.in deleted file mode 100644 index 5d6cf4335f..0000000000 --- a/sdl2-config.cmake.in +++ /dev/null @@ -1,206 +0,0 @@ -# sdl2 cmake project-config input for ./configure script - -include(FeatureSummary) -set_package_properties(SDL2 PROPERTIES - URL "https://www.libsdl.org/" - DESCRIPTION "low level access to audio, keyboard, mouse, joystick, and graphics hardware" -) - -# Copied from `configure_package_config_file` -macro(set_and_check _var _file) - set(${_var} "${_file}") - if(NOT EXISTS "${_file}") - message(FATAL_ERROR "File or directory ${_file} referenced by variable ${_var} does not exist !") - endif() -endmacro() - -get_filename_component(prefix "${CMAKE_CURRENT_LIST_DIR}/@cmake_prefix_relpath@" ABSOLUTE) - -set(exec_prefix "@exec_prefix@") -set(bindir "@bindir@") -set(libdir "@libdir@") -set(includedir "@includedir@") - -set_and_check(SDL2_PREFIX "${prefix}") -set_and_check(SDL2_EXEC_PREFIX "${exec_prefix}") -set_and_check(SDL2_BINDIR "${bindir}") -set_and_check(SDL2_INCLUDE_DIR "${includedir}/SDL2") -set_and_check(SDL2_LIBDIR "${libdir}") -set(SDL2_INCLUDE_DIRS "${includedir};${SDL2_INCLUDE_DIR}") - -set(SDL2_LIBRARIES SDL2::SDL2) -set(SDL2_STATIC_LIBRARIES SDL2::SDL2-static) -set(SDL2MAIN_LIBRARY) -set(SDL2TEST_LIBRARY SDL2::SDL2test) - -unset(prefix) -unset(exec_prefix) -unset(bindir) -unset(libdir) -unset(includedir) - -set(_sdl2_libraries_in "@SDL_LIBS@") -set(_sdl2_static_private_libs_in "@SDL_STATIC_LIBS@") - -# Convert _sdl2_libraries to list and keep only libraries + library directories -string(REGEX MATCHALL "-[lm]([-a-zA-Z0-9._]+)" _sdl2_libraries "${_sdl2_libraries_in}") -string(REGEX REPLACE "^-l" "" _sdl2_libraries "${_sdl2_libraries}") -string(REGEX REPLACE ";-l" ";" _sdl2_libraries "${_sdl2_libraries}") -string(REGEX MATCHALL "-L([-a-zA-Z0-9._/]+)" _sdl2_libdirs "${_sdl2_libraries_in}") -string(REGEX REPLACE "^-L" "" _sdl2_libdirs "${_sdl2_libdirs}") -string(REGEX REPLACE ";-L" ";" _sdl2_libdirs "${_sdl2_libdirs}") -list(APPEND _sdl2_libdirs "${SDL2_LIBDIR}") - -# Convert _sdl2_static_private_libs to list and keep only libraries + library directories -string(REGEX MATCHALL "(-[lm]([-a-zA-Z0-9._]+))|(-Wl,[^ ]*framework[^ ]*)|(-pthread)" _sdl2_static_private_libs "${_sdl2_static_private_libs_in}") -string(REGEX REPLACE "^-l" "" _sdl2_static_private_libs "${_sdl2_static_private_libs}") -string(REGEX REPLACE ";-l" ";" _sdl2_static_private_libs "${_sdl2_static_private_libs}") -string(REGEX MATCHALL "-L([-a-zA-Z0-9._/]+)" _sdl2_static_private_libdirs "${_sdl2_static_private_libs_in}") -string(REGEX REPLACE "^-L" "" _sdl2_static_private_libdirs "${_sdl2_static_private_libdirs}") -string(REGEX REPLACE ";-L" ";" _sdl2_static_private_libdirs "${_sdl2_static_private_libdirs}") - -if(_sdl2_libraries MATCHES ".*SDL2main.*") - list(INSERT SDL2_LIBRARIES 0 SDL2::SDL2main) - list(INSERT SDL2_STATIC_LIBRARIES 0 SDL2::SDL2main) -endif() - -set(_sdl2main_library ${SDL2_LIBDIR}/${CMAKE_STATIC_LIBRARY_PREFIX}SDL2main${CMAKE_STATIC_LIBRARY_SUFFIX}) -if(EXISTS "${_sdl2main_library}") - set(SDL2MAIN_LIBRARY SDL2::SDL2main) - if(NOT TARGET SDL2::SDL2main) - add_library(SDL2::SDL2main STATIC IMPORTED) - set_target_properties(SDL2::SDL2main - PROPERTIES - IMPORTED_LOCATION "${_sdl2main_library}" - ) - if(WIN32) - # INTERFACE_LINK_OPTIONS needs CMake 3.13 - cmake_minimum_required(VERSION 3.13) - # Mark WinMain/WinMain@16 as undefined, such that it will be withheld by the linker. - if(CMAKE_SIZEOF_VOID_P EQUAL 4) - set_target_properties(SDL2::SDL2main - PROPERTIES - INTERFACE_LINK_OPTIONS "$<$,EXECUTABLE>:-Wl,--undefined=_WinMain@16>" - ) - else() - set_target_properties(SDL2::SDL2main - PROPERTIES - INTERFACE_LINK_OPTIONS "$<$,EXECUTABLE>:-Wl,--undefined=WinMain>" - ) - endif() - endif() - endif() - set(SDL2_SDL2main_FOUND TRUE) -else() - set(SDL2_SDL2main_FOUND FALSE) -endif() -unset(_sdl2main_library) - -# Remove SDL2 since this is the "central" library -# Remove SDL2main since this will be provided by SDL2::SDL2main (if available) -# Remove mingw32 and cygwin since these are not needed when using `-Wl,--undefined,WinMain` -set(_sdl2_link_libraries ${_sdl2_libraries}) -list(REMOVE_ITEM _sdl2_link_libraries SDL2 SDL2main mingw32 cygwin) - -if(WIN32) - set(_sdl2_implib "${SDL2_LIBDIR}/${CMAKE_STATIC_LIBRARY_PREFIX}SDL2${CMAKE_SHARED_LIBRARY_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}") - set(_sdl2_dll "${SDL2_BINDIR}/SDL2${CMAKE_SHARED_LIBRARY_SUFFIX}") - if(EXISTS "${_sdl2_implib}" AND EXISTS "${_sdl2_dll}") - if(NOT TARGET SDL2::SDL2) - add_library(SDL2::SDL2 SHARED IMPORTED) - set_target_properties(SDL2::SDL2 PROPERTIES - INTERFACE_INCLUDE_DIRECTORIES "${SDL2_INCLUDE_DIR}" - INTERFACE_LINK_LIBRARIES "${_sdl2_link_libraries}" - INTERFACE_LINK_DIRECTORIES "${_sdl2_libdirs}" - IMPORTED_LINK_INTERFACE_LANGUAGES "C" - IMPORTED_IMPLIB "${_sdl2_implib}" - IMPORTED_LOCATION "${_sdl2_dll}" - ) - endif() - set(SDL2_SDL2_FOUND TRUE) - else() - set(SDL2_SDL2_FOUND FALSE) - endif() - unset(_sdl2_implib) - unset(_sdl2_dll) -else() - set(_sdl2_shared "${SDL2_LIBDIR}/${CMAKE_SHARED_LIBRARY_PREFIX}SDL2${CMAKE_SHARED_LIBRARY_SUFFIX}") - if(EXISTS "${_sdl2_shared}") - if(NOT TARGET SDL2::SDL2) - add_library(SDL2::SDL2 SHARED IMPORTED) - set_target_properties(SDL2::SDL2 PROPERTIES - INTERFACE_INCLUDE_DIRECTORIES "${SDL2_INCLUDE_DIR}" - INTERFACE_LINK_LIBRARIES "${_sdl2_link_libraries}" - INTERFACE_LINK_DIRECTORIES "${_sdl2_libdirs}" - IMPORTED_LINK_INTERFACE_LANGUAGES "C" - IMPORTED_LOCATION "${_sdl2_shared}" - ) - endif() - set(SDL2_SDL2_FOUND TRUE) - else() - set(SDL2_SDL2_FOUND FALSE) - endif() - unset(_sdl2_shared) -endif() - -set(_sdl2_static "${SDL2_LIBDIR}/${CMAKE_STATIC_LIBRARY_PREFIX}SDL2${CMAKE_STATIC_LIBRARY_SUFFIX}") -if(EXISTS "${_sdl2_static}") - if(NOT TARGET SDL2::SDL2-static) - add_library(SDL2::SDL2-static STATIC IMPORTED) - set_target_properties(SDL2::SDL2-static - PROPERTIES - IMPORTED_LOCATION "${_sdl2_static}" - INTERFACE_INCLUDE_DIRECTORIES "${SDL2_INCLUDE_DIR}" - INTERFACE_LINK_LIBRARIES "${_sdl2_link_libraries};${_sdl2_static_private_libs}" - INTERFACE_LINK_DIRECTORIES "${_sdl2_libdirs};${_sdl2_static_private_libdirs}" - IMPORTED_LINK_INTERFACE_LANGUAGES "C" - ) - endif() - set(SDL2_SDL2-static_FOUND TRUE) -else() - set(SDL2_SDL2-static_FOUND FALSE) -endif() -unset(_sdl2_static) - -unset(_sdl2_link_libraries) - -set(_sdl2test_library "${SDL2_LIBDIR}/${CMAKE_STATIC_LIBRARY_PREFIX}SDL2_test${CMAKE_STATIC_LIBRARY_SUFFIX}") -if(EXISTS "${_sdl2test_library}") - if(NOT TARGET SDL2::SDL2test) - add_library(SDL2::SDL2test STATIC IMPORTED) - set_target_properties(SDL2::SDL2test - PROPERTIES - IMPORTED_LOCATION "${_sdl2test_library}" - INTERFACE_INCLUDE_DIRECTORIES "${SDL2_INCLUDE_DIR}" - IMPORTED_LINK_INTERFACE_LANGUAGES "C" - ) - endif() - set(SDL2_SDL2test_FOUND TRUE) -else() - set(SDL2_SDL2test_FOUND FALSE) -endif() -unset(_sdl2test_library) - -# Copied from `configure_package_config_file` -macro(check_required_components _NAME) - foreach(comp ${${_NAME}_FIND_COMPONENTS}) - if(NOT ${_NAME}_${comp}_FOUND) - if(${_NAME}_FIND_REQUIRED_${comp}) - set(${_NAME}_FOUND FALSE) - endif() - endif() - endforeach() -endmacro() - -check_required_components(SDL2) - -# Create SDL2::SDL2 alias for static-only builds -if(TARGET SDL2::SDL2-static AND NOT TARGET SDL2::SDL2) - if(CMAKE_VERSION VERSION_LESS "3.18") - # FIXME: Aliasing local targets is not supported on CMake < 3.18, so make it global. - add_library(SDL2::SDL2 INTERFACE IMPORTED) - set_target_properties(SDL2::SDL2 PROPERTIES INTERFACE_LINK_LIBRARIES "SDL2::SDL2-static") - else() - add_library(SDL2::SDL2 ALIAS SDL2::SDL2-static) - endif() -endif() diff --git a/sdl2-config-version.cmake.in b/sdl3-config-version.cmake.in similarity index 81% rename from sdl2-config-version.cmake.in rename to sdl3-config-version.cmake.in index 5c6aee44d4..cdb37b1dda 100644 --- a/sdl2-config-version.cmake.in +++ b/sdl3-config-version.cmake.in @@ -1,4 +1,4 @@ -# sdl2 cmake project-config-version input for ./configure scripts +# sdl3 cmake project-config-version input for ./configure scripts set(PACKAGE_VERSION "@SDL_VERSION@") diff --git a/sdl3-config.cmake.in b/sdl3-config.cmake.in new file mode 100644 index 0000000000..0e1184fb51 --- /dev/null +++ b/sdl3-config.cmake.in @@ -0,0 +1,206 @@ +# sdl3 cmake project-config input for ./configure script + +include(FeatureSummary) +set_package_properties(SDL3 PROPERTIES + URL "https://www.libsdl.org/" + DESCRIPTION "low level access to audio, keyboard, mouse, joystick, and graphics hardware" +) + +# Copied from `configure_package_config_file` +macro(set_and_check _var _file) + set(${_var} "${_file}") + if(NOT EXISTS "${_file}") + message(FATAL_ERROR "File or directory ${_file} referenced by variable ${_var} does not exist !") + endif() +endmacro() + +get_filename_component(prefix "${CMAKE_CURRENT_LIST_DIR}/@cmake_prefix_relpath@" ABSOLUTE) + +set(exec_prefix "@exec_prefix@") +set(bindir "@bindir@") +set(libdir "@libdir@") +set(includedir "@includedir@") + +set_and_check(SDL3_PREFIX "${prefix}") +set_and_check(SDL3_EXEC_PREFIX "${exec_prefix}") +set_and_check(SDL3_BINDIR "${bindir}") +set_and_check(SDL3_INCLUDE_DIR "${includedir}/SDL3") +set_and_check(SDL3_LIBDIR "${libdir}") +set(SDL3_INCLUDE_DIRS "${includedir};${SDL3_INCLUDE_DIR}") + +set(SDL3_LIBRARIES SDL3::SDL3) +set(SDL3_STATIC_LIBRARIES SDL3::SDL3-static) +set(SDL3MAIN_LIBRARY) +set(SDL3TEST_LIBRARY SDL3::SDL3test) + +unset(prefix) +unset(exec_prefix) +unset(bindir) +unset(libdir) +unset(includedir) + +set(_sdl3_libraries_in "@SDL_LIBS@") +set(_sdl3_static_private_libs_in "@SDL_STATIC_LIBS@") + +# Convert _sdl3_libraries to list and keep only libraries + library directories +string(REGEX MATCHALL "-[lm]([-a-zA-Z0-9._]+)" _sdl3_libraries "${_sdl3_libraries_in}") +string(REGEX REPLACE "^-l" "" _sdl3_libraries "${_sdl3_libraries}") +string(REGEX REPLACE ";-l" ";" _sdl3_libraries "${_sdl3_libraries}") +string(REGEX MATCHALL "-L([-a-zA-Z0-9._/]+)" _sdl3_libdirs "${_sdl3_libraries_in}") +string(REGEX REPLACE "^-L" "" _sdl3_libdirs "${_sdl3_libdirs}") +string(REGEX REPLACE ";-L" ";" _sdl3_libdirs "${_sdl3_libdirs}") +list(APPEND _sdl3_libdirs "${SDL3_LIBDIR}") + +# Convert _sdl3_static_private_libs to list and keep only libraries + library directories +string(REGEX MATCHALL "(-[lm]([-a-zA-Z0-9._]+))|(-Wl,[^ ]*framework[^ ]*)|(-pthread)" _sdl3_static_private_libs "${_sdl3_static_private_libs_in}") +string(REGEX REPLACE "^-l" "" _sdl3_static_private_libs "${_sdl3_static_private_libs}") +string(REGEX REPLACE ";-l" ";" _sdl3_static_private_libs "${_sdl3_static_private_libs}") +string(REGEX MATCHALL "-L([-a-zA-Z0-9._/]+)" _sdl3_static_private_libdirs "${_sdl3_static_private_libs_in}") +string(REGEX REPLACE "^-L" "" _sdl3_static_private_libdirs "${_sdl3_static_private_libdirs}") +string(REGEX REPLACE ";-L" ";" _sdl3_static_private_libdirs "${_sdl3_static_private_libdirs}") + +if(_sdl3_libraries MATCHES ".*SDL3main.*") + list(INSERT SDL3_LIBRARIES 0 SDL3::SDL3main) + list(INSERT SDL3_STATIC_LIBRARIES 0 SDL3::SDL3main) +endif() + +set(_sdl3main_library ${SDL3_LIBDIR}/${CMAKE_STATIC_LIBRARY_PREFIX}SDL3main${CMAKE_STATIC_LIBRARY_SUFFIX}) +if(EXISTS "${_sdl3main_library}") + set(SDL3MAIN_LIBRARY SDL3::SDL3main) + if(NOT TARGET SDL3::SDL3main) + add_library(SDL3::SDL3main STATIC IMPORTED) + set_target_properties(SDL3::SDL3main + PROPERTIES + IMPORTED_LOCATION "${_sdl3main_library}" + ) + if(WIN32) + # INTERFACE_LINK_OPTIONS needs CMake 3.13 + cmake_minimum_required(VERSION 3.13) + # Mark WinMain/WinMain@16 as undefined, such that it will be withheld by the linker. + if(CMAKE_SIZEOF_VOID_P EQUAL 4) + set_target_properties(SDL3::SDL3main + PROPERTIES + INTERFACE_LINK_OPTIONS "$<$,EXECUTABLE>:-Wl,--undefined=_WinMain@16>" + ) + else() + set_target_properties(SDL3::SDL3main + PROPERTIES + INTERFACE_LINK_OPTIONS "$<$,EXECUTABLE>:-Wl,--undefined=WinMain>" + ) + endif() + endif() + endif() + set(SDL3_SDL3main_FOUND TRUE) +else() + set(SDL3_SDL3main_FOUND FALSE) +endif() +unset(_sdl3main_library) + +# Remove SDL3 since this is the "central" library +# Remove SDL3main since this will be provided by SDL3::SDL3main (if available) +# Remove mingw32 and cygwin since these are not needed when using `-Wl,--undefined,WinMain` +set(_sdl3_link_libraries ${_sdl3_libraries}) +list(REMOVE_ITEM _sdl3_link_libraries SDL3 SDL3main mingw32 cygwin) + +if(WIN32) + set(_sdl3_implib "${SDL3_LIBDIR}/${CMAKE_STATIC_LIBRARY_PREFIX}SDL3${CMAKE_SHARED_LIBRARY_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}") + set(_sdl3_dll "${SDL3_BINDIR}/SDL3${CMAKE_SHARED_LIBRARY_SUFFIX}") + if(EXISTS "${_sdl3_implib}" AND EXISTS "${_sdl3_dll}") + if(NOT TARGET SDL3::SDL3) + add_library(SDL3::SDL3 SHARED IMPORTED) + set_target_properties(SDL3::SDL3 PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${SDL3_INCLUDE_DIR}" + INTERFACE_LINK_LIBRARIES "${_sdl3_link_libraries}" + INTERFACE_LINK_DIRECTORIES "${_sdl3_libdirs}" + IMPORTED_LINK_INTERFACE_LANGUAGES "C" + IMPORTED_IMPLIB "${_sdl3_implib}" + IMPORTED_LOCATION "${_sdl3_dll}" + ) + endif() + set(SDL3_SDL3_FOUND TRUE) + else() + set(SDL3_SDL3_FOUND FALSE) + endif() + unset(_sdl3_implib) + unset(_sdl3_dll) +else() + set(_sdl3_shared "${SDL3_LIBDIR}/${CMAKE_SHARED_LIBRARY_PREFIX}SDL3${CMAKE_SHARED_LIBRARY_SUFFIX}") + if(EXISTS "${_sdl3_shared}") + if(NOT TARGET SDL3::SDL3) + add_library(SDL3::SDL3 SHARED IMPORTED) + set_target_properties(SDL3::SDL3 PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${SDL3_INCLUDE_DIR}" + INTERFACE_LINK_LIBRARIES "${_sdl3_link_libraries}" + INTERFACE_LINK_DIRECTORIES "${_sdl3_libdirs}" + IMPORTED_LINK_INTERFACE_LANGUAGES "C" + IMPORTED_LOCATION "${_sdl3_shared}" + ) + endif() + set(SDL3_SDL3_FOUND TRUE) + else() + set(SDL3_SDL3_FOUND FALSE) + endif() + unset(_sdl3_shared) +endif() + +set(_sdl3_static "${SDL3_LIBDIR}/${CMAKE_STATIC_LIBRARY_PREFIX}SDL3${CMAKE_STATIC_LIBRARY_SUFFIX}") +if(EXISTS "${_sdl3_static}") + if(NOT TARGET SDL3::SDL3-static) + add_library(SDL3::SDL3-static STATIC IMPORTED) + set_target_properties(SDL3::SDL3-static + PROPERTIES + IMPORTED_LOCATION "${_sdl3_static}" + INTERFACE_INCLUDE_DIRECTORIES "${SDL3_INCLUDE_DIR}" + INTERFACE_LINK_LIBRARIES "${_sdl3_link_libraries};${_sdl3_static_private_libs}" + INTERFACE_LINK_DIRECTORIES "${_sdl3_libdirs};${_sdl3_static_private_libdirs}" + IMPORTED_LINK_INTERFACE_LANGUAGES "C" + ) + endif() + set(SDL3_SDL3-static_FOUND TRUE) +else() + set(SDL3_SDL3-static_FOUND FALSE) +endif() +unset(_sdl3_static) + +unset(_sdl3_link_libraries) + +set(_sdl3test_library "${SDL3_LIBDIR}/${CMAKE_STATIC_LIBRARY_PREFIX}SDL3_test${CMAKE_STATIC_LIBRARY_SUFFIX}") +if(EXISTS "${_sdl3test_library}") + if(NOT TARGET SDL3::SDL3test) + add_library(SDL3::SDL3test STATIC IMPORTED) + set_target_properties(SDL3::SDL3test + PROPERTIES + IMPORTED_LOCATION "${_sdl3test_library}" + INTERFACE_INCLUDE_DIRECTORIES "${SDL3_INCLUDE_DIR}" + IMPORTED_LINK_INTERFACE_LANGUAGES "C" + ) + endif() + set(SDL3_SDL3test_FOUND TRUE) +else() + set(SDL3_SDL3test_FOUND FALSE) +endif() +unset(_sdl3test_library) + +# Copied from `configure_package_config_file` +macro(check_required_components _NAME) + foreach(comp ${${_NAME}_FIND_COMPONENTS}) + if(NOT ${_NAME}_${comp}_FOUND) + if(${_NAME}_FIND_REQUIRED_${comp}) + set(${_NAME}_FOUND FALSE) + endif() + endif() + endforeach() +endmacro() + +check_required_components(SDL3) + +# Create SDL3::SDL3 alias for static-only builds +if(TARGET SDL3::SDL3-static AND NOT TARGET SDL3::SDL3) + if(CMAKE_VERSION VERSION_LESS "3.18") + # FIXME: Aliasing local targets is not supported on CMake < 3.18, so make it global. + add_library(SDL3::SDL3 INTERFACE IMPORTED) + set_target_properties(SDL3::SDL3 PROPERTIES INTERFACE_LINK_LIBRARIES "SDL3::SDL3-static") + else() + add_library(SDL3::SDL3 ALIAS SDL3::SDL3-static) + endif() +endif() diff --git a/sdl2-config.in b/sdl3-config.in similarity index 94% rename from sdl2-config.in rename to sdl3-config.in index f6eca7668c..46aff2df66 100644 --- a/sdl2-config.in +++ b/sdl3-config.in @@ -46,14 +46,14 @@ while test $# -gt 0; do echo @SDL_VERSION@ ;; --cflags) - echo -I@includedir@/SDL2 @SDL_CFLAGS@ + echo -I@includedir@/SDL3 @SDL_CFLAGS@ ;; @ENABLE_SHARED_TRUE@ --libs) @ENABLE_SHARED_TRUE@ echo -L@libdir@ @SDL_RLD_FLAGS@ @SDL_LIBS@ @ENABLE_SHARED_TRUE@ ;; @ENABLE_STATIC_TRUE@@ENABLE_SHARED_TRUE@ --static-libs) @ENABLE_STATIC_TRUE@@ENABLE_SHARED_FALSE@ --libs|--static-libs) -@ENABLE_STATIC_TRUE@ sdl_static_libs=$(echo "@SDL_LIBS@ @SDL_STATIC_LIBS@" | sed -E "s#-lSDL2[ $]#$libdir/libSDL2.a #g") +@ENABLE_STATIC_TRUE@ sdl_static_libs=$(echo "@SDL_LIBS@ @SDL_STATIC_LIBS@" | sed -E "s#-lSDL3[ $]#$libdir/libSDL3.a #g") @ENABLE_STATIC_TRUE@ echo -L@libdir@ $sdl_static_libs @ENABLE_STATIC_TRUE@ ;; *) diff --git a/sdl2.m4 b/sdl3.m4 similarity index 73% rename from sdl2.m4 rename to sdl3.m4 index 75b60f6ea9..88d426f135 100644 --- a/sdl2.m4 +++ b/sdl3.m4 @@ -6,18 +6,18 @@ # Shamelessly stolen from Owen Taylor # # Changelog: -# * also look for SDL2.framework under Mac OS X +# * also look for SDL3.framework under Mac OS X # * removed HP/UX 9 support. # * updated for newer autoconf. # serial 2 -dnl AM_PATH_SDL2([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) +dnl AM_PATH_SDL3([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) dnl Test for SDL, and define SDL_CFLAGS and SDL_LIBS dnl -AC_DEFUN([AM_PATH_SDL2], +AC_DEFUN([AM_PATH_SDL3], [dnl -dnl Get the cflags and libraries from the sdl2-config script +dnl Get the cflags and libraries from the sdl3-config script dnl AC_ARG_WITH(sdl-prefix,[ --with-sdl-prefix=PFX Prefix where SDL is installed (optional)], sdl_prefix="$withval", sdl_prefix="") @@ -25,53 +25,53 @@ AC_ARG_WITH(sdl-exec-prefix,[ --with-sdl-exec-prefix=PFX Exec prefix where SDL sdl_exec_prefix="$withval", sdl_exec_prefix="") AC_ARG_ENABLE(sdltest, [ --disable-sdltest Do not try to compile and run a test SDL program], , enable_sdltest=yes) -AC_ARG_ENABLE(sdlframework, [ --disable-sdlframework Do not search for SDL2.framework], +AC_ARG_ENABLE(sdlframework, [ --disable-sdlframework Do not search for SDL3.framework], , search_sdl_framework=yes) -AC_ARG_VAR(SDL2_FRAMEWORK, [Path to SDL2.framework]) +AC_ARG_VAR(SDL3_FRAMEWORK, [Path to SDL3.framework]) - min_sdl_version=ifelse([$1], ,2.0.0,$1) + min_sdl_version=ifelse([$1], ,3.0.0,$1) if test "x$sdl_prefix$sdl_exec_prefix" = x ; then - PKG_CHECK_MODULES([SDL], [sdl2 >= $min_sdl_version], + PKG_CHECK_MODULES([SDL], [sdl3 >= $min_sdl_version], [sdl_pc=yes], [sdl_pc=no]) else sdl_pc=no if test x$sdl_exec_prefix != x ; then sdl_config_args="$sdl_config_args --exec-prefix=$sdl_exec_prefix" - if test x${SDL2_CONFIG+set} != xset ; then - SDL2_CONFIG=$sdl_exec_prefix/bin/sdl2-config + if test x${SDL3_CONFIG+set} != xset ; then + SDL3_CONFIG=$sdl_exec_prefix/bin/sdl3-config fi fi if test x$sdl_prefix != x ; then sdl_config_args="$sdl_config_args --prefix=$sdl_prefix" - if test x${SDL2_CONFIG+set} != xset ; then - SDL2_CONFIG=$sdl_prefix/bin/sdl2-config + if test x${SDL3_CONFIG+set} != xset ; then + SDL3_CONFIG=$sdl_prefix/bin/sdl3-config fi fi fi if test "x$sdl_pc" = xyes ; then no_sdl="" - SDL2_CONFIG="pkg-config sdl2" + SDL3_CONFIG="pkg-config sdl3" else as_save_PATH="$PATH" if test "x$prefix" != xNONE && test "$cross_compiling" != yes; then PATH="$prefix/bin:$prefix/usr/bin:$PATH" fi - AC_PATH_PROG(SDL2_CONFIG, sdl2-config, no, [$PATH]) + AC_PATH_PROG(SDL3_CONFIG, sdl3-config, no, [$PATH]) PATH="$as_save_PATH" no_sdl="" - if test "$SDL2_CONFIG" = "no" -a "x$search_sdl_framework" = "xyes"; then - AC_MSG_CHECKING(for SDL2.framework) - if test "x$SDL2_FRAMEWORK" != x; then - sdl_framework=$SDL2_FRAMEWORK + if test "$SDL3_CONFIG" = "no" -a "x$search_sdl_framework" = "xyes"; then + AC_MSG_CHECKING(for SDL3.framework) + if test "x$SDL3_FRAMEWORK" != x; then + sdl_framework=$SDL3_FRAMEWORK else for d in / ~/ /System/; do - if test -d "${d}Library/Frameworks/SDL2.framework"; then - sdl_framework="${d}Library/Frameworks/SDL2.framework" + if test -d "${d}Library/Frameworks/SDL3.framework"; then + sdl_framework="${d}Library/Frameworks/SDL3.framework" fi done fi @@ -79,25 +79,25 @@ AC_ARG_VAR(SDL2_FRAMEWORK, [Path to SDL2.framework]) if test x"$sdl_framework" != x && test -d "$sdl_framework"; then AC_MSG_RESULT($sdl_framework) sdl_framework_dir=`dirname $sdl_framework` - SDL_CFLAGS="-F$sdl_framework_dir -Wl,-framework,SDL2 -I$sdl_framework/include" - SDL_LIBS="-F$sdl_framework_dir -Wl,-framework,SDL2" + SDL_CFLAGS="-F$sdl_framework_dir -Wl,-framework,SDL3 -I$sdl_framework/include" + SDL_LIBS="-F$sdl_framework_dir -Wl,-framework,SDL3" else no_sdl=yes fi fi - if test "$SDL2_CONFIG" != "no"; then + if test "$SDL3_CONFIG" != "no"; then if test "x$sdl_pc" = "xno"; then AC_MSG_CHECKING(for SDL - version >= $min_sdl_version) - SDL_CFLAGS=`$SDL2_CONFIG $sdl_config_args --cflags` - SDL_LIBS=`$SDL2_CONFIG $sdl_config_args --libs` + SDL_CFLAGS=`$SDL3_CONFIG $sdl_config_args --cflags` + SDL_LIBS=`$SDL3_CONFIG $sdl_config_args --libs` fi - sdl_major_version=`$SDL2_CONFIG $sdl_config_args --version | \ + sdl_major_version=`$SDL3_CONFIG $sdl_config_args --version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` - sdl_minor_version=`$SDL2_CONFIG $sdl_config_args --version | \ + sdl_minor_version=`$SDL3_CONFIG $sdl_config_args --version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` - sdl_micro_version=`$SDL2_CONFIG $sdl_config_args --version | \ + sdl_micro_version=`$SDL3_CONFIG $sdl_config_args --version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` if test "x$enable_sdltest" = "xyes" ; then ac_save_CFLAGS="$CFLAGS" @@ -108,7 +108,7 @@ AC_ARG_VAR(SDL2_FRAMEWORK, [Path to SDL2.framework]) LIBS="$LIBS $SDL_LIBS" dnl dnl Now check if the installed SDL is sufficiently new. (Also sanity -dnl checks the results of sdl2-config to some extent +dnl checks the results of sdl3-config to some extent dnl rm -f conf.sdltest AC_RUN_IFELSE([AC_LANG_SOURCE([[ @@ -136,11 +136,11 @@ int main (int argc, char *argv[]) } else { - printf("\n*** 'sdl2-config --version' returned %d.%d.%d, but the minimum version\n", $sdl_major_version, $sdl_minor_version, $sdl_micro_version); - printf("*** of SDL required is %d.%d.%d. If sdl2-config is correct, then it is\n", major, minor, micro); + printf("\n*** 'sdl3-config --version' returned %d.%d.%d, but the minimum version\n", $sdl_major_version, $sdl_minor_version, $sdl_micro_version); + printf("*** of SDL required is %d.%d.%d. If sdl3-config is correct, then it is\n", major, minor, micro); printf("*** best to upgrade to the required version.\n"); - printf("*** If sdl2-config was wrong, set the environment variable SDL2_CONFIG\n"); - printf("*** to point to the correct copy of sdl2-config, and remove the file\n"); + printf("*** If sdl3-config was wrong, set the environment variable SDL3_CONFIG\n"); + printf("*** to point to the correct copy of sdl3-config, and remove the file\n"); printf("*** config.cache before re-running configure\n"); return 1; } @@ -164,11 +164,11 @@ int main (int argc, char *argv[]) if test "x$no_sdl" = x ; then ifelse([$2], , :, [$2]) else - if test "$SDL2_CONFIG" = "no" ; then - echo "*** The sdl2-config script installed by SDL could not be found" + if test "$SDL3_CONFIG" = "no" ; then + echo "*** The sdl3-config script installed by SDL could not be found" echo "*** If SDL was installed in PREFIX, make sure PREFIX/bin is in" - echo "*** your path, or set the SDL2_CONFIG environment variable to the" - echo "*** full path to sdl2-config." + echo "*** your path, or set the SDL3_CONFIG environment variable to the" + echo "*** full path to sdl3-config." else if test -f conf.sdltest ; then : @@ -198,7 +198,7 @@ int main(int argc, char *argv[]) [ echo "*** The test program failed to compile or link. See the file config.log for the" echo "*** exact error that occured. This usually means SDL was incorrectly installed" echo "*** or that you have moved SDL since it was installed. In the latter case, you" - echo "*** may want to edit the sdl2-config script: $SDL2_CONFIG" ]) + echo "*** may want to edit the sdl3-config script: $SDL3_CONFIG" ]) CFLAGS="$ac_save_CFLAGS" CXXFLAGS="$ac_save_CXXFLAGS" LIBS="$ac_save_LIBS" diff --git a/sdl2.pc.in b/sdl3.pc.in similarity index 86% rename from sdl2.pc.in rename to sdl3.pc.in index ad1a9574fe..96a480c86f 100644 --- a/sdl2.pc.in +++ b/sdl3.pc.in @@ -5,10 +5,10 @@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ -Name: sdl2 +Name: sdl3 Description: Simple DirectMedia Layer is a cross-platform multimedia library designed to provide low level access to audio, keyboard, mouse, joystick, 3D hardware via OpenGL, and 2D video framebuffer. Version: @SDL_VERSION@ Requires: Conflicts: Libs: -L${libdir} @SDL_RLD_FLAGS@ @SDL_LIBS@ @PKGCONFIG_LIBS_PRIV@ @SDL_STATIC_LIBS@ -Cflags: -I${includedir} -I${includedir}/SDL2 @SDL_CFLAGS@ +Cflags: -I${includedir} -I${includedir}/SDL3 @SDL_CFLAGS@ diff --git a/src/SDL_internal.h b/src/SDL_internal.h index 43e407f87a..1055151d03 100644 --- a/src/SDL_internal.h +++ b/src/SDL_internal.h @@ -55,7 +55,7 @@ #define O_CLOEXEC 0 #endif -/* A few #defines to reduce SDL2 footprint. +/* A few #defines to reduce SDL footprint. Only effective when library is statically linked. You have to manually edit this file. */ #ifndef SDL_LEAN_AND_MEAN diff --git a/src/audio/emscripten/SDL_emscriptenaudio.c b/src/audio/emscripten/SDL_emscriptenaudio.c index bfe42821a4..8a07f6c7fd 100644 --- a/src/audio/emscripten/SDL_emscriptenaudio.c +++ b/src/audio/emscripten/SDL_emscriptenaudio.c @@ -38,10 +38,10 @@ FeedAudioDevice(_THIS, const void *buf, const int buflen) { const int framelen = (SDL_AUDIO_BITSIZE(this->spec.format) / 8) * this->spec.channels; MAIN_THREAD_EM_ASM({ - var SDL2 = Module['SDL2']; - var numChannels = SDL2.audio.currentOutputBuffer['numberOfChannels']; + var SDL3 = Module['SDL3']; + var numChannels = SDL3.audio.currentOutputBuffer['numberOfChannels']; for (var c = 0; c < numChannels; ++c) { - var channelData = SDL2.audio.currentOutputBuffer['getChannelData'](c); + var channelData = SDL3.audio.currentOutputBuffer['getChannelData'](c); if (channelData.length != $1) { throw 'Web Audio output buffer length mismatch! Destination size: ' + channelData.length + ' samples vs expected ' + $1 + ' samples!'; } @@ -107,10 +107,10 @@ HandleCaptureProcess(_THIS) } MAIN_THREAD_EM_ASM({ - var SDL2 = Module['SDL2']; - var numChannels = SDL2.capture.currentCaptureBuffer.numberOfChannels; + var SDL3 = Module['SDL3']; + var numChannels = SDL3.capture.currentCaptureBuffer.numberOfChannels; for (var c = 0; c < numChannels; ++c) { - var channelData = SDL2.capture.currentCaptureBuffer.getChannelData(c); + var channelData = SDL3.capture.currentCaptureBuffer.getChannelData(c); if (channelData.length != $1) { throw 'Web Audio capture buffer length mismatch! Destination size: ' + channelData.length + ' samples vs expected ' + $1 + ' samples!'; } @@ -153,45 +153,45 @@ static void EMSCRIPTENAUDIO_CloseDevice(_THIS) { MAIN_THREAD_EM_ASM({ - var SDL2 = Module['SDL2']; + var SDL3 = Module['SDL3']; if ($0) { - if (SDL2.capture.silenceTimer !== undefined) { - clearTimeout(SDL2.capture.silenceTimer); + if (SDL3.capture.silenceTimer !== undefined) { + clearTimeout(SDL3.capture.silenceTimer); } - if (SDL2.capture.stream !== undefined) { - var tracks = SDL2.capture.stream.getAudioTracks(); + if (SDL3.capture.stream !== undefined) { + var tracks = SDL3.capture.stream.getAudioTracks(); for (var i = 0; i < tracks.length; i++) { - SDL2.capture.stream.removeTrack(tracks[i]); + SDL3.capture.stream.removeTrack(tracks[i]); } - SDL2.capture.stream = undefined; + SDL3.capture.stream = undefined; } - if (SDL2.capture.scriptProcessorNode !== undefined) { - SDL2.capture.scriptProcessorNode.onaudioprocess = function(audioProcessingEvent) {}; - SDL2.capture.scriptProcessorNode.disconnect(); - SDL2.capture.scriptProcessorNode = undefined; + if (SDL3.capture.scriptProcessorNode !== undefined) { + SDL3.capture.scriptProcessorNode.onaudioprocess = function(audioProcessingEvent) {}; + SDL3.capture.scriptProcessorNode.disconnect(); + SDL3.capture.scriptProcessorNode = undefined; } - if (SDL2.capture.mediaStreamNode !== undefined) { - SDL2.capture.mediaStreamNode.disconnect(); - SDL2.capture.mediaStreamNode = undefined; + if (SDL3.capture.mediaStreamNode !== undefined) { + SDL3.capture.mediaStreamNode.disconnect(); + SDL3.capture.mediaStreamNode = undefined; } - if (SDL2.capture.silenceBuffer !== undefined) { - SDL2.capture.silenceBuffer = undefined + if (SDL3.capture.silenceBuffer !== undefined) { + SDL3.capture.silenceBuffer = undefined } - SDL2.capture = undefined; + SDL3.capture = undefined; } else { - if (SDL2.audio.scriptProcessorNode != undefined) { - SDL2.audio.scriptProcessorNode.disconnect(); - SDL2.audio.scriptProcessorNode = undefined; + if (SDL3.audio.scriptProcessorNode != undefined) { + SDL3.audio.scriptProcessorNode.disconnect(); + SDL3.audio.scriptProcessorNode = undefined; } - SDL2.audio = undefined; + SDL3.audio = undefined; } - if ((SDL2.audioContext !== undefined) && (SDL2.audio === undefined) && (SDL2.capture === undefined)) { - SDL2.audioContext.close(); - SDL2.audioContext = undefined; + if ((SDL3.audioContext !== undefined) && (SDL3.audio === undefined) && (SDL3.capture === undefined)) { + SDL3.audioContext.close(); + SDL3.audioContext = undefined; } }, this->iscapture); -#if 0 /* !!! FIXME: currently not used. Can we move some stuff off the SDL2 namespace? --ryan. */ +#if 0 /* !!! FIXME: currently not used. Can we move some stuff off the SDL3 namespace? --ryan. */ SDL_free(this->hidden); #endif } @@ -207,27 +207,27 @@ EMSCRIPTENAUDIO_OpenDevice(_THIS, const char *devname) /* create context */ result = MAIN_THREAD_EM_ASM_INT({ - if(typeof(Module['SDL2']) === 'undefined') { - Module['SDL2'] = {}; + if(typeof(Module['SDL3']) === 'undefined') { + Module['SDL3'] = {}; } - var SDL2 = Module['SDL2']; + var SDL3 = Module['SDL3']; if (!$0) { - SDL2.audio = {}; + SDL3.audio = {}; } else { - SDL2.capture = {}; + SDL3.capture = {}; } - if (!SDL2.audioContext) { + if (!SDL3.audioContext) { if (typeof(AudioContext) !== 'undefined') { - SDL2.audioContext = new AudioContext(); + SDL3.audioContext = new AudioContext(); } else if (typeof(webkitAudioContext) !== 'undefined') { - SDL2.audioContext = new webkitAudioContext(); + SDL3.audioContext = new webkitAudioContext(); } - if (SDL2.audioContext) { - autoResumeAudioContext(SDL2.audioContext); + if (SDL3.audioContext) { + autoResumeAudioContext(SDL3.audioContext); } } - return SDL2.audioContext === undefined ? -1 : 0; + return SDL3.audioContext === undefined ? -1 : 0; }, iscapture); if (result < 0) { return SDL_SetError("Web Audio API is not available!"); @@ -250,7 +250,7 @@ EMSCRIPTENAUDIO_OpenDevice(_THIS, const char *devname) this->spec.format = test_format; /* Initialize all variables that we clean on shutdown */ -#if 0 /* !!! FIXME: currently not used. Can we move some stuff off the SDL2 namespace? --ryan. */ +#if 0 /* !!! FIXME: currently not used. Can we move some stuff off the SDL3 namespace? --ryan. */ this->hidden = (struct SDL_PrivateAudioData *) SDL_malloc((sizeof *this->hidden)); if (this->hidden == NULL) { @@ -262,8 +262,8 @@ EMSCRIPTENAUDIO_OpenDevice(_THIS, const char *devname) /* limit to native freq */ this->spec.freq = EM_ASM_INT_V({ - var SDL2 = Module['SDL2']; - return SDL2.audioContext.sampleRate; + var SDL3 = Module['SDL3']; + return SDL3.audioContext.sampleRate; }); SDL_CalculateAudioSpec(&this->spec); @@ -286,24 +286,24 @@ EMSCRIPTENAUDIO_OpenDevice(_THIS, const char *devname) to be honest. */ MAIN_THREAD_EM_ASM({ - var SDL2 = Module['SDL2']; + var SDL3 = Module['SDL3']; var have_microphone = function(stream) { //console.log('SDL audio capture: we have a microphone! Replacing silence callback.'); - if (SDL2.capture.silenceTimer !== undefined) { - clearTimeout(SDL2.capture.silenceTimer); - SDL2.capture.silenceTimer = undefined; + if (SDL3.capture.silenceTimer !== undefined) { + clearTimeout(SDL3.capture.silenceTimer); + SDL3.capture.silenceTimer = undefined; } - SDL2.capture.mediaStreamNode = SDL2.audioContext.createMediaStreamSource(stream); - SDL2.capture.scriptProcessorNode = SDL2.audioContext.createScriptProcessor($1, $0, 1); - SDL2.capture.scriptProcessorNode.onaudioprocess = function(audioProcessingEvent) { - if ((SDL2 === undefined) || (SDL2.capture === undefined)) { return; } + SDL3.capture.mediaStreamNode = SDL3.audioContext.createMediaStreamSource(stream); + SDL3.capture.scriptProcessorNode = SDL3.audioContext.createScriptProcessor($1, $0, 1); + SDL3.capture.scriptProcessorNode.onaudioprocess = function(audioProcessingEvent) { + if ((SDL3 === undefined) || (SDL3.capture === undefined)) { return; } audioProcessingEvent.outputBuffer.getChannelData(0).fill(0.0); - SDL2.capture.currentCaptureBuffer = audioProcessingEvent.inputBuffer; + SDL3.capture.currentCaptureBuffer = audioProcessingEvent.inputBuffer; dynCall('vi', $2, [$3]); }; - SDL2.capture.mediaStreamNode.connect(SDL2.capture.scriptProcessorNode); - SDL2.capture.scriptProcessorNode.connect(SDL2.audioContext.destination); - SDL2.capture.stream = stream; + SDL3.capture.mediaStreamNode.connect(SDL3.capture.scriptProcessorNode); + SDL3.capture.scriptProcessorNode.connect(SDL3.audioContext.destination); + SDL3.capture.stream = stream; }; var no_microphone = function(error) { @@ -311,14 +311,14 @@ EMSCRIPTENAUDIO_OpenDevice(_THIS, const char *devname) }; /* we write silence to the audio callback until the microphone is available (user approves use, etc). */ - SDL2.capture.silenceBuffer = SDL2.audioContext.createBuffer($0, $1, SDL2.audioContext.sampleRate); - SDL2.capture.silenceBuffer.getChannelData(0).fill(0.0); + SDL3.capture.silenceBuffer = SDL3.audioContext.createBuffer($0, $1, SDL3.audioContext.sampleRate); + SDL3.capture.silenceBuffer.getChannelData(0).fill(0.0); var silence_callback = function() { - SDL2.capture.currentCaptureBuffer = SDL2.capture.silenceBuffer; + SDL3.capture.currentCaptureBuffer = SDL3.capture.silenceBuffer; dynCall('vi', $2, [$3]); }; - SDL2.capture.silenceTimer = setTimeout(silence_callback, ($1 / SDL2.audioContext.sampleRate) * 1000); + SDL3.capture.silenceTimer = setTimeout(silence_callback, ($1 / SDL3.audioContext.sampleRate) * 1000); if ((navigator.mediaDevices !== undefined) && (navigator.mediaDevices.getUserMedia !== undefined)) { navigator.mediaDevices.getUserMedia({ audio: true, video: false }).then(have_microphone).catch(no_microphone); @@ -329,14 +329,14 @@ EMSCRIPTENAUDIO_OpenDevice(_THIS, const char *devname) } else { /* setup a ScriptProcessorNode */ MAIN_THREAD_EM_ASM({ - var SDL2 = Module['SDL2']; - SDL2.audio.scriptProcessorNode = SDL2.audioContext['createScriptProcessor']($1, 0, $0); - SDL2.audio.scriptProcessorNode['onaudioprocess'] = function (e) { - if ((SDL2 === undefined) || (SDL2.audio === undefined)) { return; } - SDL2.audio.currentOutputBuffer = e['outputBuffer']; + var SDL3 = Module['SDL3']; + SDL3.audio.scriptProcessorNode = SDL3.audioContext['createScriptProcessor']($1, 0, $0); + SDL3.audio.scriptProcessorNode['onaudioprocess'] = function (e) { + if ((SDL3 === undefined) || (SDL3.audio === undefined)) { return; } + SDL3.audio.currentOutputBuffer = e['outputBuffer']; dynCall('vi', $2, [$3]); }; - SDL2.audio.scriptProcessorNode['connect'](SDL2.audioContext['destination']); + SDL3.audio.scriptProcessorNode['connect'](SDL3.audioContext['destination']); }, this->spec.channels, this->spec.samples, HandleAudioProcess, this); } diff --git a/src/audio/qsa/SDL_qsa_audio.c b/src/audio/qsa/SDL_qsa_audio.c index 7a843f364e..38db66cf09 100644 --- a/src/audio/qsa/SDL_qsa_audio.c +++ b/src/audio/qsa/SDL_qsa_audio.c @@ -26,7 +26,7 @@ */ /* !!! FIXME: can this target support hotplugging? */ -/* !!! FIXME: ...does SDL2 even support QNX? */ +/* !!! FIXME: ...does SDL even support QNX? */ #include "../../SDL_internal.h" diff --git a/src/core/linux/SDL_ibus.c b/src/core/linux/SDL_ibus.c index 94f7aa626d..1478de8800 100644 --- a/src/core/linux/SDL_ibus.c +++ b/src/core/linux/SDL_ibus.c @@ -434,7 +434,7 @@ IBus_SetCapabilities(void *data, const char *name, const char *old_val, static SDL_bool IBus_SetupConnection(SDL_DBusContext *dbus, const char* addr) { - const char *client_name = "SDL2_Application"; + const char *client_name = "SDL3_Application"; const char *path = NULL; SDL_bool result = SDL_FALSE; DBusObjectPathVTable ibus_vtable; diff --git a/src/dynapi/SDL2.exports b/src/dynapi/SDL2.exports deleted file mode 100644 index 5085bffd94..0000000000 --- a/src/dynapi/SDL2.exports +++ /dev/null @@ -1,869 +0,0 @@ -# Windows exports file for Watcom -# DO NOT EDIT THIS FILE BY HAND. It is autogenerated by gendynapi.pl. -++'_SDL_DYNAPI_entry'.'SDL2.dll'.'SDL_DYNAPI_entry' -++'_SDL_SetError'.'SDL2.dll'.'SDL_SetError' -++'_SDL_Log'.'SDL2.dll'.'SDL_Log' -++'_SDL_LogVerbose'.'SDL2.dll'.'SDL_LogVerbose' -++'_SDL_LogDebug'.'SDL2.dll'.'SDL_LogDebug' -++'_SDL_LogInfo'.'SDL2.dll'.'SDL_LogInfo' -++'_SDL_LogWarn'.'SDL2.dll'.'SDL_LogWarn' -++'_SDL_LogError'.'SDL2.dll'.'SDL_LogError' -++'_SDL_LogCritical'.'SDL2.dll'.'SDL_LogCritical' -++'_SDL_LogMessage'.'SDL2.dll'.'SDL_LogMessage' -++'_SDL_sscanf'.'SDL2.dll'.'SDL_sscanf' -++'_SDL_snprintf'.'SDL2.dll'.'SDL_snprintf' -++'_SDL_CreateThread'.'SDL2.dll'.'SDL_CreateThread' -++'_SDL_RWFromFP'.'SDL2.dll'.'SDL_RWFromFP' -++'_SDL_RegisterApp'.'SDL2.dll'.'SDL_RegisterApp' -++'_SDL_UnregisterApp'.'SDL2.dll'.'SDL_UnregisterApp' -++'_SDL_Direct3D9GetAdapterIndex'.'SDL2.dll'.'SDL_Direct3D9GetAdapterIndex' -++'_SDL_RenderGetD3D9Device'.'SDL2.dll'.'SDL_RenderGetD3D9Device' -# ++'_SDL_iPhoneSetAnimationCallback'.'SDL2.dll'.'SDL_iPhoneSetAnimationCallback' -# ++'_SDL_iPhoneSetEventPump'.'SDL2.dll'.'SDL_iPhoneSetEventPump' -# ++'_SDL_AndroidGetJNIEnv'.'SDL2.dll'.'SDL_AndroidGetJNIEnv' -# ++'_SDL_AndroidGetActivity'.'SDL2.dll'.'SDL_AndroidGetActivity' -# ++'_SDL_AndroidGetInternalStoragePath'.'SDL2.dll'.'SDL_AndroidGetInternalStoragePath' -# ++'_SDL_AndroidGetExternalStorageState'.'SDL2.dll'.'SDL_AndroidGetExternalStorageState' -# ++'_SDL_AndroidGetExternalStoragePath'.'SDL2.dll'.'SDL_AndroidGetExternalStoragePath' -++'_SDL_Init'.'SDL2.dll'.'SDL_Init' -++'_SDL_InitSubSystem'.'SDL2.dll'.'SDL_InitSubSystem' -++'_SDL_QuitSubSystem'.'SDL2.dll'.'SDL_QuitSubSystem' -++'_SDL_WasInit'.'SDL2.dll'.'SDL_WasInit' -++'_SDL_Quit'.'SDL2.dll'.'SDL_Quit' -++'_SDL_ReportAssertion'.'SDL2.dll'.'SDL_ReportAssertion' -++'_SDL_SetAssertionHandler'.'SDL2.dll'.'SDL_SetAssertionHandler' -++'_SDL_GetAssertionReport'.'SDL2.dll'.'SDL_GetAssertionReport' -++'_SDL_ResetAssertionReport'.'SDL2.dll'.'SDL_ResetAssertionReport' -++'_SDL_AtomicTryLock'.'SDL2.dll'.'SDL_AtomicTryLock' -++'_SDL_AtomicLock'.'SDL2.dll'.'SDL_AtomicLock' -++'_SDL_AtomicUnlock'.'SDL2.dll'.'SDL_AtomicUnlock' -++'_SDL_AtomicCAS'.'SDL2.dll'.'SDL_AtomicCAS' -++'_SDL_AtomicSet'.'SDL2.dll'.'SDL_AtomicSet' -++'_SDL_AtomicGet'.'SDL2.dll'.'SDL_AtomicGet' -++'_SDL_AtomicAdd'.'SDL2.dll'.'SDL_AtomicAdd' -++'_SDL_AtomicCASPtr'.'SDL2.dll'.'SDL_AtomicCASPtr' -++'_SDL_AtomicSetPtr'.'SDL2.dll'.'SDL_AtomicSetPtr' -++'_SDL_AtomicGetPtr'.'SDL2.dll'.'SDL_AtomicGetPtr' -++'_SDL_GetNumAudioDrivers'.'SDL2.dll'.'SDL_GetNumAudioDrivers' -++'_SDL_GetAudioDriver'.'SDL2.dll'.'SDL_GetAudioDriver' -++'_SDL_AudioInit'.'SDL2.dll'.'SDL_AudioInit' -++'_SDL_AudioQuit'.'SDL2.dll'.'SDL_AudioQuit' -++'_SDL_GetCurrentAudioDriver'.'SDL2.dll'.'SDL_GetCurrentAudioDriver' -++'_SDL_OpenAudio'.'SDL2.dll'.'SDL_OpenAudio' -++'_SDL_GetNumAudioDevices'.'SDL2.dll'.'SDL_GetNumAudioDevices' -++'_SDL_GetAudioDeviceName'.'SDL2.dll'.'SDL_GetAudioDeviceName' -++'_SDL_OpenAudioDevice'.'SDL2.dll'.'SDL_OpenAudioDevice' -++'_SDL_GetAudioStatus'.'SDL2.dll'.'SDL_GetAudioStatus' -++'_SDL_GetAudioDeviceStatus'.'SDL2.dll'.'SDL_GetAudioDeviceStatus' -++'_SDL_PauseAudio'.'SDL2.dll'.'SDL_PauseAudio' -++'_SDL_PauseAudioDevice'.'SDL2.dll'.'SDL_PauseAudioDevice' -++'_SDL_LoadWAV_RW'.'SDL2.dll'.'SDL_LoadWAV_RW' -++'_SDL_FreeWAV'.'SDL2.dll'.'SDL_FreeWAV' -++'_SDL_BuildAudioCVT'.'SDL2.dll'.'SDL_BuildAudioCVT' -++'_SDL_ConvertAudio'.'SDL2.dll'.'SDL_ConvertAudio' -++'_SDL_MixAudio'.'SDL2.dll'.'SDL_MixAudio' -++'_SDL_MixAudioFormat'.'SDL2.dll'.'SDL_MixAudioFormat' -++'_SDL_LockAudio'.'SDL2.dll'.'SDL_LockAudio' -++'_SDL_LockAudioDevice'.'SDL2.dll'.'SDL_LockAudioDevice' -++'_SDL_UnlockAudio'.'SDL2.dll'.'SDL_UnlockAudio' -++'_SDL_UnlockAudioDevice'.'SDL2.dll'.'SDL_UnlockAudioDevice' -++'_SDL_CloseAudio'.'SDL2.dll'.'SDL_CloseAudio' -++'_SDL_CloseAudioDevice'.'SDL2.dll'.'SDL_CloseAudioDevice' -++'_SDL_SetClipboardText'.'SDL2.dll'.'SDL_SetClipboardText' -++'_SDL_GetClipboardText'.'SDL2.dll'.'SDL_GetClipboardText' -++'_SDL_HasClipboardText'.'SDL2.dll'.'SDL_HasClipboardText' -++'_SDL_GetCPUCount'.'SDL2.dll'.'SDL_GetCPUCount' -++'_SDL_GetCPUCacheLineSize'.'SDL2.dll'.'SDL_GetCPUCacheLineSize' -++'_SDL_HasRDTSC'.'SDL2.dll'.'SDL_HasRDTSC' -++'_SDL_HasAltiVec'.'SDL2.dll'.'SDL_HasAltiVec' -++'_SDL_HasMMX'.'SDL2.dll'.'SDL_HasMMX' -++'_SDL_Has3DNow'.'SDL2.dll'.'SDL_Has3DNow' -++'_SDL_HasSSE'.'SDL2.dll'.'SDL_HasSSE' -++'_SDL_HasSSE2'.'SDL2.dll'.'SDL_HasSSE2' -++'_SDL_HasSSE3'.'SDL2.dll'.'SDL_HasSSE3' -++'_SDL_HasSSE41'.'SDL2.dll'.'SDL_HasSSE41' -++'_SDL_HasSSE42'.'SDL2.dll'.'SDL_HasSSE42' -++'_SDL_GetSystemRAM'.'SDL2.dll'.'SDL_GetSystemRAM' -++'_SDL_GetError'.'SDL2.dll'.'SDL_GetError' -++'_SDL_ClearError'.'SDL2.dll'.'SDL_ClearError' -++'_SDL_Error'.'SDL2.dll'.'SDL_Error' -++'_SDL_PumpEvents'.'SDL2.dll'.'SDL_PumpEvents' -++'_SDL_PeepEvents'.'SDL2.dll'.'SDL_PeepEvents' -++'_SDL_HasEvent'.'SDL2.dll'.'SDL_HasEvent' -++'_SDL_HasEvents'.'SDL2.dll'.'SDL_HasEvents' -++'_SDL_FlushEvent'.'SDL2.dll'.'SDL_FlushEvent' -++'_SDL_FlushEvents'.'SDL2.dll'.'SDL_FlushEvents' -++'_SDL_PollEvent'.'SDL2.dll'.'SDL_PollEvent' -++'_SDL_WaitEvent'.'SDL2.dll'.'SDL_WaitEvent' -++'_SDL_WaitEventTimeout'.'SDL2.dll'.'SDL_WaitEventTimeout' -++'_SDL_PushEvent'.'SDL2.dll'.'SDL_PushEvent' -++'_SDL_SetEventFilter'.'SDL2.dll'.'SDL_SetEventFilter' -++'_SDL_GetEventFilter'.'SDL2.dll'.'SDL_GetEventFilter' -++'_SDL_AddEventWatch'.'SDL2.dll'.'SDL_AddEventWatch' -++'_SDL_DelEventWatch'.'SDL2.dll'.'SDL_DelEventWatch' -++'_SDL_FilterEvents'.'SDL2.dll'.'SDL_FilterEvents' -++'_SDL_EventState'.'SDL2.dll'.'SDL_EventState' -++'_SDL_RegisterEvents'.'SDL2.dll'.'SDL_RegisterEvents' -++'_SDL_GetBasePath'.'SDL2.dll'.'SDL_GetBasePath' -++'_SDL_GetPrefPath'.'SDL2.dll'.'SDL_GetPrefPath' -++'_SDL_GameControllerAddMapping'.'SDL2.dll'.'SDL_GameControllerAddMapping' -++'_SDL_GameControllerMappingForGUID'.'SDL2.dll'.'SDL_GameControllerMappingForGUID' -++'_SDL_GameControllerMapping'.'SDL2.dll'.'SDL_GameControllerMapping' -++'_SDL_IsGameController'.'SDL2.dll'.'SDL_IsGameController' -++'_SDL_GameControllerNameForIndex'.'SDL2.dll'.'SDL_GameControllerNameForIndex' -++'_SDL_GameControllerOpen'.'SDL2.dll'.'SDL_GameControllerOpen' -++'_SDL_GameControllerName'.'SDL2.dll'.'SDL_GameControllerName' -++'_SDL_GameControllerGetAttached'.'SDL2.dll'.'SDL_GameControllerGetAttached' -++'_SDL_GameControllerGetJoystick'.'SDL2.dll'.'SDL_GameControllerGetJoystick' -++'_SDL_GameControllerEventState'.'SDL2.dll'.'SDL_GameControllerEventState' -++'_SDL_GameControllerUpdate'.'SDL2.dll'.'SDL_GameControllerUpdate' -++'_SDL_GameControllerGetAxisFromString'.'SDL2.dll'.'SDL_GameControllerGetAxisFromString' -++'_SDL_GameControllerGetStringForAxis'.'SDL2.dll'.'SDL_GameControllerGetStringForAxis' -++'_SDL_GameControllerGetBindForAxis'.'SDL2.dll'.'SDL_GameControllerGetBindForAxis' -++'_SDL_GameControllerGetAxis'.'SDL2.dll'.'SDL_GameControllerGetAxis' -++'_SDL_GameControllerGetButtonFromString'.'SDL2.dll'.'SDL_GameControllerGetButtonFromString' -++'_SDL_GameControllerGetStringForButton'.'SDL2.dll'.'SDL_GameControllerGetStringForButton' -++'_SDL_GameControllerGetBindForButton'.'SDL2.dll'.'SDL_GameControllerGetBindForButton' -++'_SDL_GameControllerGetButton'.'SDL2.dll'.'SDL_GameControllerGetButton' -++'_SDL_GameControllerClose'.'SDL2.dll'.'SDL_GameControllerClose' -++'_SDL_RecordGesture'.'SDL2.dll'.'SDL_RecordGesture' -++'_SDL_SaveAllDollarTemplates'.'SDL2.dll'.'SDL_SaveAllDollarTemplates' -++'_SDL_SaveDollarTemplate'.'SDL2.dll'.'SDL_SaveDollarTemplate' -++'_SDL_LoadDollarTemplates'.'SDL2.dll'.'SDL_LoadDollarTemplates' -++'_SDL_NumHaptics'.'SDL2.dll'.'SDL_NumHaptics' -++'_SDL_HapticName'.'SDL2.dll'.'SDL_HapticName' -++'_SDL_HapticOpen'.'SDL2.dll'.'SDL_HapticOpen' -++'_SDL_HapticOpened'.'SDL2.dll'.'SDL_HapticOpened' -++'_SDL_HapticIndex'.'SDL2.dll'.'SDL_HapticIndex' -++'_SDL_MouseIsHaptic'.'SDL2.dll'.'SDL_MouseIsHaptic' -++'_SDL_HapticOpenFromMouse'.'SDL2.dll'.'SDL_HapticOpenFromMouse' -++'_SDL_JoystickIsHaptic'.'SDL2.dll'.'SDL_JoystickIsHaptic' -++'_SDL_HapticOpenFromJoystick'.'SDL2.dll'.'SDL_HapticOpenFromJoystick' -++'_SDL_HapticClose'.'SDL2.dll'.'SDL_HapticClose' -++'_SDL_HapticNumEffects'.'SDL2.dll'.'SDL_HapticNumEffects' -++'_SDL_HapticNumEffectsPlaying'.'SDL2.dll'.'SDL_HapticNumEffectsPlaying' -++'_SDL_HapticQuery'.'SDL2.dll'.'SDL_HapticQuery' -++'_SDL_HapticNumAxes'.'SDL2.dll'.'SDL_HapticNumAxes' -++'_SDL_HapticEffectSupported'.'SDL2.dll'.'SDL_HapticEffectSupported' -++'_SDL_HapticNewEffect'.'SDL2.dll'.'SDL_HapticNewEffect' -++'_SDL_HapticUpdateEffect'.'SDL2.dll'.'SDL_HapticUpdateEffect' -++'_SDL_HapticRunEffect'.'SDL2.dll'.'SDL_HapticRunEffect' -++'_SDL_HapticStopEffect'.'SDL2.dll'.'SDL_HapticStopEffect' -++'_SDL_HapticDestroyEffect'.'SDL2.dll'.'SDL_HapticDestroyEffect' -++'_SDL_HapticGetEffectStatus'.'SDL2.dll'.'SDL_HapticGetEffectStatus' -++'_SDL_HapticSetGain'.'SDL2.dll'.'SDL_HapticSetGain' -++'_SDL_HapticSetAutocenter'.'SDL2.dll'.'SDL_HapticSetAutocenter' -++'_SDL_HapticPause'.'SDL2.dll'.'SDL_HapticPause' -++'_SDL_HapticUnpause'.'SDL2.dll'.'SDL_HapticUnpause' -++'_SDL_HapticStopAll'.'SDL2.dll'.'SDL_HapticStopAll' -++'_SDL_HapticRumbleSupported'.'SDL2.dll'.'SDL_HapticRumbleSupported' -++'_SDL_HapticRumbleInit'.'SDL2.dll'.'SDL_HapticRumbleInit' -++'_SDL_HapticRumblePlay'.'SDL2.dll'.'SDL_HapticRumblePlay' -++'_SDL_HapticRumbleStop'.'SDL2.dll'.'SDL_HapticRumbleStop' -++'_SDL_SetHintWithPriority'.'SDL2.dll'.'SDL_SetHintWithPriority' -++'_SDL_SetHint'.'SDL2.dll'.'SDL_SetHint' -++'_SDL_GetHint'.'SDL2.dll'.'SDL_GetHint' -++'_SDL_AddHintCallback'.'SDL2.dll'.'SDL_AddHintCallback' -++'_SDL_DelHintCallback'.'SDL2.dll'.'SDL_DelHintCallback' -++'_SDL_ClearHints'.'SDL2.dll'.'SDL_ClearHints' -++'_SDL_NumJoysticks'.'SDL2.dll'.'SDL_NumJoysticks' -++'_SDL_JoystickNameForIndex'.'SDL2.dll'.'SDL_JoystickNameForIndex' -++'_SDL_JoystickOpen'.'SDL2.dll'.'SDL_JoystickOpen' -++'_SDL_JoystickName'.'SDL2.dll'.'SDL_JoystickName' -++'_SDL_JoystickGetDeviceGUID'.'SDL2.dll'.'SDL_JoystickGetDeviceGUID' -++'_SDL_JoystickGetGUID'.'SDL2.dll'.'SDL_JoystickGetGUID' -++'_SDL_JoystickGetGUIDString'.'SDL2.dll'.'SDL_JoystickGetGUIDString' -++'_SDL_JoystickGetGUIDFromString'.'SDL2.dll'.'SDL_JoystickGetGUIDFromString' -++'_SDL_JoystickGetAttached'.'SDL2.dll'.'SDL_JoystickGetAttached' -++'_SDL_JoystickInstanceID'.'SDL2.dll'.'SDL_JoystickInstanceID' -++'_SDL_JoystickNumAxes'.'SDL2.dll'.'SDL_JoystickNumAxes' -++'_SDL_JoystickNumBalls'.'SDL2.dll'.'SDL_JoystickNumBalls' -++'_SDL_JoystickNumHats'.'SDL2.dll'.'SDL_JoystickNumHats' -++'_SDL_JoystickNumButtons'.'SDL2.dll'.'SDL_JoystickNumButtons' -++'_SDL_JoystickUpdate'.'SDL2.dll'.'SDL_JoystickUpdate' -++'_SDL_JoystickEventState'.'SDL2.dll'.'SDL_JoystickEventState' -++'_SDL_JoystickGetAxis'.'SDL2.dll'.'SDL_JoystickGetAxis' -++'_SDL_JoystickGetHat'.'SDL2.dll'.'SDL_JoystickGetHat' -++'_SDL_JoystickGetBall'.'SDL2.dll'.'SDL_JoystickGetBall' -++'_SDL_JoystickGetButton'.'SDL2.dll'.'SDL_JoystickGetButton' -++'_SDL_JoystickClose'.'SDL2.dll'.'SDL_JoystickClose' -++'_SDL_GetKeyboardFocus'.'SDL2.dll'.'SDL_GetKeyboardFocus' -++'_SDL_GetKeyboardState'.'SDL2.dll'.'SDL_GetKeyboardState' -++'_SDL_GetModState'.'SDL2.dll'.'SDL_GetModState' -++'_SDL_SetModState'.'SDL2.dll'.'SDL_SetModState' -++'_SDL_GetKeyFromScancode'.'SDL2.dll'.'SDL_GetKeyFromScancode' -++'_SDL_GetScancodeFromKey'.'SDL2.dll'.'SDL_GetScancodeFromKey' -++'_SDL_GetScancodeName'.'SDL2.dll'.'SDL_GetScancodeName' -++'_SDL_GetScancodeFromName'.'SDL2.dll'.'SDL_GetScancodeFromName' -++'_SDL_GetKeyName'.'SDL2.dll'.'SDL_GetKeyName' -++'_SDL_GetKeyFromName'.'SDL2.dll'.'SDL_GetKeyFromName' -++'_SDL_StartTextInput'.'SDL2.dll'.'SDL_StartTextInput' -++'_SDL_IsTextInputActive'.'SDL2.dll'.'SDL_IsTextInputActive' -++'_SDL_StopTextInput'.'SDL2.dll'.'SDL_StopTextInput' -++'_SDL_SetTextInputRect'.'SDL2.dll'.'SDL_SetTextInputRect' -++'_SDL_HasScreenKeyboardSupport'.'SDL2.dll'.'SDL_HasScreenKeyboardSupport' -++'_SDL_IsScreenKeyboardShown'.'SDL2.dll'.'SDL_IsScreenKeyboardShown' -++'_SDL_LoadObject'.'SDL2.dll'.'SDL_LoadObject' -++'_SDL_LoadFunction'.'SDL2.dll'.'SDL_LoadFunction' -++'_SDL_UnloadObject'.'SDL2.dll'.'SDL_UnloadObject' -++'_SDL_LogSetAllPriority'.'SDL2.dll'.'SDL_LogSetAllPriority' -++'_SDL_LogSetPriority'.'SDL2.dll'.'SDL_LogSetPriority' -++'_SDL_LogGetPriority'.'SDL2.dll'.'SDL_LogGetPriority' -++'_SDL_LogResetPriorities'.'SDL2.dll'.'SDL_LogResetPriorities' -++'_SDL_LogMessageV'.'SDL2.dll'.'SDL_LogMessageV' -++'_SDL_LogGetOutputFunction'.'SDL2.dll'.'SDL_LogGetOutputFunction' -++'_SDL_LogSetOutputFunction'.'SDL2.dll'.'SDL_LogSetOutputFunction' -++'_SDL_SetMainReady'.'SDL2.dll'.'SDL_SetMainReady' -++'_SDL_ShowMessageBox'.'SDL2.dll'.'SDL_ShowMessageBox' -++'_SDL_ShowSimpleMessageBox'.'SDL2.dll'.'SDL_ShowSimpleMessageBox' -++'_SDL_GetMouseFocus'.'SDL2.dll'.'SDL_GetMouseFocus' -++'_SDL_GetMouseState'.'SDL2.dll'.'SDL_GetMouseState' -++'_SDL_GetRelativeMouseState'.'SDL2.dll'.'SDL_GetRelativeMouseState' -++'_SDL_WarpMouseInWindow'.'SDL2.dll'.'SDL_WarpMouseInWindow' -++'_SDL_SetRelativeMouseMode'.'SDL2.dll'.'SDL_SetRelativeMouseMode' -++'_SDL_GetRelativeMouseMode'.'SDL2.dll'.'SDL_GetRelativeMouseMode' -++'_SDL_CreateCursor'.'SDL2.dll'.'SDL_CreateCursor' -++'_SDL_CreateColorCursor'.'SDL2.dll'.'SDL_CreateColorCursor' -++'_SDL_CreateSystemCursor'.'SDL2.dll'.'SDL_CreateSystemCursor' -++'_SDL_SetCursor'.'SDL2.dll'.'SDL_SetCursor' -++'_SDL_GetCursor'.'SDL2.dll'.'SDL_GetCursor' -++'_SDL_GetDefaultCursor'.'SDL2.dll'.'SDL_GetDefaultCursor' -++'_SDL_FreeCursor'.'SDL2.dll'.'SDL_FreeCursor' -++'_SDL_ShowCursor'.'SDL2.dll'.'SDL_ShowCursor' -++'_SDL_CreateMutex'.'SDL2.dll'.'SDL_CreateMutex' -++'_SDL_LockMutex'.'SDL2.dll'.'SDL_LockMutex' -++'_SDL_TryLockMutex'.'SDL2.dll'.'SDL_TryLockMutex' -++'_SDL_UnlockMutex'.'SDL2.dll'.'SDL_UnlockMutex' -++'_SDL_DestroyMutex'.'SDL2.dll'.'SDL_DestroyMutex' -++'_SDL_CreateSemaphore'.'SDL2.dll'.'SDL_CreateSemaphore' -++'_SDL_DestroySemaphore'.'SDL2.dll'.'SDL_DestroySemaphore' -++'_SDL_SemWait'.'SDL2.dll'.'SDL_SemWait' -++'_SDL_SemTryWait'.'SDL2.dll'.'SDL_SemTryWait' -++'_SDL_SemWaitTimeout'.'SDL2.dll'.'SDL_SemWaitTimeout' -++'_SDL_SemPost'.'SDL2.dll'.'SDL_SemPost' -++'_SDL_SemValue'.'SDL2.dll'.'SDL_SemValue' -++'_SDL_CreateCond'.'SDL2.dll'.'SDL_CreateCond' -++'_SDL_DestroyCond'.'SDL2.dll'.'SDL_DestroyCond' -++'_SDL_CondSignal'.'SDL2.dll'.'SDL_CondSignal' -++'_SDL_CondBroadcast'.'SDL2.dll'.'SDL_CondBroadcast' -++'_SDL_CondWait'.'SDL2.dll'.'SDL_CondWait' -++'_SDL_CondWaitTimeout'.'SDL2.dll'.'SDL_CondWaitTimeout' -++'_SDL_GetPixelFormatName'.'SDL2.dll'.'SDL_GetPixelFormatName' -++'_SDL_PixelFormatEnumToMasks'.'SDL2.dll'.'SDL_PixelFormatEnumToMasks' -++'_SDL_MasksToPixelFormatEnum'.'SDL2.dll'.'SDL_MasksToPixelFormatEnum' -++'_SDL_AllocFormat'.'SDL2.dll'.'SDL_AllocFormat' -++'_SDL_FreeFormat'.'SDL2.dll'.'SDL_FreeFormat' -++'_SDL_AllocPalette'.'SDL2.dll'.'SDL_AllocPalette' -++'_SDL_SetPixelFormatPalette'.'SDL2.dll'.'SDL_SetPixelFormatPalette' -++'_SDL_SetPaletteColors'.'SDL2.dll'.'SDL_SetPaletteColors' -++'_SDL_FreePalette'.'SDL2.dll'.'SDL_FreePalette' -++'_SDL_MapRGB'.'SDL2.dll'.'SDL_MapRGB' -++'_SDL_MapRGBA'.'SDL2.dll'.'SDL_MapRGBA' -++'_SDL_GetRGB'.'SDL2.dll'.'SDL_GetRGB' -++'_SDL_GetRGBA'.'SDL2.dll'.'SDL_GetRGBA' -++'_SDL_CalculateGammaRamp'.'SDL2.dll'.'SDL_CalculateGammaRamp' -++'_SDL_GetPlatform'.'SDL2.dll'.'SDL_GetPlatform' -++'_SDL_GetPowerInfo'.'SDL2.dll'.'SDL_GetPowerInfo' -++'_SDL_HasIntersection'.'SDL2.dll'.'SDL_HasIntersection' -++'_SDL_IntersectRect'.'SDL2.dll'.'SDL_IntersectRect' -++'_SDL_UnionRect'.'SDL2.dll'.'SDL_UnionRect' -++'_SDL_EnclosePoints'.'SDL2.dll'.'SDL_EnclosePoints' -++'_SDL_IntersectRectAndLine'.'SDL2.dll'.'SDL_IntersectRectAndLine' -++'_SDL_GetNumRenderDrivers'.'SDL2.dll'.'SDL_GetNumRenderDrivers' -++'_SDL_GetRenderDriverInfo'.'SDL2.dll'.'SDL_GetRenderDriverInfo' -++'_SDL_CreateWindowAndRenderer'.'SDL2.dll'.'SDL_CreateWindowAndRenderer' -++'_SDL_CreateRenderer'.'SDL2.dll'.'SDL_CreateRenderer' -++'_SDL_CreateSoftwareRenderer'.'SDL2.dll'.'SDL_CreateSoftwareRenderer' -++'_SDL_GetRenderer'.'SDL2.dll'.'SDL_GetRenderer' -++'_SDL_GetRendererInfo'.'SDL2.dll'.'SDL_GetRendererInfo' -++'_SDL_GetRendererOutputSize'.'SDL2.dll'.'SDL_GetRendererOutputSize' -++'_SDL_CreateTexture'.'SDL2.dll'.'SDL_CreateTexture' -++'_SDL_CreateTextureFromSurface'.'SDL2.dll'.'SDL_CreateTextureFromSurface' -++'_SDL_QueryTexture'.'SDL2.dll'.'SDL_QueryTexture' -++'_SDL_SetTextureColorMod'.'SDL2.dll'.'SDL_SetTextureColorMod' -++'_SDL_GetTextureColorMod'.'SDL2.dll'.'SDL_GetTextureColorMod' -++'_SDL_SetTextureAlphaMod'.'SDL2.dll'.'SDL_SetTextureAlphaMod' -++'_SDL_GetTextureAlphaMod'.'SDL2.dll'.'SDL_GetTextureAlphaMod' -++'_SDL_SetTextureBlendMode'.'SDL2.dll'.'SDL_SetTextureBlendMode' -++'_SDL_GetTextureBlendMode'.'SDL2.dll'.'SDL_GetTextureBlendMode' -++'_SDL_UpdateTexture'.'SDL2.dll'.'SDL_UpdateTexture' -++'_SDL_UpdateYUVTexture'.'SDL2.dll'.'SDL_UpdateYUVTexture' -++'_SDL_LockTexture'.'SDL2.dll'.'SDL_LockTexture' -++'_SDL_UnlockTexture'.'SDL2.dll'.'SDL_UnlockTexture' -++'_SDL_RenderTargetSupported'.'SDL2.dll'.'SDL_RenderTargetSupported' -++'_SDL_SetRenderTarget'.'SDL2.dll'.'SDL_SetRenderTarget' -++'_SDL_GetRenderTarget'.'SDL2.dll'.'SDL_GetRenderTarget' -++'_SDL_RenderSetLogicalSize'.'SDL2.dll'.'SDL_RenderSetLogicalSize' -++'_SDL_RenderGetLogicalSize'.'SDL2.dll'.'SDL_RenderGetLogicalSize' -++'_SDL_RenderSetViewport'.'SDL2.dll'.'SDL_RenderSetViewport' -++'_SDL_RenderGetViewport'.'SDL2.dll'.'SDL_RenderGetViewport' -++'_SDL_RenderSetClipRect'.'SDL2.dll'.'SDL_RenderSetClipRect' -++'_SDL_RenderGetClipRect'.'SDL2.dll'.'SDL_RenderGetClipRect' -++'_SDL_RenderSetScale'.'SDL2.dll'.'SDL_RenderSetScale' -++'_SDL_RenderGetScale'.'SDL2.dll'.'SDL_RenderGetScale' -++'_SDL_SetRenderDrawColor'.'SDL2.dll'.'SDL_SetRenderDrawColor' -++'_SDL_GetRenderDrawColor'.'SDL2.dll'.'SDL_GetRenderDrawColor' -++'_SDL_SetRenderDrawBlendMode'.'SDL2.dll'.'SDL_SetRenderDrawBlendMode' -++'_SDL_GetRenderDrawBlendMode'.'SDL2.dll'.'SDL_GetRenderDrawBlendMode' -++'_SDL_RenderClear'.'SDL2.dll'.'SDL_RenderClear' -++'_SDL_RenderDrawPoint'.'SDL2.dll'.'SDL_RenderDrawPoint' -++'_SDL_RenderDrawPoints'.'SDL2.dll'.'SDL_RenderDrawPoints' -++'_SDL_RenderDrawLine'.'SDL2.dll'.'SDL_RenderDrawLine' -++'_SDL_RenderDrawLines'.'SDL2.dll'.'SDL_RenderDrawLines' -++'_SDL_RenderDrawRect'.'SDL2.dll'.'SDL_RenderDrawRect' -++'_SDL_RenderDrawRects'.'SDL2.dll'.'SDL_RenderDrawRects' -++'_SDL_RenderFillRect'.'SDL2.dll'.'SDL_RenderFillRect' -++'_SDL_RenderFillRects'.'SDL2.dll'.'SDL_RenderFillRects' -++'_SDL_RenderCopy'.'SDL2.dll'.'SDL_RenderCopy' -++'_SDL_RenderCopyEx'.'SDL2.dll'.'SDL_RenderCopyEx' -++'_SDL_RenderReadPixels'.'SDL2.dll'.'SDL_RenderReadPixels' -++'_SDL_RenderPresent'.'SDL2.dll'.'SDL_RenderPresent' -++'_SDL_DestroyTexture'.'SDL2.dll'.'SDL_DestroyTexture' -++'_SDL_DestroyRenderer'.'SDL2.dll'.'SDL_DestroyRenderer' -++'_SDL_GL_BindTexture'.'SDL2.dll'.'SDL_GL_BindTexture' -++'_SDL_GL_UnbindTexture'.'SDL2.dll'.'SDL_GL_UnbindTexture' -++'_SDL_RWFromFile'.'SDL2.dll'.'SDL_RWFromFile' -++'_SDL_RWFromMem'.'SDL2.dll'.'SDL_RWFromMem' -++'_SDL_RWFromConstMem'.'SDL2.dll'.'SDL_RWFromConstMem' -++'_SDL_AllocRW'.'SDL2.dll'.'SDL_AllocRW' -++'_SDL_FreeRW'.'SDL2.dll'.'SDL_FreeRW' -++'_SDL_ReadU8'.'SDL2.dll'.'SDL_ReadU8' -++'_SDL_ReadLE16'.'SDL2.dll'.'SDL_ReadLE16' -++'_SDL_ReadBE16'.'SDL2.dll'.'SDL_ReadBE16' -++'_SDL_ReadLE32'.'SDL2.dll'.'SDL_ReadLE32' -++'_SDL_ReadBE32'.'SDL2.dll'.'SDL_ReadBE32' -++'_SDL_ReadLE64'.'SDL2.dll'.'SDL_ReadLE64' -++'_SDL_ReadBE64'.'SDL2.dll'.'SDL_ReadBE64' -++'_SDL_WriteU8'.'SDL2.dll'.'SDL_WriteU8' -++'_SDL_WriteLE16'.'SDL2.dll'.'SDL_WriteLE16' -++'_SDL_WriteBE16'.'SDL2.dll'.'SDL_WriteBE16' -++'_SDL_WriteLE32'.'SDL2.dll'.'SDL_WriteLE32' -++'_SDL_WriteBE32'.'SDL2.dll'.'SDL_WriteBE32' -++'_SDL_WriteLE64'.'SDL2.dll'.'SDL_WriteLE64' -++'_SDL_WriteBE64'.'SDL2.dll'.'SDL_WriteBE64' -++'_SDL_CreateShapedWindow'.'SDL2.dll'.'SDL_CreateShapedWindow' -++'_SDL_IsShapedWindow'.'SDL2.dll'.'SDL_IsShapedWindow' -++'_SDL_SetWindowShape'.'SDL2.dll'.'SDL_SetWindowShape' -++'_SDL_GetShapedWindowMode'.'SDL2.dll'.'SDL_GetShapedWindowMode' -++'_SDL_malloc'.'SDL2.dll'.'SDL_malloc' -++'_SDL_calloc'.'SDL2.dll'.'SDL_calloc' -++'_SDL_realloc'.'SDL2.dll'.'SDL_realloc' -++'_SDL_free'.'SDL2.dll'.'SDL_free' -++'_SDL_getenv'.'SDL2.dll'.'SDL_getenv' -++'_SDL_setenv'.'SDL2.dll'.'SDL_setenv' -++'_SDL_qsort'.'SDL2.dll'.'SDL_qsort' -++'_SDL_abs'.'SDL2.dll'.'SDL_abs' -++'_SDL_isdigit'.'SDL2.dll'.'SDL_isdigit' -++'_SDL_isspace'.'SDL2.dll'.'SDL_isspace' -++'_SDL_toupper'.'SDL2.dll'.'SDL_toupper' -++'_SDL_tolower'.'SDL2.dll'.'SDL_tolower' -++'_SDL_memset'.'SDL2.dll'.'SDL_memset' -++'_SDL_memcpy'.'SDL2.dll'.'SDL_memcpy' -++'_SDL_memmove'.'SDL2.dll'.'SDL_memmove' -++'_SDL_memcmp'.'SDL2.dll'.'SDL_memcmp' -++'_SDL_wcslen'.'SDL2.dll'.'SDL_wcslen' -++'_SDL_wcslcpy'.'SDL2.dll'.'SDL_wcslcpy' -++'_SDL_wcslcat'.'SDL2.dll'.'SDL_wcslcat' -++'_SDL_strlen'.'SDL2.dll'.'SDL_strlen' -++'_SDL_strlcpy'.'SDL2.dll'.'SDL_strlcpy' -++'_SDL_utf8strlcpy'.'SDL2.dll'.'SDL_utf8strlcpy' -++'_SDL_strlcat'.'SDL2.dll'.'SDL_strlcat' -++'_SDL_strdup'.'SDL2.dll'.'SDL_strdup' -++'_SDL_strrev'.'SDL2.dll'.'SDL_strrev' -++'_SDL_strupr'.'SDL2.dll'.'SDL_strupr' -++'_SDL_strlwr'.'SDL2.dll'.'SDL_strlwr' -++'_SDL_strchr'.'SDL2.dll'.'SDL_strchr' -++'_SDL_strrchr'.'SDL2.dll'.'SDL_strrchr' -++'_SDL_strstr'.'SDL2.dll'.'SDL_strstr' -++'_SDL_itoa'.'SDL2.dll'.'SDL_itoa' -++'_SDL_uitoa'.'SDL2.dll'.'SDL_uitoa' -++'_SDL_ltoa'.'SDL2.dll'.'SDL_ltoa' -++'_SDL_ultoa'.'SDL2.dll'.'SDL_ultoa' -++'_SDL_lltoa'.'SDL2.dll'.'SDL_lltoa' -++'_SDL_ulltoa'.'SDL2.dll'.'SDL_ulltoa' -++'_SDL_atoi'.'SDL2.dll'.'SDL_atoi' -++'_SDL_atof'.'SDL2.dll'.'SDL_atof' -++'_SDL_strtol'.'SDL2.dll'.'SDL_strtol' -++'_SDL_strtoul'.'SDL2.dll'.'SDL_strtoul' -++'_SDL_strtoll'.'SDL2.dll'.'SDL_strtoll' -++'_SDL_strtoull'.'SDL2.dll'.'SDL_strtoull' -++'_SDL_strtod'.'SDL2.dll'.'SDL_strtod' -++'_SDL_strcmp'.'SDL2.dll'.'SDL_strcmp' -++'_SDL_strncmp'.'SDL2.dll'.'SDL_strncmp' -++'_SDL_strcasecmp'.'SDL2.dll'.'SDL_strcasecmp' -++'_SDL_strncasecmp'.'SDL2.dll'.'SDL_strncasecmp' -++'_SDL_vsnprintf'.'SDL2.dll'.'SDL_vsnprintf' -++'_SDL_acos'.'SDL2.dll'.'SDL_acos' -++'_SDL_asin'.'SDL2.dll'.'SDL_asin' -++'_SDL_atan'.'SDL2.dll'.'SDL_atan' -++'_SDL_atan2'.'SDL2.dll'.'SDL_atan2' -++'_SDL_ceil'.'SDL2.dll'.'SDL_ceil' -++'_SDL_copysign'.'SDL2.dll'.'SDL_copysign' -++'_SDL_cos'.'SDL2.dll'.'SDL_cos' -++'_SDL_cosf'.'SDL2.dll'.'SDL_cosf' -++'_SDL_fabs'.'SDL2.dll'.'SDL_fabs' -++'_SDL_floor'.'SDL2.dll'.'SDL_floor' -++'_SDL_log'.'SDL2.dll'.'SDL_log' -++'_SDL_pow'.'SDL2.dll'.'SDL_pow' -++'_SDL_scalbn'.'SDL2.dll'.'SDL_scalbn' -++'_SDL_sin'.'SDL2.dll'.'SDL_sin' -++'_SDL_sinf'.'SDL2.dll'.'SDL_sinf' -++'_SDL_sqrt'.'SDL2.dll'.'SDL_sqrt' -++'_SDL_iconv_open'.'SDL2.dll'.'SDL_iconv_open' -++'_SDL_iconv_close'.'SDL2.dll'.'SDL_iconv_close' -++'_SDL_iconv'.'SDL2.dll'.'SDL_iconv' -++'_SDL_iconv_string'.'SDL2.dll'.'SDL_iconv_string' -++'_SDL_CreateRGBSurface'.'SDL2.dll'.'SDL_CreateRGBSurface' -++'_SDL_CreateRGBSurfaceFrom'.'SDL2.dll'.'SDL_CreateRGBSurfaceFrom' -++'_SDL_FreeSurface'.'SDL2.dll'.'SDL_FreeSurface' -++'_SDL_SetSurfacePalette'.'SDL2.dll'.'SDL_SetSurfacePalette' -++'_SDL_LockSurface'.'SDL2.dll'.'SDL_LockSurface' -++'_SDL_UnlockSurface'.'SDL2.dll'.'SDL_UnlockSurface' -++'_SDL_LoadBMP_RW'.'SDL2.dll'.'SDL_LoadBMP_RW' -++'_SDL_SaveBMP_RW'.'SDL2.dll'.'SDL_SaveBMP_RW' -++'_SDL_SetSurfaceRLE'.'SDL2.dll'.'SDL_SetSurfaceRLE' -++'_SDL_SetColorKey'.'SDL2.dll'.'SDL_SetColorKey' -++'_SDL_GetColorKey'.'SDL2.dll'.'SDL_GetColorKey' -++'_SDL_SetSurfaceColorMod'.'SDL2.dll'.'SDL_SetSurfaceColorMod' -++'_SDL_GetSurfaceColorMod'.'SDL2.dll'.'SDL_GetSurfaceColorMod' -++'_SDL_SetSurfaceAlphaMod'.'SDL2.dll'.'SDL_SetSurfaceAlphaMod' -++'_SDL_GetSurfaceAlphaMod'.'SDL2.dll'.'SDL_GetSurfaceAlphaMod' -++'_SDL_SetSurfaceBlendMode'.'SDL2.dll'.'SDL_SetSurfaceBlendMode' -++'_SDL_GetSurfaceBlendMode'.'SDL2.dll'.'SDL_GetSurfaceBlendMode' -++'_SDL_SetClipRect'.'SDL2.dll'.'SDL_SetClipRect' -++'_SDL_GetClipRect'.'SDL2.dll'.'SDL_GetClipRect' -++'_SDL_ConvertSurface'.'SDL2.dll'.'SDL_ConvertSurface' -++'_SDL_ConvertSurfaceFormat'.'SDL2.dll'.'SDL_ConvertSurfaceFormat' -++'_SDL_ConvertPixels'.'SDL2.dll'.'SDL_ConvertPixels' -++'_SDL_FillRect'.'SDL2.dll'.'SDL_FillRect' -++'_SDL_FillRects'.'SDL2.dll'.'SDL_FillRects' -++'_SDL_UpperBlit'.'SDL2.dll'.'SDL_UpperBlit' -++'_SDL_LowerBlit'.'SDL2.dll'.'SDL_LowerBlit' -++'_SDL_SoftStretch'.'SDL2.dll'.'SDL_SoftStretch' -++'_SDL_UpperBlitScaled'.'SDL2.dll'.'SDL_UpperBlitScaled' -++'_SDL_LowerBlitScaled'.'SDL2.dll'.'SDL_LowerBlitScaled' -++'_SDL_GetWindowWMInfo'.'SDL2.dll'.'SDL_GetWindowWMInfo' -++'_SDL_GetThreadName'.'SDL2.dll'.'SDL_GetThreadName' -++'_SDL_ThreadID'.'SDL2.dll'.'SDL_ThreadID' -++'_SDL_GetThreadID'.'SDL2.dll'.'SDL_GetThreadID' -++'_SDL_SetThreadPriority'.'SDL2.dll'.'SDL_SetThreadPriority' -++'_SDL_WaitThread'.'SDL2.dll'.'SDL_WaitThread' -++'_SDL_DetachThread'.'SDL2.dll'.'SDL_DetachThread' -++'_SDL_TLSCreate'.'SDL2.dll'.'SDL_TLSCreate' -++'_SDL_TLSGet'.'SDL2.dll'.'SDL_TLSGet' -++'_SDL_TLSSet'.'SDL2.dll'.'SDL_TLSSet' -++'_SDL_GetTicks'.'SDL2.dll'.'SDL_GetTicks' -++'_SDL_GetPerformanceCounter'.'SDL2.dll'.'SDL_GetPerformanceCounter' -++'_SDL_GetPerformanceFrequency'.'SDL2.dll'.'SDL_GetPerformanceFrequency' -++'_SDL_Delay'.'SDL2.dll'.'SDL_Delay' -++'_SDL_AddTimer'.'SDL2.dll'.'SDL_AddTimer' -++'_SDL_RemoveTimer'.'SDL2.dll'.'SDL_RemoveTimer' -++'_SDL_GetNumTouchDevices'.'SDL2.dll'.'SDL_GetNumTouchDevices' -++'_SDL_GetTouchDevice'.'SDL2.dll'.'SDL_GetTouchDevice' -++'_SDL_GetNumTouchFingers'.'SDL2.dll'.'SDL_GetNumTouchFingers' -++'_SDL_GetTouchFinger'.'SDL2.dll'.'SDL_GetTouchFinger' -++'_SDL_GetVersion'.'SDL2.dll'.'SDL_GetVersion' -++'_SDL_GetRevision'.'SDL2.dll'.'SDL_GetRevision' -++'_SDL_GetRevisionNumber'.'SDL2.dll'.'SDL_GetRevisionNumber' -++'_SDL_GetNumVideoDrivers'.'SDL2.dll'.'SDL_GetNumVideoDrivers' -++'_SDL_GetVideoDriver'.'SDL2.dll'.'SDL_GetVideoDriver' -++'_SDL_VideoInit'.'SDL2.dll'.'SDL_VideoInit' -++'_SDL_VideoQuit'.'SDL2.dll'.'SDL_VideoQuit' -++'_SDL_GetCurrentVideoDriver'.'SDL2.dll'.'SDL_GetCurrentVideoDriver' -++'_SDL_GetNumVideoDisplays'.'SDL2.dll'.'SDL_GetNumVideoDisplays' -++'_SDL_GetDisplayName'.'SDL2.dll'.'SDL_GetDisplayName' -++'_SDL_GetDisplayBounds'.'SDL2.dll'.'SDL_GetDisplayBounds' -++'_SDL_GetDisplayDPI'.'SDL2.dll'.'SDL_GetDisplayDPI' -++'_SDL_GetNumDisplayModes'.'SDL2.dll'.'SDL_GetNumDisplayModes' -++'_SDL_GetDisplayMode'.'SDL2.dll'.'SDL_GetDisplayMode' -++'_SDL_GetDesktopDisplayMode'.'SDL2.dll'.'SDL_GetDesktopDisplayMode' -++'_SDL_GetCurrentDisplayMode'.'SDL2.dll'.'SDL_GetCurrentDisplayMode' -++'_SDL_GetClosestDisplayMode'.'SDL2.dll'.'SDL_GetClosestDisplayMode' -++'_SDL_GetWindowDisplayIndex'.'SDL2.dll'.'SDL_GetWindowDisplayIndex' -++'_SDL_SetWindowDisplayMode'.'SDL2.dll'.'SDL_SetWindowDisplayMode' -++'_SDL_GetWindowDisplayMode'.'SDL2.dll'.'SDL_GetWindowDisplayMode' -++'_SDL_GetWindowPixelFormat'.'SDL2.dll'.'SDL_GetWindowPixelFormat' -++'_SDL_CreateWindow'.'SDL2.dll'.'SDL_CreateWindow' -++'_SDL_CreateWindowFrom'.'SDL2.dll'.'SDL_CreateWindowFrom' -++'_SDL_GetWindowID'.'SDL2.dll'.'SDL_GetWindowID' -++'_SDL_GetWindowFromID'.'SDL2.dll'.'SDL_GetWindowFromID' -++'_SDL_GetWindowFlags'.'SDL2.dll'.'SDL_GetWindowFlags' -++'_SDL_SetWindowTitle'.'SDL2.dll'.'SDL_SetWindowTitle' -++'_SDL_GetWindowTitle'.'SDL2.dll'.'SDL_GetWindowTitle' -++'_SDL_SetWindowIcon'.'SDL2.dll'.'SDL_SetWindowIcon' -++'_SDL_SetWindowData'.'SDL2.dll'.'SDL_SetWindowData' -++'_SDL_GetWindowData'.'SDL2.dll'.'SDL_GetWindowData' -++'_SDL_SetWindowPosition'.'SDL2.dll'.'SDL_SetWindowPosition' -++'_SDL_GetWindowPosition'.'SDL2.dll'.'SDL_GetWindowPosition' -++'_SDL_SetWindowSize'.'SDL2.dll'.'SDL_SetWindowSize' -++'_SDL_GetWindowSize'.'SDL2.dll'.'SDL_GetWindowSize' -++'_SDL_SetWindowMinimumSize'.'SDL2.dll'.'SDL_SetWindowMinimumSize' -++'_SDL_GetWindowMinimumSize'.'SDL2.dll'.'SDL_GetWindowMinimumSize' -++'_SDL_SetWindowMaximumSize'.'SDL2.dll'.'SDL_SetWindowMaximumSize' -++'_SDL_GetWindowMaximumSize'.'SDL2.dll'.'SDL_GetWindowMaximumSize' -++'_SDL_SetWindowBordered'.'SDL2.dll'.'SDL_SetWindowBordered' -++'_SDL_ShowWindow'.'SDL2.dll'.'SDL_ShowWindow' -++'_SDL_HideWindow'.'SDL2.dll'.'SDL_HideWindow' -++'_SDL_RaiseWindow'.'SDL2.dll'.'SDL_RaiseWindow' -++'_SDL_MaximizeWindow'.'SDL2.dll'.'SDL_MaximizeWindow' -++'_SDL_MinimizeWindow'.'SDL2.dll'.'SDL_MinimizeWindow' -++'_SDL_RestoreWindow'.'SDL2.dll'.'SDL_RestoreWindow' -++'_SDL_SetWindowFullscreen'.'SDL2.dll'.'SDL_SetWindowFullscreen' -++'_SDL_GetWindowSurface'.'SDL2.dll'.'SDL_GetWindowSurface' -++'_SDL_UpdateWindowSurface'.'SDL2.dll'.'SDL_UpdateWindowSurface' -++'_SDL_UpdateWindowSurfaceRects'.'SDL2.dll'.'SDL_UpdateWindowSurfaceRects' -++'_SDL_SetWindowGrab'.'SDL2.dll'.'SDL_SetWindowGrab' -++'_SDL_GetWindowGrab'.'SDL2.dll'.'SDL_GetWindowGrab' -++'_SDL_SetWindowBrightness'.'SDL2.dll'.'SDL_SetWindowBrightness' -++'_SDL_GetWindowBrightness'.'SDL2.dll'.'SDL_GetWindowBrightness' -++'_SDL_SetWindowGammaRamp'.'SDL2.dll'.'SDL_SetWindowGammaRamp' -++'_SDL_GetWindowGammaRamp'.'SDL2.dll'.'SDL_GetWindowGammaRamp' -++'_SDL_DestroyWindow'.'SDL2.dll'.'SDL_DestroyWindow' -++'_SDL_IsScreenSaverEnabled'.'SDL2.dll'.'SDL_IsScreenSaverEnabled' -++'_SDL_EnableScreenSaver'.'SDL2.dll'.'SDL_EnableScreenSaver' -++'_SDL_DisableScreenSaver'.'SDL2.dll'.'SDL_DisableScreenSaver' -++'_SDL_GL_LoadLibrary'.'SDL2.dll'.'SDL_GL_LoadLibrary' -++'_SDL_GL_GetProcAddress'.'SDL2.dll'.'SDL_GL_GetProcAddress' -++'_SDL_GL_UnloadLibrary'.'SDL2.dll'.'SDL_GL_UnloadLibrary' -++'_SDL_GL_ExtensionSupported'.'SDL2.dll'.'SDL_GL_ExtensionSupported' -++'_SDL_GL_SetAttribute'.'SDL2.dll'.'SDL_GL_SetAttribute' -++'_SDL_GL_GetAttribute'.'SDL2.dll'.'SDL_GL_GetAttribute' -++'_SDL_GL_CreateContext'.'SDL2.dll'.'SDL_GL_CreateContext' -++'_SDL_GL_MakeCurrent'.'SDL2.dll'.'SDL_GL_MakeCurrent' -++'_SDL_GL_GetCurrentWindow'.'SDL2.dll'.'SDL_GL_GetCurrentWindow' -++'_SDL_GL_GetCurrentContext'.'SDL2.dll'.'SDL_GL_GetCurrentContext' -++'_SDL_GL_GetDrawableSize'.'SDL2.dll'.'SDL_GL_GetDrawableSize' -++'_SDL_GL_SetSwapInterval'.'SDL2.dll'.'SDL_GL_SetSwapInterval' -++'_SDL_GL_GetSwapInterval'.'SDL2.dll'.'SDL_GL_GetSwapInterval' -++'_SDL_GL_SwapWindow'.'SDL2.dll'.'SDL_GL_SwapWindow' -++'_SDL_GL_DeleteContext'.'SDL2.dll'.'SDL_GL_DeleteContext' -++'_SDL_vsscanf'.'SDL2.dll'.'SDL_vsscanf' -++'_SDL_GameControllerAddMappingsFromRW'.'SDL2.dll'.'SDL_GameControllerAddMappingsFromRW' -++'_SDL_GL_ResetAttributes'.'SDL2.dll'.'SDL_GL_ResetAttributes' -++'_SDL_HasAVX'.'SDL2.dll'.'SDL_HasAVX' -++'_SDL_GetDefaultAssertionHandler'.'SDL2.dll'.'SDL_GetDefaultAssertionHandler' -++'_SDL_GetAssertionHandler'.'SDL2.dll'.'SDL_GetAssertionHandler' -++'_SDL_DXGIGetOutputInfo'.'SDL2.dll'.'SDL_DXGIGetOutputInfo' -++'_SDL_RenderIsClipEnabled'.'SDL2.dll'.'SDL_RenderIsClipEnabled' -# ++'_SDL_WinRTRunApp'.'SDL2.dll'.'SDL_WinRTRunApp' -++'_SDL_WarpMouseGlobal'.'SDL2.dll'.'SDL_WarpMouseGlobal' -# ++'_SDL_WinRTGetFSPathUNICODE'.'SDL2.dll'.'SDL_WinRTGetFSPathUNICODE' -# ++'_SDL_WinRTGetFSPathUTF8'.'SDL2.dll'.'SDL_WinRTGetFSPathUTF8' -++'_SDL_sqrtf'.'SDL2.dll'.'SDL_sqrtf' -++'_SDL_tan'.'SDL2.dll'.'SDL_tan' -++'_SDL_tanf'.'SDL2.dll'.'SDL_tanf' -++'_SDL_CaptureMouse'.'SDL2.dll'.'SDL_CaptureMouse' -++'_SDL_SetWindowHitTest'.'SDL2.dll'.'SDL_SetWindowHitTest' -++'_SDL_GetGlobalMouseState'.'SDL2.dll'.'SDL_GetGlobalMouseState' -++'_SDL_HasAVX2'.'SDL2.dll'.'SDL_HasAVX2' -++'_SDL_QueueAudio'.'SDL2.dll'.'SDL_QueueAudio' -++'_SDL_GetQueuedAudioSize'.'SDL2.dll'.'SDL_GetQueuedAudioSize' -++'_SDL_ClearQueuedAudio'.'SDL2.dll'.'SDL_ClearQueuedAudio' -++'_SDL_GetGrabbedWindow'.'SDL2.dll'.'SDL_GetGrabbedWindow' -++'_SDL_SetWindowsMessageHook'.'SDL2.dll'.'SDL_SetWindowsMessageHook' -++'_SDL_JoystickCurrentPowerLevel'.'SDL2.dll'.'SDL_JoystickCurrentPowerLevel' -++'_SDL_GameControllerFromInstanceID'.'SDL2.dll'.'SDL_GameControllerFromInstanceID' -++'_SDL_JoystickFromInstanceID'.'SDL2.dll'.'SDL_JoystickFromInstanceID' -++'_SDL_GetDisplayUsableBounds'.'SDL2.dll'.'SDL_GetDisplayUsableBounds' -++'_SDL_GetWindowBordersSize'.'SDL2.dll'.'SDL_GetWindowBordersSize' -++'_SDL_SetWindowOpacity'.'SDL2.dll'.'SDL_SetWindowOpacity' -++'_SDL_GetWindowOpacity'.'SDL2.dll'.'SDL_GetWindowOpacity' -++'_SDL_SetWindowInputFocus'.'SDL2.dll'.'SDL_SetWindowInputFocus' -++'_SDL_SetWindowModalFor'.'SDL2.dll'.'SDL_SetWindowModalFor' -++'_SDL_RenderSetIntegerScale'.'SDL2.dll'.'SDL_RenderSetIntegerScale' -++'_SDL_RenderGetIntegerScale'.'SDL2.dll'.'SDL_RenderGetIntegerScale' -++'_SDL_DequeueAudio'.'SDL2.dll'.'SDL_DequeueAudio' -++'_SDL_SetWindowResizable'.'SDL2.dll'.'SDL_SetWindowResizable' -++'_SDL_CreateRGBSurfaceWithFormat'.'SDL2.dll'.'SDL_CreateRGBSurfaceWithFormat' -++'_SDL_CreateRGBSurfaceWithFormatFrom'.'SDL2.dll'.'SDL_CreateRGBSurfaceWithFormatFrom' -++'_SDL_GetHintBoolean'.'SDL2.dll'.'SDL_GetHintBoolean' -++'_SDL_JoystickGetDeviceVendor'.'SDL2.dll'.'SDL_JoystickGetDeviceVendor' -++'_SDL_JoystickGetDeviceProduct'.'SDL2.dll'.'SDL_JoystickGetDeviceProduct' -++'_SDL_JoystickGetDeviceProductVersion'.'SDL2.dll'.'SDL_JoystickGetDeviceProductVersion' -++'_SDL_JoystickGetVendor'.'SDL2.dll'.'SDL_JoystickGetVendor' -++'_SDL_JoystickGetProduct'.'SDL2.dll'.'SDL_JoystickGetProduct' -++'_SDL_JoystickGetProductVersion'.'SDL2.dll'.'SDL_JoystickGetProductVersion' -++'_SDL_GameControllerGetVendor'.'SDL2.dll'.'SDL_GameControllerGetVendor' -++'_SDL_GameControllerGetProduct'.'SDL2.dll'.'SDL_GameControllerGetProduct' -++'_SDL_GameControllerGetProductVersion'.'SDL2.dll'.'SDL_GameControllerGetProductVersion' -++'_SDL_HasNEON'.'SDL2.dll'.'SDL_HasNEON' -++'_SDL_GameControllerNumMappings'.'SDL2.dll'.'SDL_GameControllerNumMappings' -++'_SDL_GameControllerMappingForIndex'.'SDL2.dll'.'SDL_GameControllerMappingForIndex' -++'_SDL_JoystickGetAxisInitialState'.'SDL2.dll'.'SDL_JoystickGetAxisInitialState' -++'_SDL_JoystickGetDeviceType'.'SDL2.dll'.'SDL_JoystickGetDeviceType' -++'_SDL_JoystickGetType'.'SDL2.dll'.'SDL_JoystickGetType' -++'_SDL_MemoryBarrierReleaseFunction'.'SDL2.dll'.'SDL_MemoryBarrierReleaseFunction' -++'_SDL_MemoryBarrierAcquireFunction'.'SDL2.dll'.'SDL_MemoryBarrierAcquireFunction' -++'_SDL_JoystickGetDeviceInstanceID'.'SDL2.dll'.'SDL_JoystickGetDeviceInstanceID' -++'_SDL_utf8strlen'.'SDL2.dll'.'SDL_utf8strlen' -++'_SDL_LoadFile_RW'.'SDL2.dll'.'SDL_LoadFile_RW' -++'_SDL_wcscmp'.'SDL2.dll'.'SDL_wcscmp' -++'_SDL_ComposeCustomBlendMode'.'SDL2.dll'.'SDL_ComposeCustomBlendMode' -++'_SDL_DuplicateSurface'.'SDL2.dll'.'SDL_DuplicateSurface' -++'_SDL_Vulkan_LoadLibrary'.'SDL2.dll'.'SDL_Vulkan_LoadLibrary' -++'_SDL_Vulkan_GetVkGetInstanceProcAddr'.'SDL2.dll'.'SDL_Vulkan_GetVkGetInstanceProcAddr' -++'_SDL_Vulkan_UnloadLibrary'.'SDL2.dll'.'SDL_Vulkan_UnloadLibrary' -++'_SDL_Vulkan_GetInstanceExtensions'.'SDL2.dll'.'SDL_Vulkan_GetInstanceExtensions' -++'_SDL_Vulkan_CreateSurface'.'SDL2.dll'.'SDL_Vulkan_CreateSurface' -++'_SDL_Vulkan_GetDrawableSize'.'SDL2.dll'.'SDL_Vulkan_GetDrawableSize' -++'_SDL_LockJoysticks'.'SDL2.dll'.'SDL_LockJoysticks' -++'_SDL_UnlockJoysticks'.'SDL2.dll'.'SDL_UnlockJoysticks' -++'_SDL_GetMemoryFunctions'.'SDL2.dll'.'SDL_GetMemoryFunctions' -++'_SDL_SetMemoryFunctions'.'SDL2.dll'.'SDL_SetMemoryFunctions' -++'_SDL_GetNumAllocations'.'SDL2.dll'.'SDL_GetNumAllocations' -++'_SDL_NewAudioStream'.'SDL2.dll'.'SDL_NewAudioStream' -++'_SDL_AudioStreamPut'.'SDL2.dll'.'SDL_AudioStreamPut' -++'_SDL_AudioStreamGet'.'SDL2.dll'.'SDL_AudioStreamGet' -++'_SDL_AudioStreamClear'.'SDL2.dll'.'SDL_AudioStreamClear' -++'_SDL_AudioStreamAvailable'.'SDL2.dll'.'SDL_AudioStreamAvailable' -++'_SDL_FreeAudioStream'.'SDL2.dll'.'SDL_FreeAudioStream' -++'_SDL_AudioStreamFlush'.'SDL2.dll'.'SDL_AudioStreamFlush' -++'_SDL_acosf'.'SDL2.dll'.'SDL_acosf' -++'_SDL_asinf'.'SDL2.dll'.'SDL_asinf' -++'_SDL_atanf'.'SDL2.dll'.'SDL_atanf' -++'_SDL_atan2f'.'SDL2.dll'.'SDL_atan2f' -++'_SDL_ceilf'.'SDL2.dll'.'SDL_ceilf' -++'_SDL_copysignf'.'SDL2.dll'.'SDL_copysignf' -++'_SDL_fabsf'.'SDL2.dll'.'SDL_fabsf' -++'_SDL_floorf'.'SDL2.dll'.'SDL_floorf' -++'_SDL_logf'.'SDL2.dll'.'SDL_logf' -++'_SDL_powf'.'SDL2.dll'.'SDL_powf' -++'_SDL_scalbnf'.'SDL2.dll'.'SDL_scalbnf' -++'_SDL_fmod'.'SDL2.dll'.'SDL_fmod' -++'_SDL_fmodf'.'SDL2.dll'.'SDL_fmodf' -++'_SDL_SetYUVConversionMode'.'SDL2.dll'.'SDL_SetYUVConversionMode' -++'_SDL_GetYUVConversionMode'.'SDL2.dll'.'SDL_GetYUVConversionMode' -++'_SDL_GetYUVConversionModeForResolution'.'SDL2.dll'.'SDL_GetYUVConversionModeForResolution' -++'_SDL_RenderGetMetalLayer'.'SDL2.dll'.'SDL_RenderGetMetalLayer' -++'_SDL_RenderGetMetalCommandEncoder'.'SDL2.dll'.'SDL_RenderGetMetalCommandEncoder' -# ++'_SDL_IsAndroidTV'.'SDL2.dll'.'SDL_IsAndroidTV' -# ++'_SDL_WinRTGetDeviceFamily'.'SDL2.dll'.'SDL_WinRTGetDeviceFamily' -++'_SDL_log10'.'SDL2.dll'.'SDL_log10' -++'_SDL_log10f'.'SDL2.dll'.'SDL_log10f' -++'_SDL_GameControllerMappingForDeviceIndex'.'SDL2.dll'.'SDL_GameControllerMappingForDeviceIndex' -# ++'_SDL_LinuxSetThreadPriority'.'SDL2.dll'.'SDL_LinuxSetThreadPriority' -++'_SDL_HasAVX512F'.'SDL2.dll'.'SDL_HasAVX512F' -# ++'_SDL_IsChromebook'.'SDL2.dll'.'SDL_IsChromebook' -# ++'_SDL_IsDeXMode'.'SDL2.dll'.'SDL_IsDeXMode' -# ++'_SDL_AndroidBackButton'.'SDL2.dll'.'SDL_AndroidBackButton' -++'_SDL_exp'.'SDL2.dll'.'SDL_exp' -++'_SDL_expf'.'SDL2.dll'.'SDL_expf' -++'_SDL_wcsdup'.'SDL2.dll'.'SDL_wcsdup' -++'_SDL_GameControllerRumble'.'SDL2.dll'.'SDL_GameControllerRumble' -++'_SDL_JoystickRumble'.'SDL2.dll'.'SDL_JoystickRumble' -++'_SDL_NumSensors'.'SDL2.dll'.'SDL_NumSensors' -++'_SDL_SensorGetDeviceName'.'SDL2.dll'.'SDL_SensorGetDeviceName' -++'_SDL_SensorGetDeviceType'.'SDL2.dll'.'SDL_SensorGetDeviceType' -++'_SDL_SensorGetDeviceNonPortableType'.'SDL2.dll'.'SDL_SensorGetDeviceNonPortableType' -++'_SDL_SensorGetDeviceInstanceID'.'SDL2.dll'.'SDL_SensorGetDeviceInstanceID' -++'_SDL_SensorOpen'.'SDL2.dll'.'SDL_SensorOpen' -++'_SDL_SensorFromInstanceID'.'SDL2.dll'.'SDL_SensorFromInstanceID' -++'_SDL_SensorGetName'.'SDL2.dll'.'SDL_SensorGetName' -++'_SDL_SensorGetType'.'SDL2.dll'.'SDL_SensorGetType' -++'_SDL_SensorGetNonPortableType'.'SDL2.dll'.'SDL_SensorGetNonPortableType' -++'_SDL_SensorGetInstanceID'.'SDL2.dll'.'SDL_SensorGetInstanceID' -++'_SDL_SensorGetData'.'SDL2.dll'.'SDL_SensorGetData' -++'_SDL_SensorClose'.'SDL2.dll'.'SDL_SensorClose' -++'_SDL_SensorUpdate'.'SDL2.dll'.'SDL_SensorUpdate' -++'_SDL_IsTablet'.'SDL2.dll'.'SDL_IsTablet' -++'_SDL_GetDisplayOrientation'.'SDL2.dll'.'SDL_GetDisplayOrientation' -++'_SDL_HasColorKey'.'SDL2.dll'.'SDL_HasColorKey' -++'_SDL_CreateThreadWithStackSize'.'SDL2.dll'.'SDL_CreateThreadWithStackSize' -++'_SDL_JoystickGetDevicePlayerIndex'.'SDL2.dll'.'SDL_JoystickGetDevicePlayerIndex' -++'_SDL_JoystickGetPlayerIndex'.'SDL2.dll'.'SDL_JoystickGetPlayerIndex' -++'_SDL_GameControllerGetPlayerIndex'.'SDL2.dll'.'SDL_GameControllerGetPlayerIndex' -++'_SDL_RenderFlush'.'SDL2.dll'.'SDL_RenderFlush' -++'_SDL_RenderDrawPointF'.'SDL2.dll'.'SDL_RenderDrawPointF' -++'_SDL_RenderDrawPointsF'.'SDL2.dll'.'SDL_RenderDrawPointsF' -++'_SDL_RenderDrawLineF'.'SDL2.dll'.'SDL_RenderDrawLineF' -++'_SDL_RenderDrawLinesF'.'SDL2.dll'.'SDL_RenderDrawLinesF' -++'_SDL_RenderDrawRectF'.'SDL2.dll'.'SDL_RenderDrawRectF' -++'_SDL_RenderDrawRectsF'.'SDL2.dll'.'SDL_RenderDrawRectsF' -++'_SDL_RenderFillRectF'.'SDL2.dll'.'SDL_RenderFillRectF' -++'_SDL_RenderFillRectsF'.'SDL2.dll'.'SDL_RenderFillRectsF' -++'_SDL_RenderCopyF'.'SDL2.dll'.'SDL_RenderCopyF' -++'_SDL_RenderCopyExF'.'SDL2.dll'.'SDL_RenderCopyExF' -++'_SDL_GetTouchDeviceType'.'SDL2.dll'.'SDL_GetTouchDeviceType' -# ++'_SDL_UIKitRunApp'.'SDL2.dll'.'SDL_UIKitRunApp' -++'_SDL_SIMDGetAlignment'.'SDL2.dll'.'SDL_SIMDGetAlignment' -++'_SDL_SIMDAlloc'.'SDL2.dll'.'SDL_SIMDAlloc' -++'_SDL_SIMDFree'.'SDL2.dll'.'SDL_SIMDFree' -++'_SDL_RWsize'.'SDL2.dll'.'SDL_RWsize' -++'_SDL_RWseek'.'SDL2.dll'.'SDL_RWseek' -++'_SDL_RWtell'.'SDL2.dll'.'SDL_RWtell' -++'_SDL_RWread'.'SDL2.dll'.'SDL_RWread' -++'_SDL_RWwrite'.'SDL2.dll'.'SDL_RWwrite' -++'_SDL_RWclose'.'SDL2.dll'.'SDL_RWclose' -++'_SDL_LoadFile'.'SDL2.dll'.'SDL_LoadFile' -++'_SDL_Metal_CreateView'.'SDL2.dll'.'SDL_Metal_CreateView' -++'_SDL_Metal_DestroyView'.'SDL2.dll'.'SDL_Metal_DestroyView' -++'_SDL_LockTextureToSurface'.'SDL2.dll'.'SDL_LockTextureToSurface' -++'_SDL_HasARMSIMD'.'SDL2.dll'.'SDL_HasARMSIMD' -++'_SDL_strtokr'.'SDL2.dll'.'SDL_strtokr' -++'_SDL_wcsstr'.'SDL2.dll'.'SDL_wcsstr' -++'_SDL_wcsncmp'.'SDL2.dll'.'SDL_wcsncmp' -++'_SDL_GameControllerTypeForIndex'.'SDL2.dll'.'SDL_GameControllerTypeForIndex' -++'_SDL_GameControllerGetType'.'SDL2.dll'.'SDL_GameControllerGetType' -++'_SDL_GameControllerFromPlayerIndex'.'SDL2.dll'.'SDL_GameControllerFromPlayerIndex' -++'_SDL_GameControllerSetPlayerIndex'.'SDL2.dll'.'SDL_GameControllerSetPlayerIndex' -++'_SDL_JoystickFromPlayerIndex'.'SDL2.dll'.'SDL_JoystickFromPlayerIndex' -++'_SDL_JoystickSetPlayerIndex'.'SDL2.dll'.'SDL_JoystickSetPlayerIndex' -++'_SDL_SetTextureScaleMode'.'SDL2.dll'.'SDL_SetTextureScaleMode' -++'_SDL_GetTextureScaleMode'.'SDL2.dll'.'SDL_GetTextureScaleMode' -++'_SDL_OnApplicationWillTerminate'.'SDL2.dll'.'SDL_OnApplicationWillTerminate' -++'_SDL_OnApplicationDidReceiveMemoryWarning'.'SDL2.dll'.'SDL_OnApplicationDidReceiveMemoryWarning' -++'_SDL_OnApplicationWillResignActive'.'SDL2.dll'.'SDL_OnApplicationWillResignActive' -++'_SDL_OnApplicationDidEnterBackground'.'SDL2.dll'.'SDL_OnApplicationDidEnterBackground' -++'_SDL_OnApplicationWillEnterForeground'.'SDL2.dll'.'SDL_OnApplicationWillEnterForeground' -++'_SDL_OnApplicationDidBecomeActive'.'SDL2.dll'.'SDL_OnApplicationDidBecomeActive' -# ++'_SDL_OnApplicationDidChangeStatusBarOrientation'.'SDL2.dll'.'SDL_OnApplicationDidChangeStatusBarOrientation' -# ++'_SDL_GetAndroidSDKVersion'.'SDL2.dll'.'SDL_GetAndroidSDKVersion' -++'_SDL_isupper'.'SDL2.dll'.'SDL_isupper' -++'_SDL_islower'.'SDL2.dll'.'SDL_islower' -++'_SDL_JoystickAttachVirtual'.'SDL2.dll'.'SDL_JoystickAttachVirtual' -++'_SDL_JoystickDetachVirtual'.'SDL2.dll'.'SDL_JoystickDetachVirtual' -++'_SDL_JoystickIsVirtual'.'SDL2.dll'.'SDL_JoystickIsVirtual' -++'_SDL_JoystickSetVirtualAxis'.'SDL2.dll'.'SDL_JoystickSetVirtualAxis' -++'_SDL_JoystickSetVirtualButton'.'SDL2.dll'.'SDL_JoystickSetVirtualButton' -++'_SDL_JoystickSetVirtualHat'.'SDL2.dll'.'SDL_JoystickSetVirtualHat' -++'_SDL_GetErrorMsg'.'SDL2.dll'.'SDL_GetErrorMsg' -++'_SDL_LockSensors'.'SDL2.dll'.'SDL_LockSensors' -++'_SDL_UnlockSensors'.'SDL2.dll'.'SDL_UnlockSensors' -++'_SDL_Metal_GetLayer'.'SDL2.dll'.'SDL_Metal_GetLayer' -++'_SDL_Metal_GetDrawableSize'.'SDL2.dll'.'SDL_Metal_GetDrawableSize' -++'_SDL_trunc'.'SDL2.dll'.'SDL_trunc' -++'_SDL_truncf'.'SDL2.dll'.'SDL_truncf' -++'_SDL_GetPreferredLocales'.'SDL2.dll'.'SDL_GetPreferredLocales' -++'_SDL_SIMDRealloc'.'SDL2.dll'.'SDL_SIMDRealloc' -# ++'_SDL_AndroidRequestPermission'.'SDL2.dll'.'SDL_AndroidRequestPermission' -++'_SDL_OpenURL'.'SDL2.dll'.'SDL_OpenURL' -++'_SDL_HasSurfaceRLE'.'SDL2.dll'.'SDL_HasSurfaceRLE' -++'_SDL_GameControllerHasLED'.'SDL2.dll'.'SDL_GameControllerHasLED' -++'_SDL_GameControllerSetLED'.'SDL2.dll'.'SDL_GameControllerSetLED' -++'_SDL_JoystickHasLED'.'SDL2.dll'.'SDL_JoystickHasLED' -++'_SDL_JoystickSetLED'.'SDL2.dll'.'SDL_JoystickSetLED' -++'_SDL_GameControllerRumbleTriggers'.'SDL2.dll'.'SDL_GameControllerRumbleTriggers' -++'_SDL_JoystickRumbleTriggers'.'SDL2.dll'.'SDL_JoystickRumbleTriggers' -++'_SDL_GameControllerHasAxis'.'SDL2.dll'.'SDL_GameControllerHasAxis' -++'_SDL_GameControllerHasButton'.'SDL2.dll'.'SDL_GameControllerHasButton' -++'_SDL_GameControllerGetNumTouchpads'.'SDL2.dll'.'SDL_GameControllerGetNumTouchpads' -++'_SDL_GameControllerGetNumTouchpadFingers'.'SDL2.dll'.'SDL_GameControllerGetNumTouchpadFingers' -++'_SDL_GameControllerGetTouchpadFinger'.'SDL2.dll'.'SDL_GameControllerGetTouchpadFinger' -++'_SDL_crc32'.'SDL2.dll'.'SDL_crc32' -++'_SDL_GameControllerGetSerial'.'SDL2.dll'.'SDL_GameControllerGetSerial' -++'_SDL_JoystickGetSerial'.'SDL2.dll'.'SDL_JoystickGetSerial' -++'_SDL_GameControllerHasSensor'.'SDL2.dll'.'SDL_GameControllerHasSensor' -++'_SDL_GameControllerSetSensorEnabled'.'SDL2.dll'.'SDL_GameControllerSetSensorEnabled' -++'_SDL_GameControllerIsSensorEnabled'.'SDL2.dll'.'SDL_GameControllerIsSensorEnabled' -++'_SDL_GameControllerGetSensorData'.'SDL2.dll'.'SDL_GameControllerGetSensorData' -++'_SDL_wcscasecmp'.'SDL2.dll'.'SDL_wcscasecmp' -++'_SDL_wcsncasecmp'.'SDL2.dll'.'SDL_wcsncasecmp' -++'_SDL_round'.'SDL2.dll'.'SDL_round' -++'_SDL_roundf'.'SDL2.dll'.'SDL_roundf' -++'_SDL_lround'.'SDL2.dll'.'SDL_lround' -++'_SDL_lroundf'.'SDL2.dll'.'SDL_lroundf' -++'_SDL_SoftStretchLinear'.'SDL2.dll'.'SDL_SoftStretchLinear' -++'_SDL_RenderGetD3D11Device'.'SDL2.dll'.'SDL_RenderGetD3D11Device' -++'_SDL_UpdateNVTexture'.'SDL2.dll'.'SDL_UpdateNVTexture' -++'_SDL_SetWindowKeyboardGrab'.'SDL2.dll'.'SDL_SetWindowKeyboardGrab' -++'_SDL_SetWindowMouseGrab'.'SDL2.dll'.'SDL_SetWindowMouseGrab' -++'_SDL_GetWindowKeyboardGrab'.'SDL2.dll'.'SDL_GetWindowKeyboardGrab' -++'_SDL_GetWindowMouseGrab'.'SDL2.dll'.'SDL_GetWindowMouseGrab' -++'_SDL_isalpha'.'SDL2.dll'.'SDL_isalpha' -++'_SDL_isalnum'.'SDL2.dll'.'SDL_isalnum' -++'_SDL_isblank'.'SDL2.dll'.'SDL_isblank' -++'_SDL_iscntrl'.'SDL2.dll'.'SDL_iscntrl' -++'_SDL_isxdigit'.'SDL2.dll'.'SDL_isxdigit' -++'_SDL_ispunct'.'SDL2.dll'.'SDL_ispunct' -++'_SDL_isprint'.'SDL2.dll'.'SDL_isprint' -++'_SDL_isgraph'.'SDL2.dll'.'SDL_isgraph' -# ++'_SDL_AndroidShowToast'.'SDL2.dll'.'SDL_AndroidShowToast' -++'_SDL_GetAudioDeviceSpec'.'SDL2.dll'.'SDL_GetAudioDeviceSpec' -++'_SDL_TLSCleanup'.'SDL2.dll'.'SDL_TLSCleanup' -++'_SDL_SetWindowAlwaysOnTop'.'SDL2.dll'.'SDL_SetWindowAlwaysOnTop' -++'_SDL_FlashWindow'.'SDL2.dll'.'SDL_FlashWindow' -++'_SDL_GameControllerSendEffect'.'SDL2.dll'.'SDL_GameControllerSendEffect' -++'_SDL_JoystickSendEffect'.'SDL2.dll'.'SDL_JoystickSendEffect' -++'_SDL_GameControllerGetSensorDataRate'.'SDL2.dll'.'SDL_GameControllerGetSensorDataRate' -++'_SDL_SetTextureUserData'.'SDL2.dll'.'SDL_SetTextureUserData' -++'_SDL_GetTextureUserData'.'SDL2.dll'.'SDL_GetTextureUserData' -++'_SDL_RenderGeometry'.'SDL2.dll'.'SDL_RenderGeometry' -++'_SDL_RenderGeometryRaw'.'SDL2.dll'.'SDL_RenderGeometryRaw' -++'_SDL_RenderSetVSync'.'SDL2.dll'.'SDL_RenderSetVSync' -++'_SDL_asprintf'.'SDL2.dll'.'SDL_asprintf' -++'_SDL_vasprintf'.'SDL2.dll'.'SDL_vasprintf' -++'_SDL_GetWindowICCProfile'.'SDL2.dll'.'SDL_GetWindowICCProfile' -++'_SDL_GetTicks64'.'SDL2.dll'.'SDL_GetTicks64' -# ++'_SDL_LinuxSetThreadPriorityAndPolicy'.'SDL2.dll'.'SDL_LinuxSetThreadPriorityAndPolicy' -++'_SDL_GameControllerGetAppleSFSymbolsNameForButton'.'SDL2.dll'.'SDL_GameControllerGetAppleSFSymbolsNameForButton' -++'_SDL_GameControllerGetAppleSFSymbolsNameForAxis'.'SDL2.dll'.'SDL_GameControllerGetAppleSFSymbolsNameForAxis' -++'_SDL_hid_init'.'SDL2.dll'.'SDL_hid_init' -++'_SDL_hid_exit'.'SDL2.dll'.'SDL_hid_exit' -++'_SDL_hid_device_change_count'.'SDL2.dll'.'SDL_hid_device_change_count' -++'_SDL_hid_enumerate'.'SDL2.dll'.'SDL_hid_enumerate' -++'_SDL_hid_free_enumeration'.'SDL2.dll'.'SDL_hid_free_enumeration' -++'_SDL_hid_open'.'SDL2.dll'.'SDL_hid_open' -++'_SDL_hid_open_path'.'SDL2.dll'.'SDL_hid_open_path' -++'_SDL_hid_write'.'SDL2.dll'.'SDL_hid_write' -++'_SDL_hid_read_timeout'.'SDL2.dll'.'SDL_hid_read_timeout' -++'_SDL_hid_read'.'SDL2.dll'.'SDL_hid_read' -++'_SDL_hid_set_nonblocking'.'SDL2.dll'.'SDL_hid_set_nonblocking' -++'_SDL_hid_send_feature_report'.'SDL2.dll'.'SDL_hid_send_feature_report' -++'_SDL_hid_get_feature_report'.'SDL2.dll'.'SDL_hid_get_feature_report' -++'_SDL_hid_close'.'SDL2.dll'.'SDL_hid_close' -++'_SDL_hid_get_manufacturer_string'.'SDL2.dll'.'SDL_hid_get_manufacturer_string' -++'_SDL_hid_get_product_string'.'SDL2.dll'.'SDL_hid_get_product_string' -++'_SDL_hid_get_serial_number_string'.'SDL2.dll'.'SDL_hid_get_serial_number_string' -++'_SDL_hid_get_indexed_string'.'SDL2.dll'.'SDL_hid_get_indexed_string' -++'_SDL_SetWindowMouseRect'.'SDL2.dll'.'SDL_SetWindowMouseRect' -++'_SDL_GetWindowMouseRect'.'SDL2.dll'.'SDL_GetWindowMouseRect' -++'_SDL_RenderWindowToLogical'.'SDL2.dll'.'SDL_RenderWindowToLogical' -++'_SDL_RenderLogicalToWindow'.'SDL2.dll'.'SDL_RenderLogicalToWindow' -++'_SDL_JoystickHasRumble'.'SDL2.dll'.'SDL_JoystickHasRumble' -++'_SDL_JoystickHasRumbleTriggers'.'SDL2.dll'.'SDL_JoystickHasRumbleTriggers' -++'_SDL_GameControllerHasRumble'.'SDL2.dll'.'SDL_GameControllerHasRumble' -++'_SDL_GameControllerHasRumbleTriggers'.'SDL2.dll'.'SDL_GameControllerHasRumbleTriggers' -++'_SDL_hid_ble_scan'.'SDL2.dll'.'SDL_hid_ble_scan' -++'_SDL_PremultiplyAlpha'.'SDL2.dll'.'SDL_PremultiplyAlpha' -# ++'_SDL_AndroidSendMessage'.'SDL2.dll'.'SDL_AndroidSendMessage' -++'_SDL_GetTouchName'.'SDL2.dll'.'SDL_GetTouchName' -++'_SDL_ClearComposition'.'SDL2.dll'.'SDL_ClearComposition' -++'_SDL_IsTextInputShown'.'SDL2.dll'.'SDL_IsTextInputShown' -++'_SDL_HasIntersectionF'.'SDL2.dll'.'SDL_HasIntersectionF' -++'_SDL_IntersectFRect'.'SDL2.dll'.'SDL_IntersectFRect' -++'_SDL_UnionFRect'.'SDL2.dll'.'SDL_UnionFRect' -++'_SDL_EncloseFPoints'.'SDL2.dll'.'SDL_EncloseFPoints' -++'_SDL_IntersectFRectAndLine'.'SDL2.dll'.'SDL_IntersectFRectAndLine' -++'_SDL_RenderGetWindow'.'SDL2.dll'.'SDL_RenderGetWindow' -++'_SDL_bsearch'.'SDL2.dll'.'SDL_bsearch' -++'_SDL_GameControllerPathForIndex'.'SDL2.dll'.'SDL_GameControllerPathForIndex' -++'_SDL_GameControllerPath'.'SDL2.dll'.'SDL_GameControllerPath' -++'_SDL_JoystickPathForIndex'.'SDL2.dll'.'SDL_JoystickPathForIndex' -++'_SDL_JoystickPath'.'SDL2.dll'.'SDL_JoystickPath' -++'_SDL_JoystickAttachVirtualEx'.'SDL2.dll'.'SDL_JoystickAttachVirtualEx' -++'_SDL_GameControllerGetFirmwareVersion'.'SDL2.dll'.'SDL_GameControllerGetFirmwareVersion' -++'_SDL_JoystickGetFirmwareVersion'.'SDL2.dll'.'SDL_JoystickGetFirmwareVersion' -++'_SDL_GUIDToString'.'SDL2.dll'.'SDL_GUIDToString' -++'_SDL_GUIDFromString'.'SDL2.dll'.'SDL_GUIDFromString' -++'_SDL_HasLSX'.'SDL2.dll'.'SDL_HasLSX' -++'_SDL_HasLASX'.'SDL2.dll'.'SDL_HasLASX' -++'_SDL_RenderGetD3D12Device'.'SDL2.dll'.'SDL_RenderGetD3D12Device' -++'_SDL_utf8strnlen'.'SDL2.dll'.'SDL_utf8strnlen' -# ++'_SDL_GDKGetTaskQueue'.'SDL2.dll'.'SDL_GDKGetTaskQueue' -# ++'_SDL_GDKRunApp'.'SDL2.dll'.'SDL_GDKRunApp' -++'_SDL_GetOriginalMemoryFunctions'.'SDL2.dll'.'SDL_GetOriginalMemoryFunctions' -++'_SDL_ResetKeyboard'.'SDL2.dll'.'SDL_ResetKeyboard' -++'_SDL_GetDefaultAudioInfo'.'SDL2.dll'.'SDL_GetDefaultAudioInfo' -++'_SDL_GetPointDisplayIndex'.'SDL2.dll'.'SDL_GetPointDisplayIndex' -++'_SDL_GetRectDisplayIndex'.'SDL2.dll'.'SDL_GetRectDisplayIndex' -++'_SDL_ResetHint'.'SDL2.dll'.'SDL_ResetHint' -++'_SDL_crc16'.'SDL2.dll'.'SDL_crc16' -++'_SDL_GetWindowSizeInPixels'.'SDL2.dll'.'SDL_GetWindowSizeInPixels' -++'_SDL_GetJoystickGUIDInfo'.'SDL2.dll'.'SDL_GetJoystickGUIDInfo' -++'_SDL_SetPrimarySelectionText'.'SDL2.dll'.'SDL_SetPrimarySelectionText' -++'_SDL_GetPrimarySelectionText'.'SDL2.dll'.'SDL_GetPrimarySelectionText' -++'_SDL_HasPrimarySelectionText'.'SDL2.dll'.'SDL_HasPrimarySelectionText' -++'_SDL_GameControllerGetSensorDataWithTimestamp'.'SDL2.dll'.'SDL_GameControllerGetSensorDataWithTimestamp' -++'_SDL_SensorGetDataWithTimestamp'.'SDL2.dll'.'SDL_SensorGetDataWithTimestamp' -++'_SDL_ResetHints'.'SDL2.dll'.'SDL_ResetHints' -++'_SDL_strcasestr'.'SDL2.dll'.'SDL_strcasestr' diff --git a/src/dynapi/SDL3.exports b/src/dynapi/SDL3.exports new file mode 100644 index 0000000000..7bc5863a3e --- /dev/null +++ b/src/dynapi/SDL3.exports @@ -0,0 +1,869 @@ +# Windows exports file for Watcom +# DO NOT EDIT THIS FILE BY HAND. It is autogenerated by gendynapi.pl. +++'_SDL_DYNAPI_entry'.'SDL3.dll'.'SDL_DYNAPI_entry' +++'_SDL_SetError'.'SDL3.dll'.'SDL_SetError' +++'_SDL_Log'.'SDL3.dll'.'SDL_Log' +++'_SDL_LogVerbose'.'SDL3.dll'.'SDL_LogVerbose' +++'_SDL_LogDebug'.'SDL3.dll'.'SDL_LogDebug' +++'_SDL_LogInfo'.'SDL3.dll'.'SDL_LogInfo' +++'_SDL_LogWarn'.'SDL3.dll'.'SDL_LogWarn' +++'_SDL_LogError'.'SDL3.dll'.'SDL_LogError' +++'_SDL_LogCritical'.'SDL3.dll'.'SDL_LogCritical' +++'_SDL_LogMessage'.'SDL3.dll'.'SDL_LogMessage' +++'_SDL_sscanf'.'SDL3.dll'.'SDL_sscanf' +++'_SDL_snprintf'.'SDL3.dll'.'SDL_snprintf' +++'_SDL_CreateThread'.'SDL3.dll'.'SDL_CreateThread' +++'_SDL_RWFromFP'.'SDL3.dll'.'SDL_RWFromFP' +++'_SDL_RegisterApp'.'SDL3.dll'.'SDL_RegisterApp' +++'_SDL_UnregisterApp'.'SDL3.dll'.'SDL_UnregisterApp' +++'_SDL_Direct3D9GetAdapterIndex'.'SDL3.dll'.'SDL_Direct3D9GetAdapterIndex' +++'_SDL_RenderGetD3D9Device'.'SDL3.dll'.'SDL_RenderGetD3D9Device' +# ++'_SDL_iPhoneSetAnimationCallback'.'SDL3.dll'.'SDL_iPhoneSetAnimationCallback' +# ++'_SDL_iPhoneSetEventPump'.'SDL3.dll'.'SDL_iPhoneSetEventPump' +# ++'_SDL_AndroidGetJNIEnv'.'SDL3.dll'.'SDL_AndroidGetJNIEnv' +# ++'_SDL_AndroidGetActivity'.'SDL3.dll'.'SDL_AndroidGetActivity' +# ++'_SDL_AndroidGetInternalStoragePath'.'SDL3.dll'.'SDL_AndroidGetInternalStoragePath' +# ++'_SDL_AndroidGetExternalStorageState'.'SDL3.dll'.'SDL_AndroidGetExternalStorageState' +# ++'_SDL_AndroidGetExternalStoragePath'.'SDL3.dll'.'SDL_AndroidGetExternalStoragePath' +++'_SDL_Init'.'SDL3.dll'.'SDL_Init' +++'_SDL_InitSubSystem'.'SDL3.dll'.'SDL_InitSubSystem' +++'_SDL_QuitSubSystem'.'SDL3.dll'.'SDL_QuitSubSystem' +++'_SDL_WasInit'.'SDL3.dll'.'SDL_WasInit' +++'_SDL_Quit'.'SDL3.dll'.'SDL_Quit' +++'_SDL_ReportAssertion'.'SDL3.dll'.'SDL_ReportAssertion' +++'_SDL_SetAssertionHandler'.'SDL3.dll'.'SDL_SetAssertionHandler' +++'_SDL_GetAssertionReport'.'SDL3.dll'.'SDL_GetAssertionReport' +++'_SDL_ResetAssertionReport'.'SDL3.dll'.'SDL_ResetAssertionReport' +++'_SDL_AtomicTryLock'.'SDL3.dll'.'SDL_AtomicTryLock' +++'_SDL_AtomicLock'.'SDL3.dll'.'SDL_AtomicLock' +++'_SDL_AtomicUnlock'.'SDL3.dll'.'SDL_AtomicUnlock' +++'_SDL_AtomicCAS'.'SDL3.dll'.'SDL_AtomicCAS' +++'_SDL_AtomicSet'.'SDL3.dll'.'SDL_AtomicSet' +++'_SDL_AtomicGet'.'SDL3.dll'.'SDL_AtomicGet' +++'_SDL_AtomicAdd'.'SDL3.dll'.'SDL_AtomicAdd' +++'_SDL_AtomicCASPtr'.'SDL3.dll'.'SDL_AtomicCASPtr' +++'_SDL_AtomicSetPtr'.'SDL3.dll'.'SDL_AtomicSetPtr' +++'_SDL_AtomicGetPtr'.'SDL3.dll'.'SDL_AtomicGetPtr' +++'_SDL_GetNumAudioDrivers'.'SDL3.dll'.'SDL_GetNumAudioDrivers' +++'_SDL_GetAudioDriver'.'SDL3.dll'.'SDL_GetAudioDriver' +++'_SDL_AudioInit'.'SDL3.dll'.'SDL_AudioInit' +++'_SDL_AudioQuit'.'SDL3.dll'.'SDL_AudioQuit' +++'_SDL_GetCurrentAudioDriver'.'SDL3.dll'.'SDL_GetCurrentAudioDriver' +++'_SDL_OpenAudio'.'SDL3.dll'.'SDL_OpenAudio' +++'_SDL_GetNumAudioDevices'.'SDL3.dll'.'SDL_GetNumAudioDevices' +++'_SDL_GetAudioDeviceName'.'SDL3.dll'.'SDL_GetAudioDeviceName' +++'_SDL_OpenAudioDevice'.'SDL3.dll'.'SDL_OpenAudioDevice' +++'_SDL_GetAudioStatus'.'SDL3.dll'.'SDL_GetAudioStatus' +++'_SDL_GetAudioDeviceStatus'.'SDL3.dll'.'SDL_GetAudioDeviceStatus' +++'_SDL_PauseAudio'.'SDL3.dll'.'SDL_PauseAudio' +++'_SDL_PauseAudioDevice'.'SDL3.dll'.'SDL_PauseAudioDevice' +++'_SDL_LoadWAV_RW'.'SDL3.dll'.'SDL_LoadWAV_RW' +++'_SDL_FreeWAV'.'SDL3.dll'.'SDL_FreeWAV' +++'_SDL_BuildAudioCVT'.'SDL3.dll'.'SDL_BuildAudioCVT' +++'_SDL_ConvertAudio'.'SDL3.dll'.'SDL_ConvertAudio' +++'_SDL_MixAudio'.'SDL3.dll'.'SDL_MixAudio' +++'_SDL_MixAudioFormat'.'SDL3.dll'.'SDL_MixAudioFormat' +++'_SDL_LockAudio'.'SDL3.dll'.'SDL_LockAudio' +++'_SDL_LockAudioDevice'.'SDL3.dll'.'SDL_LockAudioDevice' +++'_SDL_UnlockAudio'.'SDL3.dll'.'SDL_UnlockAudio' +++'_SDL_UnlockAudioDevice'.'SDL3.dll'.'SDL_UnlockAudioDevice' +++'_SDL_CloseAudio'.'SDL3.dll'.'SDL_CloseAudio' +++'_SDL_CloseAudioDevice'.'SDL3.dll'.'SDL_CloseAudioDevice' +++'_SDL_SetClipboardText'.'SDL3.dll'.'SDL_SetClipboardText' +++'_SDL_GetClipboardText'.'SDL3.dll'.'SDL_GetClipboardText' +++'_SDL_HasClipboardText'.'SDL3.dll'.'SDL_HasClipboardText' +++'_SDL_GetCPUCount'.'SDL3.dll'.'SDL_GetCPUCount' +++'_SDL_GetCPUCacheLineSize'.'SDL3.dll'.'SDL_GetCPUCacheLineSize' +++'_SDL_HasRDTSC'.'SDL3.dll'.'SDL_HasRDTSC' +++'_SDL_HasAltiVec'.'SDL3.dll'.'SDL_HasAltiVec' +++'_SDL_HasMMX'.'SDL3.dll'.'SDL_HasMMX' +++'_SDL_Has3DNow'.'SDL3.dll'.'SDL_Has3DNow' +++'_SDL_HasSSE'.'SDL3.dll'.'SDL_HasSSE' +++'_SDL_HasSSE2'.'SDL3.dll'.'SDL_HasSSE2' +++'_SDL_HasSSE3'.'SDL3.dll'.'SDL_HasSSE3' +++'_SDL_HasSSE41'.'SDL3.dll'.'SDL_HasSSE41' +++'_SDL_HasSSE42'.'SDL3.dll'.'SDL_HasSSE42' +++'_SDL_GetSystemRAM'.'SDL3.dll'.'SDL_GetSystemRAM' +++'_SDL_GetError'.'SDL3.dll'.'SDL_GetError' +++'_SDL_ClearError'.'SDL3.dll'.'SDL_ClearError' +++'_SDL_Error'.'SDL3.dll'.'SDL_Error' +++'_SDL_PumpEvents'.'SDL3.dll'.'SDL_PumpEvents' +++'_SDL_PeepEvents'.'SDL3.dll'.'SDL_PeepEvents' +++'_SDL_HasEvent'.'SDL3.dll'.'SDL_HasEvent' +++'_SDL_HasEvents'.'SDL3.dll'.'SDL_HasEvents' +++'_SDL_FlushEvent'.'SDL3.dll'.'SDL_FlushEvent' +++'_SDL_FlushEvents'.'SDL3.dll'.'SDL_FlushEvents' +++'_SDL_PollEvent'.'SDL3.dll'.'SDL_PollEvent' +++'_SDL_WaitEvent'.'SDL3.dll'.'SDL_WaitEvent' +++'_SDL_WaitEventTimeout'.'SDL3.dll'.'SDL_WaitEventTimeout' +++'_SDL_PushEvent'.'SDL3.dll'.'SDL_PushEvent' +++'_SDL_SetEventFilter'.'SDL3.dll'.'SDL_SetEventFilter' +++'_SDL_GetEventFilter'.'SDL3.dll'.'SDL_GetEventFilter' +++'_SDL_AddEventWatch'.'SDL3.dll'.'SDL_AddEventWatch' +++'_SDL_DelEventWatch'.'SDL3.dll'.'SDL_DelEventWatch' +++'_SDL_FilterEvents'.'SDL3.dll'.'SDL_FilterEvents' +++'_SDL_EventState'.'SDL3.dll'.'SDL_EventState' +++'_SDL_RegisterEvents'.'SDL3.dll'.'SDL_RegisterEvents' +++'_SDL_GetBasePath'.'SDL3.dll'.'SDL_GetBasePath' +++'_SDL_GetPrefPath'.'SDL3.dll'.'SDL_GetPrefPath' +++'_SDL_GameControllerAddMapping'.'SDL3.dll'.'SDL_GameControllerAddMapping' +++'_SDL_GameControllerMappingForGUID'.'SDL3.dll'.'SDL_GameControllerMappingForGUID' +++'_SDL_GameControllerMapping'.'SDL3.dll'.'SDL_GameControllerMapping' +++'_SDL_IsGameController'.'SDL3.dll'.'SDL_IsGameController' +++'_SDL_GameControllerNameForIndex'.'SDL3.dll'.'SDL_GameControllerNameForIndex' +++'_SDL_GameControllerOpen'.'SDL3.dll'.'SDL_GameControllerOpen' +++'_SDL_GameControllerName'.'SDL3.dll'.'SDL_GameControllerName' +++'_SDL_GameControllerGetAttached'.'SDL3.dll'.'SDL_GameControllerGetAttached' +++'_SDL_GameControllerGetJoystick'.'SDL3.dll'.'SDL_GameControllerGetJoystick' +++'_SDL_GameControllerEventState'.'SDL3.dll'.'SDL_GameControllerEventState' +++'_SDL_GameControllerUpdate'.'SDL3.dll'.'SDL_GameControllerUpdate' +++'_SDL_GameControllerGetAxisFromString'.'SDL3.dll'.'SDL_GameControllerGetAxisFromString' +++'_SDL_GameControllerGetStringForAxis'.'SDL3.dll'.'SDL_GameControllerGetStringForAxis' +++'_SDL_GameControllerGetBindForAxis'.'SDL3.dll'.'SDL_GameControllerGetBindForAxis' +++'_SDL_GameControllerGetAxis'.'SDL3.dll'.'SDL_GameControllerGetAxis' +++'_SDL_GameControllerGetButtonFromString'.'SDL3.dll'.'SDL_GameControllerGetButtonFromString' +++'_SDL_GameControllerGetStringForButton'.'SDL3.dll'.'SDL_GameControllerGetStringForButton' +++'_SDL_GameControllerGetBindForButton'.'SDL3.dll'.'SDL_GameControllerGetBindForButton' +++'_SDL_GameControllerGetButton'.'SDL3.dll'.'SDL_GameControllerGetButton' +++'_SDL_GameControllerClose'.'SDL3.dll'.'SDL_GameControllerClose' +++'_SDL_RecordGesture'.'SDL3.dll'.'SDL_RecordGesture' +++'_SDL_SaveAllDollarTemplates'.'SDL3.dll'.'SDL_SaveAllDollarTemplates' +++'_SDL_SaveDollarTemplate'.'SDL3.dll'.'SDL_SaveDollarTemplate' +++'_SDL_LoadDollarTemplates'.'SDL3.dll'.'SDL_LoadDollarTemplates' +++'_SDL_NumHaptics'.'SDL3.dll'.'SDL_NumHaptics' +++'_SDL_HapticName'.'SDL3.dll'.'SDL_HapticName' +++'_SDL_HapticOpen'.'SDL3.dll'.'SDL_HapticOpen' +++'_SDL_HapticOpened'.'SDL3.dll'.'SDL_HapticOpened' +++'_SDL_HapticIndex'.'SDL3.dll'.'SDL_HapticIndex' +++'_SDL_MouseIsHaptic'.'SDL3.dll'.'SDL_MouseIsHaptic' +++'_SDL_HapticOpenFromMouse'.'SDL3.dll'.'SDL_HapticOpenFromMouse' +++'_SDL_JoystickIsHaptic'.'SDL3.dll'.'SDL_JoystickIsHaptic' +++'_SDL_HapticOpenFromJoystick'.'SDL3.dll'.'SDL_HapticOpenFromJoystick' +++'_SDL_HapticClose'.'SDL3.dll'.'SDL_HapticClose' +++'_SDL_HapticNumEffects'.'SDL3.dll'.'SDL_HapticNumEffects' +++'_SDL_HapticNumEffectsPlaying'.'SDL3.dll'.'SDL_HapticNumEffectsPlaying' +++'_SDL_HapticQuery'.'SDL3.dll'.'SDL_HapticQuery' +++'_SDL_HapticNumAxes'.'SDL3.dll'.'SDL_HapticNumAxes' +++'_SDL_HapticEffectSupported'.'SDL3.dll'.'SDL_HapticEffectSupported' +++'_SDL_HapticNewEffect'.'SDL3.dll'.'SDL_HapticNewEffect' +++'_SDL_HapticUpdateEffect'.'SDL3.dll'.'SDL_HapticUpdateEffect' +++'_SDL_HapticRunEffect'.'SDL3.dll'.'SDL_HapticRunEffect' +++'_SDL_HapticStopEffect'.'SDL3.dll'.'SDL_HapticStopEffect' +++'_SDL_HapticDestroyEffect'.'SDL3.dll'.'SDL_HapticDestroyEffect' +++'_SDL_HapticGetEffectStatus'.'SDL3.dll'.'SDL_HapticGetEffectStatus' +++'_SDL_HapticSetGain'.'SDL3.dll'.'SDL_HapticSetGain' +++'_SDL_HapticSetAutocenter'.'SDL3.dll'.'SDL_HapticSetAutocenter' +++'_SDL_HapticPause'.'SDL3.dll'.'SDL_HapticPause' +++'_SDL_HapticUnpause'.'SDL3.dll'.'SDL_HapticUnpause' +++'_SDL_HapticStopAll'.'SDL3.dll'.'SDL_HapticStopAll' +++'_SDL_HapticRumbleSupported'.'SDL3.dll'.'SDL_HapticRumbleSupported' +++'_SDL_HapticRumbleInit'.'SDL3.dll'.'SDL_HapticRumbleInit' +++'_SDL_HapticRumblePlay'.'SDL3.dll'.'SDL_HapticRumblePlay' +++'_SDL_HapticRumbleStop'.'SDL3.dll'.'SDL_HapticRumbleStop' +++'_SDL_SetHintWithPriority'.'SDL3.dll'.'SDL_SetHintWithPriority' +++'_SDL_SetHint'.'SDL3.dll'.'SDL_SetHint' +++'_SDL_GetHint'.'SDL3.dll'.'SDL_GetHint' +++'_SDL_AddHintCallback'.'SDL3.dll'.'SDL_AddHintCallback' +++'_SDL_DelHintCallback'.'SDL3.dll'.'SDL_DelHintCallback' +++'_SDL_ClearHints'.'SDL3.dll'.'SDL_ClearHints' +++'_SDL_NumJoysticks'.'SDL3.dll'.'SDL_NumJoysticks' +++'_SDL_JoystickNameForIndex'.'SDL3.dll'.'SDL_JoystickNameForIndex' +++'_SDL_JoystickOpen'.'SDL3.dll'.'SDL_JoystickOpen' +++'_SDL_JoystickName'.'SDL3.dll'.'SDL_JoystickName' +++'_SDL_JoystickGetDeviceGUID'.'SDL3.dll'.'SDL_JoystickGetDeviceGUID' +++'_SDL_JoystickGetGUID'.'SDL3.dll'.'SDL_JoystickGetGUID' +++'_SDL_JoystickGetGUIDString'.'SDL3.dll'.'SDL_JoystickGetGUIDString' +++'_SDL_JoystickGetGUIDFromString'.'SDL3.dll'.'SDL_JoystickGetGUIDFromString' +++'_SDL_JoystickGetAttached'.'SDL3.dll'.'SDL_JoystickGetAttached' +++'_SDL_JoystickInstanceID'.'SDL3.dll'.'SDL_JoystickInstanceID' +++'_SDL_JoystickNumAxes'.'SDL3.dll'.'SDL_JoystickNumAxes' +++'_SDL_JoystickNumBalls'.'SDL3.dll'.'SDL_JoystickNumBalls' +++'_SDL_JoystickNumHats'.'SDL3.dll'.'SDL_JoystickNumHats' +++'_SDL_JoystickNumButtons'.'SDL3.dll'.'SDL_JoystickNumButtons' +++'_SDL_JoystickUpdate'.'SDL3.dll'.'SDL_JoystickUpdate' +++'_SDL_JoystickEventState'.'SDL3.dll'.'SDL_JoystickEventState' +++'_SDL_JoystickGetAxis'.'SDL3.dll'.'SDL_JoystickGetAxis' +++'_SDL_JoystickGetHat'.'SDL3.dll'.'SDL_JoystickGetHat' +++'_SDL_JoystickGetBall'.'SDL3.dll'.'SDL_JoystickGetBall' +++'_SDL_JoystickGetButton'.'SDL3.dll'.'SDL_JoystickGetButton' +++'_SDL_JoystickClose'.'SDL3.dll'.'SDL_JoystickClose' +++'_SDL_GetKeyboardFocus'.'SDL3.dll'.'SDL_GetKeyboardFocus' +++'_SDL_GetKeyboardState'.'SDL3.dll'.'SDL_GetKeyboardState' +++'_SDL_GetModState'.'SDL3.dll'.'SDL_GetModState' +++'_SDL_SetModState'.'SDL3.dll'.'SDL_SetModState' +++'_SDL_GetKeyFromScancode'.'SDL3.dll'.'SDL_GetKeyFromScancode' +++'_SDL_GetScancodeFromKey'.'SDL3.dll'.'SDL_GetScancodeFromKey' +++'_SDL_GetScancodeName'.'SDL3.dll'.'SDL_GetScancodeName' +++'_SDL_GetScancodeFromName'.'SDL3.dll'.'SDL_GetScancodeFromName' +++'_SDL_GetKeyName'.'SDL3.dll'.'SDL_GetKeyName' +++'_SDL_GetKeyFromName'.'SDL3.dll'.'SDL_GetKeyFromName' +++'_SDL_StartTextInput'.'SDL3.dll'.'SDL_StartTextInput' +++'_SDL_IsTextInputActive'.'SDL3.dll'.'SDL_IsTextInputActive' +++'_SDL_StopTextInput'.'SDL3.dll'.'SDL_StopTextInput' +++'_SDL_SetTextInputRect'.'SDL3.dll'.'SDL_SetTextInputRect' +++'_SDL_HasScreenKeyboardSupport'.'SDL3.dll'.'SDL_HasScreenKeyboardSupport' +++'_SDL_IsScreenKeyboardShown'.'SDL3.dll'.'SDL_IsScreenKeyboardShown' +++'_SDL_LoadObject'.'SDL3.dll'.'SDL_LoadObject' +++'_SDL_LoadFunction'.'SDL3.dll'.'SDL_LoadFunction' +++'_SDL_UnloadObject'.'SDL3.dll'.'SDL_UnloadObject' +++'_SDL_LogSetAllPriority'.'SDL3.dll'.'SDL_LogSetAllPriority' +++'_SDL_LogSetPriority'.'SDL3.dll'.'SDL_LogSetPriority' +++'_SDL_LogGetPriority'.'SDL3.dll'.'SDL_LogGetPriority' +++'_SDL_LogResetPriorities'.'SDL3.dll'.'SDL_LogResetPriorities' +++'_SDL_LogMessageV'.'SDL3.dll'.'SDL_LogMessageV' +++'_SDL_LogGetOutputFunction'.'SDL3.dll'.'SDL_LogGetOutputFunction' +++'_SDL_LogSetOutputFunction'.'SDL3.dll'.'SDL_LogSetOutputFunction' +++'_SDL_SetMainReady'.'SDL3.dll'.'SDL_SetMainReady' +++'_SDL_ShowMessageBox'.'SDL3.dll'.'SDL_ShowMessageBox' +++'_SDL_ShowSimpleMessageBox'.'SDL3.dll'.'SDL_ShowSimpleMessageBox' +++'_SDL_GetMouseFocus'.'SDL3.dll'.'SDL_GetMouseFocus' +++'_SDL_GetMouseState'.'SDL3.dll'.'SDL_GetMouseState' +++'_SDL_GetRelativeMouseState'.'SDL3.dll'.'SDL_GetRelativeMouseState' +++'_SDL_WarpMouseInWindow'.'SDL3.dll'.'SDL_WarpMouseInWindow' +++'_SDL_SetRelativeMouseMode'.'SDL3.dll'.'SDL_SetRelativeMouseMode' +++'_SDL_GetRelativeMouseMode'.'SDL3.dll'.'SDL_GetRelativeMouseMode' +++'_SDL_CreateCursor'.'SDL3.dll'.'SDL_CreateCursor' +++'_SDL_CreateColorCursor'.'SDL3.dll'.'SDL_CreateColorCursor' +++'_SDL_CreateSystemCursor'.'SDL3.dll'.'SDL_CreateSystemCursor' +++'_SDL_SetCursor'.'SDL3.dll'.'SDL_SetCursor' +++'_SDL_GetCursor'.'SDL3.dll'.'SDL_GetCursor' +++'_SDL_GetDefaultCursor'.'SDL3.dll'.'SDL_GetDefaultCursor' +++'_SDL_FreeCursor'.'SDL3.dll'.'SDL_FreeCursor' +++'_SDL_ShowCursor'.'SDL3.dll'.'SDL_ShowCursor' +++'_SDL_CreateMutex'.'SDL3.dll'.'SDL_CreateMutex' +++'_SDL_LockMutex'.'SDL3.dll'.'SDL_LockMutex' +++'_SDL_TryLockMutex'.'SDL3.dll'.'SDL_TryLockMutex' +++'_SDL_UnlockMutex'.'SDL3.dll'.'SDL_UnlockMutex' +++'_SDL_DestroyMutex'.'SDL3.dll'.'SDL_DestroyMutex' +++'_SDL_CreateSemaphore'.'SDL3.dll'.'SDL_CreateSemaphore' +++'_SDL_DestroySemaphore'.'SDL3.dll'.'SDL_DestroySemaphore' +++'_SDL_SemWait'.'SDL3.dll'.'SDL_SemWait' +++'_SDL_SemTryWait'.'SDL3.dll'.'SDL_SemTryWait' +++'_SDL_SemWaitTimeout'.'SDL3.dll'.'SDL_SemWaitTimeout' +++'_SDL_SemPost'.'SDL3.dll'.'SDL_SemPost' +++'_SDL_SemValue'.'SDL3.dll'.'SDL_SemValue' +++'_SDL_CreateCond'.'SDL3.dll'.'SDL_CreateCond' +++'_SDL_DestroyCond'.'SDL3.dll'.'SDL_DestroyCond' +++'_SDL_CondSignal'.'SDL3.dll'.'SDL_CondSignal' +++'_SDL_CondBroadcast'.'SDL3.dll'.'SDL_CondBroadcast' +++'_SDL_CondWait'.'SDL3.dll'.'SDL_CondWait' +++'_SDL_CondWaitTimeout'.'SDL3.dll'.'SDL_CondWaitTimeout' +++'_SDL_GetPixelFormatName'.'SDL3.dll'.'SDL_GetPixelFormatName' +++'_SDL_PixelFormatEnumToMasks'.'SDL3.dll'.'SDL_PixelFormatEnumToMasks' +++'_SDL_MasksToPixelFormatEnum'.'SDL3.dll'.'SDL_MasksToPixelFormatEnum' +++'_SDL_AllocFormat'.'SDL3.dll'.'SDL_AllocFormat' +++'_SDL_FreeFormat'.'SDL3.dll'.'SDL_FreeFormat' +++'_SDL_AllocPalette'.'SDL3.dll'.'SDL_AllocPalette' +++'_SDL_SetPixelFormatPalette'.'SDL3.dll'.'SDL_SetPixelFormatPalette' +++'_SDL_SetPaletteColors'.'SDL3.dll'.'SDL_SetPaletteColors' +++'_SDL_FreePalette'.'SDL3.dll'.'SDL_FreePalette' +++'_SDL_MapRGB'.'SDL3.dll'.'SDL_MapRGB' +++'_SDL_MapRGBA'.'SDL3.dll'.'SDL_MapRGBA' +++'_SDL_GetRGB'.'SDL3.dll'.'SDL_GetRGB' +++'_SDL_GetRGBA'.'SDL3.dll'.'SDL_GetRGBA' +++'_SDL_CalculateGammaRamp'.'SDL3.dll'.'SDL_CalculateGammaRamp' +++'_SDL_GetPlatform'.'SDL3.dll'.'SDL_GetPlatform' +++'_SDL_GetPowerInfo'.'SDL3.dll'.'SDL_GetPowerInfo' +++'_SDL_HasIntersection'.'SDL3.dll'.'SDL_HasIntersection' +++'_SDL_IntersectRect'.'SDL3.dll'.'SDL_IntersectRect' +++'_SDL_UnionRect'.'SDL3.dll'.'SDL_UnionRect' +++'_SDL_EnclosePoints'.'SDL3.dll'.'SDL_EnclosePoints' +++'_SDL_IntersectRectAndLine'.'SDL3.dll'.'SDL_IntersectRectAndLine' +++'_SDL_GetNumRenderDrivers'.'SDL3.dll'.'SDL_GetNumRenderDrivers' +++'_SDL_GetRenderDriverInfo'.'SDL3.dll'.'SDL_GetRenderDriverInfo' +++'_SDL_CreateWindowAndRenderer'.'SDL3.dll'.'SDL_CreateWindowAndRenderer' +++'_SDL_CreateRenderer'.'SDL3.dll'.'SDL_CreateRenderer' +++'_SDL_CreateSoftwareRenderer'.'SDL3.dll'.'SDL_CreateSoftwareRenderer' +++'_SDL_GetRenderer'.'SDL3.dll'.'SDL_GetRenderer' +++'_SDL_GetRendererInfo'.'SDL3.dll'.'SDL_GetRendererInfo' +++'_SDL_GetRendererOutputSize'.'SDL3.dll'.'SDL_GetRendererOutputSize' +++'_SDL_CreateTexture'.'SDL3.dll'.'SDL_CreateTexture' +++'_SDL_CreateTextureFromSurface'.'SDL3.dll'.'SDL_CreateTextureFromSurface' +++'_SDL_QueryTexture'.'SDL3.dll'.'SDL_QueryTexture' +++'_SDL_SetTextureColorMod'.'SDL3.dll'.'SDL_SetTextureColorMod' +++'_SDL_GetTextureColorMod'.'SDL3.dll'.'SDL_GetTextureColorMod' +++'_SDL_SetTextureAlphaMod'.'SDL3.dll'.'SDL_SetTextureAlphaMod' +++'_SDL_GetTextureAlphaMod'.'SDL3.dll'.'SDL_GetTextureAlphaMod' +++'_SDL_SetTextureBlendMode'.'SDL3.dll'.'SDL_SetTextureBlendMode' +++'_SDL_GetTextureBlendMode'.'SDL3.dll'.'SDL_GetTextureBlendMode' +++'_SDL_UpdateTexture'.'SDL3.dll'.'SDL_UpdateTexture' +++'_SDL_UpdateYUVTexture'.'SDL3.dll'.'SDL_UpdateYUVTexture' +++'_SDL_LockTexture'.'SDL3.dll'.'SDL_LockTexture' +++'_SDL_UnlockTexture'.'SDL3.dll'.'SDL_UnlockTexture' +++'_SDL_RenderTargetSupported'.'SDL3.dll'.'SDL_RenderTargetSupported' +++'_SDL_SetRenderTarget'.'SDL3.dll'.'SDL_SetRenderTarget' +++'_SDL_GetRenderTarget'.'SDL3.dll'.'SDL_GetRenderTarget' +++'_SDL_RenderSetLogicalSize'.'SDL3.dll'.'SDL_RenderSetLogicalSize' +++'_SDL_RenderGetLogicalSize'.'SDL3.dll'.'SDL_RenderGetLogicalSize' +++'_SDL_RenderSetViewport'.'SDL3.dll'.'SDL_RenderSetViewport' +++'_SDL_RenderGetViewport'.'SDL3.dll'.'SDL_RenderGetViewport' +++'_SDL_RenderSetClipRect'.'SDL3.dll'.'SDL_RenderSetClipRect' +++'_SDL_RenderGetClipRect'.'SDL3.dll'.'SDL_RenderGetClipRect' +++'_SDL_RenderSetScale'.'SDL3.dll'.'SDL_RenderSetScale' +++'_SDL_RenderGetScale'.'SDL3.dll'.'SDL_RenderGetScale' +++'_SDL_SetRenderDrawColor'.'SDL3.dll'.'SDL_SetRenderDrawColor' +++'_SDL_GetRenderDrawColor'.'SDL3.dll'.'SDL_GetRenderDrawColor' +++'_SDL_SetRenderDrawBlendMode'.'SDL3.dll'.'SDL_SetRenderDrawBlendMode' +++'_SDL_GetRenderDrawBlendMode'.'SDL3.dll'.'SDL_GetRenderDrawBlendMode' +++'_SDL_RenderClear'.'SDL3.dll'.'SDL_RenderClear' +++'_SDL_RenderDrawPoint'.'SDL3.dll'.'SDL_RenderDrawPoint' +++'_SDL_RenderDrawPoints'.'SDL3.dll'.'SDL_RenderDrawPoints' +++'_SDL_RenderDrawLine'.'SDL3.dll'.'SDL_RenderDrawLine' +++'_SDL_RenderDrawLines'.'SDL3.dll'.'SDL_RenderDrawLines' +++'_SDL_RenderDrawRect'.'SDL3.dll'.'SDL_RenderDrawRect' +++'_SDL_RenderDrawRects'.'SDL3.dll'.'SDL_RenderDrawRects' +++'_SDL_RenderFillRect'.'SDL3.dll'.'SDL_RenderFillRect' +++'_SDL_RenderFillRects'.'SDL3.dll'.'SDL_RenderFillRects' +++'_SDL_RenderCopy'.'SDL3.dll'.'SDL_RenderCopy' +++'_SDL_RenderCopyEx'.'SDL3.dll'.'SDL_RenderCopyEx' +++'_SDL_RenderReadPixels'.'SDL3.dll'.'SDL_RenderReadPixels' +++'_SDL_RenderPresent'.'SDL3.dll'.'SDL_RenderPresent' +++'_SDL_DestroyTexture'.'SDL3.dll'.'SDL_DestroyTexture' +++'_SDL_DestroyRenderer'.'SDL3.dll'.'SDL_DestroyRenderer' +++'_SDL_GL_BindTexture'.'SDL3.dll'.'SDL_GL_BindTexture' +++'_SDL_GL_UnbindTexture'.'SDL3.dll'.'SDL_GL_UnbindTexture' +++'_SDL_RWFromFile'.'SDL3.dll'.'SDL_RWFromFile' +++'_SDL_RWFromMem'.'SDL3.dll'.'SDL_RWFromMem' +++'_SDL_RWFromConstMem'.'SDL3.dll'.'SDL_RWFromConstMem' +++'_SDL_AllocRW'.'SDL3.dll'.'SDL_AllocRW' +++'_SDL_FreeRW'.'SDL3.dll'.'SDL_FreeRW' +++'_SDL_ReadU8'.'SDL3.dll'.'SDL_ReadU8' +++'_SDL_ReadLE16'.'SDL3.dll'.'SDL_ReadLE16' +++'_SDL_ReadBE16'.'SDL3.dll'.'SDL_ReadBE16' +++'_SDL_ReadLE32'.'SDL3.dll'.'SDL_ReadLE32' +++'_SDL_ReadBE32'.'SDL3.dll'.'SDL_ReadBE32' +++'_SDL_ReadLE64'.'SDL3.dll'.'SDL_ReadLE64' +++'_SDL_ReadBE64'.'SDL3.dll'.'SDL_ReadBE64' +++'_SDL_WriteU8'.'SDL3.dll'.'SDL_WriteU8' +++'_SDL_WriteLE16'.'SDL3.dll'.'SDL_WriteLE16' +++'_SDL_WriteBE16'.'SDL3.dll'.'SDL_WriteBE16' +++'_SDL_WriteLE32'.'SDL3.dll'.'SDL_WriteLE32' +++'_SDL_WriteBE32'.'SDL3.dll'.'SDL_WriteBE32' +++'_SDL_WriteLE64'.'SDL3.dll'.'SDL_WriteLE64' +++'_SDL_WriteBE64'.'SDL3.dll'.'SDL_WriteBE64' +++'_SDL_CreateShapedWindow'.'SDL3.dll'.'SDL_CreateShapedWindow' +++'_SDL_IsShapedWindow'.'SDL3.dll'.'SDL_IsShapedWindow' +++'_SDL_SetWindowShape'.'SDL3.dll'.'SDL_SetWindowShape' +++'_SDL_GetShapedWindowMode'.'SDL3.dll'.'SDL_GetShapedWindowMode' +++'_SDL_malloc'.'SDL3.dll'.'SDL_malloc' +++'_SDL_calloc'.'SDL3.dll'.'SDL_calloc' +++'_SDL_realloc'.'SDL3.dll'.'SDL_realloc' +++'_SDL_free'.'SDL3.dll'.'SDL_free' +++'_SDL_getenv'.'SDL3.dll'.'SDL_getenv' +++'_SDL_setenv'.'SDL3.dll'.'SDL_setenv' +++'_SDL_qsort'.'SDL3.dll'.'SDL_qsort' +++'_SDL_abs'.'SDL3.dll'.'SDL_abs' +++'_SDL_isdigit'.'SDL3.dll'.'SDL_isdigit' +++'_SDL_isspace'.'SDL3.dll'.'SDL_isspace' +++'_SDL_toupper'.'SDL3.dll'.'SDL_toupper' +++'_SDL_tolower'.'SDL3.dll'.'SDL_tolower' +++'_SDL_memset'.'SDL3.dll'.'SDL_memset' +++'_SDL_memcpy'.'SDL3.dll'.'SDL_memcpy' +++'_SDL_memmove'.'SDL3.dll'.'SDL_memmove' +++'_SDL_memcmp'.'SDL3.dll'.'SDL_memcmp' +++'_SDL_wcslen'.'SDL3.dll'.'SDL_wcslen' +++'_SDL_wcslcpy'.'SDL3.dll'.'SDL_wcslcpy' +++'_SDL_wcslcat'.'SDL3.dll'.'SDL_wcslcat' +++'_SDL_strlen'.'SDL3.dll'.'SDL_strlen' +++'_SDL_strlcpy'.'SDL3.dll'.'SDL_strlcpy' +++'_SDL_utf8strlcpy'.'SDL3.dll'.'SDL_utf8strlcpy' +++'_SDL_strlcat'.'SDL3.dll'.'SDL_strlcat' +++'_SDL_strdup'.'SDL3.dll'.'SDL_strdup' +++'_SDL_strrev'.'SDL3.dll'.'SDL_strrev' +++'_SDL_strupr'.'SDL3.dll'.'SDL_strupr' +++'_SDL_strlwr'.'SDL3.dll'.'SDL_strlwr' +++'_SDL_strchr'.'SDL3.dll'.'SDL_strchr' +++'_SDL_strrchr'.'SDL3.dll'.'SDL_strrchr' +++'_SDL_strstr'.'SDL3.dll'.'SDL_strstr' +++'_SDL_itoa'.'SDL3.dll'.'SDL_itoa' +++'_SDL_uitoa'.'SDL3.dll'.'SDL_uitoa' +++'_SDL_ltoa'.'SDL3.dll'.'SDL_ltoa' +++'_SDL_ultoa'.'SDL3.dll'.'SDL_ultoa' +++'_SDL_lltoa'.'SDL3.dll'.'SDL_lltoa' +++'_SDL_ulltoa'.'SDL3.dll'.'SDL_ulltoa' +++'_SDL_atoi'.'SDL3.dll'.'SDL_atoi' +++'_SDL_atof'.'SDL3.dll'.'SDL_atof' +++'_SDL_strtol'.'SDL3.dll'.'SDL_strtol' +++'_SDL_strtoul'.'SDL3.dll'.'SDL_strtoul' +++'_SDL_strtoll'.'SDL3.dll'.'SDL_strtoll' +++'_SDL_strtoull'.'SDL3.dll'.'SDL_strtoull' +++'_SDL_strtod'.'SDL3.dll'.'SDL_strtod' +++'_SDL_strcmp'.'SDL3.dll'.'SDL_strcmp' +++'_SDL_strncmp'.'SDL3.dll'.'SDL_strncmp' +++'_SDL_strcasecmp'.'SDL3.dll'.'SDL_strcasecmp' +++'_SDL_strncasecmp'.'SDL3.dll'.'SDL_strncasecmp' +++'_SDL_vsnprintf'.'SDL3.dll'.'SDL_vsnprintf' +++'_SDL_acos'.'SDL3.dll'.'SDL_acos' +++'_SDL_asin'.'SDL3.dll'.'SDL_asin' +++'_SDL_atan'.'SDL3.dll'.'SDL_atan' +++'_SDL_atan2'.'SDL3.dll'.'SDL_atan2' +++'_SDL_ceil'.'SDL3.dll'.'SDL_ceil' +++'_SDL_copysign'.'SDL3.dll'.'SDL_copysign' +++'_SDL_cos'.'SDL3.dll'.'SDL_cos' +++'_SDL_cosf'.'SDL3.dll'.'SDL_cosf' +++'_SDL_fabs'.'SDL3.dll'.'SDL_fabs' +++'_SDL_floor'.'SDL3.dll'.'SDL_floor' +++'_SDL_log'.'SDL3.dll'.'SDL_log' +++'_SDL_pow'.'SDL3.dll'.'SDL_pow' +++'_SDL_scalbn'.'SDL3.dll'.'SDL_scalbn' +++'_SDL_sin'.'SDL3.dll'.'SDL_sin' +++'_SDL_sinf'.'SDL3.dll'.'SDL_sinf' +++'_SDL_sqrt'.'SDL3.dll'.'SDL_sqrt' +++'_SDL_iconv_open'.'SDL3.dll'.'SDL_iconv_open' +++'_SDL_iconv_close'.'SDL3.dll'.'SDL_iconv_close' +++'_SDL_iconv'.'SDL3.dll'.'SDL_iconv' +++'_SDL_iconv_string'.'SDL3.dll'.'SDL_iconv_string' +++'_SDL_CreateRGBSurface'.'SDL3.dll'.'SDL_CreateRGBSurface' +++'_SDL_CreateRGBSurfaceFrom'.'SDL3.dll'.'SDL_CreateRGBSurfaceFrom' +++'_SDL_FreeSurface'.'SDL3.dll'.'SDL_FreeSurface' +++'_SDL_SetSurfacePalette'.'SDL3.dll'.'SDL_SetSurfacePalette' +++'_SDL_LockSurface'.'SDL3.dll'.'SDL_LockSurface' +++'_SDL_UnlockSurface'.'SDL3.dll'.'SDL_UnlockSurface' +++'_SDL_LoadBMP_RW'.'SDL3.dll'.'SDL_LoadBMP_RW' +++'_SDL_SaveBMP_RW'.'SDL3.dll'.'SDL_SaveBMP_RW' +++'_SDL_SetSurfaceRLE'.'SDL3.dll'.'SDL_SetSurfaceRLE' +++'_SDL_SetColorKey'.'SDL3.dll'.'SDL_SetColorKey' +++'_SDL_GetColorKey'.'SDL3.dll'.'SDL_GetColorKey' +++'_SDL_SetSurfaceColorMod'.'SDL3.dll'.'SDL_SetSurfaceColorMod' +++'_SDL_GetSurfaceColorMod'.'SDL3.dll'.'SDL_GetSurfaceColorMod' +++'_SDL_SetSurfaceAlphaMod'.'SDL3.dll'.'SDL_SetSurfaceAlphaMod' +++'_SDL_GetSurfaceAlphaMod'.'SDL3.dll'.'SDL_GetSurfaceAlphaMod' +++'_SDL_SetSurfaceBlendMode'.'SDL3.dll'.'SDL_SetSurfaceBlendMode' +++'_SDL_GetSurfaceBlendMode'.'SDL3.dll'.'SDL_GetSurfaceBlendMode' +++'_SDL_SetClipRect'.'SDL3.dll'.'SDL_SetClipRect' +++'_SDL_GetClipRect'.'SDL3.dll'.'SDL_GetClipRect' +++'_SDL_ConvertSurface'.'SDL3.dll'.'SDL_ConvertSurface' +++'_SDL_ConvertSurfaceFormat'.'SDL3.dll'.'SDL_ConvertSurfaceFormat' +++'_SDL_ConvertPixels'.'SDL3.dll'.'SDL_ConvertPixels' +++'_SDL_FillRect'.'SDL3.dll'.'SDL_FillRect' +++'_SDL_FillRects'.'SDL3.dll'.'SDL_FillRects' +++'_SDL_UpperBlit'.'SDL3.dll'.'SDL_UpperBlit' +++'_SDL_LowerBlit'.'SDL3.dll'.'SDL_LowerBlit' +++'_SDL_SoftStretch'.'SDL3.dll'.'SDL_SoftStretch' +++'_SDL_UpperBlitScaled'.'SDL3.dll'.'SDL_UpperBlitScaled' +++'_SDL_LowerBlitScaled'.'SDL3.dll'.'SDL_LowerBlitScaled' +++'_SDL_GetWindowWMInfo'.'SDL3.dll'.'SDL_GetWindowWMInfo' +++'_SDL_GetThreadName'.'SDL3.dll'.'SDL_GetThreadName' +++'_SDL_ThreadID'.'SDL3.dll'.'SDL_ThreadID' +++'_SDL_GetThreadID'.'SDL3.dll'.'SDL_GetThreadID' +++'_SDL_SetThreadPriority'.'SDL3.dll'.'SDL_SetThreadPriority' +++'_SDL_WaitThread'.'SDL3.dll'.'SDL_WaitThread' +++'_SDL_DetachThread'.'SDL3.dll'.'SDL_DetachThread' +++'_SDL_TLSCreate'.'SDL3.dll'.'SDL_TLSCreate' +++'_SDL_TLSGet'.'SDL3.dll'.'SDL_TLSGet' +++'_SDL_TLSSet'.'SDL3.dll'.'SDL_TLSSet' +++'_SDL_GetTicks'.'SDL3.dll'.'SDL_GetTicks' +++'_SDL_GetPerformanceCounter'.'SDL3.dll'.'SDL_GetPerformanceCounter' +++'_SDL_GetPerformanceFrequency'.'SDL3.dll'.'SDL_GetPerformanceFrequency' +++'_SDL_Delay'.'SDL3.dll'.'SDL_Delay' +++'_SDL_AddTimer'.'SDL3.dll'.'SDL_AddTimer' +++'_SDL_RemoveTimer'.'SDL3.dll'.'SDL_RemoveTimer' +++'_SDL_GetNumTouchDevices'.'SDL3.dll'.'SDL_GetNumTouchDevices' +++'_SDL_GetTouchDevice'.'SDL3.dll'.'SDL_GetTouchDevice' +++'_SDL_GetNumTouchFingers'.'SDL3.dll'.'SDL_GetNumTouchFingers' +++'_SDL_GetTouchFinger'.'SDL3.dll'.'SDL_GetTouchFinger' +++'_SDL_GetVersion'.'SDL3.dll'.'SDL_GetVersion' +++'_SDL_GetRevision'.'SDL3.dll'.'SDL_GetRevision' +++'_SDL_GetRevisionNumber'.'SDL3.dll'.'SDL_GetRevisionNumber' +++'_SDL_GetNumVideoDrivers'.'SDL3.dll'.'SDL_GetNumVideoDrivers' +++'_SDL_GetVideoDriver'.'SDL3.dll'.'SDL_GetVideoDriver' +++'_SDL_VideoInit'.'SDL3.dll'.'SDL_VideoInit' +++'_SDL_VideoQuit'.'SDL3.dll'.'SDL_VideoQuit' +++'_SDL_GetCurrentVideoDriver'.'SDL3.dll'.'SDL_GetCurrentVideoDriver' +++'_SDL_GetNumVideoDisplays'.'SDL3.dll'.'SDL_GetNumVideoDisplays' +++'_SDL_GetDisplayName'.'SDL3.dll'.'SDL_GetDisplayName' +++'_SDL_GetDisplayBounds'.'SDL3.dll'.'SDL_GetDisplayBounds' +++'_SDL_GetDisplayDPI'.'SDL3.dll'.'SDL_GetDisplayDPI' +++'_SDL_GetNumDisplayModes'.'SDL3.dll'.'SDL_GetNumDisplayModes' +++'_SDL_GetDisplayMode'.'SDL3.dll'.'SDL_GetDisplayMode' +++'_SDL_GetDesktopDisplayMode'.'SDL3.dll'.'SDL_GetDesktopDisplayMode' +++'_SDL_GetCurrentDisplayMode'.'SDL3.dll'.'SDL_GetCurrentDisplayMode' +++'_SDL_GetClosestDisplayMode'.'SDL3.dll'.'SDL_GetClosestDisplayMode' +++'_SDL_GetWindowDisplayIndex'.'SDL3.dll'.'SDL_GetWindowDisplayIndex' +++'_SDL_SetWindowDisplayMode'.'SDL3.dll'.'SDL_SetWindowDisplayMode' +++'_SDL_GetWindowDisplayMode'.'SDL3.dll'.'SDL_GetWindowDisplayMode' +++'_SDL_GetWindowPixelFormat'.'SDL3.dll'.'SDL_GetWindowPixelFormat' +++'_SDL_CreateWindow'.'SDL3.dll'.'SDL_CreateWindow' +++'_SDL_CreateWindowFrom'.'SDL3.dll'.'SDL_CreateWindowFrom' +++'_SDL_GetWindowID'.'SDL3.dll'.'SDL_GetWindowID' +++'_SDL_GetWindowFromID'.'SDL3.dll'.'SDL_GetWindowFromID' +++'_SDL_GetWindowFlags'.'SDL3.dll'.'SDL_GetWindowFlags' +++'_SDL_SetWindowTitle'.'SDL3.dll'.'SDL_SetWindowTitle' +++'_SDL_GetWindowTitle'.'SDL3.dll'.'SDL_GetWindowTitle' +++'_SDL_SetWindowIcon'.'SDL3.dll'.'SDL_SetWindowIcon' +++'_SDL_SetWindowData'.'SDL3.dll'.'SDL_SetWindowData' +++'_SDL_GetWindowData'.'SDL3.dll'.'SDL_GetWindowData' +++'_SDL_SetWindowPosition'.'SDL3.dll'.'SDL_SetWindowPosition' +++'_SDL_GetWindowPosition'.'SDL3.dll'.'SDL_GetWindowPosition' +++'_SDL_SetWindowSize'.'SDL3.dll'.'SDL_SetWindowSize' +++'_SDL_GetWindowSize'.'SDL3.dll'.'SDL_GetWindowSize' +++'_SDL_SetWindowMinimumSize'.'SDL3.dll'.'SDL_SetWindowMinimumSize' +++'_SDL_GetWindowMinimumSize'.'SDL3.dll'.'SDL_GetWindowMinimumSize' +++'_SDL_SetWindowMaximumSize'.'SDL3.dll'.'SDL_SetWindowMaximumSize' +++'_SDL_GetWindowMaximumSize'.'SDL3.dll'.'SDL_GetWindowMaximumSize' +++'_SDL_SetWindowBordered'.'SDL3.dll'.'SDL_SetWindowBordered' +++'_SDL_ShowWindow'.'SDL3.dll'.'SDL_ShowWindow' +++'_SDL_HideWindow'.'SDL3.dll'.'SDL_HideWindow' +++'_SDL_RaiseWindow'.'SDL3.dll'.'SDL_RaiseWindow' +++'_SDL_MaximizeWindow'.'SDL3.dll'.'SDL_MaximizeWindow' +++'_SDL_MinimizeWindow'.'SDL3.dll'.'SDL_MinimizeWindow' +++'_SDL_RestoreWindow'.'SDL3.dll'.'SDL_RestoreWindow' +++'_SDL_SetWindowFullscreen'.'SDL3.dll'.'SDL_SetWindowFullscreen' +++'_SDL_GetWindowSurface'.'SDL3.dll'.'SDL_GetWindowSurface' +++'_SDL_UpdateWindowSurface'.'SDL3.dll'.'SDL_UpdateWindowSurface' +++'_SDL_UpdateWindowSurfaceRects'.'SDL3.dll'.'SDL_UpdateWindowSurfaceRects' +++'_SDL_SetWindowGrab'.'SDL3.dll'.'SDL_SetWindowGrab' +++'_SDL_GetWindowGrab'.'SDL3.dll'.'SDL_GetWindowGrab' +++'_SDL_SetWindowBrightness'.'SDL3.dll'.'SDL_SetWindowBrightness' +++'_SDL_GetWindowBrightness'.'SDL3.dll'.'SDL_GetWindowBrightness' +++'_SDL_SetWindowGammaRamp'.'SDL3.dll'.'SDL_SetWindowGammaRamp' +++'_SDL_GetWindowGammaRamp'.'SDL3.dll'.'SDL_GetWindowGammaRamp' +++'_SDL_DestroyWindow'.'SDL3.dll'.'SDL_DestroyWindow' +++'_SDL_IsScreenSaverEnabled'.'SDL3.dll'.'SDL_IsScreenSaverEnabled' +++'_SDL_EnableScreenSaver'.'SDL3.dll'.'SDL_EnableScreenSaver' +++'_SDL_DisableScreenSaver'.'SDL3.dll'.'SDL_DisableScreenSaver' +++'_SDL_GL_LoadLibrary'.'SDL3.dll'.'SDL_GL_LoadLibrary' +++'_SDL_GL_GetProcAddress'.'SDL3.dll'.'SDL_GL_GetProcAddress' +++'_SDL_GL_UnloadLibrary'.'SDL3.dll'.'SDL_GL_UnloadLibrary' +++'_SDL_GL_ExtensionSupported'.'SDL3.dll'.'SDL_GL_ExtensionSupported' +++'_SDL_GL_SetAttribute'.'SDL3.dll'.'SDL_GL_SetAttribute' +++'_SDL_GL_GetAttribute'.'SDL3.dll'.'SDL_GL_GetAttribute' +++'_SDL_GL_CreateContext'.'SDL3.dll'.'SDL_GL_CreateContext' +++'_SDL_GL_MakeCurrent'.'SDL3.dll'.'SDL_GL_MakeCurrent' +++'_SDL_GL_GetCurrentWindow'.'SDL3.dll'.'SDL_GL_GetCurrentWindow' +++'_SDL_GL_GetCurrentContext'.'SDL3.dll'.'SDL_GL_GetCurrentContext' +++'_SDL_GL_GetDrawableSize'.'SDL3.dll'.'SDL_GL_GetDrawableSize' +++'_SDL_GL_SetSwapInterval'.'SDL3.dll'.'SDL_GL_SetSwapInterval' +++'_SDL_GL_GetSwapInterval'.'SDL3.dll'.'SDL_GL_GetSwapInterval' +++'_SDL_GL_SwapWindow'.'SDL3.dll'.'SDL_GL_SwapWindow' +++'_SDL_GL_DeleteContext'.'SDL3.dll'.'SDL_GL_DeleteContext' +++'_SDL_vsscanf'.'SDL3.dll'.'SDL_vsscanf' +++'_SDL_GameControllerAddMappingsFromRW'.'SDL3.dll'.'SDL_GameControllerAddMappingsFromRW' +++'_SDL_GL_ResetAttributes'.'SDL3.dll'.'SDL_GL_ResetAttributes' +++'_SDL_HasAVX'.'SDL3.dll'.'SDL_HasAVX' +++'_SDL_GetDefaultAssertionHandler'.'SDL3.dll'.'SDL_GetDefaultAssertionHandler' +++'_SDL_GetAssertionHandler'.'SDL3.dll'.'SDL_GetAssertionHandler' +++'_SDL_DXGIGetOutputInfo'.'SDL3.dll'.'SDL_DXGIGetOutputInfo' +++'_SDL_RenderIsClipEnabled'.'SDL3.dll'.'SDL_RenderIsClipEnabled' +# ++'_SDL_WinRTRunApp'.'SDL3.dll'.'SDL_WinRTRunApp' +++'_SDL_WarpMouseGlobal'.'SDL3.dll'.'SDL_WarpMouseGlobal' +# ++'_SDL_WinRTGetFSPathUNICODE'.'SDL3.dll'.'SDL_WinRTGetFSPathUNICODE' +# ++'_SDL_WinRTGetFSPathUTF8'.'SDL3.dll'.'SDL_WinRTGetFSPathUTF8' +++'_SDL_sqrtf'.'SDL3.dll'.'SDL_sqrtf' +++'_SDL_tan'.'SDL3.dll'.'SDL_tan' +++'_SDL_tanf'.'SDL3.dll'.'SDL_tanf' +++'_SDL_CaptureMouse'.'SDL3.dll'.'SDL_CaptureMouse' +++'_SDL_SetWindowHitTest'.'SDL3.dll'.'SDL_SetWindowHitTest' +++'_SDL_GetGlobalMouseState'.'SDL3.dll'.'SDL_GetGlobalMouseState' +++'_SDL_HasAVX2'.'SDL3.dll'.'SDL_HasAVX2' +++'_SDL_QueueAudio'.'SDL3.dll'.'SDL_QueueAudio' +++'_SDL_GetQueuedAudioSize'.'SDL3.dll'.'SDL_GetQueuedAudioSize' +++'_SDL_ClearQueuedAudio'.'SDL3.dll'.'SDL_ClearQueuedAudio' +++'_SDL_GetGrabbedWindow'.'SDL3.dll'.'SDL_GetGrabbedWindow' +++'_SDL_SetWindowsMessageHook'.'SDL3.dll'.'SDL_SetWindowsMessageHook' +++'_SDL_JoystickCurrentPowerLevel'.'SDL3.dll'.'SDL_JoystickCurrentPowerLevel' +++'_SDL_GameControllerFromInstanceID'.'SDL3.dll'.'SDL_GameControllerFromInstanceID' +++'_SDL_JoystickFromInstanceID'.'SDL3.dll'.'SDL_JoystickFromInstanceID' +++'_SDL_GetDisplayUsableBounds'.'SDL3.dll'.'SDL_GetDisplayUsableBounds' +++'_SDL_GetWindowBordersSize'.'SDL3.dll'.'SDL_GetWindowBordersSize' +++'_SDL_SetWindowOpacity'.'SDL3.dll'.'SDL_SetWindowOpacity' +++'_SDL_GetWindowOpacity'.'SDL3.dll'.'SDL_GetWindowOpacity' +++'_SDL_SetWindowInputFocus'.'SDL3.dll'.'SDL_SetWindowInputFocus' +++'_SDL_SetWindowModalFor'.'SDL3.dll'.'SDL_SetWindowModalFor' +++'_SDL_RenderSetIntegerScale'.'SDL3.dll'.'SDL_RenderSetIntegerScale' +++'_SDL_RenderGetIntegerScale'.'SDL3.dll'.'SDL_RenderGetIntegerScale' +++'_SDL_DequeueAudio'.'SDL3.dll'.'SDL_DequeueAudio' +++'_SDL_SetWindowResizable'.'SDL3.dll'.'SDL_SetWindowResizable' +++'_SDL_CreateRGBSurfaceWithFormat'.'SDL3.dll'.'SDL_CreateRGBSurfaceWithFormat' +++'_SDL_CreateRGBSurfaceWithFormatFrom'.'SDL3.dll'.'SDL_CreateRGBSurfaceWithFormatFrom' +++'_SDL_GetHintBoolean'.'SDL3.dll'.'SDL_GetHintBoolean' +++'_SDL_JoystickGetDeviceVendor'.'SDL3.dll'.'SDL_JoystickGetDeviceVendor' +++'_SDL_JoystickGetDeviceProduct'.'SDL3.dll'.'SDL_JoystickGetDeviceProduct' +++'_SDL_JoystickGetDeviceProductVersion'.'SDL3.dll'.'SDL_JoystickGetDeviceProductVersion' +++'_SDL_JoystickGetVendor'.'SDL3.dll'.'SDL_JoystickGetVendor' +++'_SDL_JoystickGetProduct'.'SDL3.dll'.'SDL_JoystickGetProduct' +++'_SDL_JoystickGetProductVersion'.'SDL3.dll'.'SDL_JoystickGetProductVersion' +++'_SDL_GameControllerGetVendor'.'SDL3.dll'.'SDL_GameControllerGetVendor' +++'_SDL_GameControllerGetProduct'.'SDL3.dll'.'SDL_GameControllerGetProduct' +++'_SDL_GameControllerGetProductVersion'.'SDL3.dll'.'SDL_GameControllerGetProductVersion' +++'_SDL_HasNEON'.'SDL3.dll'.'SDL_HasNEON' +++'_SDL_GameControllerNumMappings'.'SDL3.dll'.'SDL_GameControllerNumMappings' +++'_SDL_GameControllerMappingForIndex'.'SDL3.dll'.'SDL_GameControllerMappingForIndex' +++'_SDL_JoystickGetAxisInitialState'.'SDL3.dll'.'SDL_JoystickGetAxisInitialState' +++'_SDL_JoystickGetDeviceType'.'SDL3.dll'.'SDL_JoystickGetDeviceType' +++'_SDL_JoystickGetType'.'SDL3.dll'.'SDL_JoystickGetType' +++'_SDL_MemoryBarrierReleaseFunction'.'SDL3.dll'.'SDL_MemoryBarrierReleaseFunction' +++'_SDL_MemoryBarrierAcquireFunction'.'SDL3.dll'.'SDL_MemoryBarrierAcquireFunction' +++'_SDL_JoystickGetDeviceInstanceID'.'SDL3.dll'.'SDL_JoystickGetDeviceInstanceID' +++'_SDL_utf8strlen'.'SDL3.dll'.'SDL_utf8strlen' +++'_SDL_LoadFile_RW'.'SDL3.dll'.'SDL_LoadFile_RW' +++'_SDL_wcscmp'.'SDL3.dll'.'SDL_wcscmp' +++'_SDL_ComposeCustomBlendMode'.'SDL3.dll'.'SDL_ComposeCustomBlendMode' +++'_SDL_DuplicateSurface'.'SDL3.dll'.'SDL_DuplicateSurface' +++'_SDL_Vulkan_LoadLibrary'.'SDL3.dll'.'SDL_Vulkan_LoadLibrary' +++'_SDL_Vulkan_GetVkGetInstanceProcAddr'.'SDL3.dll'.'SDL_Vulkan_GetVkGetInstanceProcAddr' +++'_SDL_Vulkan_UnloadLibrary'.'SDL3.dll'.'SDL_Vulkan_UnloadLibrary' +++'_SDL_Vulkan_GetInstanceExtensions'.'SDL3.dll'.'SDL_Vulkan_GetInstanceExtensions' +++'_SDL_Vulkan_CreateSurface'.'SDL3.dll'.'SDL_Vulkan_CreateSurface' +++'_SDL_Vulkan_GetDrawableSize'.'SDL3.dll'.'SDL_Vulkan_GetDrawableSize' +++'_SDL_LockJoysticks'.'SDL3.dll'.'SDL_LockJoysticks' +++'_SDL_UnlockJoysticks'.'SDL3.dll'.'SDL_UnlockJoysticks' +++'_SDL_GetMemoryFunctions'.'SDL3.dll'.'SDL_GetMemoryFunctions' +++'_SDL_SetMemoryFunctions'.'SDL3.dll'.'SDL_SetMemoryFunctions' +++'_SDL_GetNumAllocations'.'SDL3.dll'.'SDL_GetNumAllocations' +++'_SDL_NewAudioStream'.'SDL3.dll'.'SDL_NewAudioStream' +++'_SDL_AudioStreamPut'.'SDL3.dll'.'SDL_AudioStreamPut' +++'_SDL_AudioStreamGet'.'SDL3.dll'.'SDL_AudioStreamGet' +++'_SDL_AudioStreamClear'.'SDL3.dll'.'SDL_AudioStreamClear' +++'_SDL_AudioStreamAvailable'.'SDL3.dll'.'SDL_AudioStreamAvailable' +++'_SDL_FreeAudioStream'.'SDL3.dll'.'SDL_FreeAudioStream' +++'_SDL_AudioStreamFlush'.'SDL3.dll'.'SDL_AudioStreamFlush' +++'_SDL_acosf'.'SDL3.dll'.'SDL_acosf' +++'_SDL_asinf'.'SDL3.dll'.'SDL_asinf' +++'_SDL_atanf'.'SDL3.dll'.'SDL_atanf' +++'_SDL_atan2f'.'SDL3.dll'.'SDL_atan2f' +++'_SDL_ceilf'.'SDL3.dll'.'SDL_ceilf' +++'_SDL_copysignf'.'SDL3.dll'.'SDL_copysignf' +++'_SDL_fabsf'.'SDL3.dll'.'SDL_fabsf' +++'_SDL_floorf'.'SDL3.dll'.'SDL_floorf' +++'_SDL_logf'.'SDL3.dll'.'SDL_logf' +++'_SDL_powf'.'SDL3.dll'.'SDL_powf' +++'_SDL_scalbnf'.'SDL3.dll'.'SDL_scalbnf' +++'_SDL_fmod'.'SDL3.dll'.'SDL_fmod' +++'_SDL_fmodf'.'SDL3.dll'.'SDL_fmodf' +++'_SDL_SetYUVConversionMode'.'SDL3.dll'.'SDL_SetYUVConversionMode' +++'_SDL_GetYUVConversionMode'.'SDL3.dll'.'SDL_GetYUVConversionMode' +++'_SDL_GetYUVConversionModeForResolution'.'SDL3.dll'.'SDL_GetYUVConversionModeForResolution' +++'_SDL_RenderGetMetalLayer'.'SDL3.dll'.'SDL_RenderGetMetalLayer' +++'_SDL_RenderGetMetalCommandEncoder'.'SDL3.dll'.'SDL_RenderGetMetalCommandEncoder' +# ++'_SDL_IsAndroidTV'.'SDL3.dll'.'SDL_IsAndroidTV' +# ++'_SDL_WinRTGetDeviceFamily'.'SDL3.dll'.'SDL_WinRTGetDeviceFamily' +++'_SDL_log10'.'SDL3.dll'.'SDL_log10' +++'_SDL_log10f'.'SDL3.dll'.'SDL_log10f' +++'_SDL_GameControllerMappingForDeviceIndex'.'SDL3.dll'.'SDL_GameControllerMappingForDeviceIndex' +# ++'_SDL_LinuxSetThreadPriority'.'SDL3.dll'.'SDL_LinuxSetThreadPriority' +++'_SDL_HasAVX512F'.'SDL3.dll'.'SDL_HasAVX512F' +# ++'_SDL_IsChromebook'.'SDL3.dll'.'SDL_IsChromebook' +# ++'_SDL_IsDeXMode'.'SDL3.dll'.'SDL_IsDeXMode' +# ++'_SDL_AndroidBackButton'.'SDL3.dll'.'SDL_AndroidBackButton' +++'_SDL_exp'.'SDL3.dll'.'SDL_exp' +++'_SDL_expf'.'SDL3.dll'.'SDL_expf' +++'_SDL_wcsdup'.'SDL3.dll'.'SDL_wcsdup' +++'_SDL_GameControllerRumble'.'SDL3.dll'.'SDL_GameControllerRumble' +++'_SDL_JoystickRumble'.'SDL3.dll'.'SDL_JoystickRumble' +++'_SDL_NumSensors'.'SDL3.dll'.'SDL_NumSensors' +++'_SDL_SensorGetDeviceName'.'SDL3.dll'.'SDL_SensorGetDeviceName' +++'_SDL_SensorGetDeviceType'.'SDL3.dll'.'SDL_SensorGetDeviceType' +++'_SDL_SensorGetDeviceNonPortableType'.'SDL3.dll'.'SDL_SensorGetDeviceNonPortableType' +++'_SDL_SensorGetDeviceInstanceID'.'SDL3.dll'.'SDL_SensorGetDeviceInstanceID' +++'_SDL_SensorOpen'.'SDL3.dll'.'SDL_SensorOpen' +++'_SDL_SensorFromInstanceID'.'SDL3.dll'.'SDL_SensorFromInstanceID' +++'_SDL_SensorGetName'.'SDL3.dll'.'SDL_SensorGetName' +++'_SDL_SensorGetType'.'SDL3.dll'.'SDL_SensorGetType' +++'_SDL_SensorGetNonPortableType'.'SDL3.dll'.'SDL_SensorGetNonPortableType' +++'_SDL_SensorGetInstanceID'.'SDL3.dll'.'SDL_SensorGetInstanceID' +++'_SDL_SensorGetData'.'SDL3.dll'.'SDL_SensorGetData' +++'_SDL_SensorClose'.'SDL3.dll'.'SDL_SensorClose' +++'_SDL_SensorUpdate'.'SDL3.dll'.'SDL_SensorUpdate' +++'_SDL_IsTablet'.'SDL3.dll'.'SDL_IsTablet' +++'_SDL_GetDisplayOrientation'.'SDL3.dll'.'SDL_GetDisplayOrientation' +++'_SDL_HasColorKey'.'SDL3.dll'.'SDL_HasColorKey' +++'_SDL_CreateThreadWithStackSize'.'SDL3.dll'.'SDL_CreateThreadWithStackSize' +++'_SDL_JoystickGetDevicePlayerIndex'.'SDL3.dll'.'SDL_JoystickGetDevicePlayerIndex' +++'_SDL_JoystickGetPlayerIndex'.'SDL3.dll'.'SDL_JoystickGetPlayerIndex' +++'_SDL_GameControllerGetPlayerIndex'.'SDL3.dll'.'SDL_GameControllerGetPlayerIndex' +++'_SDL_RenderFlush'.'SDL3.dll'.'SDL_RenderFlush' +++'_SDL_RenderDrawPointF'.'SDL3.dll'.'SDL_RenderDrawPointF' +++'_SDL_RenderDrawPointsF'.'SDL3.dll'.'SDL_RenderDrawPointsF' +++'_SDL_RenderDrawLineF'.'SDL3.dll'.'SDL_RenderDrawLineF' +++'_SDL_RenderDrawLinesF'.'SDL3.dll'.'SDL_RenderDrawLinesF' +++'_SDL_RenderDrawRectF'.'SDL3.dll'.'SDL_RenderDrawRectF' +++'_SDL_RenderDrawRectsF'.'SDL3.dll'.'SDL_RenderDrawRectsF' +++'_SDL_RenderFillRectF'.'SDL3.dll'.'SDL_RenderFillRectF' +++'_SDL_RenderFillRectsF'.'SDL3.dll'.'SDL_RenderFillRectsF' +++'_SDL_RenderCopyF'.'SDL3.dll'.'SDL_RenderCopyF' +++'_SDL_RenderCopyExF'.'SDL3.dll'.'SDL_RenderCopyExF' +++'_SDL_GetTouchDeviceType'.'SDL3.dll'.'SDL_GetTouchDeviceType' +# ++'_SDL_UIKitRunApp'.'SDL3.dll'.'SDL_UIKitRunApp' +++'_SDL_SIMDGetAlignment'.'SDL3.dll'.'SDL_SIMDGetAlignment' +++'_SDL_SIMDAlloc'.'SDL3.dll'.'SDL_SIMDAlloc' +++'_SDL_SIMDFree'.'SDL3.dll'.'SDL_SIMDFree' +++'_SDL_RWsize'.'SDL3.dll'.'SDL_RWsize' +++'_SDL_RWseek'.'SDL3.dll'.'SDL_RWseek' +++'_SDL_RWtell'.'SDL3.dll'.'SDL_RWtell' +++'_SDL_RWread'.'SDL3.dll'.'SDL_RWread' +++'_SDL_RWwrite'.'SDL3.dll'.'SDL_RWwrite' +++'_SDL_RWclose'.'SDL3.dll'.'SDL_RWclose' +++'_SDL_LoadFile'.'SDL3.dll'.'SDL_LoadFile' +++'_SDL_Metal_CreateView'.'SDL3.dll'.'SDL_Metal_CreateView' +++'_SDL_Metal_DestroyView'.'SDL3.dll'.'SDL_Metal_DestroyView' +++'_SDL_LockTextureToSurface'.'SDL3.dll'.'SDL_LockTextureToSurface' +++'_SDL_HasARMSIMD'.'SDL3.dll'.'SDL_HasARMSIMD' +++'_SDL_strtokr'.'SDL3.dll'.'SDL_strtokr' +++'_SDL_wcsstr'.'SDL3.dll'.'SDL_wcsstr' +++'_SDL_wcsncmp'.'SDL3.dll'.'SDL_wcsncmp' +++'_SDL_GameControllerTypeForIndex'.'SDL3.dll'.'SDL_GameControllerTypeForIndex' +++'_SDL_GameControllerGetType'.'SDL3.dll'.'SDL_GameControllerGetType' +++'_SDL_GameControllerFromPlayerIndex'.'SDL3.dll'.'SDL_GameControllerFromPlayerIndex' +++'_SDL_GameControllerSetPlayerIndex'.'SDL3.dll'.'SDL_GameControllerSetPlayerIndex' +++'_SDL_JoystickFromPlayerIndex'.'SDL3.dll'.'SDL_JoystickFromPlayerIndex' +++'_SDL_JoystickSetPlayerIndex'.'SDL3.dll'.'SDL_JoystickSetPlayerIndex' +++'_SDL_SetTextureScaleMode'.'SDL3.dll'.'SDL_SetTextureScaleMode' +++'_SDL_GetTextureScaleMode'.'SDL3.dll'.'SDL_GetTextureScaleMode' +++'_SDL_OnApplicationWillTerminate'.'SDL3.dll'.'SDL_OnApplicationWillTerminate' +++'_SDL_OnApplicationDidReceiveMemoryWarning'.'SDL3.dll'.'SDL_OnApplicationDidReceiveMemoryWarning' +++'_SDL_OnApplicationWillResignActive'.'SDL3.dll'.'SDL_OnApplicationWillResignActive' +++'_SDL_OnApplicationDidEnterBackground'.'SDL3.dll'.'SDL_OnApplicationDidEnterBackground' +++'_SDL_OnApplicationWillEnterForeground'.'SDL3.dll'.'SDL_OnApplicationWillEnterForeground' +++'_SDL_OnApplicationDidBecomeActive'.'SDL3.dll'.'SDL_OnApplicationDidBecomeActive' +# ++'_SDL_OnApplicationDidChangeStatusBarOrientation'.'SDL3.dll'.'SDL_OnApplicationDidChangeStatusBarOrientation' +# ++'_SDL_GetAndroidSDKVersion'.'SDL3.dll'.'SDL_GetAndroidSDKVersion' +++'_SDL_isupper'.'SDL3.dll'.'SDL_isupper' +++'_SDL_islower'.'SDL3.dll'.'SDL_islower' +++'_SDL_JoystickAttachVirtual'.'SDL3.dll'.'SDL_JoystickAttachVirtual' +++'_SDL_JoystickDetachVirtual'.'SDL3.dll'.'SDL_JoystickDetachVirtual' +++'_SDL_JoystickIsVirtual'.'SDL3.dll'.'SDL_JoystickIsVirtual' +++'_SDL_JoystickSetVirtualAxis'.'SDL3.dll'.'SDL_JoystickSetVirtualAxis' +++'_SDL_JoystickSetVirtualButton'.'SDL3.dll'.'SDL_JoystickSetVirtualButton' +++'_SDL_JoystickSetVirtualHat'.'SDL3.dll'.'SDL_JoystickSetVirtualHat' +++'_SDL_GetErrorMsg'.'SDL3.dll'.'SDL_GetErrorMsg' +++'_SDL_LockSensors'.'SDL3.dll'.'SDL_LockSensors' +++'_SDL_UnlockSensors'.'SDL3.dll'.'SDL_UnlockSensors' +++'_SDL_Metal_GetLayer'.'SDL3.dll'.'SDL_Metal_GetLayer' +++'_SDL_Metal_GetDrawableSize'.'SDL3.dll'.'SDL_Metal_GetDrawableSize' +++'_SDL_trunc'.'SDL3.dll'.'SDL_trunc' +++'_SDL_truncf'.'SDL3.dll'.'SDL_truncf' +++'_SDL_GetPreferredLocales'.'SDL3.dll'.'SDL_GetPreferredLocales' +++'_SDL_SIMDRealloc'.'SDL3.dll'.'SDL_SIMDRealloc' +# ++'_SDL_AndroidRequestPermission'.'SDL3.dll'.'SDL_AndroidRequestPermission' +++'_SDL_OpenURL'.'SDL3.dll'.'SDL_OpenURL' +++'_SDL_HasSurfaceRLE'.'SDL3.dll'.'SDL_HasSurfaceRLE' +++'_SDL_GameControllerHasLED'.'SDL3.dll'.'SDL_GameControllerHasLED' +++'_SDL_GameControllerSetLED'.'SDL3.dll'.'SDL_GameControllerSetLED' +++'_SDL_JoystickHasLED'.'SDL3.dll'.'SDL_JoystickHasLED' +++'_SDL_JoystickSetLED'.'SDL3.dll'.'SDL_JoystickSetLED' +++'_SDL_GameControllerRumbleTriggers'.'SDL3.dll'.'SDL_GameControllerRumbleTriggers' +++'_SDL_JoystickRumbleTriggers'.'SDL3.dll'.'SDL_JoystickRumbleTriggers' +++'_SDL_GameControllerHasAxis'.'SDL3.dll'.'SDL_GameControllerHasAxis' +++'_SDL_GameControllerHasButton'.'SDL3.dll'.'SDL_GameControllerHasButton' +++'_SDL_GameControllerGetNumTouchpads'.'SDL3.dll'.'SDL_GameControllerGetNumTouchpads' +++'_SDL_GameControllerGetNumTouchpadFingers'.'SDL3.dll'.'SDL_GameControllerGetNumTouchpadFingers' +++'_SDL_GameControllerGetTouchpadFinger'.'SDL3.dll'.'SDL_GameControllerGetTouchpadFinger' +++'_SDL_crc32'.'SDL3.dll'.'SDL_crc32' +++'_SDL_GameControllerGetSerial'.'SDL3.dll'.'SDL_GameControllerGetSerial' +++'_SDL_JoystickGetSerial'.'SDL3.dll'.'SDL_JoystickGetSerial' +++'_SDL_GameControllerHasSensor'.'SDL3.dll'.'SDL_GameControllerHasSensor' +++'_SDL_GameControllerSetSensorEnabled'.'SDL3.dll'.'SDL_GameControllerSetSensorEnabled' +++'_SDL_GameControllerIsSensorEnabled'.'SDL3.dll'.'SDL_GameControllerIsSensorEnabled' +++'_SDL_GameControllerGetSensorData'.'SDL3.dll'.'SDL_GameControllerGetSensorData' +++'_SDL_wcscasecmp'.'SDL3.dll'.'SDL_wcscasecmp' +++'_SDL_wcsncasecmp'.'SDL3.dll'.'SDL_wcsncasecmp' +++'_SDL_round'.'SDL3.dll'.'SDL_round' +++'_SDL_roundf'.'SDL3.dll'.'SDL_roundf' +++'_SDL_lround'.'SDL3.dll'.'SDL_lround' +++'_SDL_lroundf'.'SDL3.dll'.'SDL_lroundf' +++'_SDL_SoftStretchLinear'.'SDL3.dll'.'SDL_SoftStretchLinear' +++'_SDL_RenderGetD3D11Device'.'SDL3.dll'.'SDL_RenderGetD3D11Device' +++'_SDL_UpdateNVTexture'.'SDL3.dll'.'SDL_UpdateNVTexture' +++'_SDL_SetWindowKeyboardGrab'.'SDL3.dll'.'SDL_SetWindowKeyboardGrab' +++'_SDL_SetWindowMouseGrab'.'SDL3.dll'.'SDL_SetWindowMouseGrab' +++'_SDL_GetWindowKeyboardGrab'.'SDL3.dll'.'SDL_GetWindowKeyboardGrab' +++'_SDL_GetWindowMouseGrab'.'SDL3.dll'.'SDL_GetWindowMouseGrab' +++'_SDL_isalpha'.'SDL3.dll'.'SDL_isalpha' +++'_SDL_isalnum'.'SDL3.dll'.'SDL_isalnum' +++'_SDL_isblank'.'SDL3.dll'.'SDL_isblank' +++'_SDL_iscntrl'.'SDL3.dll'.'SDL_iscntrl' +++'_SDL_isxdigit'.'SDL3.dll'.'SDL_isxdigit' +++'_SDL_ispunct'.'SDL3.dll'.'SDL_ispunct' +++'_SDL_isprint'.'SDL3.dll'.'SDL_isprint' +++'_SDL_isgraph'.'SDL3.dll'.'SDL_isgraph' +# ++'_SDL_AndroidShowToast'.'SDL3.dll'.'SDL_AndroidShowToast' +++'_SDL_GetAudioDeviceSpec'.'SDL3.dll'.'SDL_GetAudioDeviceSpec' +++'_SDL_TLSCleanup'.'SDL3.dll'.'SDL_TLSCleanup' +++'_SDL_SetWindowAlwaysOnTop'.'SDL3.dll'.'SDL_SetWindowAlwaysOnTop' +++'_SDL_FlashWindow'.'SDL3.dll'.'SDL_FlashWindow' +++'_SDL_GameControllerSendEffect'.'SDL3.dll'.'SDL_GameControllerSendEffect' +++'_SDL_JoystickSendEffect'.'SDL3.dll'.'SDL_JoystickSendEffect' +++'_SDL_GameControllerGetSensorDataRate'.'SDL3.dll'.'SDL_GameControllerGetSensorDataRate' +++'_SDL_SetTextureUserData'.'SDL3.dll'.'SDL_SetTextureUserData' +++'_SDL_GetTextureUserData'.'SDL3.dll'.'SDL_GetTextureUserData' +++'_SDL_RenderGeometry'.'SDL3.dll'.'SDL_RenderGeometry' +++'_SDL_RenderGeometryRaw'.'SDL3.dll'.'SDL_RenderGeometryRaw' +++'_SDL_RenderSetVSync'.'SDL3.dll'.'SDL_RenderSetVSync' +++'_SDL_asprintf'.'SDL3.dll'.'SDL_asprintf' +++'_SDL_vasprintf'.'SDL3.dll'.'SDL_vasprintf' +++'_SDL_GetWindowICCProfile'.'SDL3.dll'.'SDL_GetWindowICCProfile' +++'_SDL_GetTicks64'.'SDL3.dll'.'SDL_GetTicks64' +# ++'_SDL_LinuxSetThreadPriorityAndPolicy'.'SDL3.dll'.'SDL_LinuxSetThreadPriorityAndPolicy' +++'_SDL_GameControllerGetAppleSFSymbolsNameForButton'.'SDL3.dll'.'SDL_GameControllerGetAppleSFSymbolsNameForButton' +++'_SDL_GameControllerGetAppleSFSymbolsNameForAxis'.'SDL3.dll'.'SDL_GameControllerGetAppleSFSymbolsNameForAxis' +++'_SDL_hid_init'.'SDL3.dll'.'SDL_hid_init' +++'_SDL_hid_exit'.'SDL3.dll'.'SDL_hid_exit' +++'_SDL_hid_device_change_count'.'SDL3.dll'.'SDL_hid_device_change_count' +++'_SDL_hid_enumerate'.'SDL3.dll'.'SDL_hid_enumerate' +++'_SDL_hid_free_enumeration'.'SDL3.dll'.'SDL_hid_free_enumeration' +++'_SDL_hid_open'.'SDL3.dll'.'SDL_hid_open' +++'_SDL_hid_open_path'.'SDL3.dll'.'SDL_hid_open_path' +++'_SDL_hid_write'.'SDL3.dll'.'SDL_hid_write' +++'_SDL_hid_read_timeout'.'SDL3.dll'.'SDL_hid_read_timeout' +++'_SDL_hid_read'.'SDL3.dll'.'SDL_hid_read' +++'_SDL_hid_set_nonblocking'.'SDL3.dll'.'SDL_hid_set_nonblocking' +++'_SDL_hid_send_feature_report'.'SDL3.dll'.'SDL_hid_send_feature_report' +++'_SDL_hid_get_feature_report'.'SDL3.dll'.'SDL_hid_get_feature_report' +++'_SDL_hid_close'.'SDL3.dll'.'SDL_hid_close' +++'_SDL_hid_get_manufacturer_string'.'SDL3.dll'.'SDL_hid_get_manufacturer_string' +++'_SDL_hid_get_product_string'.'SDL3.dll'.'SDL_hid_get_product_string' +++'_SDL_hid_get_serial_number_string'.'SDL3.dll'.'SDL_hid_get_serial_number_string' +++'_SDL_hid_get_indexed_string'.'SDL3.dll'.'SDL_hid_get_indexed_string' +++'_SDL_SetWindowMouseRect'.'SDL3.dll'.'SDL_SetWindowMouseRect' +++'_SDL_GetWindowMouseRect'.'SDL3.dll'.'SDL_GetWindowMouseRect' +++'_SDL_RenderWindowToLogical'.'SDL3.dll'.'SDL_RenderWindowToLogical' +++'_SDL_RenderLogicalToWindow'.'SDL3.dll'.'SDL_RenderLogicalToWindow' +++'_SDL_JoystickHasRumble'.'SDL3.dll'.'SDL_JoystickHasRumble' +++'_SDL_JoystickHasRumbleTriggers'.'SDL3.dll'.'SDL_JoystickHasRumbleTriggers' +++'_SDL_GameControllerHasRumble'.'SDL3.dll'.'SDL_GameControllerHasRumble' +++'_SDL_GameControllerHasRumbleTriggers'.'SDL3.dll'.'SDL_GameControllerHasRumbleTriggers' +++'_SDL_hid_ble_scan'.'SDL3.dll'.'SDL_hid_ble_scan' +++'_SDL_PremultiplyAlpha'.'SDL3.dll'.'SDL_PremultiplyAlpha' +# ++'_SDL_AndroidSendMessage'.'SDL3.dll'.'SDL_AndroidSendMessage' +++'_SDL_GetTouchName'.'SDL3.dll'.'SDL_GetTouchName' +++'_SDL_ClearComposition'.'SDL3.dll'.'SDL_ClearComposition' +++'_SDL_IsTextInputShown'.'SDL3.dll'.'SDL_IsTextInputShown' +++'_SDL_HasIntersectionF'.'SDL3.dll'.'SDL_HasIntersectionF' +++'_SDL_IntersectFRect'.'SDL3.dll'.'SDL_IntersectFRect' +++'_SDL_UnionFRect'.'SDL3.dll'.'SDL_UnionFRect' +++'_SDL_EncloseFPoints'.'SDL3.dll'.'SDL_EncloseFPoints' +++'_SDL_IntersectFRectAndLine'.'SDL3.dll'.'SDL_IntersectFRectAndLine' +++'_SDL_RenderGetWindow'.'SDL3.dll'.'SDL_RenderGetWindow' +++'_SDL_bsearch'.'SDL3.dll'.'SDL_bsearch' +++'_SDL_GameControllerPathForIndex'.'SDL3.dll'.'SDL_GameControllerPathForIndex' +++'_SDL_GameControllerPath'.'SDL3.dll'.'SDL_GameControllerPath' +++'_SDL_JoystickPathForIndex'.'SDL3.dll'.'SDL_JoystickPathForIndex' +++'_SDL_JoystickPath'.'SDL3.dll'.'SDL_JoystickPath' +++'_SDL_JoystickAttachVirtualEx'.'SDL3.dll'.'SDL_JoystickAttachVirtualEx' +++'_SDL_GameControllerGetFirmwareVersion'.'SDL3.dll'.'SDL_GameControllerGetFirmwareVersion' +++'_SDL_JoystickGetFirmwareVersion'.'SDL3.dll'.'SDL_JoystickGetFirmwareVersion' +++'_SDL_GUIDToString'.'SDL3.dll'.'SDL_GUIDToString' +++'_SDL_GUIDFromString'.'SDL3.dll'.'SDL_GUIDFromString' +++'_SDL_HasLSX'.'SDL3.dll'.'SDL_HasLSX' +++'_SDL_HasLASX'.'SDL3.dll'.'SDL_HasLASX' +++'_SDL_RenderGetD3D12Device'.'SDL3.dll'.'SDL_RenderGetD3D12Device' +++'_SDL_utf8strnlen'.'SDL3.dll'.'SDL_utf8strnlen' +# ++'_SDL_GDKGetTaskQueue'.'SDL3.dll'.'SDL_GDKGetTaskQueue' +# ++'_SDL_GDKRunApp'.'SDL3.dll'.'SDL_GDKRunApp' +++'_SDL_GetOriginalMemoryFunctions'.'SDL3.dll'.'SDL_GetOriginalMemoryFunctions' +++'_SDL_ResetKeyboard'.'SDL3.dll'.'SDL_ResetKeyboard' +++'_SDL_GetDefaultAudioInfo'.'SDL3.dll'.'SDL_GetDefaultAudioInfo' +++'_SDL_GetPointDisplayIndex'.'SDL3.dll'.'SDL_GetPointDisplayIndex' +++'_SDL_GetRectDisplayIndex'.'SDL3.dll'.'SDL_GetRectDisplayIndex' +++'_SDL_ResetHint'.'SDL3.dll'.'SDL_ResetHint' +++'_SDL_crc16'.'SDL3.dll'.'SDL_crc16' +++'_SDL_GetWindowSizeInPixels'.'SDL3.dll'.'SDL_GetWindowSizeInPixels' +++'_SDL_GetJoystickGUIDInfo'.'SDL3.dll'.'SDL_GetJoystickGUIDInfo' +++'_SDL_SetPrimarySelectionText'.'SDL3.dll'.'SDL_SetPrimarySelectionText' +++'_SDL_GetPrimarySelectionText'.'SDL3.dll'.'SDL_GetPrimarySelectionText' +++'_SDL_HasPrimarySelectionText'.'SDL3.dll'.'SDL_HasPrimarySelectionText' +++'_SDL_GameControllerGetSensorDataWithTimestamp'.'SDL3.dll'.'SDL_GameControllerGetSensorDataWithTimestamp' +++'_SDL_SensorGetDataWithTimestamp'.'SDL3.dll'.'SDL_SensorGetDataWithTimestamp' +++'_SDL_ResetHints'.'SDL3.dll'.'SDL_ResetHints' +++'_SDL_strcasestr'.'SDL3.dll'.'SDL_strcasestr' diff --git a/src/dynapi/SDL_dynapi.c b/src/dynapi/SDL_dynapi.c index 9a7e4c9943..033c4a75d3 100644 --- a/src/dynapi/SDL_dynapi.c +++ b/src/dynapi/SDL_dynapi.c @@ -195,7 +195,7 @@ SDL_DYNAPI_VARARGS(,,) static int SDLCALL SDL_SetError_LOGSDLCALLS(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) { char buf[512]; /* !!! FIXME: dynamic allocation */ \ va_list ap; - SDL_Log_REAL("SDL2CALL SDL_SetError"); + SDL_Log_REAL("SDL3CALL SDL_SetError"); va_start(ap, fmt); SDL_vsnprintf_REAL(buf, sizeof (buf), fmt, ap); va_end(ap); @@ -204,7 +204,7 @@ static int SDLCALL SDL_SetError_LOGSDLCALLS(SDL_PRINTF_FORMAT_STRING const char static int SDLCALL SDL_sscanf_LOGSDLCALLS(const char *buf, SDL_SCANF_FORMAT_STRING const char *fmt, ...) { int retval; va_list ap; - SDL_Log_REAL("SDL2CALL SDL_sscanf"); + SDL_Log_REAL("SDL3CALL SDL_sscanf"); va_start(ap, fmt); retval = SDL_vsscanf_REAL(buf, fmt, ap); va_end(ap); @@ -213,7 +213,7 @@ static int SDLCALL SDL_sscanf_LOGSDLCALLS(const char *buf, SDL_SCANF_FORMAT_STRI static int SDLCALL SDL_snprintf_LOGSDLCALLS(SDL_OUT_Z_CAP(maxlen) char *buf, size_t maxlen, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) { int retval; va_list ap; - SDL_Log_REAL("SDL2CALL SDL_snprintf"); + SDL_Log_REAL("SDL3CALL SDL_snprintf"); va_start(ap, fmt); retval = SDL_vsnprintf_REAL(buf, maxlen, fmt, ap); va_end(ap); @@ -222,7 +222,7 @@ static int SDLCALL SDL_snprintf_LOGSDLCALLS(SDL_OUT_Z_CAP(maxlen) char *buf, siz static int SDLCALL SDL_asprintf_LOGSDLCALLS(char **strp, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) { int retval; va_list ap; - SDL_Log_REAL("SDL2CALL SDL_asprintf"); + SDL_Log_REAL("SDL3CALL SDL_asprintf"); va_start(ap, fmt); retval = SDL_vasprintf_REAL(strp, fmt, ap); va_end(ap); @@ -230,14 +230,14 @@ static int SDLCALL SDL_asprintf_LOGSDLCALLS(char **strp, SDL_PRINTF_FORMAT_STRIN } static void SDLCALL SDL_Log_LOGSDLCALLS(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) { va_list ap; - SDL_Log_REAL("SDL2CALL SDL_Log"); + SDL_Log_REAL("SDL3CALL SDL_Log"); va_start(ap, fmt); SDL_LogMessageV_REAL(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO, fmt, ap); \ va_end(ap); } static void SDLCALL SDL_LogMessage_LOGSDLCALLS(int category, SDL_LogPriority priority, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) { va_list ap; - SDL_Log_REAL("SDL2CALL SDL_LogMessage"); + SDL_Log_REAL("SDL3CALL SDL_LogMessage"); va_start(ap, fmt); SDL_LogMessageV_REAL(category, priority, fmt, ap); va_end(ap); @@ -245,7 +245,7 @@ static void SDLCALL SDL_LogMessage_LOGSDLCALLS(int category, SDL_LogPriority pri #define SDL_DYNAPI_VARARGS_LOGFN_LOGSDLCALLS(logname, prio) \ static void SDLCALL SDL_Log##logname##_LOGSDLCALLS(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) { \ va_list ap; va_start(ap, fmt); \ - SDL_Log_REAL("SDL2CALL SDL_Log%s", #logname); \ + SDL_Log_REAL("SDL3CALL SDL_Log%s", #logname); \ SDL_LogMessageV_REAL(category, SDL_LOG_PRIORITY_##prio, fmt, ap); \ va_end(ap); \ } @@ -256,7 +256,7 @@ SDL_DYNAPI_VARARGS_LOGFN_LOGSDLCALLS(Warn, WARN) SDL_DYNAPI_VARARGS_LOGFN_LOGSDLCALLS(Error, ERROR) SDL_DYNAPI_VARARGS_LOGFN_LOGSDLCALLS(Critical, CRITICAL) #define SDL_DYNAPI_PROC(rc,fn,params,args,ret) \ - rc SDLCALL fn##_LOGSDLCALLS params { SDL_Log_REAL("SDL2CALL %s", #fn); ret fn##_REAL args; } + rc SDLCALL fn##_LOGSDLCALLS params { SDL_Log_REAL("SDL3CALL %s", #fn); ret fn##_REAL args; } #define SDL_DYNAPI_PROC_NO_VARARGS 1 #include "SDL_dynapi_procs.h" #undef SDL_DYNAPI_PROC diff --git a/src/dynapi/gendynapi.pl b/src/dynapi/gendynapi.pl index a9ff9723be..6c19a8f7d4 100755 --- a/src/dynapi/gendynapi.pl +++ b/src/dynapi/gendynapi.pl @@ -33,7 +33,7 @@ use File::Basename; chdir(dirname(__FILE__) . '/../..'); my $sdl_dynapi_procs_h = "src/dynapi/SDL_dynapi_procs.h"; my $sdl_dynapi_overrides_h = "src/dynapi/SDL_dynapi_overrides.h"; -my $sdl2_exports = "src/dynapi/SDL2.exports"; +my $sdl3_exports = "src/dynapi/SDL3.exports"; my %existing = (); if (-f $sdl_dynapi_procs_h) { @@ -48,7 +48,7 @@ if (-f $sdl_dynapi_procs_h) { open(SDL_DYNAPI_PROCS_H, '>>', $sdl_dynapi_procs_h) or die("Can't open $sdl_dynapi_procs_h: $!\n"); open(SDL_DYNAPI_OVERRIDES_H, '>>', $sdl_dynapi_overrides_h) or die("Can't open $sdl_dynapi_overrides_h: $!\n"); -open(SDL2_EXPORTS, '>>', $sdl2_exports) or die("Can't open $sdl2_exports: $!\n"); +open(SDL3_EXPORTS, '>>', $sdl3_exports) or die("Can't open $sdl3_exports: $!\n"); opendir(HEADERS, 'include') or die("Can't open include dir: $!\n"); while (my $d = readdir(HEADERS)) { @@ -135,7 +135,7 @@ while (my $d = readdir(HEADERS)) { print("NEW: $decl\n"); print SDL_DYNAPI_PROCS_H "SDL_DYNAPI_PROC($rc,$fn,$paramstr,$argstr,$retstr)\n"; print SDL_DYNAPI_OVERRIDES_H "#define $fn ${fn}_REAL\n"; - print SDL2_EXPORTS "++'_${fn}'.'SDL2.dll'.'${fn}'\n"; + print SDL3_EXPORTS "++'_${fn}'.'SDL3.dll'.'${fn}'\n"; } else { print("Failed to parse decl [$decl]!\n"); } @@ -146,6 +146,6 @@ closedir(HEADERS); close(SDL_DYNAPI_PROCS_H); close(SDL_DYNAPI_OVERRIDES_H); -close(SDL2_EXPORTS); +close(SDL3_EXPORTS); # vi: set ts=4 sw=4 expandtab: diff --git a/src/main/windows/version.rc b/src/main/windows/version.rc index fb2c268900..4a3b139b38 100644 --- a/src/main/windows/version.rc +++ b/src/main/windows/version.rc @@ -9,8 +9,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US // VS_VERSION_INFO VERSIONINFO - FILEVERSION 2,26,0,0 - PRODUCTVERSION 2,26,0,0 + FILEVERSION 3,0,0,0 + PRODUCTVERSION 3,0,0,0 FILEFLAGSMASK 0x3fL FILEFLAGS 0x0L FILEOS 0x40004L @@ -23,12 +23,12 @@ BEGIN BEGIN VALUE "CompanyName", "\0" VALUE "FileDescription", "SDL\0" - VALUE "FileVersion", "2, 26, 0, 0\0" + VALUE "FileVersion", "3, 0, 0, 0\0" VALUE "InternalName", "SDL\0" VALUE "LegalCopyright", "Copyright (C) 2022 Sam Lantinga\0" - VALUE "OriginalFilename", "SDL2.dll\0" + VALUE "OriginalFilename", "SDL3.dll\0" VALUE "ProductName", "Simple DirectMedia Layer\0" - VALUE "ProductVersion", "2, 26, 0, 0\0" + VALUE "ProductVersion", "3, 0, 0, 0\0" END END BLOCK "VarFileInfo" diff --git a/src/main/winrt/SDL2-WinRTResource_BlankCursor.cur b/src/main/winrt/SDL3-WinRTResource_BlankCursor.cur similarity index 100% rename from src/main/winrt/SDL2-WinRTResource_BlankCursor.cur rename to src/main/winrt/SDL3-WinRTResource_BlankCursor.cur diff --git a/src/main/winrt/SDL2-WinRTResources.rc b/src/main/winrt/SDL3-WinRTResources.rc similarity index 54% rename from src/main/winrt/SDL2-WinRTResources.rc rename to src/main/winrt/SDL3-WinRTResources.rc index ce8549f2d2..457fd093bd 100644 --- a/src/main/winrt/SDL2-WinRTResources.rc +++ b/src/main/winrt/SDL3-WinRTResources.rc @@ -1,3 +1,3 @@ #include "winres.h" LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -5000 CURSOR "SDL2-WinRTResource_BlankCursor.cur" +5000 CURSOR "SDL3-WinRTResource_BlankCursor.cur" diff --git a/src/stdlib/SDL_mslibc.c b/src/stdlib/SDL_mslibc.c index 8f92463b13..00418e3329 100644 --- a/src/stdlib/SDL_mslibc.c +++ b/src/stdlib/SDL_mslibc.c @@ -39,7 +39,7 @@ __declspec(selectany) int _fltused = 1; #endif /* The optimizer on Visual Studio 2005 and later generates memcpy() and memset() calls. - Always provide it for the SDL2 DLL, but skip it when building static lib w/ static runtime. */ + Always provide it for the SDL3 DLL, but skip it when building static lib w/ static runtime. */ #if (_MSC_VER >= 1400) && (!defined(_MT) || defined(DLL_EXPORT)) extern void *memcpy(void* dst, const void* src, size_t len); #pragma intrinsic(memcpy) diff --git a/src/video/emscripten/SDL_emscriptenframebuffer.c b/src/video/emscripten/SDL_emscriptenframebuffer.c index 03fea04efa..edc523a462 100644 --- a/src/video/emscripten/SDL_emscriptenframebuffer.c +++ b/src/video/emscripten/SDL_emscriptenframebuffer.c @@ -76,19 +76,19 @@ int Emscripten_UpdateWindowFramebuffer(_THIS, SDL_Window * window, const SDL_Rec var h = $1; var pixels = $2; - if (!Module['SDL2']) Module['SDL2'] = {}; - var SDL2 = Module['SDL2']; - if (SDL2.ctxCanvas !== Module['canvas']) { - SDL2.ctx = Module['createContext'](Module['canvas'], false, true); - SDL2.ctxCanvas = Module['canvas']; + if (!Module['SDL3']) Module['SDL3'] = {}; + var SDL3 = Module['SDL3']; + if (SDL3.ctxCanvas !== Module['canvas']) { + SDL3.ctx = Module['createContext'](Module['canvas'], false, true); + SDL3.ctxCanvas = Module['canvas']; } - if (SDL2.w !== w || SDL2.h !== h || SDL2.imageCtx !== SDL2.ctx) { - SDL2.image = SDL2.ctx.createImageData(w, h); - SDL2.w = w; - SDL2.h = h; - SDL2.imageCtx = SDL2.ctx; + if (SDL3.w !== w || SDL3.h !== h || SDL3.imageCtx !== SDL3.ctx) { + SDL3.image = SDL3.ctx.createImageData(w, h); + SDL3.w = w; + SDL3.h = h; + SDL3.imageCtx = SDL3.ctx; } - var data = SDL2.image.data; + var data = SDL3.image.data; var src = pixels >> 2; var dst = 0; var num; @@ -108,12 +108,12 @@ int Emscripten_UpdateWindowFramebuffer(_THIS, SDL_Window * window, const SDL_Rec dst += 4; } } else { - if (SDL2.data32Data !== data) { - SDL2.data32 = new Int32Array(data.buffer); - SDL2.data8 = new Uint8Array(data.buffer); - SDL2.data32Data = data; + if (SDL3.data32Data !== data) { + SDL3.data32 = new Int32Array(data.buffer); + SDL3.data8 = new Uint8Array(data.buffer); + SDL3.data32Data = data; } - var data32 = SDL2.data32; + var data32 = SDL3.data32; num = data32.length; // logically we need to do // while (dst < num) { @@ -124,7 +124,7 @@ int Emscripten_UpdateWindowFramebuffer(_THIS, SDL_Window * window, const SDL_Rec // native SDL_memcpy efficiencies, and the remaining loop // just stores, not load + store, so it is faster data32.set(HEAP32.subarray(src, src + num)); - var data8 = SDL2.data8; + var data8 = SDL3.data8; var i = 3; var j = i + 4*num; if (num % 8 == 0) { @@ -155,7 +155,7 @@ int Emscripten_UpdateWindowFramebuffer(_THIS, SDL_Window * window, const SDL_Rec } } - SDL2.ctx.putImageData(SDL2.image, 0, 0); + SDL3.ctx.putImageData(SDL3.image, 0, 0); }, surface->w, surface->h, surface->pixels); if (emscripten_has_asyncify() && SDL_GetHintBoolean(SDL_HINT_EMSCRIPTEN_ASYNCIFY, SDL_TRUE)) { diff --git a/src/video/haiku/SDL_bmessagebox.cc b/src/video/haiku/SDL_bmessagebox.cc index d777ed834e..22b453cbb4 100644 --- a/src/video/haiku/SDL_bmessagebox.cc +++ b/src/video/haiku/SDL_bmessagebox.cc @@ -309,7 +309,7 @@ public: fComputedMessageBoxWidth(0.0f), fCloseButton(G_CLOSE_BUTTON_ID), fDefaultButton(G_DEFAULT_BUTTON_ID), fCustomColorScheme(false), fThereIsLongLine(false), - HAIKU_SDL_DefTitle("SDL2 MessageBox"), + HAIKU_SDL_DefTitle("SDL MessageBox"), HAIKU_SDL_DefMessage("Some information has been lost."), HAIKU_SDL_DefButton("OK") { diff --git a/src/video/kmsdrm/SDL_kmsdrmopengles.c b/src/video/kmsdrm/SDL_kmsdrmopengles.c index 253e34ecdb..0580e0ec5d 100644 --- a/src/video/kmsdrm/SDL_kmsdrmopengles.c +++ b/src/video/kmsdrm/SDL_kmsdrmopengles.c @@ -186,7 +186,7 @@ KMSDRM_GLES_SwapWindow(_THIS, SDL_Window * window) { we have waited here, there won't be a pending pageflip so the WaitPageflip at the beginning of this function will be a no-op. Just leave it here and don't worry. - Run your SDL2 program with "SDL_KMSDRM_DOUBLE_BUFFER=1 " + Run your SDL program with "SDL_KMSDRM_DOUBLE_BUFFER=1 " to enable this. */ if (windata->double_buffer) { if (!KMSDRM_WaitPageflip(_this, windata)) { diff --git a/src/video/kmsdrm/SDL_kmsdrmvideo.c b/src/video/kmsdrm/SDL_kmsdrmvideo.c index 6c05bbd9bf..e76c67efc6 100644 --- a/src/video/kmsdrm/SDL_kmsdrmvideo.c +++ b/src/video/kmsdrm/SDL_kmsdrmvideo.c @@ -1435,7 +1435,7 @@ KMSDRM_CreateWindow(_THIS, SDL_Window * window) if (!(viddata->gbm_init)) { - /* After SDL_CreateWindow, most SDL2 programs will do SDL_CreateRenderer(), + /* After SDL_CreateWindow, most SDL programs will do SDL_CreateRenderer(), which will in turn call GL_CreateRenderer() or GLES2_CreateRenderer(). In order for the GL_CreateRenderer() or GLES2_CreateRenderer() call to succeed without an unnecessary window re-creation, we must: diff --git a/src/video/os2/SDL_os2video.c b/src/video/os2/SDL_os2video.c index 599384edf6..f0147dc080 100644 --- a/src/video/os2/SDL_os2video.c +++ b/src/video/os2/SDL_os2video.c @@ -40,7 +40,7 @@ #define FOURCC_R666 mmioFOURCC('R','6','6','6') #endif -#define WIN_CLIENT_CLASS "SDL2" +#define WIN_CLIENT_CLASS "SDL3" #define OS2DRIVER_NAME_DIVE "DIVE" #define OS2DRIVER_NAME_VMAN "VMAN" @@ -760,7 +760,7 @@ static int OS2_CreateWindow(_THIS, SDL_Window *window) ulSWPFlags |= SWP_MINIMIZE; hwndFrame = WinCreateStdWindow(HWND_DESKTOP, 0, &ulFrameFlags, - WIN_CLIENT_CLASS, "SDL2", 0, 0, 0, &hwnd); + WIN_CLIENT_CLASS, "SDL3", 0, 0, 0, &hwnd); if (hwndFrame == NULLHANDLE) return SDL_SetError("Couldn't create window"); diff --git a/src/video/raspberry/SDL_rpiopengles.c b/src/video/raspberry/SDL_rpiopengles.c index 7b62b3e439..fe7d52175c 100644 --- a/src/video/raspberry/SDL_rpiopengles.c +++ b/src/video/raspberry/SDL_rpiopengles.c @@ -52,7 +52,7 @@ RPI_GLES_SwapWindow(_THIS, SDL_Window * window) { } /* Wait immediately for vsync (as if we only had two buffers), for low input-lag scenarios. - * Run your SDL2 program with "SDL_RPI_DOUBLE_BUFFER=1 " to enable this. */ + * Run your SDL program with "SDL_RPI_DOUBLE_BUFFER=1 " to enable this. */ if (wdata->double_buffer) { SDL_LockMutex(wdata->vsync_cond_mutex); SDL_CondWait(wdata->vsync_cond, wdata->vsync_cond_mutex); diff --git a/src/video/windows/SDL_windowswindow.c b/src/video/windows/SDL_windowswindow.c index d260f15c60..600f92af29 100644 --- a/src/video/windows/SDL_windowswindow.c +++ b/src/video/windows/SDL_windowswindow.c @@ -37,6 +37,7 @@ #include "SDL_windowsshape.h" #include "SDL_hints.h" #include "SDL_timer.h" +#include "SDL_version.h" /* Dropfile support */ #include @@ -773,7 +774,7 @@ WIN_GetWindowBordersSize(_THIS, SDL_Window * window, int *top, int *left, int *b /* Now that both the inner and outer rects use the same coordinate system we can substract them to get the border size. * Keep in mind that the top/left coordinates of rcWindow are negative because the border lies slightly before {0,0}, - * so switch them around because SDL2 wants them in positive. */ + * so switch them around because SDL3 wants them in positive. */ *top = rcClient.top - rcWindow.top; *left = rcClient.left - rcWindow.left; *bottom = rcWindow.bottom - rcClient.bottom; diff --git a/src/video/winrt/SDL_winrtmouse.cpp b/src/video/winrt/SDL_winrtmouse.cpp index 8c32e5fcf3..24e44682eb 100644 --- a/src/video/winrt/SDL_winrtmouse.cpp +++ b/src/video/winrt/SDL_winrtmouse.cpp @@ -160,8 +160,8 @@ WINRT_ShowCursor(SDL_Cursor * cursor) // Tech notes: // - SDL's blank cursor resource uses a resource ID of 5000. // - SDL's cursor resources consist of the following two files: - // - src/main/winrt/SDL2-WinRTResource_BlankCursor.cur -- cursor pixel data - // - src/main/winrt/SDL2-WinRTResources.rc -- declares the cursor resource, and its ID (of 5000) + // - src/main/winrt/SDL3-WinRTResource_BlankCursor.cur -- cursor pixel data + // - src/main/winrt/SDL3-WinRTResources.rc -- declares the cursor resource, and its ID (of 5000) // const unsigned int win32CursorResourceID = 5000; diff --git a/src/video/x11/SDL_x11video.c b/src/video/x11/SDL_x11video.c index 49f5c5b9bc..59f2cf5450 100644 --- a/src/video/x11/SDL_x11video.c +++ b/src/video/x11/SDL_x11video.c @@ -473,7 +473,7 @@ X11_VideoInit(_THIS) #endif /* SDL_VIDEO_DRIVER_X11_XFIXES */ #ifndef X_HAVE_UTF8_STRING -#warning X server does not support UTF8_STRING, a feature introduced in 2000! This is likely to become a hard error in a future libSDL2. +#warning X server does not support UTF8_STRING, a feature introduced in 2000! This is likely to become a hard error in a future libSDL3. #endif if (X11_InitKeyboard(_this) != 0) { diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 676a8e7919..8afa14f472 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.0) -project(SDL2_test) +project(SDL3_test) include(CheckCCompilerFlag) include(CMakeParseArguments) @@ -22,8 +22,8 @@ macro(add_sdl_test_executable TARGET) endif() endmacro() -if(NOT TARGET SDL2::SDL2-static) - find_package(SDL2 2.0.23 REQUIRED COMPONENTS SDL2-static SDL2test) +if(NOT TARGET SDL3::SDL3-static) + find_package(SDL3 3.0.0 REQUIRED COMPONENTS SDL3-static SDL3test) endif() enable_testing() @@ -33,14 +33,14 @@ if(SDL_INSTALL_TESTS) endif() if(N3DS) - link_libraries(SDL2::SDL2main) + link_libraries(SDL3::SDL3main) endif() if(PSP) link_libraries( - SDL2::SDL2main - SDL2::SDL2test - SDL2::SDL2-static + SDL3::SDL3main + SDL3::SDL3test + SDL3::SDL3-static GL pspvram pspvfpu @@ -54,20 +54,20 @@ if(PSP) ) elseif(PS2) link_libraries( - SDL2main - SDL2_test - SDL2-static + SDL3main + SDL3_test + SDL3-static patches gskit dmakit ps2_drivers ) else() - link_libraries(SDL2::SDL2test SDL2::SDL2-static) + link_libraries(SDL3::SDL3test SDL3::SDL3-static) endif() if(WINDOWS) - # mingw32 must come before SDL2main to link successfully + # mingw32 must come before SDL3main to link successfully if(MINGW OR CYGWIN) link_libraries(mingw32) endif() @@ -79,7 +79,7 @@ if(WINDOWS) # FIXME: Parent directory CMakeLists.txt only sets these for mingw/cygwin, # but we need them for VS as well. - link_libraries(SDL2main) + link_libraries(SDL3main) add_definitions(-Dmain=SDL_main) endif() @@ -331,8 +331,8 @@ if(N3DS) set(SMDH_FILE "${TARGET_BINARY_DIR}/${APP}.smdh") ctr_generate_smdh("${SMDH_FILE}" NAME "SDL-${APP}" - DESCRIPTION "SDL2 Test suite" - AUTHOR "SDL2 Contributors" + DESCRIPTION "SDL3 Test suite" + AUTHOR "SDL3 Contributors" ICON "${CMAKE_CURRENT_SOURCE_DIR}/n3ds/logo48x48.png" ) ctr_create_3dsx( @@ -412,11 +412,11 @@ foreach(TESTCASE ${SDL_TESTS_NONINTERACTIVE}) ) if(SDL_INSTALL_TESTS) set(exe ${TESTCASE}) - set(installedtestsdir "${CMAKE_INSTALL_FULL_LIBEXECDIR}/installed-tests/SDL2") + set(installedtestsdir "${CMAKE_INSTALL_FULL_LIBEXECDIR}/installed-tests/SDL3") configure_file(template.test.in "${exe}.test" @ONLY) install( FILES "${CMAKE_CURRENT_BINARY_DIR}/${exe}.test" - DESTINATION ${CMAKE_INSTALL_DATADIR}/installed-tests/SDL2 + DESTINATION ${CMAKE_INSTALL_DATADIR}/installed-tests/SDL3 ) endif() endforeach() @@ -428,16 +428,16 @@ if(SDL_INSTALL_TESTS) if(RISCOS) install( FILES ${SDL_TEST_EXECUTABLES_AIF} - DESTINATION ${CMAKE_INSTALL_LIBEXECDIR}/installed-tests/SDL2 + DESTINATION ${CMAKE_INSTALL_LIBEXECDIR}/installed-tests/SDL3 ) else() install( TARGETS ${SDL_TEST_EXECUTABLES} - DESTINATION ${CMAKE_INSTALL_LIBEXECDIR}/installed-tests/SDL2 + DESTINATION ${CMAKE_INSTALL_LIBEXECDIR}/installed-tests/SDL3 ) endif() install( FILES ${RESOURCE_FILES} - DESTINATION ${CMAKE_INSTALL_LIBEXECDIR}/installed-tests/SDL2 + DESTINATION ${CMAKE_INSTALL_LIBEXECDIR}/installed-tests/SDL3 ) endif() diff --git a/test/Makefile.in b/test/Makefile.in index 93df6360e8..0927871e78 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -90,8 +90,8 @@ TARGETS = \ all: Makefile $(TARGETS) copydatafiles generatetestmeta -installedtestsdir = $(libexecdir)/installed-tests/SDL2 -installedtestsmetadir = $(datadir)/installed-tests/SDL2 +installedtestsdir = $(libexecdir)/installed-tests/SDL3 +installedtestsmetadir = $(datadir)/installed-tests/SDL3 generatetestmeta: rm -f *.test diff --git a/test/Makefile.os2 b/test/Makefile.os2 index ee66409b0c..3f6daf8594 100644 --- a/test/Makefile.os2 +++ b/test/Makefile.os2 @@ -1,4 +1,4 @@ -# Open Watcom makefile to build SDL2 tests for OS/2 +# Open Watcom makefile to build SDL3 tests for OS/2 # wmake -f Makefile.os2 # # To error out upon warnings: wmake -f Makefile.os2 ENABLE_WERROR=1 diff --git a/test/Makefile.w32 b/test/Makefile.w32 index 02e68e865f..55ad493f4f 100644 --- a/test/Makefile.w32 +++ b/test/Makefile.w32 @@ -1,4 +1,4 @@ -# Open Watcom makefile to build SDL2 tests for Win32 +# Open Watcom makefile to build SDL3 tests for Win32 # wmake -f Makefile.w32 # # To error out upon warnings: wmake -f Makefile.w32 ENABLE_WERROR=1 diff --git a/test/acinclude.m4 b/test/acinclude.m4 index 0fdf353ea2..3dd4058eab 100644 --- a/test/acinclude.m4 +++ b/test/acinclude.m4 @@ -7,12 +7,12 @@ # serial 2 -dnl AM_PATH_SDL2([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) +dnl AM_PATH_SDL3([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) dnl Test for SDL, and define SDL_CFLAGS and SDL_LIBS dnl -AC_DEFUN([AM_PATH_SDL2], +AC_DEFUN([AM_PATH_SDL3], [dnl -dnl Get the cflags and libraries from the sdl2-config script +dnl Get the cflags and libraries from the sdl3-config script dnl AC_ARG_WITH(sdl-prefix,[ --with-sdl-prefix=PFX Prefix where SDL is installed (optional)], sdl_prefix="$withval", sdl_prefix="") @@ -21,52 +21,52 @@ AC_ARG_WITH(sdl-exec-prefix,[ --with-sdl-exec-prefix=PFX Exec prefix where SDL AC_ARG_ENABLE(sdltest, [ --disable-sdltest Do not try to compile and run a test SDL program], , enable_sdltest=yes) - min_sdl_version=ifelse([$1], ,2.0.0,$1) + min_sdl_version=ifelse([$1], ,3.0.0,$1) if test "x$sdl_prefix$sdl_exec_prefix" = x ; then - PKG_CHECK_MODULES([SDL], [sdl2 >= $min_sdl_version], + PKG_CHECK_MODULES([SDL], [sdl3 >= $min_sdl_version], [sdl_pc=yes], [sdl_pc=no]) else sdl_pc=no if test x$sdl_exec_prefix != x ; then sdl_config_args="$sdl_config_args --exec-prefix=$sdl_exec_prefix" - if test x${SDL2_CONFIG+set} != xset ; then - SDL2_CONFIG=$sdl_exec_prefix/bin/sdl2-config + if test x${SDL3_CONFIG+set} != xset ; then + SDL3_CONFIG=$sdl_exec_prefix/bin/sdl3-config fi fi if test x$sdl_prefix != x ; then sdl_config_args="$sdl_config_args --prefix=$sdl_prefix" - if test x${SDL2_CONFIG+set} != xset ; then - SDL2_CONFIG=$sdl_prefix/bin/sdl2-config + if test x${SDL3_CONFIG+set} != xset ; then + SDL3_CONFIG=$sdl_prefix/bin/sdl3-config fi fi fi if test "x$sdl_pc" = xyes ; then no_sdl="" - SDL2_CONFIG="pkg-config sdl2" + SDL3_CONFIG="pkg-config sdl3" else as_save_PATH="$PATH" if test "x$prefix" != xNONE && test "$cross_compiling" != yes; then PATH="$prefix/bin:$prefix/usr/bin:$PATH" fi - AC_PATH_PROG(SDL2_CONFIG, sdl2-config, no, [$PATH]) + AC_PATH_PROG(SDL3_CONFIG, sdl3-config, no, [$PATH]) PATH="$as_save_PATH" AC_MSG_CHECKING(for SDL - version >= $min_sdl_version) no_sdl="" - if test "$SDL2_CONFIG" = "no" ; then + if test "$SDL3_CONFIG" = "no" ; then no_sdl=yes else - SDL_CFLAGS=`$SDL2_CONFIG $sdl_config_args --cflags` - SDL_LIBS=`$SDL2_CONFIG $sdl_config_args --libs` + SDL_CFLAGS=`$SDL3_CONFIG $sdl_config_args --cflags` + SDL_LIBS=`$SDL3_CONFIG $sdl_config_args --libs` - sdl_major_version=`$SDL2_CONFIG $sdl_config_args --version | \ + sdl_major_version=`$SDL3_CONFIG $sdl_config_args --version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` - sdl_minor_version=`$SDL2_CONFIG $sdl_config_args --version | \ + sdl_minor_version=`$SDL3_CONFIG $sdl_config_args --version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` - sdl_micro_version=`$SDL2_CONFIG $sdl_config_args --version | \ + sdl_micro_version=`$SDL3_CONFIG $sdl_config_args --version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` if test "x$enable_sdltest" = "xyes" ; then ac_save_CFLAGS="$CFLAGS" @@ -77,7 +77,7 @@ AC_ARG_ENABLE(sdltest, [ --disable-sdltest Do not try to compile and run LIBS="$LIBS $SDL_LIBS" dnl dnl Now check if the installed SDL is sufficiently new. (Also sanity -dnl checks the results of sdl2-config to some extent +dnl checks the results of sdl3-config to some extent dnl rm -f conf.sdltest AC_RUN_IFELSE([AC_LANG_SOURCE([[ @@ -105,11 +105,11 @@ int main (int argc, char *argv[]) } else { - printf("\n*** 'sdl2-config --version' returned %d.%d.%d, but the minimum version\n", $sdl_major_version, $sdl_minor_version, $sdl_micro_version); - printf("*** of SDL required is %d.%d.%d. If sdl2-config is correct, then it is\n", major, minor, micro); + printf("\n*** 'sdl3-config --version' returned %d.%d.%d, but the minimum version\n", $sdl_major_version, $sdl_minor_version, $sdl_micro_version); + printf("*** of SDL required is %d.%d.%d. If sdl3-config is correct, then it is\n", major, minor, micro); printf("*** best to upgrade to the required version.\n"); - printf("*** If sdl2-config was wrong, set the environment variable SDL2_CONFIG\n"); - printf("*** to point to the correct copy of sdl2-config, and remove the file\n"); + printf("*** If sdl3-config was wrong, set the environment variable SDL3_CONFIG\n"); + printf("*** to point to the correct copy of sdl3-config, and remove the file\n"); printf("*** config.cache before re-running configure\n"); return 1; } @@ -130,11 +130,11 @@ int main (int argc, char *argv[]) if test "x$no_sdl" = x ; then ifelse([$2], , :, [$2]) else - if test "$SDL2_CONFIG" = "no" ; then - echo "*** The sdl2-config script installed by SDL could not be found" + if test "$SDL3_CONFIG" = "no" ; then + echo "*** The sdl3-config script installed by SDL could not be found" echo "*** If SDL was installed in PREFIX, make sure PREFIX/bin is in" - echo "*** your path, or set the SDL2_CONFIG environment variable to the" - echo "*** full path to sdl2-config." + echo "*** your path, or set the SDL3_CONFIG environment variable to the" + echo "*** full path to sdl3-config." else if test -f conf.sdltest ; then : @@ -164,7 +164,7 @@ int main(int argc, char *argv[]) [ echo "*** The test program failed to compile or link. See the file config.log for the" echo "*** exact error that occured. This usually means SDL was incorrectly installed" echo "*** or that you have moved SDL since it was installed. In the latter case, you" - echo "*** may want to edit the sdl2-config script: $SDL2_CONFIG" ]) + echo "*** may want to edit the sdl3-config script: $SDL3_CONFIG" ]) CFLAGS="$ac_save_CFLAGS" CXXFLAGS="$ac_save_CXXFLAGS" LIBS="$ac_save_LIBS" diff --git a/test/configure b/test/configure index c71abe4897..f524bd4d37 100755 --- a/test/configure +++ b/test/configure @@ -627,7 +627,7 @@ OPENGLES2_TARGETS OPENGLES1_TARGETS CPP XMKMF -SDL2_CONFIG +SDL3_CONFIG SDL_LIBS SDL_CFLAGS PKG_CONFIG_LIBDIR @@ -3719,7 +3719,7 @@ esac -SDL_VERSION=2.0.18 +SDL_VERSION=3.0.0 @@ -3881,19 +3881,19 @@ fi if test "x$sdl_prefix$sdl_exec_prefix" = x ; then pkg_failed=no -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for sdl2 >= $min_sdl_version" >&5 -printf %s "checking for sdl2 >= $min_sdl_version... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for sdl3 >= $min_sdl_version" >&5 +printf %s "checking for sdl3 >= $min_sdl_version... " >&6; } if test -n "$SDL_CFLAGS"; then pkg_cv_SDL_CFLAGS="$SDL_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"sdl2 >= \$min_sdl_version\""; } >&5 - ($PKG_CONFIG --exists --print-errors "sdl2 >= $min_sdl_version") 2>&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"sdl3 >= \$min_sdl_version\""; } >&5 + ($PKG_CONFIG --exists --print-errors "sdl3 >= $min_sdl_version") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_SDL_CFLAGS=`$PKG_CONFIG --cflags "sdl2 >= $min_sdl_version" 2>/dev/null` + pkg_cv_SDL_CFLAGS=`$PKG_CONFIG --cflags "sdl3 >= $min_sdl_version" 2>/dev/null` else pkg_failed=yes fi @@ -3904,12 +3904,12 @@ if test -n "$SDL_LIBS"; then pkg_cv_SDL_LIBS="$SDL_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"sdl2 >= \$min_sdl_version\""; } >&5 - ($PKG_CONFIG --exists --print-errors "sdl2 >= $min_sdl_version") 2>&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"sdl3 >= \$min_sdl_version\""; } >&5 + ($PKG_CONFIG --exists --print-errors "sdl3 >= $min_sdl_version") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_SDL_LIBS=`$PKG_CONFIG --libs "sdl2 >= $min_sdl_version" 2>/dev/null` + pkg_cv_SDL_LIBS=`$PKG_CONFIG --libs "sdl3 >= $min_sdl_version" 2>/dev/null` else pkg_failed=yes fi @@ -3929,9 +3929,9 @@ else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - SDL_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "sdl2 >= $min_sdl_version" 2>&1` + SDL_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "sdl3 >= $min_sdl_version" 2>&1` else - SDL_PKG_ERRORS=`$PKG_CONFIG --print-errors "sdl2 >= $min_sdl_version" 2>&1` + SDL_PKG_ERRORS=`$PKG_CONFIG --print-errors "sdl3 >= $min_sdl_version" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$SDL_PKG_ERRORS" >&5 @@ -3952,37 +3952,37 @@ fi sdl_pc=no if test x$sdl_exec_prefix != x ; then sdl_config_args="$sdl_config_args --exec-prefix=$sdl_exec_prefix" - if test x${SDL2_CONFIG+set} != xset ; then - SDL2_CONFIG=$sdl_exec_prefix/bin/sdl2-config + if test x${SDL3_CONFIG+set} != xset ; then + SDL3_CONFIG=$sdl_exec_prefix/bin/sdl3-config fi fi if test x$sdl_prefix != x ; then sdl_config_args="$sdl_config_args --prefix=$sdl_prefix" - if test x${SDL2_CONFIG+set} != xset ; then - SDL2_CONFIG=$sdl_prefix/bin/sdl2-config + if test x${SDL3_CONFIG+set} != xset ; then + SDL3_CONFIG=$sdl_prefix/bin/sdl3-config fi fi fi if test "x$sdl_pc" = xyes ; then no_sdl="" - SDL2_CONFIG="pkg-config sdl2" + SDL3_CONFIG="pkg-config sdl3" else as_save_PATH="$PATH" if test "x$prefix" != xNONE && test "$cross_compiling" != yes; then PATH="$prefix/bin:$prefix/usr/bin:$PATH" fi - # Extract the first word of "sdl2-config", so it can be a program name with args. -set dummy sdl2-config; ac_word=$2 + # Extract the first word of "sdl3-config", so it can be a program name with args. +set dummy sdl3-config; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_path_SDL2_CONFIG+y} +if test ${ac_cv_path_SDL3_CONFIG+y} then : printf %s "(cached) " >&6 else $as_nop - case $SDL2_CONFIG in + case $SDL3_CONFIG in [\\/]* | ?:[\\/]*) - ac_cv_path_SDL2_CONFIG="$SDL2_CONFIG" # Let the user override the test with a path. + ac_cv_path_SDL3_CONFIG="$SDL3_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -3996,7 +3996,7 @@ do esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_path_SDL2_CONFIG="$as_dir$ac_word$ac_exec_ext" + ac_cv_path_SDL3_CONFIG="$as_dir$ac_word$ac_exec_ext" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi @@ -4004,14 +4004,14 @@ done done IFS=$as_save_IFS - test -z "$ac_cv_path_SDL2_CONFIG" && ac_cv_path_SDL2_CONFIG="no" + test -z "$ac_cv_path_SDL3_CONFIG" && ac_cv_path_SDL3_CONFIG="no" ;; esac fi -SDL2_CONFIG=$ac_cv_path_SDL2_CONFIG -if test -n "$SDL2_CONFIG"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $SDL2_CONFIG" >&5 -printf "%s\n" "$SDL2_CONFIG" >&6; } +SDL3_CONFIG=$ac_cv_path_SDL3_CONFIG +if test -n "$SDL3_CONFIG"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $SDL3_CONFIG" >&5 +printf "%s\n" "$SDL3_CONFIG" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } @@ -4023,17 +4023,17 @@ fi printf %s "checking for SDL - version >= $min_sdl_version... " >&6; } no_sdl="" - if test "$SDL2_CONFIG" = "no" ; then + if test "$SDL3_CONFIG" = "no" ; then no_sdl=yes else - SDL_CFLAGS=`$SDL2_CONFIG $sdl_config_args --cflags` - SDL_LIBS=`$SDL2_CONFIG $sdl_config_args --libs` + SDL_CFLAGS=`$SDL3_CONFIG $sdl_config_args --cflags` + SDL_LIBS=`$SDL3_CONFIG $sdl_config_args --libs` - sdl_major_version=`$SDL2_CONFIG $sdl_config_args --version | \ + sdl_major_version=`$SDL3_CONFIG $sdl_config_args --version | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'` - sdl_minor_version=`$SDL2_CONFIG $sdl_config_args --version | \ + sdl_minor_version=`$SDL3_CONFIG $sdl_config_args --version | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'` - sdl_micro_version=`$SDL2_CONFIG $sdl_config_args --version | \ + sdl_micro_version=`$SDL3_CONFIG $sdl_config_args --version | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'` if test "x$enable_sdltest" = "xyes" ; then ac_save_CFLAGS="$CFLAGS" @@ -4074,11 +4074,11 @@ int main (int argc, char *argv[]) } else { - printf("\n*** 'sdl2-config --version' returned %d.%d.%d, but the minimum version\n", $sdl_major_version, $sdl_minor_version, $sdl_micro_version); - printf("*** of SDL required is %d.%d.%d. If sdl2-config is correct, then it is\n", major, minor, micro); + printf("\n*** 'sdl3-config --version' returned %d.%d.%d, but the minimum version\n", $sdl_major_version, $sdl_minor_version, $sdl_micro_version); + printf("*** of SDL required is %d.%d.%d. If sdl3-config is correct, then it is\n", major, minor, micro); printf("*** best to upgrade to the required version.\n"); - printf("*** If sdl2-config was wrong, set the environment variable SDL2_CONFIG\n"); - printf("*** to point to the correct copy of sdl2-config, and remove the file\n"); + printf("*** If sdl3-config was wrong, set the environment variable SDL3_CONFIG\n"); + printf("*** to point to the correct copy of sdl3-config, and remove the file\n"); printf("*** config.cache before re-running configure\n"); return 1; } @@ -4112,11 +4112,11 @@ printf "%s\n" "no" >&6; } if test "x$no_sdl" = x ; then : else - if test "$SDL2_CONFIG" = "no" ; then - echo "*** The sdl2-config script installed by SDL could not be found" + if test "$SDL3_CONFIG" = "no" ; then + echo "*** The sdl3-config script installed by SDL could not be found" echo "*** If SDL was installed in PREFIX, make sure PREFIX/bin is in" - echo "*** your path, or set the SDL2_CONFIG environment variable to the" - echo "*** full path to sdl2-config." + echo "*** your path, or set the SDL3_CONFIG environment variable to the" + echo "*** full path to sdl3-config." else if test -f conf.sdltest ; then : @@ -4159,7 +4159,7 @@ else $as_nop echo "*** The test program failed to compile or link. See the file config.log for the" echo "*** exact error that occured. This usually means SDL was incorrectly installed" echo "*** or that you have moved SDL since it was installed. In the latter case, you" - echo "*** may want to edit the sdl2-config script: $SDL2_CONFIG" + echo "*** may want to edit the sdl3-config script: $SDL3_CONFIG" fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -4178,7 +4178,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam \ rm -f conf.sdltest CFLAGS="$CFLAGS $SDL_CFLAGS" -LIBS="$LIBS -lSDL2_test $SDL_LIBS" +LIBS="$LIBS -lSDL3_test $SDL_LIBS" ac_ext=c ac_cpp='$CPP $CPPFLAGS' @@ -4832,14 +4832,14 @@ esac -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for TTF_Init in -lSDL2_ttf" >&5 -printf %s "checking for TTF_Init in -lSDL2_ttf... " >&6; } -if test ${ac_cv_lib_SDL2_ttf_TTF_Init+y} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for TTF_Init in -lSDL3_ttf" >&5 +printf %s "checking for TTF_Init in -lSDL3_ttf... " >&6; } +if test ${ac_cv_lib_SDL3_ttf_TTF_Init+y} then : printf %s "(cached) " >&6 else $as_nop ac_check_lib_save_LIBS=$LIBS -LIBS="-lSDL2_ttf $LIBS" +LIBS="-lSDL3_ttf $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -4857,24 +4857,24 @@ return TTF_Init (); _ACEOF if ac_fn_c_try_link "$LINENO" then : - ac_cv_lib_SDL2_ttf_TTF_Init=yes + ac_cv_lib_SDL3_ttf_TTF_Init=yes else $as_nop - ac_cv_lib_SDL2_ttf_TTF_Init=no + ac_cv_lib_SDL3_ttf_TTF_Init=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_SDL2_ttf_TTF_Init" >&5 -printf "%s\n" "$ac_cv_lib_SDL2_ttf_TTF_Init" >&6; } -if test "x$ac_cv_lib_SDL2_ttf_TTF_Init" = xyes +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_SDL3_ttf_TTF_Init" >&5 +printf "%s\n" "$ac_cv_lib_SDL3_ttf_TTF_Init" >&6; } +if test "x$ac_cv_lib_SDL3_ttf_TTF_Init" = xyes then : have_SDL_ttf=yes fi if test x$have_SDL_ttf = xyes; then CFLAGS="$CFLAGS -DHAVE_SDL_TTF" - SDL_TTF_LIB="-lSDL2_ttf" + SDL_TTF_LIB="-lSDL3_ttf" fi diff --git a/test/configure.ac b/test/configure.ac index e9890163e6..60b60ada13 100644 --- a/test/configure.ac +++ b/test/configure.ac @@ -100,13 +100,13 @@ AC_SUBST(ISUNIX) AC_SUBST(ISOS2) dnl Check for SDL -SDL_VERSION=2.0.18 -AM_PATH_SDL2($SDL_VERSION, +SDL_VERSION=3.0.0 +AM_PATH_SDL3($SDL_VERSION, :, AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!]) ) CFLAGS="$CFLAGS $SDL_CFLAGS" -LIBS="$LIBS -lSDL2_test $SDL_LIBS" +LIBS="$LIBS -lSDL3_test $SDL_LIBS" dnl Check for X11 path, needed for OpenGL on some systems AC_PATH_X @@ -267,18 +267,18 @@ AC_SUBST(GLES2LIB) AC_SUBST(XLIB) dnl Check for SDL_ttf -AC_CHECK_LIB(SDL2_ttf, TTF_Init, have_SDL_ttf=yes) +AC_CHECK_LIB(SDL3_ttf, TTF_Init, have_SDL_ttf=yes) if test x$have_SDL_ttf = xyes; then CFLAGS="$CFLAGS -DHAVE_SDL_TTF" - SDL_TTF_LIB="-lSDL2_ttf" + SDL_TTF_LIB="-lSDL3_ttf" fi AC_SUBST(SDL_TTF_LIB) -dnl Really, SDL2_test should be linking against libunwind (if it found -dnl libunwind.h when configured), but SDL2_test is a static library, so -dnl there's no way for it to link against it. We could make SDL2 depend on -dnl it, but we don't want all SDL2 build to suddenly gain an extra dependency, -dnl so just assume that if it's here now, SDL2_test was probably built with it. +dnl Really, SDL3_test should be linking against libunwind (if it found +dnl libunwind.h when configured), but SDL3_test is a static library, so +dnl there's no way for it to link against it. We could make SDL3 depend on +dnl it, but we don't want all SDL3 build to suddenly gain an extra dependency, +dnl so just assume that if it's here now, SDL3_test was probably built with it. PKG_CHECK_MODULES(LIBUNWIND, libunwind, have_libunwind=yes, have_libunwind=no) if test x$have_libunwind = xyes ; then LIBS="$LIBS $LIBUNWIND_LIBS" diff --git a/test/nacl/Makefile b/test/nacl/Makefile index 9ca166c127..ca7a030471 100644 --- a/test/nacl/Makefile +++ b/test/nacl/Makefile @@ -13,8 +13,8 @@ include $(NACL_SDK_ROOT)/tools/common.mk TARGET = sdl_app DEPS = ppapi_simple nacl_io -# ppapi_simple and SDL2 end up being listed twice due to dependency solving issues -- Gabriel -LIBS = SDL2_test SDL2 ppapi_simple SDL2main SDL2 $(DEPS) ppapi_gles2 ppapi_cpp ppapi pthread +# ppapi_simple and SDL3 end up being listed twice due to dependency solving issues -- Gabriel +LIBS = SDL3_test SDL3 ppapi_simple SDL3main SDL3 $(DEPS) ppapi_gles2 ppapi_cpp ppapi pthread CFLAGS := -Wall SOURCES ?= testgles2.c diff --git a/test/testautomation_audio.c b/test/testautomation_audio.c index e6127b5730..3ba3094ead 100644 --- a/test/testautomation_audio.c +++ b/test/testautomation_audio.c @@ -948,7 +948,7 @@ int audio_openCloseAudioDeviceConnected() SDLTest_AssertCheck(id > 1, "Validate device ID; expected: >1, got: %" SDL_PRIu32, id); if (id > 1) { -/* TODO: enable test code when function is available in SDL2 */ +/* TODO: enable test code when function is available in SDL3 */ #ifdef AUDIODEVICECONNECTED_DEFINED /* Get connected status */ diff --git a/test/testver.c b/test/testver.c index cbbba7ec6d..bf6983480e 100644 --- a/test/testver.c +++ b/test/testver.c @@ -29,10 +29,10 @@ main(int argc, char *argv[]) /* Enable standard application logging */ SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); -#if SDL_VERSION_ATLEAST(2, 0, 0) - SDL_Log("Compiled with SDL 2.0 or newer\n"); +#if SDL_VERSION_ATLEAST(3, 0, 0) + SDL_Log("Compiled with SDL 3.0 or newer\n"); #else - SDL_Log("Compiled with SDL older than 2.0\n"); + SDL_Log("Compiled with SDL older than 3.0\n"); #endif SDL_VERSION(&compiled); SDL_Log("Compiled version: %d.%d.%d (%s)\n", diff --git a/test/watcom.mif b/test/watcom.mif index 2189fd49c2..6d0d9d405f 100644 --- a/test/watcom.mif +++ b/test/watcom.mif @@ -1,9 +1,9 @@ INCPATH+= -I"../include" LIBPATH = .. -LIBS = SDL2.lib SDL2test.lib testutils.lib +LIBS = SDL3.lib SDL3test.lib testutils.lib #CFLAGS+= -DHAVE_SDL_TTF -#TTFLIBS = SDL2ttf.lib +#TTFLIBS = SDL3ttf.lib CFLAGS+= $(INCPATH) @@ -106,14 +106,14 @@ testutils.lib: testutils.obj check: .SYMBOLIC $(TESTS) @set SDL_AUDIODRIVER=dummy @set SDL_VIDEODRIVER=dummy - @copy "../SDL2.dll" . + @copy "../SDL3.dll" . @for %exe in ($(TESTS)) do %exe check-quick: .SYMBOLIC $(TESTS) @set SDL_TESTS_QUICK=1 @set SDL_AUDIODRIVER=dummy @set SDL_VIDEODRIVER=dummy - @copy "../SDL2.dll" . + @copy "../SDL3.dll" . @for %exe in ($(TESTS)) do %exe clean: .SYMBOLIC diff --git a/visualtest/COPYING.txt b/visualtest/COPYING.txt index 6a3adc9014..a92fe14bc0 100644 --- a/visualtest/COPYING.txt +++ b/visualtest/COPYING.txt @@ -1,4 +1,4 @@ -Visual and Interactive Test Automation for SDL 2.0 +Visual and Interactive Test Automation for SDL 3.0 Copyright (C) 2013 Apoorv Upreti This software is provided 'as-is', without any express or implied diff --git a/visualtest/acinclude.m4 b/visualtest/acinclude.m4 index 0fdf353ea2..3dd4058eab 100644 --- a/visualtest/acinclude.m4 +++ b/visualtest/acinclude.m4 @@ -7,12 +7,12 @@ # serial 2 -dnl AM_PATH_SDL2([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) +dnl AM_PATH_SDL3([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) dnl Test for SDL, and define SDL_CFLAGS and SDL_LIBS dnl -AC_DEFUN([AM_PATH_SDL2], +AC_DEFUN([AM_PATH_SDL3], [dnl -dnl Get the cflags and libraries from the sdl2-config script +dnl Get the cflags and libraries from the sdl3-config script dnl AC_ARG_WITH(sdl-prefix,[ --with-sdl-prefix=PFX Prefix where SDL is installed (optional)], sdl_prefix="$withval", sdl_prefix="") @@ -21,52 +21,52 @@ AC_ARG_WITH(sdl-exec-prefix,[ --with-sdl-exec-prefix=PFX Exec prefix where SDL AC_ARG_ENABLE(sdltest, [ --disable-sdltest Do not try to compile and run a test SDL program], , enable_sdltest=yes) - min_sdl_version=ifelse([$1], ,2.0.0,$1) + min_sdl_version=ifelse([$1], ,3.0.0,$1) if test "x$sdl_prefix$sdl_exec_prefix" = x ; then - PKG_CHECK_MODULES([SDL], [sdl2 >= $min_sdl_version], + PKG_CHECK_MODULES([SDL], [sdl3 >= $min_sdl_version], [sdl_pc=yes], [sdl_pc=no]) else sdl_pc=no if test x$sdl_exec_prefix != x ; then sdl_config_args="$sdl_config_args --exec-prefix=$sdl_exec_prefix" - if test x${SDL2_CONFIG+set} != xset ; then - SDL2_CONFIG=$sdl_exec_prefix/bin/sdl2-config + if test x${SDL3_CONFIG+set} != xset ; then + SDL3_CONFIG=$sdl_exec_prefix/bin/sdl3-config fi fi if test x$sdl_prefix != x ; then sdl_config_args="$sdl_config_args --prefix=$sdl_prefix" - if test x${SDL2_CONFIG+set} != xset ; then - SDL2_CONFIG=$sdl_prefix/bin/sdl2-config + if test x${SDL3_CONFIG+set} != xset ; then + SDL3_CONFIG=$sdl_prefix/bin/sdl3-config fi fi fi if test "x$sdl_pc" = xyes ; then no_sdl="" - SDL2_CONFIG="pkg-config sdl2" + SDL3_CONFIG="pkg-config sdl3" else as_save_PATH="$PATH" if test "x$prefix" != xNONE && test "$cross_compiling" != yes; then PATH="$prefix/bin:$prefix/usr/bin:$PATH" fi - AC_PATH_PROG(SDL2_CONFIG, sdl2-config, no, [$PATH]) + AC_PATH_PROG(SDL3_CONFIG, sdl3-config, no, [$PATH]) PATH="$as_save_PATH" AC_MSG_CHECKING(for SDL - version >= $min_sdl_version) no_sdl="" - if test "$SDL2_CONFIG" = "no" ; then + if test "$SDL3_CONFIG" = "no" ; then no_sdl=yes else - SDL_CFLAGS=`$SDL2_CONFIG $sdl_config_args --cflags` - SDL_LIBS=`$SDL2_CONFIG $sdl_config_args --libs` + SDL_CFLAGS=`$SDL3_CONFIG $sdl_config_args --cflags` + SDL_LIBS=`$SDL3_CONFIG $sdl_config_args --libs` - sdl_major_version=`$SDL2_CONFIG $sdl_config_args --version | \ + sdl_major_version=`$SDL3_CONFIG $sdl_config_args --version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` - sdl_minor_version=`$SDL2_CONFIG $sdl_config_args --version | \ + sdl_minor_version=`$SDL3_CONFIG $sdl_config_args --version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` - sdl_micro_version=`$SDL2_CONFIG $sdl_config_args --version | \ + sdl_micro_version=`$SDL3_CONFIG $sdl_config_args --version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` if test "x$enable_sdltest" = "xyes" ; then ac_save_CFLAGS="$CFLAGS" @@ -77,7 +77,7 @@ AC_ARG_ENABLE(sdltest, [ --disable-sdltest Do not try to compile and run LIBS="$LIBS $SDL_LIBS" dnl dnl Now check if the installed SDL is sufficiently new. (Also sanity -dnl checks the results of sdl2-config to some extent +dnl checks the results of sdl3-config to some extent dnl rm -f conf.sdltest AC_RUN_IFELSE([AC_LANG_SOURCE([[ @@ -105,11 +105,11 @@ int main (int argc, char *argv[]) } else { - printf("\n*** 'sdl2-config --version' returned %d.%d.%d, but the minimum version\n", $sdl_major_version, $sdl_minor_version, $sdl_micro_version); - printf("*** of SDL required is %d.%d.%d. If sdl2-config is correct, then it is\n", major, minor, micro); + printf("\n*** 'sdl3-config --version' returned %d.%d.%d, but the minimum version\n", $sdl_major_version, $sdl_minor_version, $sdl_micro_version); + printf("*** of SDL required is %d.%d.%d. If sdl3-config is correct, then it is\n", major, minor, micro); printf("*** best to upgrade to the required version.\n"); - printf("*** If sdl2-config was wrong, set the environment variable SDL2_CONFIG\n"); - printf("*** to point to the correct copy of sdl2-config, and remove the file\n"); + printf("*** If sdl3-config was wrong, set the environment variable SDL3_CONFIG\n"); + printf("*** to point to the correct copy of sdl3-config, and remove the file\n"); printf("*** config.cache before re-running configure\n"); return 1; } @@ -130,11 +130,11 @@ int main (int argc, char *argv[]) if test "x$no_sdl" = x ; then ifelse([$2], , :, [$2]) else - if test "$SDL2_CONFIG" = "no" ; then - echo "*** The sdl2-config script installed by SDL could not be found" + if test "$SDL3_CONFIG" = "no" ; then + echo "*** The sdl3-config script installed by SDL could not be found" echo "*** If SDL was installed in PREFIX, make sure PREFIX/bin is in" - echo "*** your path, or set the SDL2_CONFIG environment variable to the" - echo "*** full path to sdl2-config." + echo "*** your path, or set the SDL3_CONFIG environment variable to the" + echo "*** full path to sdl3-config." else if test -f conf.sdltest ; then : @@ -164,7 +164,7 @@ int main(int argc, char *argv[]) [ echo "*** The test program failed to compile or link. See the file config.log for the" echo "*** exact error that occured. This usually means SDL was incorrectly installed" echo "*** or that you have moved SDL since it was installed. In the latter case, you" - echo "*** may want to edit the sdl2-config script: $SDL2_CONFIG" ]) + echo "*** may want to edit the sdl3-config script: $SDL3_CONFIG" ]) CFLAGS="$ac_save_CFLAGS" CXXFLAGS="$ac_save_CXXFLAGS" LIBS="$ac_save_LIBS" diff --git a/visualtest/configure b/visualtest/configure index ca7c71eb08..b9576830ab 100755 --- a/visualtest/configure +++ b/visualtest/configure @@ -586,7 +586,7 @@ ac_subst_vars='LTLIBOBJS LIBOBJS LIBUNWIND_LIBS LIBUNWIND_CFLAGS -SDL2_CONFIG +SDL3_CONFIG SDL_LIBS SDL_CFLAGS PKG_CONFIG_LIBDIR @@ -2919,19 +2919,19 @@ fi if test "x$sdl_prefix$sdl_exec_prefix" = x ; then pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sdl2 >= $min_sdl_version" >&5 -$as_echo_n "checking for sdl2 >= $min_sdl_version... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sdl3 >= $min_sdl_version" >&5 +$as_echo_n "checking for sdl3 >= $min_sdl_version... " >&6; } if test -n "$SDL_CFLAGS"; then pkg_cv_SDL_CFLAGS="$SDL_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"sdl2 >= \$min_sdl_version\""; } >&5 - ($PKG_CONFIG --exists --print-errors "sdl2 >= $min_sdl_version") 2>&5 + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"sdl3 >= \$min_sdl_version\""; } >&5 + ($PKG_CONFIG --exists --print-errors "sdl3 >= $min_sdl_version") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_SDL_CFLAGS=`$PKG_CONFIG --cflags "sdl2 >= $min_sdl_version" 2>/dev/null` + pkg_cv_SDL_CFLAGS=`$PKG_CONFIG --cflags "sdl3 >= $min_sdl_version" 2>/dev/null` else pkg_failed=yes fi @@ -2942,12 +2942,12 @@ if test -n "$SDL_LIBS"; then pkg_cv_SDL_LIBS="$SDL_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"sdl2 >= \$min_sdl_version\""; } >&5 - ($PKG_CONFIG --exists --print-errors "sdl2 >= $min_sdl_version") 2>&5 + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"sdl3 >= \$min_sdl_version\""; } >&5 + ($PKG_CONFIG --exists --print-errors "sdl3 >= $min_sdl_version") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_SDL_LIBS=`$PKG_CONFIG --libs "sdl2 >= $min_sdl_version" 2>/dev/null` + pkg_cv_SDL_LIBS=`$PKG_CONFIG --libs "sdl3 >= $min_sdl_version" 2>/dev/null` else pkg_failed=yes fi @@ -2967,9 +2967,9 @@ else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - SDL_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "sdl2 >= $min_sdl_version" 2>&1` + SDL_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "sdl3 >= $min_sdl_version" 2>&1` else - SDL_PKG_ERRORS=`$PKG_CONFIG --print-errors "sdl2 >= $min_sdl_version" 2>&1` + SDL_PKG_ERRORS=`$PKG_CONFIG --print-errors "sdl3 >= $min_sdl_version" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$SDL_PKG_ERRORS" >&5 @@ -2990,36 +2990,36 @@ fi sdl_pc=no if test x$sdl_exec_prefix != x ; then sdl_config_args="$sdl_config_args --exec-prefix=$sdl_exec_prefix" - if test x${SDL2_CONFIG+set} != xset ; then - SDL2_CONFIG=$sdl_exec_prefix/bin/sdl2-config + if test x${SDL3_CONFIG+set} != xset ; then + SDL3_CONFIG=$sdl_exec_prefix/bin/sdl3-config fi fi if test x$sdl_prefix != x ; then sdl_config_args="$sdl_config_args --prefix=$sdl_prefix" - if test x${SDL2_CONFIG+set} != xset ; then - SDL2_CONFIG=$sdl_prefix/bin/sdl2-config + if test x${SDL3_CONFIG+set} != xset ; then + SDL3_CONFIG=$sdl_prefix/bin/sdl3-config fi fi fi if test "x$sdl_pc" = xyes ; then no_sdl="" - SDL2_CONFIG="pkg-config sdl2" + SDL3_CONFIG="pkg-config sdl3" else as_save_PATH="$PATH" if test "x$prefix" != xNONE && test "$cross_compiling" != yes; then PATH="$prefix/bin:$prefix/usr/bin:$PATH" fi - # Extract the first word of "sdl2-config", so it can be a program name with args. -set dummy sdl2-config; ac_word=$2 + # Extract the first word of "sdl3-config", so it can be a program name with args. +set dummy sdl3-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_SDL2_CONFIG+:} false; then : +if ${ac_cv_path_SDL3_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else - case $SDL2_CONFIG in + case $SDL3_CONFIG in [\\/]* | ?:[\\/]*) - ac_cv_path_SDL2_CONFIG="$SDL2_CONFIG" # Let the user override the test with a path. + ac_cv_path_SDL3_CONFIG="$SDL3_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -3029,7 +3029,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_SDL2_CONFIG="$as_dir/$ac_word$ac_exec_ext" + ac_cv_path_SDL3_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -3037,14 +3037,14 @@ done done IFS=$as_save_IFS - test -z "$ac_cv_path_SDL2_CONFIG" && ac_cv_path_SDL2_CONFIG="no" + test -z "$ac_cv_path_SDL3_CONFIG" && ac_cv_path_SDL3_CONFIG="no" ;; esac fi -SDL2_CONFIG=$ac_cv_path_SDL2_CONFIG -if test -n "$SDL2_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SDL2_CONFIG" >&5 -$as_echo "$SDL2_CONFIG" >&6; } +SDL3_CONFIG=$ac_cv_path_SDL3_CONFIG +if test -n "$SDL3_CONFIG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SDL3_CONFIG" >&5 +$as_echo "$SDL3_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } @@ -3056,17 +3056,17 @@ fi $as_echo_n "checking for SDL - version >= $min_sdl_version... " >&6; } no_sdl="" - if test "$SDL2_CONFIG" = "no" ; then + if test "$SDL3_CONFIG" = "no" ; then no_sdl=yes else - SDL_CFLAGS=`$SDL2_CONFIG $sdl_config_args --cflags` - SDL_LIBS=`$SDL2_CONFIG $sdl_config_args --libs` + SDL_CFLAGS=`$SDL3_CONFIG $sdl_config_args --cflags` + SDL_LIBS=`$SDL3_CONFIG $sdl_config_args --libs` - sdl_major_version=`$SDL2_CONFIG $sdl_config_args --version | \ + sdl_major_version=`$SDL3_CONFIG $sdl_config_args --version | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'` - sdl_minor_version=`$SDL2_CONFIG $sdl_config_args --version | \ + sdl_minor_version=`$SDL3_CONFIG $sdl_config_args --version | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'` - sdl_micro_version=`$SDL2_CONFIG $sdl_config_args --version | \ + sdl_micro_version=`$SDL3_CONFIG $sdl_config_args --version | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'` if test "x$enable_sdltest" = "xyes" ; then ac_save_CFLAGS="$CFLAGS" @@ -3106,11 +3106,11 @@ int main (int argc, char *argv[]) } else { - printf("\n*** 'sdl2-config --version' returned %d.%d.%d, but the minimum version\n", $sdl_major_version, $sdl_minor_version, $sdl_micro_version); - printf("*** of SDL required is %d.%d.%d. If sdl2-config is correct, then it is\n", major, minor, micro); + printf("\n*** 'sdl3-config --version' returned %d.%d.%d, but the minimum version\n", $sdl_major_version, $sdl_minor_version, $sdl_micro_version); + printf("*** of SDL required is %d.%d.%d. If sdl3-config is correct, then it is\n", major, minor, micro); printf("*** best to upgrade to the required version.\n"); - printf("*** If sdl2-config was wrong, set the environment variable SDL2_CONFIG\n"); - printf("*** to point to the correct copy of sdl2-config, and remove the file\n"); + printf("*** If sdl3-config was wrong, set the environment variable SDL3_CONFIG\n"); + printf("*** to point to the correct copy of sdl3-config, and remove the file\n"); printf("*** config.cache before re-running configure\n"); return 1; } @@ -3143,11 +3143,11 @@ $as_echo "no" >&6; } if test "x$no_sdl" = x ; then : else - if test "$SDL2_CONFIG" = "no" ; then - echo "*** The sdl2-config script installed by SDL could not be found" + if test "$SDL3_CONFIG" = "no" ; then + echo "*** The sdl3-config script installed by SDL could not be found" echo "*** If SDL was installed in PREFIX, make sure PREFIX/bin is in" - echo "*** your path, or set the SDL2_CONFIG environment variable to the" - echo "*** full path to sdl2-config." + echo "*** your path, or set the SDL3_CONFIG environment variable to the" + echo "*** full path to sdl3-config." else if test -f conf.sdltest ; then : @@ -3189,7 +3189,7 @@ else echo "*** The test program failed to compile or link. See the file config.log for the" echo "*** exact error that occured. This usually means SDL was incorrectly installed" echo "*** or that you have moved SDL since it was installed. In the latter case, you" - echo "*** may want to edit the sdl2-config script: $SDL2_CONFIG" + echo "*** may want to edit the sdl3-config script: $SDL3_CONFIG" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext @@ -3208,7 +3208,7 @@ rm -f core conftest.err conftest.$ac_objext \ rm -f conf.sdltest CFLAGS="$CFLAGS $SDL_CFLAGS" -LIBS="$LIBS -lSDL2_test $SDL_LIBS $EXTRALIB" +LIBS="$LIBS -lSDL3_test $SDL_LIBS $EXTRALIB" pkg_failed=no diff --git a/visualtest/configure.ac b/visualtest/configure.ac index 3566bf0d83..d36d891035 100644 --- a/visualtest/configure.ac +++ b/visualtest/configure.ac @@ -23,13 +23,13 @@ esac AC_SUBST(EXE) dnl Check for SDL -SDL_VERSION=2.0.0 -AM_PATH_SDL2($SDL_VERSION, +SDL_VERSION=3.0.0 +AM_PATH_SDL3($SDL_VERSION, :, AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!]) ) CFLAGS="$CFLAGS $SDL_CFLAGS" -LIBS="$LIBS -lSDL2_test $SDL_LIBS $EXTRALIB" +LIBS="$LIBS -lSDL3_test $SDL_LIBS $EXTRALIB" PKG_CHECK_MODULES(LIBUNWIND, libunwind, have_libunwind=yes, have_libunwind=no) if test x$have_libunwind = xyes ; then From 1b9c4c5ca1d166a88fed14d5026574f072c03571 Mon Sep 17 00:00:00 2001 From: SDL Wiki Bot Date: Tue, 22 Nov 2022 04:30:16 +0000 Subject: [PATCH 102/153] Sync SDL wiki -> header --- include/SDL_audio.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/SDL_audio.h b/include/SDL_audio.h index ee6c5e0922..3ad8e6c9d8 100644 --- a/include/SDL_audio.h +++ b/include/SDL_audio.h @@ -1211,9 +1211,9 @@ extern DECLSPEC void SDLCALL SDL_MixAudioFormat(Uint8 * dst, * You should not call SDL_LockAudio() on the device before queueing; SDL * handles locking internally for this function. * - * Note that SDL does not support planar audio. You will need to resample - * from planar audio formats into a non-planar one (see SDL_AudioFormat) - * before queuing audio. + * Note that SDL does not support planar audio. You will need to resample from + * planar audio formats into a non-planar one (see SDL_AudioFormat) before + * queuing audio. * * \param dev the device ID to which we will queue audio * \param data the data to queue to the device for later playback From ea21628045860c6f4b39b411d0a43ae32f51ccc7 Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Tue, 22 Nov 2022 06:36:19 +0100 Subject: [PATCH 103/153] ci: replace references to SDL2 with SDL3 --- .github/workflows/android.yml | 14 +++++++------- .github/workflows/emscripten.yml | 4 ++-- .github/workflows/main.yml | 30 +++++++++++++++--------------- .github/workflows/msvc.yml | 6 +++--- .github/workflows/n3ds.yml | 4 ++-- .github/workflows/ps2.yaml | 12 ++++++------ .github/workflows/psp.yaml | 12 ++++++------ .github/workflows/riscos.yml | 6 +++--- .github/workflows/vita.yaml | 12 ++++++------ .github/workflows/watcom.yml | 2 +- 10 files changed, 51 insertions(+), 51 deletions(-) diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index ccc02666f1..0cfda01d11 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -50,7 +50,7 @@ jobs: if: ${{ matrix.platform.name == 'CMake' }} run: | cmake --install build --config Release - echo "SDL2_DIR=$(pwd)/prefix" >> $GITHUB_ENV + echo "SDL3_DIR=$(pwd)/prefix" >> $GITHUB_ENV ( cd prefix; find ) | LC_ALL=C sort -u - name: Verify CMake configuration files if: ${{ matrix.platform.name == 'CMake' }} @@ -60,22 +60,22 @@ jobs: -DANDROID_PLATFORM=${{ matrix.platform.android_platform }} \ -DANDROID_ABI=${{ matrix.platform.android_abi }} \ -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_PREFIX_PATH=${{ env.SDL2_DIR }} + -DCMAKE_PREFIX_PATH=${{ env.SDL3_DIR }} cmake --build cmake_config_build --verbose - - name: Verify sdl2-config + - name: Verify sdl3-config if: ${{ matrix.platform.name == 'CMake' }} run: | export CC="${{ steps.setup_ndk.outputs.ndk-path }}/toolchains/llvm/prebuilt/linux-x86_64/bin/clang --target=${{ matrix.platform.arch }}-none-linux-androideabi${{ matrix.platform.android_platform }}" - export PATH=${{ env.SDL2_DIR }}/bin:$PATH + export PATH=${{ env.SDL3_DIR }}/bin:$PATH cmake/test/test_sdlconfig.sh - - name: Verify sdl2.pc + - name: Verify sdl3.pc if: ${{ matrix.platform.name == 'CMake' }} run: | export CC="${{ steps.setup_ndk.outputs.ndk-path }}/toolchains/llvm/prebuilt/linux-x86_64/bin/clang --target=${{ matrix.platform.arch }}-none-linux-androideabi${{ matrix.platform.android_platform }}" - export PKG_CONFIG_PATH=${{ env.SDL2_DIR }}/lib/pkgconfig + export PKG_CONFIG_PATH=${{ env.SDL3_DIR }}/lib/pkgconfig cmake/test/test_pkgconfig.sh - name: Verify Android.mk if: ${{ matrix.platform.name == 'CMake' }} run: | - export NDK_MODULE_PATH=${{ env.SDL2_DIR }}/share/ndk-modules + export NDK_MODULE_PATH=${{ env.SDL3_DIR }}/share/ndk-modules ndk-build -C ${{ github.workspace }}/cmake/test APP_PLATFORM=android-${{ matrix.platform.android_platform }} APP_ABI=${{ matrix.platform.android_abi }} NDK_OUT=$PWD NDK_LIBS_OUT=$PWD V=1 diff --git a/.github/workflows/emscripten.yml b/.github/workflows/emscripten.yml index 56f77b6ce0..0a5cd7bc17 100644 --- a/.github/workflows/emscripten.yml +++ b/.github/workflows/emscripten.yml @@ -33,7 +33,7 @@ jobs: # ctest -VV --test-dir build/ - name: Install run: | - echo "SDL2_DIR=$(pwd)/prefix" >> $GITHUB_ENV + echo "SDL3_DIR=$(pwd)/prefix" >> $GITHUB_ENV cmake --install build/ - name: Verify CMake configuration files run: | @@ -41,5 +41,5 @@ jobs: -DCMAKE_BUILD_TYPE=Release \ -DSDL_VENDOR_INFO="Github Workflow" \ -DTEST_SHARED=FALSE \ - -DCMAKE_PREFIX_PATH=${{ env.SDL2_DIR }} + -DCMAKE_PREFIX_PATH=${{ env.SDL3_DIR }} cmake --build cmake_config_build --verbose diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b09ae9447a..250f8905ce 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -88,14 +88,14 @@ jobs: ctest -VV --test-dir build/ if test "${{ runner.os }}" = "Linux"; then # This should show us the SDL_REVISION - strings build/libSDL2-2.0.so.0 | grep SDL- + strings build/libSDL3-3.0.so.0 | grep SDL- fi - name: Install (CMake) if: "! matrix.platform.autotools" run: | set -eu cmake --install build/ --config Release - echo "SDL2_DIR=$(pwd)/cmake_prefix" >> $GITHUB_ENV + echo "SDL3_DIR=$(pwd)/cmake_prefix" >> $GITHUB_ENV ( cd cmake_prefix; find ) | LC_ALL=C sort -u - name: Configure (Autotools) if: matrix.platform.autotools @@ -123,8 +123,8 @@ jobs: --x-libraries="/usr/lib/${multiarch}" \ --prefix=${{ github.workspace }}/autotools_prefix \ SDL_CFLAGS="-I${curdir}/include" \ - SDL_LIBS="-L${curdir}/build-autotools/build/.libs -lSDL2" \ - ac_cv_lib_SDL2_ttf_TTF_Init=no \ + SDL_LIBS="-L${curdir}/build-autotools/build/.libs -lSDL3" \ + ac_cv_lib_SDL3_ttf_TTF_Init=no \ ${NULL+} ) fi @@ -147,7 +147,7 @@ jobs: make -j"${parallel}" -C build-autotools/test check LD_LIBRARY_PATH="${curdir}/build-autotools/build/.libs" if test "${{ runner.os }}" = "Linux"; then # This should show us the SDL_REVISION - strings "${curdir}/build-autotools/build/.libs/libSDL2-2.0.so.0" | grep SDL- + strings "${curdir}/build-autotools/build/.libs/libSDL3-3.0.so.0" | grep SDL- fi - name: Install (Autotools) if: matrix.platform.autotools @@ -160,20 +160,20 @@ jobs: make -j"${parallel}" -C build-autotools/test install V=1 fi ( cd autotools_prefix; find . ) | LC_ALL=C sort -u - echo "SDL2_DIR=$(pwd)/autotools_prefix" >> $GITHUB_ENV + echo "SDL3_DIR=$(pwd)/autotools_prefix" >> $GITHUB_ENV - name: Verify CMake configuration files run: | cmake -S cmake/test -B cmake_config_build -G Ninja \ -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_PREFIX_PATH=${{ env.SDL2_DIR }} + -DCMAKE_PREFIX_PATH=${{ env.SDL3_DIR }} cmake --build cmake_config_build --verbose - - name: Verify sdl2-config + - name: Verify sdl3-config run: | - export PATH=${{ env.SDL2_DIR }}/bin:$PATH + export PATH=${{ env.SDL3_DIR }}/bin:$PATH cmake/test/test_sdlconfig.sh - - name: Verify sdl2.pc + - name: Verify sdl3.pc run: | - export PKG_CONFIG_PATH=${{ env.SDL2_DIR }}/lib/pkgconfig + export PKG_CONFIG_PATH=${{ env.SDL3_DIR }}/lib/pkgconfig cmake/test/test_pkgconfig.sh - name: Distcheck (Autotools) if: matrix.platform.autotools @@ -184,9 +184,9 @@ jobs: # Similar to Automake `make distcheck`: check that the tarball # release is sufficient to do a new build mkdir distcheck - tar -C distcheck -zxf build-autotools/SDL2-*.tar.gz - ( cd distcheck/SDL2-* && ./configure ) - make -j"${parallel}" -C distcheck/SDL2-* + tar -C distcheck -zxf build-autotools/SDL3-*.tar.gz + ( cd distcheck/SDL3-* && ./configure ) + make -j"${parallel}" -C distcheck/SDL3-* - name: Run installed-tests (Autotools) if: "runner.os == 'Linux' && matrix.platform.autotools" run: | @@ -203,4 +203,4 @@ jobs: LD_LIBRARY_PATH=/usr/local/lib \ SDL_AUDIODRIVER=dummy \ SDL_VIDEODRIVER=dummy \ - ginsttest-runner --tap SDL2 + ginsttest-runner --tap SDL3 diff --git a/.github/workflows/msvc.yml b/.github/workflows/msvc.yml index 78fb73a7c6..01d95485da 100644 --- a/.github/workflows/msvc.yml +++ b/.github/workflows/msvc.yml @@ -44,7 +44,7 @@ jobs: -DSDL_TESTS=ON ` -DSDL_INSTALL_TESTS=ON ` -DSDL_VENDOR_INFO="Github Workflow" ` - -DSDL2_DISABLE_INSTALL=OFF ` + -DSDL3_DISABLE_INSTALL=OFF ` ${{ matrix.platform.flags }} ` -DCMAKE_INSTALL_PREFIX=prefix - name: Build (CMake) @@ -56,13 +56,13 @@ jobs: ctest -VV --test-dir build/ -C Release - name: Install (CMake) run: | - echo "SDL2_DIR=$Env:GITHUB_WORKSPACE/prefix" >> $Env:GITHUB_ENV + echo "SDL3_DIR=$Env:GITHUB_WORKSPACE/prefix" >> $Env:GITHUB_ENV cmake --install build/ - name: Verify CMake configuration files if: ${{ !contains(matrix.platform.name, 'UWP') }} # FIXME: cmake/test/CMakeLists.txt should support UWP run: | cmake -S cmake/test -B cmake_config_build ` - -DCMAKE_PREFIX_PATH=${{ env.SDL2_DIR }} ` + -DCMAKE_PREFIX_PATH=${{ env.SDL3_DIR }} ` ${{ matrix.platform.flags }} cmake --build cmake_config_build --config Release diff --git a/.github/workflows/n3ds.yml b/.github/workflows/n3ds.yml index f35577e669..b7d7d9d11c 100644 --- a/.github/workflows/n3ds.yml +++ b/.github/workflows/n3ds.yml @@ -27,7 +27,7 @@ jobs: run: cmake --build build --verbose - name: Install CMake run: | - echo "SDL2_DIR=$(pwd)/prefix" >> $GITHUB_ENV + echo "SDL3_DIR=$(pwd)/prefix" >> $GITHUB_ENV cmake --install build/ ( cd prefix; find ) | LC_ALL=C sort -u - name: Verify CMake configuration files @@ -35,7 +35,7 @@ jobs: cmake -S cmake/test -B cmake_config_build -G Ninja \ -DCMAKE_TOOLCHAIN_FILE=${DEVKITPRO}/cmake/3DS.cmake \ -DTEST_SHARED=FALSE \ - -DCMAKE_PREFIX_PATH=${{ env.SDL2_DIR }} \ + -DCMAKE_PREFIX_PATH=${{ env.SDL3_DIR }} \ -DCMAKE_BUILD_TYPE=Release cmake --build cmake_config_build --verbose # Not running test_pkgconfig.sh and test_sdlconfig.sh diff --git a/.github/workflows/ps2.yaml b/.github/workflows/ps2.yaml index bfb0b1ceb3..e36905aa89 100644 --- a/.github/workflows/ps2.yaml +++ b/.github/workflows/ps2.yaml @@ -36,7 +36,7 @@ jobs: run: | set -eu cmake --install build/ --config Release - echo "SDL2_DIR=$(pwd)/cmake_prefix" >> $GITHUB_ENV + echo "SDL3_DIR=$(pwd)/cmake_prefix" >> $GITHUB_ENV ( cd cmake_prefix; find ) | LC_ALL=C sort -u - name: Verify CMake configuration files @@ -44,20 +44,20 @@ jobs: cmake -S cmake/test -B cmake_config_build -G Ninja \ -DCMAKE_TOOLCHAIN_FILE=$PS2DEV/ps2sdk/ps2dev.cmake \ -DTEST_SHARED=FALSE \ - -DCMAKE_PREFIX_PATH=${{ env.SDL2_DIR }} \ + -DCMAKE_PREFIX_PATH=${{ env.SDL3_DIR }} \ -DCMAKE_BUILD_TYPE=Release cmake --build cmake_config_build --verbose - - name: Verify sdl2-config + - name: Verify sdl3-config run: | export CC=mips64r5900el-ps2-elf-gcc - export PATH=${{ env.SDL2_DIR }}/bin:$PATH + export PATH=${{ env.SDL3_DIR }}/bin:$PATH export EXTRA_LDFLAGS="-L$PS2DEV/ps2sdk/ee/lib -L$PS2DEV/gsKit/lib -L$PS2DEV/ps2sdk/ports/lib" cmake/test/test_sdlconfig.sh - - name: Verify sdl2.pc + - name: Verify sdl3.pc run: | export CC=mips64r5900el-ps2-elf-gcc export EXTRA_LDFLAGS="-L$PS2DEV/ps2sdk/ee/lib -L$PS2DEV/gsKit/lib -L$PS2DEV/ps2sdk/ports/lib" - export PKG_CONFIG_PATH=${{ env.SDL2_DIR }}/lib/pkgconfig + export PKG_CONFIG_PATH=${{ env.SDL3_DIR }}/lib/pkgconfig cmake/test/test_pkgconfig.sh - name: Get short SHA diff --git a/.github/workflows/psp.yaml b/.github/workflows/psp.yaml index addc7b11fc..80c42c92a7 100644 --- a/.github/workflows/psp.yaml +++ b/.github/workflows/psp.yaml @@ -25,26 +25,26 @@ jobs: run: cmake --build build --config Release - name: Install run: | - echo "SDL2_DIR=$(pwd)/prefix" >> $GITHUB_ENV + echo "SDL3_DIR=$(pwd)/prefix" >> $GITHUB_ENV cmake --install build --config Release ( cd prefix; find ) | LC_ALL=C sort -u - name: Verify CMake configuration files run: | cmake -S cmake/test -B cmake_config_build \ -DCMAKE_TOOLCHAIN_FILE=$PSPDEV/psp/share/pspdev.cmake \ - -DCMAKE_PREFIX_PATH=${{ env.SDL2_DIR }} \ + -DCMAKE_PREFIX_PATH=${{ env.SDL3_DIR }} \ -DTEST_SHARED=FALSE \ -DCMAKE_BUILD_TYPE=Release cmake --build cmake_config_build --verbose - - name: Verify sdl2-config + - name: Verify sdl3-config run: | export CC=psp-gcc - export PATH=${{ env.SDL2_DIR }}/bin:$PATH + export PATH=${{ env.SDL3_DIR }}/bin:$PATH export EXTRA_LDFLAGS="-L$PSPDEV/lib -L$PSPDEV/psp/lib -L$PSPDEV/psp/sdk/lib" cmake/test/test_sdlconfig.sh - - name: Verify sdl2.pc + - name: Verify sdl3.pc run: | export CC=psp-gcc - export PKG_CONFIG_PATH=${{ env.SDL2_DIR }}/lib/pkgconfig + export PKG_CONFIG_PATH=${{ env.SDL3_DIR }}/lib/pkgconfig export EXTRA_LDFLAGS="-L$PSPDEV/lib -L$PSPDEV/psp/lib -L$PSPDEV/psp/sdk/lib" cmake/test/test_pkgconfig.sh diff --git a/.github/workflows/riscos.yml b/.github/workflows/riscos.yml index 1fec840664..2f4aca27d7 100644 --- a/.github/workflows/riscos.yml +++ b/.github/workflows/riscos.yml @@ -34,7 +34,7 @@ jobs: - name: Install (autotools) if: ${{ contains(matrix.platform.name, 'autotools') }} run: | - echo "SDL2_DIR=${{ github.workspace }}/prefix_autotools" >> $GITHUB_ENV + echo "SDL3_DIR=${{ github.workspace }}/prefix_autotools" >> $GITHUB_ENV make -C build_autotools install ( cd ${{ github.workspace }}/prefix_autotools; find ) | LC_ALL=C sort -u - name: Configure (CMake) @@ -55,14 +55,14 @@ jobs: - name: Install (CMake) if: ${{ contains(matrix.platform.name, 'CMake') }} run: | - echo "SDL2_DIR=${{ github.workspace }}/prefix_cmake" >> $GITHUB_ENV + echo "SDL3_DIR=${{ github.workspace }}/prefix_cmake" >> $GITHUB_ENV cmake --install build/ ( cd ${{ github.workspace }}/prefix_cmake; find ) | LC_ALL=C sort -u - name: Verify CMake configuration files run: | cmake -S cmake/test -B cmake_config_build -G Ninja \ -DCMAKE_TOOLCHAIN_FILE=/home/riscos/env/toolchain-riscos.cmake \ - -DCMAKE_PREFIX_PATH=${{ env.SDL2_DIR }} \ + -DCMAKE_PREFIX_PATH=${{ env.SDL3_DIR }} \ -DCMAKE_BUILD_TYPE=Release \ ${{ matrix.platform.test_args }} cmake --build cmake_config_build --verbose diff --git a/.github/workflows/vita.yaml b/.github/workflows/vita.yaml index ac3b17c435..a73114d046 100644 --- a/.github/workflows/vita.yaml +++ b/.github/workflows/vita.yaml @@ -30,7 +30,7 @@ jobs: run: cmake --build build --verbose - name: Install CMake run: | - echo "SDL2_DIR=$(pwd)/prefix" >> $GITHUB_ENV + echo "SDL3_DIR=$(pwd)/prefix" >> $GITHUB_ENV cmake --install build/ ( cd prefix; find ) | LC_ALL=C sort -u - name: Verify CMake configuration files @@ -38,16 +38,16 @@ jobs: cmake -S cmake/test -B cmake_config_build -G Ninja \ -DCMAKE_TOOLCHAIN_FILE=${VITASDK}/share/vita.toolchain.cmake \ -DTEST_SHARED=FALSE \ - -DCMAKE_PREFIX_PATH=${{ env.SDL2_DIR }} \ + -DCMAKE_PREFIX_PATH=${{ env.SDL3_DIR }} \ -DCMAKE_BUILD_TYPE=Release cmake --build cmake_config_build --verbose - - name: Verify sdl2-config + - name: Verify sdl3-config run: | export CC=arm-vita-eabi-gcc - export PATH=${{ env.SDL2_DIR }}/bin:$PATH + export PATH=${{ env.SDL3_DIR }}/bin:$PATH cmake/test/test_sdlconfig.sh - - name: Verify sdl2.pc + - name: Verify sdl3.pc run: | export CC=arm-vita-eabi-gcc - export PKG_CONFIG_PATH=${{ env.SDL2_DIR }}/lib/pkgconfig + export PKG_CONFIG_PATH=${{ env.SDL3_DIR }}/lib/pkgconfig cmake/test/test_pkgconfig.sh diff --git a/.github/workflows/watcom.yml b/.github/workflows/watcom.yml index bef3cf9572..13f1505fff 100644 --- a/.github/workflows/watcom.yml +++ b/.github/workflows/watcom.yml @@ -16,7 +16,7 @@ jobs: steps: - uses: actions/checkout@v3 - uses: open-watcom/setup-watcom@v0 - - name: Build SDL2 + - name: Build run: | wmake -f ${{ matrix.platform.makefile }} ENABLE_WERROR=1 - name: Build tests From d8864ea11de4804b49b5a7bbb573c0aa919dc0d8 Mon Sep 17 00:00:00 2001 From: Ozkan Sezer Date: Tue, 22 Nov 2022 18:47:03 +0300 Subject: [PATCH 104/153] removed visualtest --- .gitignore | 9 - .../unittest/testquit/testquit_VS2012.vcxproj | 217 - VisualC/visualtest/visualtest_VS2012.vcxproj | 308 -- visualtest/COPYING.txt | 18 - visualtest/Makefile.in | 44 - visualtest/README.txt | 214 - visualtest/acinclude.m4 | 337 -- visualtest/autogen.sh | 11 - .../testsprite2_blendmodes.actions | 3 - .../testsprite2_blendmodes.config | 5 - .../testsprite2_blendmodes.parameters | 5 - .../testsprite2_crashtest.actions | 1 - .../testsprite2_crashtest.config | 5 - .../testsprite2_crashtest.parameters | 24 - .../testsprite2_fullscreen.actions | 3 - .../testsprite2_fullscreen.config | 5 - .../testsprite2_fullscreen.parameters | 5 - .../testsprite2_geometry.actions | 3 - .../testsprite2_geometry.config | 5 - .../testsprite2_geometry.parameters | 5 - visualtest/configure | 4442 ----------------- visualtest/configure.ac | 41 - visualtest/docs/Doxyfile | 1936 ------- .../SDL_visualtest_action_configparser.h | 149 - .../SDL_visualtest_exhaustive_variator.h | 64 - .../SDL_visualtest_harness_argparser.h | 75 - .../include/SDL_visualtest_mischelper.h | 28 - .../include/SDL_visualtest_parsehelper.h | 46 - visualtest/include/SDL_visualtest_process.h | 112 - .../include/SDL_visualtest_random_variator.h | 61 - visualtest/include/SDL_visualtest_rwhelper.h | 87 - .../include/SDL_visualtest_screenshot.h | 52 - .../include/SDL_visualtest_sut_configparser.h | 105 - .../include/SDL_visualtest_variator_common.h | 122 - visualtest/include/SDL_visualtest_variators.h | 66 - visualtest/launch_harness.cmd | 2 - visualtest/launch_harness.sh | 6 - visualtest/src/action_configparser.c | 399 -- visualtest/src/harness_argparser.c | 358 -- visualtest/src/linux/linux_process.c | 208 - visualtest/src/mischelper.c | 28 - visualtest/src/parsehelper.c | 231 - visualtest/src/rwhelper.c | 131 - visualtest/src/screenshot.c | 136 - visualtest/src/sut_configparser.c | 232 - visualtest/src/testharness.c | 532 -- visualtest/src/variator_common.c | 225 - visualtest/src/variator_exhaustive.c | 133 - visualtest/src/variator_random.c | 113 - visualtest/src/variators.c | 95 - visualtest/src/windows/windows_process.c | 283 -- visualtest/src/windows/windows_screenshot.c | 349 -- visualtest/testsprite2_sample.actions | 3 - visualtest/testsprite2_sample.config | 6 - visualtest/testsprite2_sample.parameters | 29 - visualtest/unittest/testquit.actions | 1 - visualtest/unittest/testquit.c | 102 - visualtest/unittest/testquit.config | 5 - visualtest/unittest/testquit.parameters | 3 - 59 files changed, 12223 deletions(-) delete mode 100644 VisualC/visualtest/unittest/testquit/testquit_VS2012.vcxproj delete mode 100644 VisualC/visualtest/visualtest_VS2012.vcxproj delete mode 100644 visualtest/COPYING.txt delete mode 100644 visualtest/Makefile.in delete mode 100644 visualtest/README.txt delete mode 100644 visualtest/acinclude.m4 delete mode 100755 visualtest/autogen.sh delete mode 100644 visualtest/configs/testsprite2_blendmodes/testsprite2_blendmodes.actions delete mode 100644 visualtest/configs/testsprite2_blendmodes/testsprite2_blendmodes.config delete mode 100644 visualtest/configs/testsprite2_blendmodes/testsprite2_blendmodes.parameters delete mode 100644 visualtest/configs/testsprite2_crashtest/testsprite2_crashtest.actions delete mode 100644 visualtest/configs/testsprite2_crashtest/testsprite2_crashtest.config delete mode 100644 visualtest/configs/testsprite2_crashtest/testsprite2_crashtest.parameters delete mode 100644 visualtest/configs/testsprite2_fullscreen/testsprite2_fullscreen.actions delete mode 100644 visualtest/configs/testsprite2_fullscreen/testsprite2_fullscreen.config delete mode 100644 visualtest/configs/testsprite2_fullscreen/testsprite2_fullscreen.parameters delete mode 100644 visualtest/configs/testsprite2_geometry/testsprite2_geometry.actions delete mode 100644 visualtest/configs/testsprite2_geometry/testsprite2_geometry.config delete mode 100644 visualtest/configs/testsprite2_geometry/testsprite2_geometry.parameters delete mode 100755 visualtest/configure delete mode 100644 visualtest/configure.ac delete mode 100644 visualtest/docs/Doxyfile delete mode 100644 visualtest/include/SDL_visualtest_action_configparser.h delete mode 100644 visualtest/include/SDL_visualtest_exhaustive_variator.h delete mode 100644 visualtest/include/SDL_visualtest_harness_argparser.h delete mode 100644 visualtest/include/SDL_visualtest_mischelper.h delete mode 100644 visualtest/include/SDL_visualtest_parsehelper.h delete mode 100644 visualtest/include/SDL_visualtest_process.h delete mode 100644 visualtest/include/SDL_visualtest_random_variator.h delete mode 100644 visualtest/include/SDL_visualtest_rwhelper.h delete mode 100644 visualtest/include/SDL_visualtest_screenshot.h delete mode 100644 visualtest/include/SDL_visualtest_sut_configparser.h delete mode 100644 visualtest/include/SDL_visualtest_variator_common.h delete mode 100644 visualtest/include/SDL_visualtest_variators.h delete mode 100644 visualtest/launch_harness.cmd delete mode 100755 visualtest/launch_harness.sh delete mode 100644 visualtest/src/action_configparser.c delete mode 100644 visualtest/src/harness_argparser.c delete mode 100644 visualtest/src/linux/linux_process.c delete mode 100644 visualtest/src/mischelper.c delete mode 100644 visualtest/src/parsehelper.c delete mode 100644 visualtest/src/rwhelper.c delete mode 100644 visualtest/src/screenshot.c delete mode 100644 visualtest/src/sut_configparser.c delete mode 100644 visualtest/src/testharness.c delete mode 100644 visualtest/src/variator_common.c delete mode 100644 visualtest/src/variator_exhaustive.c delete mode 100644 visualtest/src/variator_random.c delete mode 100644 visualtest/src/variators.c delete mode 100644 visualtest/src/windows/windows_process.c delete mode 100644 visualtest/src/windows/windows_screenshot.c delete mode 100644 visualtest/testsprite2_sample.actions delete mode 100644 visualtest/testsprite2_sample.config delete mode 100644 visualtest/testsprite2_sample.parameters delete mode 100644 visualtest/unittest/testquit.actions delete mode 100644 visualtest/unittest/testquit.c delete mode 100644 visualtest/unittest/testquit.config delete mode 100644 visualtest/unittest/testquit.parameters diff --git a/.gitignore b/.gitignore index a746abbc16..099b15322d 100644 --- a/.gitignore +++ b/.gitignore @@ -88,15 +88,6 @@ VisualC/tests/testscale/icon.bmp VisualC/tests/testscale/sample.bmp VisualC/tests/testsprite2/icon.bmp VisualC/tests/testyuv/testyuv.bmp -VisualC/visualtest/icon.bmp -VisualC/visualtest/testquit.actions -VisualC/visualtest/testquit.config -VisualC/visualtest/testquit.exe -VisualC/visualtest/testquit.parameters -VisualC/visualtest/testsprite2.exe -VisualC/visualtest/testsprite2_sample.actions -VisualC/visualtest/testsprite2_sample.config -VisualC/visualtest/testsprite2_sample.parameters VisualC-GDK/**/Layout # for Android diff --git a/VisualC/visualtest/unittest/testquit/testquit_VS2012.vcxproj b/VisualC/visualtest/unittest/testquit/testquit_VS2012.vcxproj deleted file mode 100644 index 37fa03927c..0000000000 --- a/VisualC/visualtest/unittest/testquit/testquit_VS2012.vcxproj +++ /dev/null @@ -1,217 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - testquit - testquit - {1D12C737-7C71-45CE-AE2C-AAB47B690BC8} - 10.0 - - - - Application - false - $(DefaultPlatformToolset) - - - Application - false - MultiByte - $(DefaultPlatformToolset) - - - Application - false - $(DefaultPlatformToolset) - - - Application - false - $(DefaultPlatformToolset) - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - false - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - true - true - - - - NDEBUG;%(PreprocessorDefinitions) - true - true - Win32 - - - OnlyExplicitInline - ..\..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - - - Level3 - true - Default - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - Windows - - - - - NDEBUG;%(PreprocessorDefinitions) - true - true - - - OnlyExplicitInline - ..\..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - - - Level3 - true - Default - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - Windows - - - - - _DEBUG;%(PreprocessorDefinitions) - true - true - Win32 - - - Disabled - ..\..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - - - Level3 - true - EditAndContinue - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - true - Windows - false - - - - - _DEBUG;%(PreprocessorDefinitions) - true - true - - - Disabled - ..\..\..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - - - Level3 - true - ProgramDatabase - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - true - Windows - false - - - - - - - - {da956fd3-e142-46f2-9dd5-c78bebb56b7a} - - - {da956fd3-e143-46f2-9fe5-c77bebc56b1a} - - - {81ce8daf-ebb2-4761-8e45-b71abcca8c68} - - - - - - \ No newline at end of file diff --git a/VisualC/visualtest/visualtest_VS2012.vcxproj b/VisualC/visualtest/visualtest_VS2012.vcxproj deleted file mode 100644 index 6ad5b619d1..0000000000 --- a/VisualC/visualtest/visualtest_VS2012.vcxproj +++ /dev/null @@ -1,308 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - visualtest - visualtest - {13DDF23A-4A8F-4AF9-9734-CC09D9157924} - 10.0 - - - - Application - false - $(DefaultPlatformToolset) - - - Application - false - MultiByte - $(DefaultPlatformToolset) - - - Application - false - $(DefaultPlatformToolset) - - - Application - false - $(DefaultPlatformToolset) - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - false - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(SolutionDir)\$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - true - true - - - testharness - - - - NDEBUG;%(PreprocessorDefinitions) - true - true - Win32 - - - OnlyExplicitInline - ..\..\include;..\..\visualtest\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - - - Level3 - true - Default - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - Windows - kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;shlwapi.lib;%(AdditionalDependencies) - - - copy "$(SolutionDir)..\test\icon.bmp" "$(ProjectDir)icon.bmp" -copy "$(SolutionDir)\$(Platform)\$(Configuration)\testsprite2.exe" "$(ProjectDir)" -copy "$(SolutionDir)\$(Platform)\$(Configuration)\testquit.exe" "$(ProjectDir)" -copy /y "$(SolutionDir)..\visualtest\*.config" "$(ProjectDir)" -copy /y "$(SolutionDir)..\visualtest\*.parameters" "$(ProjectDir)" -copy /y "$(SolutionDir)..\visualtest\*.actions" "$(ProjectDir)" -copy /y "$(SolutionDir)..\visualtest\unittest\*.config" "$(ProjectDir)" -copy /y "$(SolutionDir)..\visualtest\unittest\*.parameters" "$(ProjectDir)" -copy /y "$(SolutionDir)..\visualtest\unittest\*.actions" "$(ProjectDir)" - - - Copy data files - - - - - NDEBUG;%(PreprocessorDefinitions) - true - true - - - OnlyExplicitInline - ..\..\include;..\..\visualtest\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - - - Level3 - true - Default - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - Windows - kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;shlwapi.lib;%(AdditionalDependencies) - - - copy "$(SolutionDir)..\test\icon.bmp" "$(ProjectDir)icon.bmp" -copy "$(SolutionDir)\$(Platform)\$(Configuration)\testsprite2.exe" "$(ProjectDir)" -copy "$(SolutionDir)\$(Platform)\$(Configuration)\testquit.exe" "$(ProjectDir)" -copy /y "$(SolutionDir)..\visualtest\*.config" "$(ProjectDir)" -copy /y "$(SolutionDir)..\visualtest\*.parameters" "$(ProjectDir)" -copy /y "$(SolutionDir)..\visualtest\*.actions" "$(ProjectDir)" -copy /y "$(SolutionDir)..\visualtest\unittest\*.config" "$(ProjectDir)" -copy /y "$(SolutionDir)..\visualtest\unittest\*.parameters" "$(ProjectDir)" -copy /y "$(SolutionDir)..\visualtest\unittest\*.actions" "$(ProjectDir)" - - - Copy data files - - - - - _DEBUG;%(PreprocessorDefinitions) - true - true - Win32 - - - Disabled - ..\..\include;..\..\visualtest\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - - - Level3 - true - EditAndContinue - Default - false - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - true - Windows - kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;shlwapi.lib;%(AdditionalDependencies) - false - - - copy "$(SolutionDir)..\test\icon.bmp" "$(ProjectDir)icon.bmp" -copy "$(SolutionDir)\$(Platform)\$(Configuration)\testsprite2.exe" "$(ProjectDir)" -copy "$(SolutionDir)\$(Platform)\$(Configuration)\testquit.exe" "$(ProjectDir)" -copy /y "$(SolutionDir)..\visualtest\*.config" "$(ProjectDir)" -copy /y "$(SolutionDir)..\visualtest\*.parameters" "$(ProjectDir)" -copy /y "$(SolutionDir)..\visualtest\*.actions" "$(ProjectDir)" -copy /y "$(SolutionDir)..\visualtest\unittest\*.config" "$(ProjectDir)" -copy /y "$(SolutionDir)..\visualtest\unittest\*.parameters" "$(ProjectDir)" -copy /y "$(SolutionDir)..\visualtest\unittest\*.actions" "$(ProjectDir)" - - - Copy data files - - - - - _DEBUG;%(PreprocessorDefinitions) - true - true - - - Disabled - ..\..\include;..\..\visualtest\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - - - Level3 - true - ProgramDatabase - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - true - Windows - false - kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;shlwapi.lib;%(AdditionalDependencies) - - - copy "$(SolutionDir)..\test\icon.bmp" "$(ProjectDir)icon.bmp" -copy "$(SolutionDir)\$(Platform)\$(Configuration)\testsprite2.exe" "$(ProjectDir)" -copy "$(SolutionDir)\$(Platform)\$(Configuration)\testquit.exe" "$(ProjectDir)" -copy /y "$(SolutionDir)..\visualtest\*.config" "$(ProjectDir)" -copy /y "$(SolutionDir)..\visualtest\*.parameters" "$(ProjectDir)" -copy /y "$(SolutionDir)..\visualtest\*.actions" "$(ProjectDir)" -copy /y "$(SolutionDir)..\visualtest\unittest\*.config" "$(ProjectDir)" -copy /y "$(SolutionDir)..\visualtest\unittest\*.parameters" "$(ProjectDir)" -copy /y "$(SolutionDir)..\visualtest\unittest\*.actions" "$(ProjectDir)" - - - Copy data files - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {da956fd3-e142-46f2-9dd5-c78bebb56b7a} - - - {da956fd3-e143-46f2-9fe5-c77bebc56b1a} - - - {81ce8daf-ebb2-4761-8e45-b71abcca8c68} - - - - - - \ No newline at end of file diff --git a/visualtest/COPYING.txt b/visualtest/COPYING.txt deleted file mode 100644 index a92fe14bc0..0000000000 --- a/visualtest/COPYING.txt +++ /dev/null @@ -1,18 +0,0 @@ -Visual and Interactive Test Automation for SDL 3.0 -Copyright (C) 2013 Apoorv Upreti - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. diff --git a/visualtest/Makefile.in b/visualtest/Makefile.in deleted file mode 100644 index 3cf2f6df4d..0000000000 --- a/visualtest/Makefile.in +++ /dev/null @@ -1,44 +0,0 @@ -# Makefile to build the SDL tests - -srcdir = @srcdir@ -CC = @CC@ -EXE = @EXE@ -CFLAGS = @CFLAGS@ -I../include -I./include -LIBS = @LIBS@ - -TARGETS = \ - testharness$(EXE) \ - testquit$(EXE) - -all: Makefile $(TARGETS) - -Makefile: $(srcdir)/Makefile.in - $(SHELL) config.status $@ - -testharness$(EXE): $(srcdir)/src/action_configparser.c \ - $(srcdir)/src/harness_argparser.c \ - $(srcdir)/src/rwhelper.c \ - $(srcdir)/src/testharness.c \ - $(srcdir)/src/variator_exhaustive.c \ - $(srcdir)/src/variators.c \ - $(srcdir)/src/screenshot.c \ - $(srcdir)/src/harness_argparser.c \ - $(srcdir)/src/sut_configparser.c \ - $(srcdir)/src/variator_common.c \ - $(srcdir)/src/variator_random.c \ - $(srcdir)/src/parsehelper.c \ - $(srcdir)/src/mischelper.c \ - $(srcdir)/src/linux/linux_process.c \ - $(srcdir)/src/windows/windows_process.c \ - $(srcdir)/src/windows/windows_screenshot.c - $(CC) -o $@ $^ $(CFLAGS) $(LIBS) - -testquit$(EXE): $(srcdir)/unittest/testquit.c - $(CC) -o $@ $^ $(CFLAGS) $(LIBS) - -clean: - rm -f $(TARGETS) -distclean: clean - rm -f Makefile - rm -f config.status config.cache config.log - rm -rf $(srcdir)/autom4te* diff --git a/visualtest/README.txt b/visualtest/README.txt deleted file mode 100644 index 0d9a905f6e..0000000000 --- a/visualtest/README.txt +++ /dev/null @@ -1,214 +0,0 @@ -/*! - -\mainpage Visual and Interactive Test Automation for SDL 2.0 - -\section license_sec License -Check the file \c LICENSE.txt for licensing information. - -\section intro_sec Introduction -The goal of this GSoC project is to automate the testing of testsprite2. -testsprite2 takes 26 parameters which have thousands of valid combinations and is -used to validate SDL's window, mouse and rendering behaviour. By having a test -harness that runs testsprite2 with various command line argument strings and -validates the output for each run, we can make testing an easier task for -maintainers, contributors and testers. The test harness can be used by a continuous -integration system (like buildbot or jenkins) to validate SDL after checkins. - -SDL Homepage: http://libsdl.org/ - -\section build_sec Building - -\subsection build_linux Building on Linux/Cygwin -./autogen.sh; ./configure; make; - -\subsection build_windows Building on Windows -Use the Visual Studio solution under \c SDL/VisualC/visualtest. - -\section docs_sec Documentation -Documentation is available via Doxygen. To build the documentation, cd to the -SDL/visualtest/docs directory and run \c doxygen. A good starting point for -exploring the documentation is \c SDL/visualtest/docs/html/index.html - -\section usage_sec Usage -To see all the options supported by the test harness, just run \c testharness -with no arguments. - -At the moment the following options are supported: -\li \c sutapp - Path to the system under test (SUT) application -\li \c sutargs - Launch the SUT with the specified arguments string -\li \c timeout - The maximum time after which the SUT process will be killed; - passed as hh:mm:ss; default 00:01:00 -\li \c variator - Which variator to use; see \ref variators_sec -\li \c num-variations - The number of variations to run for; taken to be - 1 for the random variator and ALL for the exhaustive variator by default -\li \c no-launch - Just print the arguments string for each variation without - launching the SUT or performing any actions -\li \c parameter-config - A config file that describes the command line parameters - supported by the SUT; see \ref paramconfig_sec or the sample *.parameters files - for more details -\li \c action-config - A config file with a list of actions to be performed while - the SUT is running; see \ref actionconfig_sec or the sample *.actions files -\li \c output-dir - Path to the directory where screenshots should be saved; is - created if it doesn't exist; taken to be "./output" by default -\li \c verify-dir - Path to the directory with the verification images; taken to - be "./verify" by default - -Paths can be relative or absolute. - -Alternatively, the options can be passed as a config file for convenience: - -testharness \-\-config testsprite2_sample.config - -For a sample, take a look at the *.config files in this repository. - -We can also pass a config file and override certain options as necessary: -testharness \-\-config testsprite2_sample.config \-\-num-variations 10 - -Note: You may find it convenient to copy the SUT executable along with any -resources to the test harness directory. Also note that testsprite2 and its -resources (icon.bmp) are automatically copied when using the Visual Studio -solution. - -\subsection usageexamples_subsec Usage examples: - -Passing a custom arguments string: -testharness \-\-sutapp testsprite2 \-\-sutargs "\-\-cyclecolor \-\-blend mod -\-\-iterations 2" \-\-action-config xyz.actions - -Using the random variator: -testharness \-\-sutapp testsprite2 \-\-variator random \-\-num-variations 5 -\-\-parameter-config xyz.parameters \-\-action-config xyz.actions - -\subsection config_subsec Config Files -Config files are an alternate way to pass parameters to the test harness. We -describe the paramters in a config file and pass that to the test harness using -the \-\-config option. The config file consists of lines of the form "x=y" where -x is an option and y is it's value. For boolean options, we simply give the name -of the option to indicate that it is to be passed to the testharness. - -The hash '#' character can be used to start a comment from that point to the end -of the line. - -\section paramconfig_sec The SUT Parameters File -To generate variations we need to describe the parameters the will be passed to -the SUT. This description is given in a parameters file. Each line of the parameters -file (except the blank lines) represents one command line option with five -comma separated fields: -name, type, values, required, categories - -\li \c name is the name of the option, e.g., \c \-\-cyclecolor. -\li \c type can have one of three values - integer, boolean and enum. -\li \c values - for integer options this is the valid range of values the option - can take, i.e., [min max]. For enum options this is a list of strings that - the option can take, e.g., [val1 val2 val3]. For boolean options this field - is ignored. -\li \c required - true if the option is required, false otherwise. -\li \c categories - a list of categories that the option belongs to. For example, - [video mouse audio] - -Just like with config files, hash characters can be used to start comments. - -\subsection additionalnotes_subsec Additional Notes - -\li If you want to have an option that always takes a certain value, use an enum - with only one value. -\li Currently there isn't any way to turn an option off, i.e., all options will - be included in the command line options string that is generated using the - config. If you don't want an option to be passed to the SUT, remove it from - the config file or comment it out. - -\section variators_sec Variators -Variators are the mechanism by which we generate strings of command line arguments -to test the SUT with. A variator is quite simply an iterator that iterates through -different variations of command line options. There are two variators supported at -the moment: -\li \b Exhaustive - Generate all possible combinations of command line arguments - that are valid. -\li \b Random - Generate a random variation each time the variator is called. - -As an example, let's try a simple .parameters file:\n - -\-\-blend, enum, [add mod], false, [] \n -\-\-fullscreen, boolean, [], false, [] - - -The exhaustive variator would generate the following four variations:\n - -\-\-blend add \n -\-\-blend mod \n -\-\-blend add \-\-fullscreen \n -\-\-blend mod \-\-fullscreen \n - - -The random variator would simply generate a random variation like the following:\n -\-\-blend mod - -\section actionconfig_sec The Actions File -Once the SUT process has been launched, automated testing happens using a mechanism -called actions. A list of actions is read from a file and each action is performed -on the SUT process sequentially. Each line in the actions file describes an action. -The format for an action is hh:mm:ss ACTION_NAME additional parameters. -There are five actions supported at the moment: -\li \b SCREENSHOT - Takes a screenshot of each window owned by the SUT process. The - images are saved as \c [hash]_[i].bmp where \c [hash] is the 32 character long - hexadecimal MD5 hash of the arguments string that was passed to the SUT while - launching it and \c i is the window number. i = 1 is an exceptional case - where the \c _[i] is dropped and the filename is simply \c [hash].bmp\n - Note: The screenshots are only of the window's client area. -\li \b VERIFY - Verifies the screenshots taken by the last SCREENSHOT action by - comparing them against a verification image. Each \c [hash]_i.bmp image output - by the SCREENSHOT action is compared against a \c [hash].bmp image in the - verify-dir. -\li \b QUIT - Gracefully quits the SUT process. On Windows this means sending a - WM_CLOSE message to each window owned by the SUT process. On Linux it means - sending a SIGQUIT signal to the SUT process. -\li \b KILL - Forcefully kills the SUT process. This is useful when the SUT process - doesn't respond to the QUIT action. -\li LAUNCH [/path/to/executable] [args] - Runs an executable with \c [args] - as the arguments string. - -Just like with config files, hash characters can be used to start comments. - -\section contint_sec Continuous Integration (CI) -One of the goals of the project was to create a test harness that integrates -with CI systems to provide automated visual and interactive testing to SDL. - -At the moment the test harness can be run in two modes that are useful for CI: -\li Crash testing mode - launch the SUT with every variation and all parameters, - report to the CI if there's a crash -\li Visual testing mode - launch and visually verify the SUT for a smaller subset - of the parameters - -Look at the launch_harness.sh/launch_harness.cmd for an example scripts that run the -test harness for all variations with all parameters and report an error on a crash. -The script uses the testsprite2_crashtest config, so remember to copy those files -over to the test harness executable directory along with the script. - -\section todo_sec TODOs -\li Allow specifying a clipping box along with the VERIFY action, i.e., hh:mm:ss - VERIFY x, y, w, h -\li Add support for spaces between the equals sign in test harness config files -\li Implement the SCREENSHOT action on Linux -\li Add a pairwise variator -\li Add actions to inject keyboard/mouse events -\li Add actions to manipulate the SUT window, e.g., minimize, restore, resize -\li Add support to load and save screenshots as .pngs instead of .bmps - -\section issues_sec Known Issues -\li The QUIT action does not work on a testsprite2 process with multiple windows. - This appears to be an issue with testsprite2. -\li The SCREENSHOT action doesn't capture the testsprite2 window correctly if the - --fullscreen option is supplied. It works with --fullscreen-desktop, however. - -\section moreinfo_sec More Information - -Author Contact Info:\n -Apoorv Upreti \c \ - -Other useful links: -- Project Repository: https://bitbucket.org/nerdap/sdlvisualtest -- Project Wiki: https://github.com/nerdap/autotestsprite2/wiki -- Project Blog: http://nerdap.github.io -- Verification images for testsprite2_blendmodes: https://www.dropbox.com/s/nm02aem76m812ng/testsprite2_blendmodes.zip -- Verification images for testsprite2_geometry: https://www.dropbox.com/s/csypwryopaslpaf/testsprite2_geometry.zip -*/ diff --git a/visualtest/acinclude.m4 b/visualtest/acinclude.m4 deleted file mode 100644 index 3dd4058eab..0000000000 --- a/visualtest/acinclude.m4 +++ /dev/null @@ -1,337 +0,0 @@ -# Configure paths for SDL -# Sam Lantinga 9/21/99 -# stolen from Manish Singh -# stolen back from Frank Belew -# stolen from Manish Singh -# Shamelessly stolen from Owen Taylor - -# serial 2 - -dnl AM_PATH_SDL3([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) -dnl Test for SDL, and define SDL_CFLAGS and SDL_LIBS -dnl -AC_DEFUN([AM_PATH_SDL3], -[dnl -dnl Get the cflags and libraries from the sdl3-config script -dnl -AC_ARG_WITH(sdl-prefix,[ --with-sdl-prefix=PFX Prefix where SDL is installed (optional)], - sdl_prefix="$withval", sdl_prefix="") -AC_ARG_WITH(sdl-exec-prefix,[ --with-sdl-exec-prefix=PFX Exec prefix where SDL is installed (optional)], - sdl_exec_prefix="$withval", sdl_exec_prefix="") -AC_ARG_ENABLE(sdltest, [ --disable-sdltest Do not try to compile and run a test SDL program], - , enable_sdltest=yes) - - min_sdl_version=ifelse([$1], ,3.0.0,$1) - - if test "x$sdl_prefix$sdl_exec_prefix" = x ; then - PKG_CHECK_MODULES([SDL], [sdl3 >= $min_sdl_version], - [sdl_pc=yes], - [sdl_pc=no]) - else - sdl_pc=no - if test x$sdl_exec_prefix != x ; then - sdl_config_args="$sdl_config_args --exec-prefix=$sdl_exec_prefix" - if test x${SDL3_CONFIG+set} != xset ; then - SDL3_CONFIG=$sdl_exec_prefix/bin/sdl3-config - fi - fi - if test x$sdl_prefix != x ; then - sdl_config_args="$sdl_config_args --prefix=$sdl_prefix" - if test x${SDL3_CONFIG+set} != xset ; then - SDL3_CONFIG=$sdl_prefix/bin/sdl3-config - fi - fi - fi - - if test "x$sdl_pc" = xyes ; then - no_sdl="" - SDL3_CONFIG="pkg-config sdl3" - else - as_save_PATH="$PATH" - if test "x$prefix" != xNONE && test "$cross_compiling" != yes; then - PATH="$prefix/bin:$prefix/usr/bin:$PATH" - fi - AC_PATH_PROG(SDL3_CONFIG, sdl3-config, no, [$PATH]) - PATH="$as_save_PATH" - AC_MSG_CHECKING(for SDL - version >= $min_sdl_version) - no_sdl="" - - if test "$SDL3_CONFIG" = "no" ; then - no_sdl=yes - else - SDL_CFLAGS=`$SDL3_CONFIG $sdl_config_args --cflags` - SDL_LIBS=`$SDL3_CONFIG $sdl_config_args --libs` - - sdl_major_version=`$SDL3_CONFIG $sdl_config_args --version | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` - sdl_minor_version=`$SDL3_CONFIG $sdl_config_args --version | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` - sdl_micro_version=`$SDL3_CONFIG $sdl_config_args --version | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` - if test "x$enable_sdltest" = "xyes" ; then - ac_save_CFLAGS="$CFLAGS" - ac_save_CXXFLAGS="$CXXFLAGS" - ac_save_LIBS="$LIBS" - CFLAGS="$CFLAGS $SDL_CFLAGS" - CXXFLAGS="$CXXFLAGS $SDL_CFLAGS" - LIBS="$LIBS $SDL_LIBS" -dnl -dnl Now check if the installed SDL is sufficiently new. (Also sanity -dnl checks the results of sdl3-config to some extent -dnl - rm -f conf.sdltest - AC_RUN_IFELSE([AC_LANG_SOURCE([[ -#include -#include -#include "SDL.h" - -int main (int argc, char *argv[]) -{ - int major, minor, micro; - FILE *fp = fopen("conf.sdltest", "w"); - - if (fp) fclose(fp); - - if (sscanf("$min_sdl_version", "%d.%d.%d", &major, &minor, µ) != 3) { - printf("%s, bad version string\n", "$min_sdl_version"); - exit(1); - } - - if (($sdl_major_version > major) || - (($sdl_major_version == major) && ($sdl_minor_version > minor)) || - (($sdl_major_version == major) && ($sdl_minor_version == minor) && ($sdl_micro_version >= micro))) - { - return 0; - } - else - { - printf("\n*** 'sdl3-config --version' returned %d.%d.%d, but the minimum version\n", $sdl_major_version, $sdl_minor_version, $sdl_micro_version); - printf("*** of SDL required is %d.%d.%d. If sdl3-config is correct, then it is\n", major, minor, micro); - printf("*** best to upgrade to the required version.\n"); - printf("*** If sdl3-config was wrong, set the environment variable SDL3_CONFIG\n"); - printf("*** to point to the correct copy of sdl3-config, and remove the file\n"); - printf("*** config.cache before re-running configure\n"); - return 1; - } -} - -]])], [], [no_sdl=yes], [echo $ac_n "cross compiling; assumed OK... $ac_c"]) - CFLAGS="$ac_save_CFLAGS" - CXXFLAGS="$ac_save_CXXFLAGS" - LIBS="$ac_save_LIBS" - fi - fi - if test "x$no_sdl" = x ; then - AC_MSG_RESULT(yes) - else - AC_MSG_RESULT(no) - fi - fi - if test "x$no_sdl" = x ; then - ifelse([$2], , :, [$2]) - else - if test "$SDL3_CONFIG" = "no" ; then - echo "*** The sdl3-config script installed by SDL could not be found" - echo "*** If SDL was installed in PREFIX, make sure PREFIX/bin is in" - echo "*** your path, or set the SDL3_CONFIG environment variable to the" - echo "*** full path to sdl3-config." - else - if test -f conf.sdltest ; then - : - else - echo "*** Could not run SDL test program, checking why..." - CFLAGS="$CFLAGS $SDL_CFLAGS" - CXXFLAGS="$CXXFLAGS $SDL_CFLAGS" - LIBS="$LIBS $SDL_LIBS" - AC_LINK_IFELSE([AC_LANG_PROGRAM([[ -#include -#include "SDL.h" - -int main(int argc, char *argv[]) -{ return 0; } -#undef main -#define main K_and_R_C_main -]], [[ return 0; ]])], - [ echo "*** The test program compiled, but did not run. This usually means" - echo "*** that the run-time linker is not finding SDL or finding the wrong" - echo "*** version of SDL. If it is not finding SDL, you'll need to set your" - echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" - echo "*** to the installed location Also, make sure you have run ldconfig if that" - echo "*** is required on your system" - echo "***" - echo "*** If you have an old version installed, it is best to remove it, although" - echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"], - [ echo "*** The test program failed to compile or link. See the file config.log for the" - echo "*** exact error that occured. This usually means SDL was incorrectly installed" - echo "*** or that you have moved SDL since it was installed. In the latter case, you" - echo "*** may want to edit the sdl3-config script: $SDL3_CONFIG" ]) - CFLAGS="$ac_save_CFLAGS" - CXXFLAGS="$ac_save_CXXFLAGS" - LIBS="$ac_save_LIBS" - fi - fi - SDL_CFLAGS="" - SDL_LIBS="" - ifelse([$3], , :, [$3]) - fi - AC_SUBST(SDL_CFLAGS) - AC_SUBST(SDL_LIBS) - rm -f conf.sdltest -]) -# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- -# serial 1 (pkg-config-0.24) -# -# Copyright © 2004 Scott James Remnant . -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# PKG_PROG_PKG_CONFIG([MIN-VERSION]) -# ---------------------------------- -AC_DEFUN([PKG_PROG_PKG_CONFIG], -[m4_pattern_forbid([^_?PKG_[A-Z_]+$]) -m4_pattern_allow([^PKG_CONFIG(_PATH|_LIBDIR)?$]) -AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility]) -AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) -AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) - -if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then - AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) -fi -if test -n "$PKG_CONFIG"; then - _pkg_min_version=m4_default([$1], [0.9.0]) - AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) - if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) - PKG_CONFIG="" - fi -fi[]dnl -])# PKG_PROG_PKG_CONFIG - -# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) -# -# Check to see whether a particular set of modules exists. Similar -# to PKG_CHECK_MODULES(), but does not set variables or print errors. -# -# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) -# only at the first occurence in configure.ac, so if the first place -# it's called might be skipped (such as if it is within an "if", you -# have to call PKG_CHECK_EXISTS manually -# -------------------------------------------------------------- -AC_DEFUN([PKG_CHECK_EXISTS], -[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl -if test -n "$PKG_CONFIG" && \ - AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then - m4_default([$2], [:]) -m4_ifvaln([$3], [else - $3])dnl -fi]) - -# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) -# --------------------------------------------- -m4_define([_PKG_CONFIG], -[if test -n "$$1"; then - pkg_cv_[]$1="$$1" - elif test -n "$PKG_CONFIG"; then - PKG_CHECK_EXISTS([$3], - [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`], - [pkg_failed=yes]) - else - pkg_failed=untried -fi[]dnl -])# _PKG_CONFIG - -# _PKG_SHORT_ERRORS_SUPPORTED -# ----------------------------- -AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], -[AC_REQUIRE([PKG_PROG_PKG_CONFIG]) -if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then - _pkg_short_errors_supported=yes -else - _pkg_short_errors_supported=no -fi[]dnl -])# _PKG_SHORT_ERRORS_SUPPORTED - - -# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], -# [ACTION-IF-NOT-FOUND]) -# -# -# Note that if there is a possibility the first call to -# PKG_CHECK_MODULES might not happen, you should be sure to include an -# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac -# -# -# -------------------------------------------------------------- -AC_DEFUN([PKG_CHECK_MODULES], -[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl -AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl -AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl - -pkg_failed=no -AC_MSG_CHECKING([for $2]) - -_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) -_PKG_CONFIG([$1][_LIBS], [libs], [$2]) - -m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS -and $1[]_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details.]) - -if test $pkg_failed = yes; then - AC_MSG_RESULT([no]) - _PKG_SHORT_ERRORS_SUPPORTED - if test $_pkg_short_errors_supported = yes; then - $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1` - else - $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1` - fi - # Put the nasty error message in config.log where it belongs - echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD - - m4_default([$4], [AC_MSG_ERROR( -[Package requirements ($2) were not met: - -$$1_PKG_ERRORS - -Consider adjusting the PKG_CONFIG_PATH environment variable if you -installed software in a non-standard prefix. - -_PKG_TEXT])[]dnl - ]) -elif test $pkg_failed = untried; then - AC_MSG_RESULT([no]) - m4_default([$4], [AC_MSG_FAILURE( -[The pkg-config script could not be found or is too old. Make sure it -is in your PATH or set the PKG_CONFIG environment variable to the full -path to pkg-config. - -_PKG_TEXT - -To get pkg-config, see .])[]dnl - ]) -else - $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS - $1[]_LIBS=$pkg_cv_[]$1[]_LIBS - AC_MSG_RESULT([yes]) - $3 -fi[]dnl -])# PKG_CHECK_MODULES diff --git a/visualtest/autogen.sh b/visualtest/autogen.sh deleted file mode 100755 index 988d41760d..0000000000 --- a/visualtest/autogen.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh - -cp acinclude.m4 aclocal.m4 - -if test "$AUTOCONF"x = x; then - AUTOCONF=autoconf -fi - -$AUTOCONF || exit 1 -rm aclocal.m4 -rm -rf autom4te.cache diff --git a/visualtest/configs/testsprite2_blendmodes/testsprite2_blendmodes.actions b/visualtest/configs/testsprite2_blendmodes/testsprite2_blendmodes.actions deleted file mode 100644 index ef54e86b48..0000000000 --- a/visualtest/configs/testsprite2_blendmodes/testsprite2_blendmodes.actions +++ /dev/null @@ -1,3 +0,0 @@ -00:00:03 SCREENSHOT -00:00:06 VERIFY -00:00:09 QUIT \ No newline at end of file diff --git a/visualtest/configs/testsprite2_blendmodes/testsprite2_blendmodes.config b/visualtest/configs/testsprite2_blendmodes/testsprite2_blendmodes.config deleted file mode 100644 index 0d707bcbc1..0000000000 --- a/visualtest/configs/testsprite2_blendmodes/testsprite2_blendmodes.config +++ /dev/null @@ -1,5 +0,0 @@ -parameter-config=testsprite2_blendmodes.parameters -variator=exhaustive -sutapp=testsprite2 -timeout=00:00:15 -action-config=testsprite2_blendmodes.actions \ No newline at end of file diff --git a/visualtest/configs/testsprite2_blendmodes/testsprite2_blendmodes.parameters b/visualtest/configs/testsprite2_blendmodes/testsprite2_blendmodes.parameters deleted file mode 100644 index a5df29c8cc..0000000000 --- a/visualtest/configs/testsprite2_blendmodes/testsprite2_blendmodes.parameters +++ /dev/null @@ -1,5 +0,0 @@ -# parameter name, type, value range, required, categories ---blend, enum, [none blend add mod], false, [] ---cyclecolor, boolean, [], false, [] ---cyclealpha, boolean, [], false, [] ---iterations, integer, [1000 1000], true, [] \ No newline at end of file diff --git a/visualtest/configs/testsprite2_crashtest/testsprite2_crashtest.actions b/visualtest/configs/testsprite2_crashtest/testsprite2_crashtest.actions deleted file mode 100644 index 75af9d75de..0000000000 --- a/visualtest/configs/testsprite2_crashtest/testsprite2_crashtest.actions +++ /dev/null @@ -1 +0,0 @@ -00:00:02 QUIT \ No newline at end of file diff --git a/visualtest/configs/testsprite2_crashtest/testsprite2_crashtest.config b/visualtest/configs/testsprite2_crashtest/testsprite2_crashtest.config deleted file mode 100644 index c8f07ca9f5..0000000000 --- a/visualtest/configs/testsprite2_crashtest/testsprite2_crashtest.config +++ /dev/null @@ -1,5 +0,0 @@ -parameter-config=testsprite2_crashtest.parameters -variator=exhaustive -sutapp=testsprite2 -timeout=00:00:10 -action-config=testsprite2_crashtest.actions \ No newline at end of file diff --git a/visualtest/configs/testsprite2_crashtest/testsprite2_crashtest.parameters b/visualtest/configs/testsprite2_crashtest/testsprite2_crashtest.parameters deleted file mode 100644 index e89ce60abe..0000000000 --- a/visualtest/configs/testsprite2_crashtest/testsprite2_crashtest.parameters +++ /dev/null @@ -1,24 +0,0 @@ -# parameter name, type, value range, required, categories ---display, integer, [1 5], false, [] ---fullscreen, boolean, [], false, [] ---fullscreen-desktop, boolean, [], false, [] ---title, enum, [vartest bartest footest], false, [] ---icon, enum, [icon.bmp], false, [] ---center, boolean, [], false, [] ---position, enum, [300,300], false, [] ---geometry, enum, [500x500], false, [] ---min-geometry, enum, [100x100 200x200], false, [] ---max-geometry, enum, [600x600 700x700], false, [] ---logical, enum, [500x500 550x450], false, [] ---scale, integer, [1 5], false, [] ---depth, integer, [1 5], false, [] ---refresh, integer, [1 5], false, [] ---vsync, boolean, [], false, [] ---noframe, boolean, [], false, [] ---resize, boolean, [], false, [] ---minimize, boolean, [], false, [] ---maximize, boolean, [], false, [] ---grab, boolean, [], false, [mouse] ---blend, enum, [none blend add mod], false, [] ---cyclecolor, boolean, [], false, [] ---cyclealpha, boolean, [], false, [] \ No newline at end of file diff --git a/visualtest/configs/testsprite2_fullscreen/testsprite2_fullscreen.actions b/visualtest/configs/testsprite2_fullscreen/testsprite2_fullscreen.actions deleted file mode 100644 index ef54e86b48..0000000000 --- a/visualtest/configs/testsprite2_fullscreen/testsprite2_fullscreen.actions +++ /dev/null @@ -1,3 +0,0 @@ -00:00:03 SCREENSHOT -00:00:06 VERIFY -00:00:09 QUIT \ No newline at end of file diff --git a/visualtest/configs/testsprite2_fullscreen/testsprite2_fullscreen.config b/visualtest/configs/testsprite2_fullscreen/testsprite2_fullscreen.config deleted file mode 100644 index 361020ac08..0000000000 --- a/visualtest/configs/testsprite2_fullscreen/testsprite2_fullscreen.config +++ /dev/null @@ -1,5 +0,0 @@ -parameter-config=testsprite2_fullscreen.parameters -variator=exhaustive -sutapp=testsprite2 -timeout=00:00:15 -action-config=testsprite2_fullscreen.actions \ No newline at end of file diff --git a/visualtest/configs/testsprite2_fullscreen/testsprite2_fullscreen.parameters b/visualtest/configs/testsprite2_fullscreen/testsprite2_fullscreen.parameters deleted file mode 100644 index 8da19673ea..0000000000 --- a/visualtest/configs/testsprite2_fullscreen/testsprite2_fullscreen.parameters +++ /dev/null @@ -1,5 +0,0 @@ -# parameter name, type, value range, required, categories ---blend, enum, [none blend add mod], false, [] ---fullscreen, boolean, [], false, [] ---fullscreen-desktop, boolean, [], false, [] ---iterations, integer, [1000 1000], true, [] \ No newline at end of file diff --git a/visualtest/configs/testsprite2_geometry/testsprite2_geometry.actions b/visualtest/configs/testsprite2_geometry/testsprite2_geometry.actions deleted file mode 100644 index ef54e86b48..0000000000 --- a/visualtest/configs/testsprite2_geometry/testsprite2_geometry.actions +++ /dev/null @@ -1,3 +0,0 @@ -00:00:03 SCREENSHOT -00:00:06 VERIFY -00:00:09 QUIT \ No newline at end of file diff --git a/visualtest/configs/testsprite2_geometry/testsprite2_geometry.config b/visualtest/configs/testsprite2_geometry/testsprite2_geometry.config deleted file mode 100644 index f3cda9ac11..0000000000 --- a/visualtest/configs/testsprite2_geometry/testsprite2_geometry.config +++ /dev/null @@ -1,5 +0,0 @@ -parameter-config=testsprite2_geometry.parameters -variator=exhaustive -sutapp=testsprite2 -timeout=00:00:15 -action-config=testsprite2_geometry.actions \ No newline at end of file diff --git a/visualtest/configs/testsprite2_geometry/testsprite2_geometry.parameters b/visualtest/configs/testsprite2_geometry/testsprite2_geometry.parameters deleted file mode 100644 index c1ac8ef372..0000000000 --- a/visualtest/configs/testsprite2_geometry/testsprite2_geometry.parameters +++ /dev/null @@ -1,5 +0,0 @@ -# parameter name, type, value range, required, categories ---geometry, enum, [500x500 600x600], false, [] ---logical, enum, [300x500 550x450], false, [] ---scale, integer, [1 5], false, [] ---iterations, integer, [1000 1000], true, [] \ No newline at end of file diff --git a/visualtest/configure b/visualtest/configure deleted file mode 100755 index b9576830ab..0000000000 --- a/visualtest/configure +++ /dev/null @@ -1,4442 +0,0 @@ -#! /bin/sh -# Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69. -# -# -# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. -# -# -# This configure script is free software; the Free Software Foundation -# gives unlimited permission to copy, distribute and modify it. -## -------------------- ## -## M4sh Initialization. ## -## -------------------- ## - -# Be more Bourne compatible -DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in #( - *posix*) : - set -o posix ;; #( - *) : - ;; -esac -fi - - -as_nl=' -' -export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -# Prefer a ksh shell builtin over an external printf program on Solaris, -# but without wasting forks for bash or zsh. -if test -z "$BASH_VERSION$ZSH_VERSION" \ - && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='print -r --' - as_echo_n='print -rn --' -elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' - else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in #( - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' - fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' -fi - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - PATH_SEPARATOR=: - (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { - (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || - PATH_SEPARATOR=';' - } -fi - - -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -IFS=" "" $as_nl" - -# Find who we are. Look in the path if we contain no directory separator. -as_myself= -case $0 in #(( - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break - done -IFS=$as_save_IFS - - ;; -esac -# We did not find ourselves, most probably we were run as `sh COMMAND' -# in which case we are not to be found in the path. -if test "x$as_myself" = x; then - as_myself=$0 -fi -if test ! -f "$as_myself"; then - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - exit 1 -fi - -# Unset variables that we do not need and which cause bugs (e.g. in -# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" -# suppresses any "Segmentation fault" message there. '((' could -# trigger a bug in pdksh 5.2.14. -for as_var in BASH_ENV ENV MAIL MAILPATH -do eval test x\${$as_var+set} = xset \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - -# Use a proper internal environment variable to ensure we don't fall - # into an infinite loop, continuously re-executing ourselves. - if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then - _as_can_reexec=no; export _as_can_reexec; - # We cannot yet assume a decent shell, so we have to provide a -# neutralization value for shells without unset; and this also -# works around shells that cannot unset nonexistent variables. -# Preserve -v and -x to the replacement shell. -BASH_ENV=/dev/null -ENV=/dev/null -(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV -case $- in # (((( - *v*x* | *x*v* ) as_opts=-vx ;; - *v* ) as_opts=-v ;; - *x* ) as_opts=-x ;; - * ) as_opts= ;; -esac -exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} -# Admittedly, this is quite paranoid, since all the known shells bail -# out after a failed `exec'. -$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 -as_fn_exit 255 - fi - # We don't want this to propagate to other subprocesses. - { _as_can_reexec=; unset _as_can_reexec;} -if test "x$CONFIG_SHELL" = x; then - as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which - # is contrary to our usage. Disable this feature. - alias -g '\${1+\"\$@\"}'='\"\$@\"' - setopt NO_GLOB_SUBST -else - case \`(set -o) 2>/dev/null\` in #( - *posix*) : - set -o posix ;; #( - *) : - ;; -esac -fi -" - as_required="as_fn_return () { (exit \$1); } -as_fn_success () { as_fn_return 0; } -as_fn_failure () { as_fn_return 1; } -as_fn_ret_success () { return 0; } -as_fn_ret_failure () { return 1; } - -exitcode=0 -as_fn_success || { exitcode=1; echo as_fn_success failed.; } -as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } -as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } -as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } -if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : - -else - exitcode=1; echo positional parameters were not saved. -fi -test x\$exitcode = x0 || exit 1 -test -x / || exit 1" - as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO - as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO - eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && - test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1" - if (eval "$as_required") 2>/dev/null; then : - as_have_required=yes -else - as_have_required=no -fi - if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : - -else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -as_found=false -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - as_found=: - case $as_dir in #( - /*) - for as_base in sh bash ksh sh5; do - # Try only shells that exist, to save several forks. - as_shell=$as_dir/$as_base - if { test -f "$as_shell" || test -f "$as_shell.exe"; } && - { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : - CONFIG_SHELL=$as_shell as_have_required=yes - if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : - break 2 -fi -fi - done;; - esac - as_found=false -done -$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && - { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : - CONFIG_SHELL=$SHELL as_have_required=yes -fi; } -IFS=$as_save_IFS - - - if test "x$CONFIG_SHELL" != x; then : - export CONFIG_SHELL - # We cannot yet assume a decent shell, so we have to provide a -# neutralization value for shells without unset; and this also -# works around shells that cannot unset nonexistent variables. -# Preserve -v and -x to the replacement shell. -BASH_ENV=/dev/null -ENV=/dev/null -(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV -case $- in # (((( - *v*x* | *x*v* ) as_opts=-vx ;; - *v* ) as_opts=-v ;; - *x* ) as_opts=-x ;; - * ) as_opts= ;; -esac -exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} -# Admittedly, this is quite paranoid, since all the known shells bail -# out after a failed `exec'. -$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 -exit 255 -fi - - if test x$as_have_required = xno; then : - $as_echo "$0: This script requires a shell more modern than all" - $as_echo "$0: the shells that I found on your system." - if test x${ZSH_VERSION+set} = xset ; then - $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" - $as_echo "$0: be upgraded to zsh 4.3.4 or later." - else - $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, -$0: including any error possibly output before this -$0: message. Then install a modern shell, or manually run -$0: the script under such a shell if you do have one." - fi - exit 1 -fi -fi -fi -SHELL=${CONFIG_SHELL-/bin/sh} -export SHELL -# Unset more variables known to interfere with behavior of common tools. -CLICOLOR_FORCE= GREP_OPTIONS= -unset CLICOLOR_FORCE GREP_OPTIONS - -## --------------------- ## -## M4sh Shell Functions. ## -## --------------------- ## -# as_fn_unset VAR -# --------------- -# Portably unset VAR. -as_fn_unset () -{ - { eval $1=; unset $1;} -} -as_unset=as_fn_unset - -# as_fn_set_status STATUS -# ----------------------- -# Set $? to STATUS, without forking. -as_fn_set_status () -{ - return $1 -} # as_fn_set_status - -# as_fn_exit STATUS -# ----------------- -# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. -as_fn_exit () -{ - set +e - as_fn_set_status $1 - exit $1 -} # as_fn_exit - -# as_fn_mkdir_p -# ------------- -# Create "$as_dir" as a directory, including parents if necessary. -as_fn_mkdir_p () -{ - - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || eval $as_mkdir_p || { - as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( - *) as_qdir=$as_dir;; - esac - as_dirs="'$as_qdir' $as_dirs" - as_dir=`$as_dirname -- "$as_dir" || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - test -d "$as_dir" && break - done - test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" - - -} # as_fn_mkdir_p - -# as_fn_executable_p FILE -# ----------------------- -# Test if FILE is an executable regular file. -as_fn_executable_p () -{ - test -f "$1" && test -x "$1" -} # as_fn_executable_p -# as_fn_append VAR VALUE -# ---------------------- -# Append the text in VALUE to the end of the definition contained in VAR. Take -# advantage of any shell optimizations that allow amortized linear growth over -# repeated appends, instead of the typical quadratic growth present in naive -# implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : - eval 'as_fn_append () - { - eval $1+=\$2 - }' -else - as_fn_append () - { - eval $1=\$$1\$2 - } -fi # as_fn_append - -# as_fn_arith ARG... -# ------------------ -# Perform arithmetic evaluation on the ARGs, and store the result in the -# global $as_val. Take advantage of shells that can avoid forks. The arguments -# must be portable across $(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : - eval 'as_fn_arith () - { - as_val=$(( $* )) - }' -else - as_fn_arith () - { - as_val=`expr "$@" || test $? -eq 1` - } -fi # as_fn_arith - - -# as_fn_error STATUS ERROR [LINENO LOG_FD] -# ---------------------------------------- -# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are -# provided, also output the error to LOG_FD, referencing LINENO. Then exit the -# script with STATUS, using 1 if that was 0. -as_fn_error () -{ - as_status=$1; test $as_status -eq 0 && as_status=1 - if test "$4"; then - as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 - fi - $as_echo "$as_me: error: $2" >&2 - as_fn_exit $as_status -} # as_fn_error - -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi - -as_me=`$as_basename -- "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - - - as_lineno_1=$LINENO as_lineno_1a=$LINENO - as_lineno_2=$LINENO as_lineno_2a=$LINENO - eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && - test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { - # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) - sed -n ' - p - /[$]LINENO/= - ' <$as_myself | - sed ' - s/[$]LINENO.*/&-/ - t lineno - b - :lineno - N - :loop - s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ - t loop - s/-\n.*// - ' >$as_me.lineno && - chmod +x "$as_me.lineno" || - { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } - - # If we had to re-execute with $CONFIG_SHELL, we're ensured to have - # already done that, so ensure we don't try to do so again and fall - # in an infinite loop. This has already happened in practice. - _as_can_reexec=no; export _as_can_reexec - # Don't try to exec as it changes $[0], causing all sort of problems - # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensitive to this). - . "./$as_me.lineno" - # Exit status is that of the last command. - exit -} - -ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in #((((( --n*) - case `echo 'xy\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - xy) ECHO_C='\c';; - *) echo `echo ksh88 bug on AIX 6.1` > /dev/null - ECHO_T=' ';; - esac;; -*) - ECHO_N='-n';; -esac - -rm -f conf$$ conf$$.exe conf$$.file -if test -d conf$$.dir; then - rm -f conf$$.dir/conf$$.file -else - rm -f conf$$.dir - mkdir conf$$.dir 2>/dev/null -fi -if (echo >conf$$.file) 2>/dev/null; then - if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -pR'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -pR' - elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln - else - as_ln_s='cp -pR' - fi -else - as_ln_s='cp -pR' -fi -rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file -rmdir conf$$.dir 2>/dev/null - -if mkdir -p . 2>/dev/null; then - as_mkdir_p='mkdir -p "$as_dir"' -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - -as_test_x='test -x' -as_executable_p=as_fn_executable_p - -# Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" - -# Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - - -test -n "$DJDIR" || exec 7<&0 &1 - -# Name of the host. -# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, -# so uname gets run too. -ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` - -# -# Initializations. -# -ac_default_prefix=/usr/local -ac_clean_files= -ac_config_libobj_dir=. -LIBOBJS= -cross_compiling=no -subdirs= -MFLAGS= -MAKEFLAGS= - -# Identity of this package. -PACKAGE_NAME= -PACKAGE_TARNAME= -PACKAGE_VERSION= -PACKAGE_STRING= -PACKAGE_BUGREPORT= -PACKAGE_URL= - -ac_unique_file="unittest/testquit.c" -ac_subst_vars='LTLIBOBJS -LIBOBJS -LIBUNWIND_LIBS -LIBUNWIND_CFLAGS -SDL3_CONFIG -SDL_LIBS -SDL_CFLAGS -PKG_CONFIG_LIBDIR -PKG_CONFIG_PATH -PKG_CONFIG -EXE -OBJEXT -EXEEXT -ac_ct_CC -CPPFLAGS -LDFLAGS -CFLAGS -CC -host_os -host_vendor -host_cpu -host -build_os -build_vendor -build_cpu -build -target_alias -host_alias -build_alias -LIBS -ECHO_T -ECHO_N -ECHO_C -DEFS -mandir -localedir -libdir -psdir -pdfdir -dvidir -htmldir -infodir -docdir -oldincludedir -includedir -localstatedir -sharedstatedir -sysconfdir -datadir -datarootdir -libexecdir -sbindir -bindir -program_transform_name -prefix -exec_prefix -PACKAGE_URL -PACKAGE_BUGREPORT -PACKAGE_STRING -PACKAGE_VERSION -PACKAGE_TARNAME -PACKAGE_NAME -PATH_SEPARATOR -SHELL' -ac_subst_files='' -ac_user_opts=' -enable_option_checking -with_sdl_prefix -with_sdl_exec_prefix -enable_sdltest -' - ac_precious_vars='build_alias -host_alias -target_alias -CC -CFLAGS -LDFLAGS -LIBS -CPPFLAGS -PKG_CONFIG -PKG_CONFIG_PATH -PKG_CONFIG_LIBDIR -SDL_CFLAGS -SDL_LIBS -LIBUNWIND_CFLAGS -LIBUNWIND_LIBS' - - -# Initialize some variables set by options. -ac_init_help= -ac_init_version=false -ac_unrecognized_opts= -ac_unrecognized_sep= -# The variables have the same names as the options, with -# dashes changed to underlines. -cache_file=/dev/null -exec_prefix=NONE -no_create= -no_recursion= -prefix=NONE -program_prefix=NONE -program_suffix=NONE -program_transform_name=s,x,x, -silent= -site= -srcdir= -verbose= -x_includes=NONE -x_libraries=NONE - -# Installation directory options. -# These are left unexpanded so users can "make install exec_prefix=/foo" -# and all the variables that are supposed to be based on exec_prefix -# by default will actually change. -# Use braces instead of parens because sh, perl, etc. also accept them. -# (The list follows the same order as the GNU Coding Standards.) -bindir='${exec_prefix}/bin' -sbindir='${exec_prefix}/sbin' -libexecdir='${exec_prefix}/libexec' -datarootdir='${prefix}/share' -datadir='${datarootdir}' -sysconfdir='${prefix}/etc' -sharedstatedir='${prefix}/com' -localstatedir='${prefix}/var' -includedir='${prefix}/include' -oldincludedir='/usr/include' -docdir='${datarootdir}/doc/${PACKAGE}' -infodir='${datarootdir}/info' -htmldir='${docdir}' -dvidir='${docdir}' -pdfdir='${docdir}' -psdir='${docdir}' -libdir='${exec_prefix}/lib' -localedir='${datarootdir}/locale' -mandir='${datarootdir}/man' - -ac_prev= -ac_dashdash= -for ac_option -do - # If the previous option needs an argument, assign it. - if test -n "$ac_prev"; then - eval $ac_prev=\$ac_option - ac_prev= - continue - fi - - case $ac_option in - *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; - *=) ac_optarg= ;; - *) ac_optarg=yes ;; - esac - - # Accept the important Cygnus configure options, so we can diagnose typos. - - case $ac_dashdash$ac_option in - --) - ac_dashdash=yes ;; - - -bindir | --bindir | --bindi | --bind | --bin | --bi) - ac_prev=bindir ;; - -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) - bindir=$ac_optarg ;; - - -build | --build | --buil | --bui | --bu) - ac_prev=build_alias ;; - -build=* | --build=* | --buil=* | --bui=* | --bu=*) - build_alias=$ac_optarg ;; - - -cache-file | --cache-file | --cache-fil | --cache-fi \ - | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) - ac_prev=cache_file ;; - -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ - | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) - cache_file=$ac_optarg ;; - - --config-cache | -C) - cache_file=config.cache ;; - - -datadir | --datadir | --datadi | --datad) - ac_prev=datadir ;; - -datadir=* | --datadir=* | --datadi=* | --datad=*) - datadir=$ac_optarg ;; - - -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ - | --dataroo | --dataro | --datar) - ac_prev=datarootdir ;; - -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ - | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) - datarootdir=$ac_optarg ;; - - -disable-* | --disable-*) - ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid feature name: $ac_useropt" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"enable_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval enable_$ac_useropt=no ;; - - -docdir | --docdir | --docdi | --doc | --do) - ac_prev=docdir ;; - -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) - docdir=$ac_optarg ;; - - -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) - ac_prev=dvidir ;; - -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) - dvidir=$ac_optarg ;; - - -enable-* | --enable-*) - ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid feature name: $ac_useropt" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"enable_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval enable_$ac_useropt=\$ac_optarg ;; - - -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ - | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ - | --exec | --exe | --ex) - ac_prev=exec_prefix ;; - -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ - | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ - | --exec=* | --exe=* | --ex=*) - exec_prefix=$ac_optarg ;; - - -gas | --gas | --ga | --g) - # Obsolete; use --with-gas. - with_gas=yes ;; - - -help | --help | --hel | --he | -h) - ac_init_help=long ;; - -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) - ac_init_help=recursive ;; - -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) - ac_init_help=short ;; - - -host | --host | --hos | --ho) - ac_prev=host_alias ;; - -host=* | --host=* | --hos=* | --ho=*) - host_alias=$ac_optarg ;; - - -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) - ac_prev=htmldir ;; - -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ - | --ht=*) - htmldir=$ac_optarg ;; - - -includedir | --includedir | --includedi | --included | --include \ - | --includ | --inclu | --incl | --inc) - ac_prev=includedir ;; - -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ - | --includ=* | --inclu=* | --incl=* | --inc=*) - includedir=$ac_optarg ;; - - -infodir | --infodir | --infodi | --infod | --info | --inf) - ac_prev=infodir ;; - -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) - infodir=$ac_optarg ;; - - -libdir | --libdir | --libdi | --libd) - ac_prev=libdir ;; - -libdir=* | --libdir=* | --libdi=* | --libd=*) - libdir=$ac_optarg ;; - - -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ - | --libexe | --libex | --libe) - ac_prev=libexecdir ;; - -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ - | --libexe=* | --libex=* | --libe=*) - libexecdir=$ac_optarg ;; - - -localedir | --localedir | --localedi | --localed | --locale) - ac_prev=localedir ;; - -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) - localedir=$ac_optarg ;; - - -localstatedir | --localstatedir | --localstatedi | --localstated \ - | --localstate | --localstat | --localsta | --localst | --locals) - ac_prev=localstatedir ;; - -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ - | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) - localstatedir=$ac_optarg ;; - - -mandir | --mandir | --mandi | --mand | --man | --ma | --m) - ac_prev=mandir ;; - -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) - mandir=$ac_optarg ;; - - -nfp | --nfp | --nf) - # Obsolete; use --without-fp. - with_fp=no ;; - - -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c | -n) - no_create=yes ;; - - -no-recursion | --no-recursion | --no-recursio | --no-recursi \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) - no_recursion=yes ;; - - -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ - | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ - | --oldin | --oldi | --old | --ol | --o) - ac_prev=oldincludedir ;; - -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ - | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ - | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) - oldincludedir=$ac_optarg ;; - - -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) - ac_prev=prefix ;; - -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) - prefix=$ac_optarg ;; - - -program-prefix | --program-prefix | --program-prefi | --program-pref \ - | --program-pre | --program-pr | --program-p) - ac_prev=program_prefix ;; - -program-prefix=* | --program-prefix=* | --program-prefi=* \ - | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) - program_prefix=$ac_optarg ;; - - -program-suffix | --program-suffix | --program-suffi | --program-suff \ - | --program-suf | --program-su | --program-s) - ac_prev=program_suffix ;; - -program-suffix=* | --program-suffix=* | --program-suffi=* \ - | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) - program_suffix=$ac_optarg ;; - - -program-transform-name | --program-transform-name \ - | --program-transform-nam | --program-transform-na \ - | --program-transform-n | --program-transform- \ - | --program-transform | --program-transfor \ - | --program-transfo | --program-transf \ - | --program-trans | --program-tran \ - | --progr-tra | --program-tr | --program-t) - ac_prev=program_transform_name ;; - -program-transform-name=* | --program-transform-name=* \ - | --program-transform-nam=* | --program-transform-na=* \ - | --program-transform-n=* | --program-transform-=* \ - | --program-transform=* | --program-transfor=* \ - | --program-transfo=* | --program-transf=* \ - | --program-trans=* | --program-tran=* \ - | --progr-tra=* | --program-tr=* | --program-t=*) - program_transform_name=$ac_optarg ;; - - -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) - ac_prev=pdfdir ;; - -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) - pdfdir=$ac_optarg ;; - - -psdir | --psdir | --psdi | --psd | --ps) - ac_prev=psdir ;; - -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) - psdir=$ac_optarg ;; - - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - silent=yes ;; - - -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) - ac_prev=sbindir ;; - -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ - | --sbi=* | --sb=*) - sbindir=$ac_optarg ;; - - -sharedstatedir | --sharedstatedir | --sharedstatedi \ - | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ - | --sharedst | --shareds | --shared | --share | --shar \ - | --sha | --sh) - ac_prev=sharedstatedir ;; - -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ - | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ - | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ - | --sha=* | --sh=*) - sharedstatedir=$ac_optarg ;; - - -site | --site | --sit) - ac_prev=site ;; - -site=* | --site=* | --sit=*) - site=$ac_optarg ;; - - -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) - ac_prev=srcdir ;; - -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) - srcdir=$ac_optarg ;; - - -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ - | --syscon | --sysco | --sysc | --sys | --sy) - ac_prev=sysconfdir ;; - -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ - | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) - sysconfdir=$ac_optarg ;; - - -target | --target | --targe | --targ | --tar | --ta | --t) - ac_prev=target_alias ;; - -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) - target_alias=$ac_optarg ;; - - -v | -verbose | --verbose | --verbos | --verbo | --verb) - verbose=yes ;; - - -version | --version | --versio | --versi | --vers | -V) - ac_init_version=: ;; - - -with-* | --with-*) - ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: $ac_useropt" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"with_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval with_$ac_useropt=\$ac_optarg ;; - - -without-* | --without-*) - ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: $ac_useropt" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"with_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval with_$ac_useropt=no ;; - - --x) - # Obsolete; use --with-x. - with_x=yes ;; - - -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ - | --x-incl | --x-inc | --x-in | --x-i) - ac_prev=x_includes ;; - -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ - | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) - x_includes=$ac_optarg ;; - - -x-libraries | --x-libraries | --x-librarie | --x-librari \ - | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) - ac_prev=x_libraries ;; - -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ - | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) - x_libraries=$ac_optarg ;; - - -*) as_fn_error $? "unrecognized option: \`$ac_option' -Try \`$0 --help' for more information" - ;; - - *=*) - ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` - # Reject names that are not valid shell variable names. - case $ac_envvar in #( - '' | [0-9]* | *[!_$as_cr_alnum]* ) - as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; - esac - eval $ac_envvar=\$ac_optarg - export $ac_envvar ;; - - *) - # FIXME: should be removed in autoconf 3.0. - $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 - expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && - $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 - : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" - ;; - - esac -done - -if test -n "$ac_prev"; then - ac_option=--`echo $ac_prev | sed 's/_/-/g'` - as_fn_error $? "missing argument to $ac_option" -fi - -if test -n "$ac_unrecognized_opts"; then - case $enable_option_checking in - no) ;; - fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; - *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; - esac -fi - -# Check all directory arguments for consistency. -for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ - datadir sysconfdir sharedstatedir localstatedir includedir \ - oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir -do - eval ac_val=\$$ac_var - # Remove trailing slashes. - case $ac_val in - */ ) - ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` - eval $ac_var=\$ac_val;; - esac - # Be sure to have absolute directory names. - case $ac_val in - [\\/$]* | ?:[\\/]* ) continue;; - NONE | '' ) case $ac_var in *prefix ) continue;; esac;; - esac - as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" -done - -# There might be people who depend on the old broken behavior: `$host' -# used to hold the argument of --host etc. -# FIXME: To remove some day. -build=$build_alias -host=$host_alias -target=$target_alias - -# FIXME: To remove some day. -if test "x$host_alias" != x; then - if test "x$build_alias" = x; then - cross_compiling=maybe - elif test "x$build_alias" != "x$host_alias"; then - cross_compiling=yes - fi -fi - -ac_tool_prefix= -test -n "$host_alias" && ac_tool_prefix=$host_alias- - -test "$silent" = yes && exec 6>/dev/null - - -ac_pwd=`pwd` && test -n "$ac_pwd" && -ac_ls_di=`ls -di .` && -ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || - as_fn_error $? "working directory cannot be determined" -test "X$ac_ls_di" = "X$ac_pwd_ls_di" || - as_fn_error $? "pwd does not report name of working directory" - - -# Find the source files, if location was not specified. -if test -z "$srcdir"; then - ac_srcdir_defaulted=yes - # Try the directory containing this script, then the parent directory. - ac_confdir=`$as_dirname -- "$as_myself" || -$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_myself" : 'X\(//\)[^/]' \| \ - X"$as_myself" : 'X\(//\)$' \| \ - X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_myself" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - srcdir=$ac_confdir - if test ! -r "$srcdir/$ac_unique_file"; then - srcdir=.. - fi -else - ac_srcdir_defaulted=no -fi -if test ! -r "$srcdir/$ac_unique_file"; then - test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." - as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" -fi -ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" -ac_abs_confdir=`( - cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" - pwd)` -# When building in place, set srcdir=. -if test "$ac_abs_confdir" = "$ac_pwd"; then - srcdir=. -fi -# Remove unnecessary trailing slashes from srcdir. -# Double slashes in file names in object file debugging info -# mess up M-x gdb in Emacs. -case $srcdir in -*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; -esac -for ac_var in $ac_precious_vars; do - eval ac_env_${ac_var}_set=\${${ac_var}+set} - eval ac_env_${ac_var}_value=\$${ac_var} - eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} - eval ac_cv_env_${ac_var}_value=\$${ac_var} -done - -# -# Report the --help message. -# -if test "$ac_init_help" = "long"; then - # Omit some internal or obsolete options to make the list less imposing. - # This message is too long to be a string in the A/UX 3.1 sh. - cat <<_ACEOF -\`configure' configures this package to adapt to many kinds of systems. - -Usage: $0 [OPTION]... [VAR=VALUE]... - -To assign environment variables (e.g., CC, CFLAGS...), specify them as -VAR=VALUE. See below for descriptions of some of the useful variables. - -Defaults for the options are specified in brackets. - -Configuration: - -h, --help display this help and exit - --help=short display options specific to this package - --help=recursive display the short help of all the included packages - -V, --version display version information and exit - -q, --quiet, --silent do not print \`checking ...' messages - --cache-file=FILE cache test results in FILE [disabled] - -C, --config-cache alias for \`--cache-file=config.cache' - -n, --no-create do not create output files - --srcdir=DIR find the sources in DIR [configure dir or \`..'] - -Installation directories: - --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] - --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [PREFIX] - -By default, \`make install' will install all the files in -\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify -an installation prefix other than \`$ac_default_prefix' using \`--prefix', -for instance \`--prefix=\$HOME'. - -For better control, use the options below. - -Fine tuning of the installation directories: - --bindir=DIR user executables [EPREFIX/bin] - --sbindir=DIR system admin executables [EPREFIX/sbin] - --libexecdir=DIR program executables [EPREFIX/libexec] - --sysconfdir=DIR read-only single-machine data [PREFIX/etc] - --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] - --localstatedir=DIR modifiable single-machine data [PREFIX/var] - --libdir=DIR object code libraries [EPREFIX/lib] - --includedir=DIR C header files [PREFIX/include] - --oldincludedir=DIR C header files for non-gcc [/usr/include] - --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] - --datadir=DIR read-only architecture-independent data [DATAROOTDIR] - --infodir=DIR info documentation [DATAROOTDIR/info] - --localedir=DIR locale-dependent data [DATAROOTDIR/locale] - --mandir=DIR man documentation [DATAROOTDIR/man] - --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] - --htmldir=DIR html documentation [DOCDIR] - --dvidir=DIR dvi documentation [DOCDIR] - --pdfdir=DIR pdf documentation [DOCDIR] - --psdir=DIR ps documentation [DOCDIR] -_ACEOF - - cat <<\_ACEOF - -System types: - --build=BUILD configure for building on BUILD [guessed] - --host=HOST cross-compile to build programs to run on HOST [BUILD] -_ACEOF -fi - -if test -n "$ac_init_help"; then - - cat <<\_ACEOF - -Optional Features: - --disable-option-checking ignore unrecognized --enable/--with options - --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) - --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --disable-sdltest Do not try to compile and run a test SDL program - -Optional Packages: - --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] - --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --with-sdl-prefix=PFX Prefix where SDL is installed (optional) - --with-sdl-exec-prefix=PFX Exec prefix where SDL is installed (optional) - -Some influential environment variables: - CC C compiler command - CFLAGS C compiler flags - LDFLAGS linker flags, e.g. -L if you have libraries in a - nonstandard directory - LIBS libraries to pass to the linker, e.g. -l - CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if - you have headers in a nonstandard directory - PKG_CONFIG path to pkg-config utility - PKG_CONFIG_PATH - directories to add to pkg-config's search path - PKG_CONFIG_LIBDIR - path overriding pkg-config's built-in search path - SDL_CFLAGS C compiler flags for SDL, overriding pkg-config - SDL_LIBS linker flags for SDL, overriding pkg-config - LIBUNWIND_CFLAGS - C compiler flags for LIBUNWIND, overriding pkg-config - LIBUNWIND_LIBS - linker flags for LIBUNWIND, overriding pkg-config - -Use these variables to override the choices made by `configure' or to help -it to find libraries and programs with nonstandard names/locations. - -Report bugs to the package provider. -_ACEOF -ac_status=$? -fi - -if test "$ac_init_help" = "recursive"; then - # If there are subdirs, report their specific --help. - for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue - test -d "$ac_dir" || - { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || - continue - ac_builddir=. - -case "$ac_dir" in -.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -*) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` - # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` - case $ac_top_builddir_sub in - "") ac_top_builddir_sub=. ac_top_build_prefix= ;; - *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; - esac ;; -esac -ac_abs_top_builddir=$ac_pwd -ac_abs_builddir=$ac_pwd$ac_dir_suffix -# for backward compatibility: -ac_top_builddir=$ac_top_build_prefix - -case $srcdir in - .) # We are building in place. - ac_srcdir=. - ac_top_srcdir=$ac_top_builddir_sub - ac_abs_top_srcdir=$ac_pwd ;; - [\\/]* | ?:[\\/]* ) # Absolute name. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir - ac_abs_top_srcdir=$srcdir ;; - *) # Relative name. - ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_build_prefix$srcdir - ac_abs_top_srcdir=$ac_pwd/$srcdir ;; -esac -ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix - - cd "$ac_dir" || { ac_status=$?; continue; } - # Check for guested configure. - if test -f "$ac_srcdir/configure.gnu"; then - echo && - $SHELL "$ac_srcdir/configure.gnu" --help=recursive - elif test -f "$ac_srcdir/configure"; then - echo && - $SHELL "$ac_srcdir/configure" --help=recursive - else - $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 - fi || ac_status=$? - cd "$ac_pwd" || { ac_status=$?; break; } - done -fi - -test -n "$ac_init_help" && exit $ac_status -if $ac_init_version; then - cat <<\_ACEOF -configure -generated by GNU Autoconf 2.69 - -Copyright (C) 2012 Free Software Foundation, Inc. -This configure script is free software; the Free Software Foundation -gives unlimited permission to copy, distribute and modify it. -_ACEOF - exit -fi - -## ------------------------ ## -## Autoconf initialization. ## -## ------------------------ ## - -# ac_fn_c_try_compile LINENO -# -------------------------- -# Try to compile conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_compile () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext - if { { ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compile") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_compile - -# ac_fn_c_try_run LINENO -# ---------------------- -# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes -# that executables *can* be run. -ac_fn_c_try_run () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' - { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then : - ac_retval=0 -else - $as_echo "$as_me: program exited with status $ac_status" >&5 - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=$ac_status -fi - rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_run - -# ac_fn_c_try_link LINENO -# ----------------------- -# Try to link conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_link () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext conftest$ac_exeext - if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - test -x conftest$ac_exeext - }; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information - # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would - # interfere with the next link command; also delete a directory that is - # left behind by Apple's compiler. We do this before executing the actions. - rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_link -cat >config.log <<_ACEOF -This file contains any messages produced by compilers while -running configure, to aid debugging if configure makes a mistake. - -It was created by $as_me, which was -generated by GNU Autoconf 2.69. Invocation command line was - - $ $0 $@ - -_ACEOF -exec 5>>config.log -{ -cat <<_ASUNAME -## --------- ## -## Platform. ## -## --------- ## - -hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` -uname -m = `(uname -m) 2>/dev/null || echo unknown` -uname -r = `(uname -r) 2>/dev/null || echo unknown` -uname -s = `(uname -s) 2>/dev/null || echo unknown` -uname -v = `(uname -v) 2>/dev/null || echo unknown` - -/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` -/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` - -/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` -/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` -/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` -/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` -/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` -/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` -/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` - -_ASUNAME - -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - $as_echo "PATH: $as_dir" - done -IFS=$as_save_IFS - -} >&5 - -cat >&5 <<_ACEOF - - -## ----------- ## -## Core tests. ## -## ----------- ## - -_ACEOF - - -# Keep a trace of the command line. -# Strip out --no-create and --no-recursion so they do not pile up. -# Strip out --silent because we don't want to record it for future runs. -# Also quote any args containing shell meta-characters. -# Make two passes to allow for proper duplicate-argument suppression. -ac_configure_args= -ac_configure_args0= -ac_configure_args1= -ac_must_keep_next=false -for ac_pass in 1 2 -do - for ac_arg - do - case $ac_arg in - -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - continue ;; - *\'*) - ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - case $ac_pass in - 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; - 2) - as_fn_append ac_configure_args1 " '$ac_arg'" - if test $ac_must_keep_next = true; then - ac_must_keep_next=false # Got value, back to normal. - else - case $ac_arg in - *=* | --config-cache | -C | -disable-* | --disable-* \ - | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ - | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ - | -with-* | --with-* | -without-* | --without-* | --x) - case "$ac_configure_args0 " in - "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; - esac - ;; - -* ) ac_must_keep_next=true ;; - esac - fi - as_fn_append ac_configure_args " '$ac_arg'" - ;; - esac - done -done -{ ac_configure_args0=; unset ac_configure_args0;} -{ ac_configure_args1=; unset ac_configure_args1;} - -# When interrupted or exit'd, cleanup temporary files, and complete -# config.log. We remove comments because anyway the quotes in there -# would cause problems or look ugly. -# WARNING: Use '\'' to represent an apostrophe within the trap. -# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. -trap 'exit_status=$? - # Save into config.log some information that might help in debugging. - { - echo - - $as_echo "## ---------------- ## -## Cache variables. ## -## ---------------- ##" - echo - # The following way of writing the cache mishandles newlines in values, -( - for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do - eval ac_val=\$$ac_var - case $ac_val in #( - *${as_nl}*) - case $ac_var in #( - *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; - esac - case $ac_var in #( - _ | IFS | as_nl) ;; #( - BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( - *) { eval $ac_var=; unset $ac_var;} ;; - esac ;; - esac - done - (set) 2>&1 | - case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( - *${as_nl}ac_space=\ *) - sed -n \ - "s/'\''/'\''\\\\'\'''\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" - ;; #( - *) - sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" - ;; - esac | - sort -) - echo - - $as_echo "## ----------------- ## -## Output variables. ## -## ----------------- ##" - echo - for ac_var in $ac_subst_vars - do - eval ac_val=\$$ac_var - case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; - esac - $as_echo "$ac_var='\''$ac_val'\''" - done | sort - echo - - if test -n "$ac_subst_files"; then - $as_echo "## ------------------- ## -## File substitutions. ## -## ------------------- ##" - echo - for ac_var in $ac_subst_files - do - eval ac_val=\$$ac_var - case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; - esac - $as_echo "$ac_var='\''$ac_val'\''" - done | sort - echo - fi - - if test -s confdefs.h; then - $as_echo "## ----------- ## -## confdefs.h. ## -## ----------- ##" - echo - cat confdefs.h - echo - fi - test "$ac_signal" != 0 && - $as_echo "$as_me: caught signal $ac_signal" - $as_echo "$as_me: exit $exit_status" - } >&5 - rm -f core *.core core.conftest.* && - rm -f -r conftest* confdefs* conf$$* $ac_clean_files && - exit $exit_status -' 0 -for ac_signal in 1 2 13 15; do - trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal -done -ac_signal=0 - -# confdefs.h avoids OS command line length limits that DEFS can exceed. -rm -f -r conftest* confdefs.h - -$as_echo "/* confdefs.h */" > confdefs.h - -# Predefined preprocessor variables. - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_NAME "$PACKAGE_NAME" -_ACEOF - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_TARNAME "$PACKAGE_TARNAME" -_ACEOF - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_VERSION "$PACKAGE_VERSION" -_ACEOF - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_STRING "$PACKAGE_STRING" -_ACEOF - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" -_ACEOF - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_URL "$PACKAGE_URL" -_ACEOF - - -# Let the site file select an alternate cache file if it wants to. -# Prefer an explicitly selected file to automatically selected ones. -ac_site_file1=NONE -ac_site_file2=NONE -if test -n "$CONFIG_SITE"; then - # We do not want a PATH search for config.site. - case $CONFIG_SITE in #(( - -*) ac_site_file1=./$CONFIG_SITE;; - */*) ac_site_file1=$CONFIG_SITE;; - *) ac_site_file1=./$CONFIG_SITE;; - esac -elif test "x$prefix" != xNONE; then - ac_site_file1=$prefix/share/config.site - ac_site_file2=$prefix/etc/config.site -else - ac_site_file1=$ac_default_prefix/share/config.site - ac_site_file2=$ac_default_prefix/etc/config.site -fi -for ac_site_file in "$ac_site_file1" "$ac_site_file2" -do - test "x$ac_site_file" = xNONE && continue - if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 -$as_echo "$as_me: loading site script $ac_site_file" >&6;} - sed 's/^/| /' "$ac_site_file" >&5 - . "$ac_site_file" \ - || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "failed to load site script $ac_site_file -See \`config.log' for more details" "$LINENO" 5; } - fi -done - -if test -r "$cache_file"; then - # Some versions of bash will fail to source /dev/null (special files - # actually), so we avoid doing that. DJGPP emulates it as a regular file. - if test /dev/null != "$cache_file" && test -f "$cache_file"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 -$as_echo "$as_me: loading cache $cache_file" >&6;} - case $cache_file in - [\\/]* | ?:[\\/]* ) . "$cache_file";; - *) . "./$cache_file";; - esac - fi -else - { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 -$as_echo "$as_me: creating cache $cache_file" >&6;} - >$cache_file -fi - -# Check that the precious variables saved in the cache have kept the same -# value. -ac_cache_corrupted=false -for ac_var in $ac_precious_vars; do - eval ac_old_set=\$ac_cv_env_${ac_var}_set - eval ac_new_set=\$ac_env_${ac_var}_set - eval ac_old_val=\$ac_cv_env_${ac_var}_value - eval ac_new_val=\$ac_env_${ac_var}_value - case $ac_old_set,$ac_new_set in - set,) - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,set) - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,);; - *) - if test "x$ac_old_val" != "x$ac_new_val"; then - # differences in whitespace do not lead to failure. - ac_old_val_w=`echo x $ac_old_val` - ac_new_val_w=`echo x $ac_new_val` - if test "$ac_old_val_w" != "$ac_new_val_w"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 -$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - ac_cache_corrupted=: - else - { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 -$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} - eval $ac_var=\$ac_old_val - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 -$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 -$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} - fi;; - esac - # Pass precious variables to config.status. - if test "$ac_new_set" = set; then - case $ac_new_val in - *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; - *) ac_arg=$ac_var=$ac_new_val ;; - esac - case " $ac_configure_args " in - *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. - *) as_fn_append ac_configure_args " '$ac_arg'" ;; - esac - fi -done -if $ac_cache_corrupted; then - { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 -$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} - as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 -fi -## -------------------- ## -## Main body of script. ## -## -------------------- ## - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - - - -ac_aux_dir= -for ac_dir in ../build-scripts "$srcdir"/../build-scripts; do - if test -f "$ac_dir/install-sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install-sh -c" - break - elif test -f "$ac_dir/install.sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install.sh -c" - break - elif test -f "$ac_dir/shtool"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/shtool install -c" - break - fi -done -if test -z "$ac_aux_dir"; then - as_fn_error $? "cannot find install-sh, install.sh, or shtool in ../build-scripts \"$srcdir\"/../build-scripts" "$LINENO" 5 -fi - -# These three variables are undocumented and unsupported, -# and are intended to be withdrawn in a future Autoconf release. -# They can cause serious problems if a builder's source tree is in a directory -# whose full name contains unusual characters. -ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. -ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. -ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. - - -# Make sure we can run config.sub. -$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || - as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 -$as_echo_n "checking build system type... " >&6; } -if ${ac_cv_build+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_build_alias=$build_alias -test "x$ac_build_alias" = x && - ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` -test "x$ac_build_alias" = x && - as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 -ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || - as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 -$as_echo "$ac_cv_build" >&6; } -case $ac_cv_build in -*-*-*) ;; -*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; -esac -build=$ac_cv_build -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_build -shift -build_cpu=$1 -build_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: -build_os=$* -IFS=$ac_save_IFS -case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 -$as_echo_n "checking host system type... " >&6; } -if ${ac_cv_host+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "x$host_alias" = x; then - ac_cv_host=$ac_cv_build -else - ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || - as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 -$as_echo "$ac_cv_host" >&6; } -case $ac_cv_host in -*-*-*) ;; -*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; -esac -host=$ac_cv_host -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_host -shift -host_cpu=$1 -host_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: -host_os=$* -IFS=$ac_save_IFS -case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac - - - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. -set dummy ${ac_tool_prefix}gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="${ac_tool_prefix}gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_CC"; then - ac_ct_CC=$CC - # Extract the first word of "gcc", so it can be a program name with args. -set dummy gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi -else - CC="$ac_cv_prog_CC" -fi - -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. -set dummy ${ac_tool_prefix}cc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="${ac_tool_prefix}cc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - fi -fi -if test -z "$CC"; then - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - ac_prog_rejected=no -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then - ac_prog_rejected=yes - continue - fi - ac_cv_prog_CC="cc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -if test $ac_prog_rejected = yes; then - # We found a bogon in the path, so make sure we never use it. - set dummy $ac_cv_prog_CC - shift - if test $# != 0; then - # We chose a different compiler from the bogus one. - # However, it has the same basename, so the bogon will be chosen - # first if we set CC to just the basename; use the full file name. - shift - ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" - fi -fi -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - for ac_prog in cl.exe - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$CC" && break - done -fi -if test -z "$CC"; then - ac_ct_CC=$CC - for ac_prog in cl.exe -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$ac_ct_CC" && break -done - - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi -fi - -fi - - -test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "no acceptable C compiler found in \$PATH -See \`config.log' for more details" "$LINENO" 5; } - -# Provide some information about the compiler. -$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 -set X $ac_compile -ac_compiler=$2 -for ac_option in --version -v -V -qversion; do - { { ac_try="$ac_compiler $ac_option >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compiler $ac_option >&5") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - sed '10a\ -... rest of stderr output deleted ... - 10q' conftest.err >conftest.er1 - cat conftest.er1 >&5 - fi - rm -f conftest.er1 conftest.err - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } -done - -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" -# Try to create an executable without -o first, disregard a.out. -# It will help us diagnose broken compilers, and finding out an intuition -# of exeext. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 -$as_echo_n "checking whether the C compiler works... " >&6; } -ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` - -# The possible output files: -ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" - -ac_rmfiles= -for ac_file in $ac_files -do - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; - * ) ac_rmfiles="$ac_rmfiles $ac_file";; - esac -done -rm -f $ac_rmfiles - -if { { ac_try="$ac_link_default" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link_default") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : - # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. -# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' -# in a Makefile. We should not override ac_cv_exeext if it was cached, -# so that the user can short-circuit this test for compilers unknown to -# Autoconf. -for ac_file in $ac_files '' -do - test -f "$ac_file" || continue - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) - ;; - [ab].out ) - # We found the default executable, but exeext='' is most - # certainly right. - break;; - *.* ) - if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; - then :; else - ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - fi - # We set ac_cv_exeext here because the later test for it is not - # safe: cross compilers may not add the suffix if given an `-o' - # argument, so we may need to know it at that point already. - # Even if this section looks crufty: it has the advantage of - # actually working. - break;; - * ) - break;; - esac -done -test "$ac_cv_exeext" = no && ac_cv_exeext= - -else - ac_file='' -fi -if test -z "$ac_file"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error 77 "C compiler cannot create executables -See \`config.log' for more details" "$LINENO" 5; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 -$as_echo_n "checking for C compiler default output file name... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 -$as_echo "$ac_file" >&6; } -ac_exeext=$ac_cv_exeext - -rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out -ac_clean_files=$ac_clean_files_save -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 -$as_echo_n "checking for suffix of executables... " >&6; } -if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : - # If both `conftest.exe' and `conftest' are `present' (well, observable) -# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will -# work properly (i.e., refer to `conftest.exe'), while it won't with -# `rm'. -for ac_file in conftest.exe conftest conftest.*; do - test -f "$ac_file" || continue - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; - *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - break;; - * ) break;; - esac -done -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details" "$LINENO" 5; } -fi -rm -f conftest conftest$ac_cv_exeext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 -$as_echo "$ac_cv_exeext" >&6; } - -rm -f conftest.$ac_ext -EXEEXT=$ac_cv_exeext -ac_exeext=$EXEEXT -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main () -{ -FILE *f = fopen ("conftest.out", "w"); - return ferror (f) || fclose (f) != 0; - - ; - return 0; -} -_ACEOF -ac_clean_files="$ac_clean_files conftest.out" -# Check that the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 -$as_echo_n "checking whether we are cross compiling... " >&6; } -if test "$cross_compiling" != yes; then - { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - if { ac_try='./conftest$ac_cv_exeext' - { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then - cross_compiling=no - else - if test "$cross_compiling" = maybe; then - cross_compiling=yes - else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details" "$LINENO" 5; } - fi - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 -$as_echo "$cross_compiling" >&6; } - -rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out -ac_clean_files=$ac_clean_files_save -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 -$as_echo_n "checking for suffix of object files... " >&6; } -if ${ac_cv_objext+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.o conftest.obj -if { { ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compile") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : - for ac_file in conftest.o conftest.obj conftest.*; do - test -f "$ac_file" || continue; - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; - *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` - break;; - esac -done -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot compute suffix of object files: cannot compile -See \`config.log' for more details" "$LINENO" 5; } -fi -rm -f conftest.$ac_cv_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 -$as_echo "$ac_cv_objext" >&6; } -OBJEXT=$ac_cv_objext -ac_objext=$OBJEXT -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 -$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } -if ${ac_cv_c_compiler_gnu+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ -#ifndef __GNUC__ - choke me -#endif - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_compiler_gnu=yes -else - ac_compiler_gnu=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -ac_cv_c_compiler_gnu=$ac_compiler_gnu - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 -$as_echo "$ac_cv_c_compiler_gnu" >&6; } -if test $ac_compiler_gnu = yes; then - GCC=yes -else - GCC= -fi -ac_test_CFLAGS=${CFLAGS+set} -ac_save_CFLAGS=$CFLAGS -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 -$as_echo_n "checking whether $CC accepts -g... " >&6; } -if ${ac_cv_prog_cc_g+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_save_c_werror_flag=$ac_c_werror_flag - ac_c_werror_flag=yes - ac_cv_prog_cc_g=no - CFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_g=yes -else - CFLAGS="" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - -else - ac_c_werror_flag=$ac_save_c_werror_flag - CFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_g=yes -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_c_werror_flag=$ac_save_c_werror_flag -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 -$as_echo "$ac_cv_prog_cc_g" >&6; } -if test "$ac_test_CFLAGS" = set; then - CFLAGS=$ac_save_CFLAGS -elif test $ac_cv_prog_cc_g = yes; then - if test "$GCC" = yes; then - CFLAGS="-g -O2" - else - CFLAGS="-g" - fi -else - if test "$GCC" = yes; then - CFLAGS="-O2" - else - CFLAGS= - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 -$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } -if ${ac_cv_prog_cc_c89+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_cv_prog_cc_c89=no -ac_save_CC=$CC -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -struct stat; -/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ -struct buf { int x; }; -FILE * (*rcsopen) (struct buf *, struct stat *, int); -static char *e (p, i) - char **p; - int i; -{ - return p[i]; -} -static char *f (char * (*g) (char **, int), char **p, ...) -{ - char *s; - va_list v; - va_start (v,p); - s = g (p, va_arg (v,int)); - va_end (v); - return s; -} - -/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has - function prototypes and stuff, but not '\xHH' hex character constants. - These don't provoke an error unfortunately, instead are silently treated - as 'x'. The following induces an error, until -std is added to get - proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an - array size at least. It's necessary to write '\x00'==0 to get something - that's true only with -std. */ -int osf4_cc_array ['\x00' == 0 ? 1 : -1]; - -/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters - inside strings and character constants. */ -#define FOO(x) 'x' -int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; - -int test (int i, double x); -struct s1 {int (*f) (int a);}; -struct s2 {int (*f) (double a);}; -int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); -int argc; -char **argv; -int -main () -{ -return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; - ; - return 0; -} -_ACEOF -for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ - -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" -do - CC="$ac_save_CC $ac_arg" - if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_c89=$ac_arg -fi -rm -f core conftest.err conftest.$ac_objext - test "x$ac_cv_prog_cc_c89" != "xno" && break -done -rm -f conftest.$ac_ext -CC=$ac_save_CC - -fi -# AC_CACHE_VAL -case "x$ac_cv_prog_cc_c89" in - x) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -$as_echo "none needed" >&6; } ;; - xno) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -$as_echo "unsupported" >&6; } ;; - *) - CC="$CC $ac_cv_prog_cc_c89" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 -$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; -esac -if test "x$ac_cv_prog_cc_c89" != xno; then : - -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - -case "$host" in - *-*-cygwin* | *-*-mingw*) - EXE=".exe" - EXTRALIB="-lshlwapi" - ;; - *) - EXE="" - EXTRALIB="" - ;; -esac - - -SDL_VERSION=2.0.0 - - - - - - -if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. -set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_PKG_CONFIG+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $PKG_CONFIG in - [\\/]* | ?:[\\/]*) - ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -PKG_CONFIG=$ac_cv_path_PKG_CONFIG -if test -n "$PKG_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 -$as_echo "$PKG_CONFIG" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_path_PKG_CONFIG"; then - ac_pt_PKG_CONFIG=$PKG_CONFIG - # Extract the first word of "pkg-config", so it can be a program name with args. -set dummy pkg-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $ac_pt_PKG_CONFIG in - [\\/]* | ?:[\\/]*) - ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG -if test -n "$ac_pt_PKG_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 -$as_echo "$ac_pt_PKG_CONFIG" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_pt_PKG_CONFIG" = x; then - PKG_CONFIG="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - PKG_CONFIG=$ac_pt_PKG_CONFIG - fi -else - PKG_CONFIG="$ac_cv_path_PKG_CONFIG" -fi - -fi -if test -n "$PKG_CONFIG"; then - _pkg_min_version=0.9.0 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 -$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; } - if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - PKG_CONFIG="" - fi -fi - - -# Check whether --with-sdl-prefix was given. -if test "${with_sdl_prefix+set}" = set; then : - withval=$with_sdl_prefix; sdl_prefix="$withval" -else - sdl_prefix="" -fi - - -# Check whether --with-sdl-exec-prefix was given. -if test "${with_sdl_exec_prefix+set}" = set; then : - withval=$with_sdl_exec_prefix; sdl_exec_prefix="$withval" -else - sdl_exec_prefix="" -fi - -# Check whether --enable-sdltest was given. -if test "${enable_sdltest+set}" = set; then : - enableval=$enable_sdltest; -else - enable_sdltest=yes -fi - - - min_sdl_version=$SDL_VERSION - - if test "x$sdl_prefix$sdl_exec_prefix" = x ; then - -pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sdl3 >= $min_sdl_version" >&5 -$as_echo_n "checking for sdl3 >= $min_sdl_version... " >&6; } - -if test -n "$SDL_CFLAGS"; then - pkg_cv_SDL_CFLAGS="$SDL_CFLAGS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"sdl3 >= \$min_sdl_version\""; } >&5 - ($PKG_CONFIG --exists --print-errors "sdl3 >= $min_sdl_version") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_SDL_CFLAGS=`$PKG_CONFIG --cflags "sdl3 >= $min_sdl_version" 2>/dev/null` -else - pkg_failed=yes -fi - else - pkg_failed=untried -fi -if test -n "$SDL_LIBS"; then - pkg_cv_SDL_LIBS="$SDL_LIBS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"sdl3 >= \$min_sdl_version\""; } >&5 - ($PKG_CONFIG --exists --print-errors "sdl3 >= $min_sdl_version") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_SDL_LIBS=`$PKG_CONFIG --libs "sdl3 >= $min_sdl_version" 2>/dev/null` -else - pkg_failed=yes -fi - else - pkg_failed=untried -fi - - - -if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - -if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then - _pkg_short_errors_supported=yes -else - _pkg_short_errors_supported=no -fi - if test $_pkg_short_errors_supported = yes; then - SDL_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "sdl3 >= $min_sdl_version" 2>&1` - else - SDL_PKG_ERRORS=`$PKG_CONFIG --print-errors "sdl3 >= $min_sdl_version" 2>&1` - fi - # Put the nasty error message in config.log where it belongs - echo "$SDL_PKG_ERRORS" >&5 - - sdl_pc=no -elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - sdl_pc=no -else - SDL_CFLAGS=$pkg_cv_SDL_CFLAGS - SDL_LIBS=$pkg_cv_SDL_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - sdl_pc=yes -fi - else - sdl_pc=no - if test x$sdl_exec_prefix != x ; then - sdl_config_args="$sdl_config_args --exec-prefix=$sdl_exec_prefix" - if test x${SDL3_CONFIG+set} != xset ; then - SDL3_CONFIG=$sdl_exec_prefix/bin/sdl3-config - fi - fi - if test x$sdl_prefix != x ; then - sdl_config_args="$sdl_config_args --prefix=$sdl_prefix" - if test x${SDL3_CONFIG+set} != xset ; then - SDL3_CONFIG=$sdl_prefix/bin/sdl3-config - fi - fi - fi - - if test "x$sdl_pc" = xyes ; then - no_sdl="" - SDL3_CONFIG="pkg-config sdl3" - else - as_save_PATH="$PATH" - if test "x$prefix" != xNONE && test "$cross_compiling" != yes; then - PATH="$prefix/bin:$prefix/usr/bin:$PATH" - fi - # Extract the first word of "sdl3-config", so it can be a program name with args. -set dummy sdl3-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_SDL3_CONFIG+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $SDL3_CONFIG in - [\\/]* | ?:[\\/]*) - ac_cv_path_SDL3_CONFIG="$SDL3_CONFIG" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_SDL3_CONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - test -z "$ac_cv_path_SDL3_CONFIG" && ac_cv_path_SDL3_CONFIG="no" - ;; -esac -fi -SDL3_CONFIG=$ac_cv_path_SDL3_CONFIG -if test -n "$SDL3_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SDL3_CONFIG" >&5 -$as_echo "$SDL3_CONFIG" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - PATH="$as_save_PATH" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SDL - version >= $min_sdl_version" >&5 -$as_echo_n "checking for SDL - version >= $min_sdl_version... " >&6; } - no_sdl="" - - if test "$SDL3_CONFIG" = "no" ; then - no_sdl=yes - else - SDL_CFLAGS=`$SDL3_CONFIG $sdl_config_args --cflags` - SDL_LIBS=`$SDL3_CONFIG $sdl_config_args --libs` - - sdl_major_version=`$SDL3_CONFIG $sdl_config_args --version | \ - sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'` - sdl_minor_version=`$SDL3_CONFIG $sdl_config_args --version | \ - sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'` - sdl_micro_version=`$SDL3_CONFIG $sdl_config_args --version | \ - sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'` - if test "x$enable_sdltest" = "xyes" ; then - ac_save_CFLAGS="$CFLAGS" - ac_save_CXXFLAGS="$CXXFLAGS" - ac_save_LIBS="$LIBS" - CFLAGS="$CFLAGS $SDL_CFLAGS" - CXXFLAGS="$CXXFLAGS $SDL_CFLAGS" - LIBS="$LIBS $SDL_LIBS" - rm -f conf.sdltest - if test "$cross_compiling" = yes; then : - echo $ac_n "cross compiling; assumed OK... $ac_c" -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include -#include -#include "SDL.h" - -int main (int argc, char *argv[]) -{ - int major, minor, micro; - FILE *fp = fopen("conf.sdltest", "w"); - - if (fp) fclose(fp); - - if (sscanf("$min_sdl_version", "%d.%d.%d", &major, &minor, µ) != 3) { - printf("%s, bad version string\n", "$min_sdl_version"); - exit(1); - } - - if (($sdl_major_version > major) || - (($sdl_major_version == major) && ($sdl_minor_version > minor)) || - (($sdl_major_version == major) && ($sdl_minor_version == minor) && ($sdl_micro_version >= micro))) - { - return 0; - } - else - { - printf("\n*** 'sdl3-config --version' returned %d.%d.%d, but the minimum version\n", $sdl_major_version, $sdl_minor_version, $sdl_micro_version); - printf("*** of SDL required is %d.%d.%d. If sdl3-config is correct, then it is\n", major, minor, micro); - printf("*** best to upgrade to the required version.\n"); - printf("*** If sdl3-config was wrong, set the environment variable SDL3_CONFIG\n"); - printf("*** to point to the correct copy of sdl3-config, and remove the file\n"); - printf("*** config.cache before re-running configure\n"); - return 1; - } -} - - -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - -else - no_sdl=yes -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - - CFLAGS="$ac_save_CFLAGS" - CXXFLAGS="$ac_save_CXXFLAGS" - LIBS="$ac_save_LIBS" - fi - fi - if test "x$no_sdl" = x ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - fi - fi - if test "x$no_sdl" = x ; then - : - else - if test "$SDL3_CONFIG" = "no" ; then - echo "*** The sdl3-config script installed by SDL could not be found" - echo "*** If SDL was installed in PREFIX, make sure PREFIX/bin is in" - echo "*** your path, or set the SDL3_CONFIG environment variable to the" - echo "*** full path to sdl3-config." - else - if test -f conf.sdltest ; then - : - else - echo "*** Could not run SDL test program, checking why..." - CFLAGS="$CFLAGS $SDL_CFLAGS" - CXXFLAGS="$CXXFLAGS $SDL_CFLAGS" - LIBS="$LIBS $SDL_LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include -#include "SDL.h" - -int main(int argc, char *argv[]) -{ return 0; } -#undef main -#define main K_and_R_C_main - -int -main () -{ - return 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - echo "*** The test program compiled, but did not run. This usually means" - echo "*** that the run-time linker is not finding SDL or finding the wrong" - echo "*** version of SDL. If it is not finding SDL, you'll need to set your" - echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" - echo "*** to the installed location Also, make sure you have run ldconfig if that" - echo "*** is required on your system" - echo "***" - echo "*** If you have an old version installed, it is best to remove it, although" - echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" -else - echo "*** The test program failed to compile or link. See the file config.log for the" - echo "*** exact error that occured. This usually means SDL was incorrectly installed" - echo "*** or that you have moved SDL since it was installed. In the latter case, you" - echo "*** may want to edit the sdl3-config script: $SDL3_CONFIG" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - CFLAGS="$ac_save_CFLAGS" - CXXFLAGS="$ac_save_CXXFLAGS" - LIBS="$ac_save_LIBS" - fi - fi - SDL_CFLAGS="" - SDL_LIBS="" - as_fn_error $? "*** SDL version $SDL_VERSION not found!" "$LINENO" 5 - - fi - - - rm -f conf.sdltest - -CFLAGS="$CFLAGS $SDL_CFLAGS" -LIBS="$LIBS -lSDL3_test $SDL_LIBS $EXTRALIB" - - -pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libunwind" >&5 -$as_echo_n "checking for libunwind... " >&6; } - -if test -n "$LIBUNWIND_CFLAGS"; then - pkg_cv_LIBUNWIND_CFLAGS="$LIBUNWIND_CFLAGS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libunwind\""; } >&5 - ($PKG_CONFIG --exists --print-errors "libunwind") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_LIBUNWIND_CFLAGS=`$PKG_CONFIG --cflags "libunwind" 2>/dev/null` -else - pkg_failed=yes -fi - else - pkg_failed=untried -fi -if test -n "$LIBUNWIND_LIBS"; then - pkg_cv_LIBUNWIND_LIBS="$LIBUNWIND_LIBS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libunwind\""; } >&5 - ($PKG_CONFIG --exists --print-errors "libunwind") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_LIBUNWIND_LIBS=`$PKG_CONFIG --libs "libunwind" 2>/dev/null` -else - pkg_failed=yes -fi - else - pkg_failed=untried -fi - - - -if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - -if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then - _pkg_short_errors_supported=yes -else - _pkg_short_errors_supported=no -fi - if test $_pkg_short_errors_supported = yes; then - LIBUNWIND_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "libunwind" 2>&1` - else - LIBUNWIND_PKG_ERRORS=`$PKG_CONFIG --print-errors "libunwind" 2>&1` - fi - # Put the nasty error message in config.log where it belongs - echo "$LIBUNWIND_PKG_ERRORS" >&5 - - have_libunwind=no -elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - have_libunwind=no -else - LIBUNWIND_CFLAGS=$pkg_cv_LIBUNWIND_CFLAGS - LIBUNWIND_LIBS=$pkg_cv_LIBUNWIND_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - have_libunwind=yes -fi -if test x$have_libunwind = xyes ; then - LIBS="$LIBS $LIBUNWIND_LIBS" -fi - -ac_config_files="$ac_config_files Makefile" - -cat >confcache <<\_ACEOF -# This file is a shell script that caches the results of configure -# tests run on this system so they can be shared between configure -# scripts and configure runs, see configure's option --config-cache. -# It is not useful on other systems. If it contains results you don't -# want to keep, you may remove or edit it. -# -# config.status only pays attention to the cache file if you give it -# the --recheck option to rerun configure. -# -# `ac_cv_env_foo' variables (set or unset) will be overridden when -# loading this file, other *unset* `ac_cv_foo' will be assigned the -# following values. - -_ACEOF - -# The following way of writing the cache mishandles newlines in values, -# but we know of no workaround that is simple, portable, and efficient. -# So, we kill variables containing newlines. -# Ultrix sh set writes to stderr and can't be redirected directly, -# and sets the high bit in the cache file unless we assign to the vars. -( - for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do - eval ac_val=\$$ac_var - case $ac_val in #( - *${as_nl}*) - case $ac_var in #( - *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; - esac - case $ac_var in #( - _ | IFS | as_nl) ;; #( - BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( - *) { eval $ac_var=; unset $ac_var;} ;; - esac ;; - esac - done - - (set) 2>&1 | - case $as_nl`(ac_space=' '; set) 2>&1` in #( - *${as_nl}ac_space=\ *) - # `set' does not quote correctly, so add quotes: double-quote - # substitution turns \\\\ into \\, and sed turns \\ into \. - sed -n \ - "s/'/'\\\\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" - ;; #( - *) - # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" - ;; - esac | - sort -) | - sed ' - /^ac_cv_env_/b end - t clear - :clear - s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ - t end - s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ - :end' >>confcache -if diff "$cache_file" confcache >/dev/null 2>&1; then :; else - if test -w "$cache_file"; then - if test "x$cache_file" != "x/dev/null"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 -$as_echo "$as_me: updating cache $cache_file" >&6;} - if test ! -f "$cache_file" || test -h "$cache_file"; then - cat confcache >"$cache_file" - else - case $cache_file in #( - */* | ?:*) - mv -f confcache "$cache_file"$$ && - mv -f "$cache_file"$$ "$cache_file" ;; #( - *) - mv -f confcache "$cache_file" ;; - esac - fi - fi - else - { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 -$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} - fi -fi -rm -f confcache - -test "x$prefix" = xNONE && prefix=$ac_default_prefix -# Let make expand exec_prefix. -test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' - -# Transform confdefs.h into DEFS. -# Protect against shell expansion while executing Makefile rules. -# Protect against Makefile macro expansion. -# -# If the first sed substitution is executed (which looks for macros that -# take arguments), then branch to the quote section. Otherwise, -# look for a macro that doesn't take arguments. -ac_script=' -:mline -/\\$/{ - N - s,\\\n,, - b mline -} -t clear -:clear -s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g -t quote -s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g -t quote -b any -:quote -s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g -s/\[/\\&/g -s/\]/\\&/g -s/\$/$$/g -H -:any -${ - g - s/^\n// - s/\n/ /g - p -} -' -DEFS=`sed -n "$ac_script" confdefs.h` - - -ac_libobjs= -ac_ltlibobjs= -U= -for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue - # 1. Remove the extension, and $U if already installed. - ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' - ac_i=`$as_echo "$ac_i" | sed "$ac_script"` - # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR - # will be set to the directory where LIBOBJS objects are built. - as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" - as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' -done -LIBOBJS=$ac_libobjs - -LTLIBOBJS=$ac_ltlibobjs - - - -: "${CONFIG_STATUS=./config.status}" -ac_write_fail=0 -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 -$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} -as_write_fail=0 -cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 -#! $SHELL -# Generated by $as_me. -# Run this file to recreate the current configuration. -# Compiler output produced by configure, useful for debugging -# configure, is in config.log if it exists. - -debug=false -ac_cs_recheck=false -ac_cs_silent=false - -SHELL=\${CONFIG_SHELL-$SHELL} -export SHELL -_ASEOF -cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 -## -------------------- ## -## M4sh Initialization. ## -## -------------------- ## - -# Be more Bourne compatible -DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in #( - *posix*) : - set -o posix ;; #( - *) : - ;; -esac -fi - - -as_nl=' -' -export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -# Prefer a ksh shell builtin over an external printf program on Solaris, -# but without wasting forks for bash or zsh. -if test -z "$BASH_VERSION$ZSH_VERSION" \ - && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='print -r --' - as_echo_n='print -rn --' -elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' - else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in #( - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' - fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' -fi - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - PATH_SEPARATOR=: - (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { - (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || - PATH_SEPARATOR=';' - } -fi - - -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -IFS=" "" $as_nl" - -# Find who we are. Look in the path if we contain no directory separator. -as_myself= -case $0 in #(( - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break - done -IFS=$as_save_IFS - - ;; -esac -# We did not find ourselves, most probably we were run as `sh COMMAND' -# in which case we are not to be found in the path. -if test "x$as_myself" = x; then - as_myself=$0 -fi -if test ! -f "$as_myself"; then - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - exit 1 -fi - -# Unset variables that we do not need and which cause bugs (e.g. in -# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" -# suppresses any "Segmentation fault" message there. '((' could -# trigger a bug in pdksh 5.2.14. -for as_var in BASH_ENV ENV MAIL MAILPATH -do eval test x\${$as_var+set} = xset \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - - -# as_fn_error STATUS ERROR [LINENO LOG_FD] -# ---------------------------------------- -# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are -# provided, also output the error to LOG_FD, referencing LINENO. Then exit the -# script with STATUS, using 1 if that was 0. -as_fn_error () -{ - as_status=$1; test $as_status -eq 0 && as_status=1 - if test "$4"; then - as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 - fi - $as_echo "$as_me: error: $2" >&2 - as_fn_exit $as_status -} # as_fn_error - - -# as_fn_set_status STATUS -# ----------------------- -# Set $? to STATUS, without forking. -as_fn_set_status () -{ - return $1 -} # as_fn_set_status - -# as_fn_exit STATUS -# ----------------- -# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. -as_fn_exit () -{ - set +e - as_fn_set_status $1 - exit $1 -} # as_fn_exit - -# as_fn_unset VAR -# --------------- -# Portably unset VAR. -as_fn_unset () -{ - { eval $1=; unset $1;} -} -as_unset=as_fn_unset -# as_fn_append VAR VALUE -# ---------------------- -# Append the text in VALUE to the end of the definition contained in VAR. Take -# advantage of any shell optimizations that allow amortized linear growth over -# repeated appends, instead of the typical quadratic growth present in naive -# implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : - eval 'as_fn_append () - { - eval $1+=\$2 - }' -else - as_fn_append () - { - eval $1=\$$1\$2 - } -fi # as_fn_append - -# as_fn_arith ARG... -# ------------------ -# Perform arithmetic evaluation on the ARGs, and store the result in the -# global $as_val. Take advantage of shells that can avoid forks. The arguments -# must be portable across $(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : - eval 'as_fn_arith () - { - as_val=$(( $* )) - }' -else - as_fn_arith () - { - as_val=`expr "$@" || test $? -eq 1` - } -fi # as_fn_arith - - -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi - -as_me=`$as_basename -- "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - -ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in #((((( --n*) - case `echo 'xy\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - xy) ECHO_C='\c';; - *) echo `echo ksh88 bug on AIX 6.1` > /dev/null - ECHO_T=' ';; - esac;; -*) - ECHO_N='-n';; -esac - -rm -f conf$$ conf$$.exe conf$$.file -if test -d conf$$.dir; then - rm -f conf$$.dir/conf$$.file -else - rm -f conf$$.dir - mkdir conf$$.dir 2>/dev/null -fi -if (echo >conf$$.file) 2>/dev/null; then - if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -pR'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -pR' - elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln - else - as_ln_s='cp -pR' - fi -else - as_ln_s='cp -pR' -fi -rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file -rmdir conf$$.dir 2>/dev/null - - -# as_fn_mkdir_p -# ------------- -# Create "$as_dir" as a directory, including parents if necessary. -as_fn_mkdir_p () -{ - - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || eval $as_mkdir_p || { - as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( - *) as_qdir=$as_dir;; - esac - as_dirs="'$as_qdir' $as_dirs" - as_dir=`$as_dirname -- "$as_dir" || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - test -d "$as_dir" && break - done - test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" - - -} # as_fn_mkdir_p -if mkdir -p . 2>/dev/null; then - as_mkdir_p='mkdir -p "$as_dir"' -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - - -# as_fn_executable_p FILE -# ----------------------- -# Test if FILE is an executable regular file. -as_fn_executable_p () -{ - test -f "$1" && test -x "$1" -} # as_fn_executable_p -as_test_x='test -x' -as_executable_p=as_fn_executable_p - -# Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" - -# Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - - -exec 6>&1 -## ----------------------------------- ## -## Main body of $CONFIG_STATUS script. ## -## ----------------------------------- ## -_ASEOF -test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# Save the log message, to keep $0 and so on meaningful, and to -# report actual input values of CONFIG_FILES etc. instead of their -# values after options handling. -ac_log=" -This file was extended by $as_me, which was -generated by GNU Autoconf 2.69. Invocation command line was - - CONFIG_FILES = $CONFIG_FILES - CONFIG_HEADERS = $CONFIG_HEADERS - CONFIG_LINKS = $CONFIG_LINKS - CONFIG_COMMANDS = $CONFIG_COMMANDS - $ $0 $@ - -on `(hostname || uname -n) 2>/dev/null | sed 1q` -" - -_ACEOF - -case $ac_config_files in *" -"*) set x $ac_config_files; shift; ac_config_files=$*;; -esac - - - -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -# Files that config.status was made for. -config_files="$ac_config_files" - -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -ac_cs_usage="\ -\`$as_me' instantiates files and other configuration actions -from templates according to the current configuration. Unless the files -and actions are specified as TAGs, all are instantiated by default. - -Usage: $0 [OPTION]... [TAG]... - - -h, --help print this help, then exit - -V, --version print version number and configuration settings, then exit - --config print configuration, then exit - -q, --quiet, --silent - do not print progress messages - -d, --debug don't remove temporary files - --recheck update $as_me by reconfiguring in the same conditions - --file=FILE[:TEMPLATE] - instantiate the configuration file FILE - -Configuration files: -$config_files - -Report bugs to the package provider." - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" -ac_cs_version="\\ -config.status -configured by $0, generated by GNU Autoconf 2.69, - with options \\"\$ac_cs_config\\" - -Copyright (C) 2012 Free Software Foundation, Inc. -This config.status script is free software; the Free Software Foundation -gives unlimited permission to copy, distribute and modify it." - -ac_pwd='$ac_pwd' -srcdir='$srcdir' -test -n "\$AWK" || AWK=awk -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# The default lists apply if the user does not specify any file. -ac_need_defaults=: -while test $# != 0 -do - case $1 in - --*=?*) - ac_option=`expr "X$1" : 'X\([^=]*\)='` - ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` - ac_shift=: - ;; - --*=) - ac_option=`expr "X$1" : 'X\([^=]*\)='` - ac_optarg= - ac_shift=: - ;; - *) - ac_option=$1 - ac_optarg=$2 - ac_shift=shift - ;; - esac - - case $ac_option in - # Handling of the options. - -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) - ac_cs_recheck=: ;; - --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) - $as_echo "$ac_cs_version"; exit ;; - --config | --confi | --conf | --con | --co | --c ) - $as_echo "$ac_cs_config"; exit ;; - --debug | --debu | --deb | --de | --d | -d ) - debug=: ;; - --file | --fil | --fi | --f ) - $ac_shift - case $ac_optarg in - *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; - '') as_fn_error $? "missing file argument" ;; - esac - as_fn_append CONFIG_FILES " '$ac_optarg'" - ac_need_defaults=false;; - --he | --h | --help | --hel | -h ) - $as_echo "$ac_cs_usage"; exit ;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil | --si | --s) - ac_cs_silent=: ;; - - # This is an error. - -*) as_fn_error $? "unrecognized option: \`$1' -Try \`$0 --help' for more information." ;; - - *) as_fn_append ac_config_targets " $1" - ac_need_defaults=false ;; - - esac - shift -done - -ac_configure_extra_args= - -if $ac_cs_silent; then - exec 6>/dev/null - ac_configure_extra_args="$ac_configure_extra_args --silent" -fi - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -if \$ac_cs_recheck; then - set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion - shift - \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 - CONFIG_SHELL='$SHELL' - export CONFIG_SHELL - exec "\$@" -fi - -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -exec 5>>config.log -{ - echo - sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX -## Running $as_me. ## -_ASBOX - $as_echo "$ac_log" -} >&5 - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 - -# Handling of arguments. -for ac_config_target in $ac_config_targets -do - case $ac_config_target in - "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; - - *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; - esac -done - - -# If the user did not use the arguments to specify the items to instantiate, -# then the envvar interface is used. Set only those that are not. -# We use the long form for the default assignment because of an extremely -# bizarre bug on SunOS 4.1.3. -if $ac_need_defaults; then - test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files -fi - -# Have a temporary directory for convenience. Make it in the build tree -# simply because there is no reason against having it here, and in addition, -# creating and moving files from /tmp can sometimes cause problems. -# Hook for its removal unless debugging. -# Note that there is a small window in which the directory will not be cleaned: -# after its creation but before its name has been assigned to `$tmp'. -$debug || -{ - tmp= ac_tmp= - trap 'exit_status=$? - : "${ac_tmp:=$tmp}" - { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status -' 0 - trap 'as_fn_exit 1' 1 2 13 15 -} -# Create a (secure) tmp directory for tmp files. - -{ - tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && - test -d "$tmp" -} || -{ - tmp=./conf$$-$RANDOM - (umask 077 && mkdir "$tmp") -} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 -ac_tmp=$tmp - -# Set up the scripts for CONFIG_FILES section. -# No need to generate them if there are no CONFIG_FILES. -# This happens for instance with `./config.status config.h'. -if test -n "$CONFIG_FILES"; then - - -ac_cr=`echo X | tr X '\015'` -# On cygwin, bash can eat \r inside `` if the user requested igncr. -# But we know of no other shell where ac_cr would be empty at this -# point, so we can use a bashism as a fallback. -if test "x$ac_cr" = x; then - eval ac_cr=\$\'\\r\' -fi -ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` -if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then - ac_cs_awk_cr='\\r' -else - ac_cs_awk_cr=$ac_cr -fi - -echo 'BEGIN {' >"$ac_tmp/subs1.awk" && -_ACEOF - - -{ - echo "cat >conf$$subs.awk <<_ACEOF" && - echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && - echo "_ACEOF" -} >conf$$subs.sh || - as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 -ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` -ac_delim='%!_!# ' -for ac_last_try in false false false false false :; do - . ./conf$$subs.sh || - as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 - - ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` - if test $ac_delim_n = $ac_delim_num; then - break - elif $ac_last_try; then - as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 - else - ac_delim="$ac_delim!$ac_delim _$ac_delim!! " - fi -done -rm -f conf$$subs.sh - -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && -_ACEOF -sed -n ' -h -s/^/S["/; s/!.*/"]=/ -p -g -s/^[^!]*!// -:repl -t repl -s/'"$ac_delim"'$// -t delim -:nl -h -s/\(.\{148\}\)..*/\1/ -t more1 -s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ -p -n -b repl -:more1 -s/["\\]/\\&/g; s/^/"/; s/$/"\\/ -p -g -s/.\{148\}// -t nl -:delim -h -s/\(.\{148\}\)..*/\1/ -t more2 -s/["\\]/\\&/g; s/^/"/; s/$/"/ -p -b -:more2 -s/["\\]/\\&/g; s/^/"/; s/$/"\\/ -p -g -s/.\{148\}// -t delim -' >$CONFIG_STATUS || ac_write_fail=1 -rm -f conf$$subs.awk -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -_ACAWK -cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && - for (key in S) S_is_set[key] = 1 - FS = "" - -} -{ - line = $ 0 - nfields = split(line, field, "@") - substed = 0 - len = length(field[1]) - for (i = 2; i < nfields; i++) { - key = field[i] - keylen = length(key) - if (S_is_set[key]) { - value = S[key] - line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) - len += length(value) + length(field[++i]) - substed = 1 - } else - len += 1 + keylen - } - - print line -} - -_ACAWK -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then - sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" -else - cat -fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ - || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 -_ACEOF - -# VPATH may cause trouble with some makes, so we remove sole $(srcdir), -# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and -# trailing colons and then remove the whole line if VPATH becomes empty -# (actually we leave an empty line to preserve line numbers). -if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ -h -s/// -s/^/:/ -s/[ ]*$/:/ -s/:\$(srcdir):/:/g -s/:\${srcdir}:/:/g -s/:@srcdir@:/:/g -s/^:*// -s/:*$// -x -s/\(=[ ]*\).*/\1/ -G -s/\n// -s/^[^=]*=[ ]*$// -}' -fi - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -fi # test -n "$CONFIG_FILES" - - -eval set X " :F $CONFIG_FILES " -shift -for ac_tag -do - case $ac_tag in - :[FHLC]) ac_mode=$ac_tag; continue;; - esac - case $ac_mode$ac_tag in - :[FHL]*:*);; - :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; - :[FH]-) ac_tag=-:-;; - :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; - esac - ac_save_IFS=$IFS - IFS=: - set x $ac_tag - IFS=$ac_save_IFS - shift - ac_file=$1 - shift - - case $ac_mode in - :L) ac_source=$1;; - :[FH]) - ac_file_inputs= - for ac_f - do - case $ac_f in - -) ac_f="$ac_tmp/stdin";; - *) # Look for the file first in the build tree, then in the source tree - # (if the path is not absolute). The absolute path cannot be DOS-style, - # because $ac_f cannot contain `:'. - test -f "$ac_f" || - case $ac_f in - [\\/$]*) false;; - *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; - esac || - as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; - esac - case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac - as_fn_append ac_file_inputs " '$ac_f'" - done - - # Let's still pretend it is `configure' which instantiates (i.e., don't - # use $as_me), people would be surprised to read: - # /* config.h. Generated by config.status. */ - configure_input='Generated from '` - $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' - `' by configure.' - if test x"$ac_file" != x-; then - configure_input="$ac_file. $configure_input" - { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 -$as_echo "$as_me: creating $ac_file" >&6;} - fi - # Neutralize special characters interpreted by sed in replacement strings. - case $configure_input in #( - *\&* | *\|* | *\\* ) - ac_sed_conf_input=`$as_echo "$configure_input" | - sed 's/[\\\\&|]/\\\\&/g'`;; #( - *) ac_sed_conf_input=$configure_input;; - esac - - case $ac_tag in - *:-:* | *:-) cat >"$ac_tmp/stdin" \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; - esac - ;; - esac - - ac_dir=`$as_dirname -- "$ac_file" || -$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_file" : 'X\(//\)[^/]' \| \ - X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - as_dir="$ac_dir"; as_fn_mkdir_p - ac_builddir=. - -case "$ac_dir" in -.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -*) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` - # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` - case $ac_top_builddir_sub in - "") ac_top_builddir_sub=. ac_top_build_prefix= ;; - *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; - esac ;; -esac -ac_abs_top_builddir=$ac_pwd -ac_abs_builddir=$ac_pwd$ac_dir_suffix -# for backward compatibility: -ac_top_builddir=$ac_top_build_prefix - -case $srcdir in - .) # We are building in place. - ac_srcdir=. - ac_top_srcdir=$ac_top_builddir_sub - ac_abs_top_srcdir=$ac_pwd ;; - [\\/]* | ?:[\\/]* ) # Absolute name. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir - ac_abs_top_srcdir=$srcdir ;; - *) # Relative name. - ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_build_prefix$srcdir - ac_abs_top_srcdir=$ac_pwd/$srcdir ;; -esac -ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix - - - case $ac_mode in - :F) - # - # CONFIG_FILE - # - -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# If the template does not know about datarootdir, expand it. -# FIXME: This hack should be removed a few years after 2.60. -ac_datarootdir_hack=; ac_datarootdir_seen= -ac_sed_dataroot=' -/datarootdir/ { - p - q -} -/@datadir@/p -/@docdir@/p -/@infodir@/p -/@localedir@/p -/@mandir@/p' -case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in -*datarootdir*) ac_datarootdir_seen=yes;; -*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 -$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 - ac_datarootdir_hack=' - s&@datadir@&$datadir&g - s&@docdir@&$docdir&g - s&@infodir@&$infodir&g - s&@localedir@&$localedir&g - s&@mandir@&$mandir&g - s&\\\${datarootdir}&$datarootdir&g' ;; -esac -_ACEOF - -# Neutralize VPATH when `$srcdir' = `.'. -# Shell code in configure.ac might set extrasub. -# FIXME: do we really want to maintain this feature? -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -ac_sed_extra="$ac_vpsub -$extrasub -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -:t -/@[a-zA-Z_][a-zA-Z_0-9]*@/!b -s|@configure_input@|$ac_sed_conf_input|;t t -s&@top_builddir@&$ac_top_builddir_sub&;t t -s&@top_build_prefix@&$ac_top_build_prefix&;t t -s&@srcdir@&$ac_srcdir&;t t -s&@abs_srcdir@&$ac_abs_srcdir&;t t -s&@top_srcdir@&$ac_top_srcdir&;t t -s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t -s&@builddir@&$ac_builddir&;t t -s&@abs_builddir@&$ac_abs_builddir&;t t -s&@abs_top_builddir@&$ac_abs_top_builddir&;t t -$ac_datarootdir_hack -" -eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ - >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - -test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && - { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && - { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ - "$ac_tmp/out"`; test -z "$ac_out"; } && - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined" >&5 -$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined" >&2;} - - rm -f "$ac_tmp/stdin" - case $ac_file in - -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; - *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; - esac \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - ;; - - - - esac - -done # for ac_tag - - -as_fn_exit 0 -_ACEOF -ac_clean_files=$ac_clean_files_save - -test $ac_write_fail = 0 || - as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 - - -# configure is writing to config.log, and then calls config.status. -# config.status does its own redirection, appending to config.log. -# Unfortunately, on DOS this fails, as config.log is still kept open -# by configure, so config.status won't be able to write to it; its -# output is simply discarded. So we exec the FD to /dev/null, -# effectively closing config.log, so it can be properly (re)opened and -# appended to by config.status. When coming back to configure, we -# need to make the FD available again. -if test "$no_create" != yes; then - ac_cs_success=: - ac_config_status_args= - test "$silent" = yes && - ac_config_status_args="$ac_config_status_args --quiet" - exec 5>/dev/null - $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false - exec 5>>config.log - # Use ||, not &&, to avoid exiting from the if with $? = 1, which - # would make configure fail if this is the last instruction. - $ac_cs_success || as_fn_exit 1 -fi -if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 -$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} -fi - diff --git a/visualtest/configure.ac b/visualtest/configure.ac deleted file mode 100644 index d36d891035..0000000000 --- a/visualtest/configure.ac +++ /dev/null @@ -1,41 +0,0 @@ -dnl Process this file with autoconf to produce a configure script. -AC_INIT -AC_CONFIG_SRCDIR([unittest/testquit.c]) - -dnl Detect the canonical build and host environments -AC_CONFIG_AUX_DIR([../build-scripts]) -AC_CANONICAL_HOST - -dnl Check for tools -AC_PROG_CC - -dnl Figure out which math or extra library to use -case "$host" in - *-*-cygwin* | *-*-mingw*) - EXE=".exe" - EXTRALIB="-lshlwapi" - ;; - *) - EXE="" - EXTRALIB="" - ;; -esac -AC_SUBST(EXE) - -dnl Check for SDL -SDL_VERSION=3.0.0 -AM_PATH_SDL3($SDL_VERSION, - :, - AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!]) -) -CFLAGS="$CFLAGS $SDL_CFLAGS" -LIBS="$LIBS -lSDL3_test $SDL_LIBS $EXTRALIB" - -PKG_CHECK_MODULES(LIBUNWIND, libunwind, have_libunwind=yes, have_libunwind=no) -if test x$have_libunwind = xyes ; then - LIBS="$LIBS $LIBUNWIND_LIBS" -fi - -dnl Finally create all the generated files -AC_CONFIG_FILES([Makefile]) -AC_OUTPUT diff --git a/visualtest/docs/Doxyfile b/visualtest/docs/Doxyfile deleted file mode 100644 index 08caeb491e..0000000000 --- a/visualtest/docs/Doxyfile +++ /dev/null @@ -1,1936 +0,0 @@ -# Doxyfile 1.8.4 - -# This file describes the settings to be used by the documentation system -# doxygen (www.doxygen.org) for a project -# -# All text after a hash (#) is considered a comment and will be ignored -# The format is: -# TAG = value [value, ...] -# For lists items can also be appended using: -# TAG += value [value, ...] -# Values that contain spaces should be placed between quotes (" ") - -#--------------------------------------------------------------------------- -# Project related configuration options -#--------------------------------------------------------------------------- - -# This tag specifies the encoding used for all characters in the config file -# that follow. The default is UTF-8 which is also the encoding used for all -# text before the first occurrence of this tag. Doxygen uses libiconv (or the -# iconv built into libc) for the transcoding. See -# http://www.gnu.org/software/libiconv for the list of possible encodings. - -DOXYFILE_ENCODING = UTF-8 - -# The PROJECT_NAME tag is a single word (or sequence of words) that should -# identify the project. Note that if you do not use Doxywizard you need -# to put quotes around the project name if it contains spaces. - -PROJECT_NAME = "SDL Visual Test" - -# The PROJECT_NUMBER tag can be used to enter a project or revision number. -# This could be handy for archiving the generated documentation or -# if some version control system is used. - -PROJECT_NUMBER = - -# Using the PROJECT_BRIEF tag one can provide an optional one line description -# for a project that appears at the top of each page and should give viewer -# a quick idea about the purpose of the project. Keep the description short. - -PROJECT_BRIEF = - -# With the PROJECT_LOGO tag one can specify an logo or icon that is -# included in the documentation. The maximum height of the logo should not -# exceed 55 pixels and the maximum width should not exceed 200 pixels. -# Doxygen will copy the logo to the output directory. - -PROJECT_LOGO = - -# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) -# base path where the generated documentation will be put. -# If a relative path is entered, it will be relative to the location -# where doxygen was started. If left blank the current directory will be used. - -OUTPUT_DIRECTORY = . - -# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create -# 4096 sub-directories (in 2 levels) under the output directory of each output -# format and will distribute the generated files over these directories. -# Enabling this option can be useful when feeding doxygen a huge amount of -# source files, where putting all generated files in the same directory would -# otherwise cause performance problems for the file system. - -CREATE_SUBDIRS = NO - -# The OUTPUT_LANGUAGE tag is used to specify the language in which all -# documentation generated by doxygen is written. Doxygen will use this -# information to generate all constant output in the proper language. -# The default language is English, other supported languages are: -# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, -# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German, -# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English -# messages), Korean, Korean-en, Latvian, Lithuanian, Norwegian, Macedonian, -# Persian, Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrillic, -# Slovak, Slovene, Spanish, Swedish, Ukrainian, and Vietnamese. - -OUTPUT_LANGUAGE = English - -# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will -# include brief member descriptions after the members that are listed in -# the file and class documentation (similar to JavaDoc). -# Set to NO to disable this. - -BRIEF_MEMBER_DESC = YES - -# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend -# the brief description of a member or function before the detailed description. -# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the -# brief descriptions will be completely suppressed. - -REPEAT_BRIEF = YES - -# This tag implements a quasi-intelligent brief description abbreviator -# that is used to form the text in various listings. Each string -# in this list, if found as the leading text of the brief description, will be -# stripped from the text and the result after processing the whole list, is -# used as the annotated text. Otherwise, the brief description is used as-is. -# If left blank, the following values are used ("$name" is automatically -# replaced with the name of the entity): "The $name class" "The $name widget" -# "The $name file" "is" "provides" "specifies" "contains" -# "represents" "a" "an" "the" - -ABBREVIATE_BRIEF = "The $name class" \ - "The $name widget" \ - "The $name file" \ - is \ - provides \ - specifies \ - contains \ - represents \ - a \ - an \ - the - -# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then -# Doxygen will generate a detailed section even if there is only a brief -# description. - -ALWAYS_DETAILED_SEC = NO - -# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all -# inherited members of a class in the documentation of that class as if those -# members were ordinary class members. Constructors, destructors and assignment -# operators of the base classes will not be shown. - -INLINE_INHERITED_MEMB = NO - -# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full -# path before files name in the file list and in the header files. If set -# to NO the shortest path that makes the file name unique will be used. - -FULL_PATH_NAMES = YES - -# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag -# can be used to strip a user-defined part of the path. Stripping is -# only done if one of the specified strings matches the left-hand part of -# the path. The tag can be used to show relative paths in the file list. -# If left blank the directory from which doxygen is run is used as the -# path to strip. Note that you specify absolute paths here, but also -# relative paths, which will be relative from the directory where doxygen is -# started. - -STRIP_FROM_PATH = - -# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of -# the path mentioned in the documentation of a class, which tells -# the reader which header file to include in order to use a class. -# If left blank only the name of the header file containing the class -# definition is used. Otherwise one should specify the include paths that -# are normally passed to the compiler using the -I flag. - -STRIP_FROM_INC_PATH = - -# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter -# (but less readable) file names. This can be useful if your file system -# doesn't support long names like on DOS, Mac, or CD-ROM. - -SHORT_NAMES = NO - -# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen -# will interpret the first line (until the first dot) of a JavaDoc-style -# comment as the brief description. If set to NO, the JavaDoc -# comments will behave just like regular Qt-style comments -# (thus requiring an explicit @brief command for a brief description.) - -JAVADOC_AUTOBRIEF = NO - -# If the QT_AUTOBRIEF tag is set to YES then Doxygen will -# interpret the first line (until the first dot) of a Qt-style -# comment as the brief description. If set to NO, the comments -# will behave just like regular Qt-style comments (thus requiring -# an explicit \brief command for a brief description.) - -QT_AUTOBRIEF = NO - -# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen -# treat a multi-line C++ special comment block (i.e. a block of //! or /// -# comments) as a brief description. This used to be the default behaviour. -# The new default is to treat a multi-line C++ comment block as a detailed -# description. Set this tag to YES if you prefer the old behaviour instead. - -MULTILINE_CPP_IS_BRIEF = NO - -# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented -# member inherits the documentation from any documented member that it -# re-implements. - -INHERIT_DOCS = YES - -# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce -# a new page for each member. If set to NO, the documentation of a member will -# be part of the file/class/namespace that contains it. - -SEPARATE_MEMBER_PAGES = NO - -# The TAB_SIZE tag can be used to set the number of spaces in a tab. -# Doxygen uses this value to replace tabs by spaces in code fragments. - -TAB_SIZE = 4 - -# This tag can be used to specify a number of aliases that acts -# as commands in the documentation. An alias has the form "name=value". -# For example adding "sideeffect=\par Side Effects:\n" will allow you to -# put the command \sideeffect (or @sideeffect) in the documentation, which -# will result in a user-defined paragraph with heading "Side Effects:". -# You can put \n's in the value part of an alias to insert newlines. - -ALIASES = - -# This tag can be used to specify a number of word-keyword mappings (TCL only). -# A mapping has the form "name=value". For example adding -# "class=itcl::class" will allow you to use the command class in the -# itcl::class meaning. - -TCL_SUBST = - -# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C -# sources only. Doxygen will then generate output that is more tailored for C. -# For instance, some of the names that are used will be different. The list -# of all members will be omitted, etc. - -OPTIMIZE_OUTPUT_FOR_C = YES - -# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java -# sources only. Doxygen will then generate output that is more tailored for -# Java. For instance, namespaces will be presented as packages, qualified -# scopes will look different, etc. - -OPTIMIZE_OUTPUT_JAVA = NO - -# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran -# sources only. Doxygen will then generate output that is more tailored for -# Fortran. - -OPTIMIZE_FOR_FORTRAN = NO - -# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL -# sources. Doxygen will then generate output that is tailored for -# VHDL. - -OPTIMIZE_OUTPUT_VHDL = NO - -# Doxygen selects the parser to use depending on the extension of the files it -# parses. With this tag you can assign which parser to use for a given -# extension. Doxygen has a built-in mapping, but you can override or extend it -# using this tag. The format is ext=language, where ext is a file extension, -# and language is one of the parsers supported by doxygen: IDL, Java, -# Javascript, CSharp, C, C++, D, PHP, Objective-C, Python, Fortran, VHDL, C, -# C++. For instance to make doxygen treat .inc files as Fortran files (default -# is PHP), and .f files as C (default is Fortran), use: inc=Fortran f=C. Note -# that for custom extensions you also need to set FILE_PATTERNS otherwise the -# files are not read by doxygen. - -EXTENSION_MAPPING = - -# If MARKDOWN_SUPPORT is enabled (the default) then doxygen pre-processes all -# comments according to the Markdown format, which allows for more readable -# documentation. See http://daringfireball.net/projects/markdown/ for details. -# The output of markdown processing is further processed by doxygen, so you -# can mix doxygen, HTML, and XML commands with Markdown formatting. -# Disable only in case of backward compatibilities issues. - -MARKDOWN_SUPPORT = YES - -# When enabled doxygen tries to link words that correspond to documented -# classes, or namespaces to their corresponding documentation. Such a link can -# be prevented in individual cases by by putting a % sign in front of the word -# or globally by setting AUTOLINK_SUPPORT to NO. - -AUTOLINK_SUPPORT = YES - -# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want -# to include (a tag file for) the STL sources as input, then you should -# set this tag to YES in order to let doxygen match functions declarations and -# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. -# func(std::string) {}). This also makes the inheritance and collaboration -# diagrams that involve STL classes more complete and accurate. - -BUILTIN_STL_SUPPORT = NO - -# If you use Microsoft's C++/CLI language, you should set this option to YES to -# enable parsing support. - -CPP_CLI_SUPPORT = NO - -# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. -# Doxygen will parse them like normal C++ but will assume all classes use public -# instead of private inheritance when no explicit protection keyword is present. - -SIP_SUPPORT = NO - -# For Microsoft's IDL there are propget and propput attributes to indicate -# getter and setter methods for a property. Setting this option to YES (the -# default) will make doxygen replace the get and set methods by a property in -# the documentation. This will only work if the methods are indeed getting or -# setting a simple type. If this is not the case, or you want to show the -# methods anyway, you should set this option to NO. - -IDL_PROPERTY_SUPPORT = YES - -# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC -# tag is set to YES, then doxygen will reuse the documentation of the first -# member in the group (if any) for the other members of the group. By default -# all members of a group must be documented explicitly. - -DISTRIBUTE_GROUP_DOC = NO - -# Set the SUBGROUPING tag to YES (the default) to allow class member groups of -# the same type (for instance a group of public functions) to be put as a -# subgroup of that type (e.g. under the Public Functions section). Set it to -# NO to prevent subgrouping. Alternatively, this can be done per class using -# the \nosubgrouping command. - -SUBGROUPING = YES - -# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and -# unions are shown inside the group in which they are included (e.g. using -# @ingroup) instead of on a separate page (for HTML and Man pages) or -# section (for LaTeX and RTF). - -INLINE_GROUPED_CLASSES = NO - -# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and -# unions with only public data fields or simple typedef fields will be shown -# inline in the documentation of the scope in which they are defined (i.e. file, -# namespace, or group documentation), provided this scope is documented. If set -# to NO (the default), structs, classes, and unions are shown on a separate -# page (for HTML and Man pages) or section (for LaTeX and RTF). - -INLINE_SIMPLE_STRUCTS = NO - -# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum -# is documented as struct, union, or enum with the name of the typedef. So -# typedef struct TypeS {} TypeT, will appear in the documentation as a struct -# with name TypeT. When disabled the typedef will appear as a member of a file, -# namespace, or class. And the struct will be named TypeS. This can typically -# be useful for C code in case the coding convention dictates that all compound -# types are typedef'ed and only the typedef is referenced, never the tag name. - -TYPEDEF_HIDES_STRUCT = NO - -# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This -# cache is used to resolve symbols given their name and scope. Since this can -# be an expensive process and often the same symbol appear multiple times in -# the code, doxygen keeps a cache of pre-resolved symbols. If the cache is too -# small doxygen will become slower. If the cache is too large, memory is wasted. -# The cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid -# range is 0..9, the default is 0, corresponding to a cache size of 2^16 = 65536 -# symbols. - -LOOKUP_CACHE_SIZE = 0 - -#--------------------------------------------------------------------------- -# Build related configuration options -#--------------------------------------------------------------------------- - -# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in -# documentation are documented, even if no documentation was available. -# Private class members and static file members will be hidden unless -# the EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES - -EXTRACT_ALL = NO - -# If the EXTRACT_PRIVATE tag is set to YES all private members of a class -# will be included in the documentation. - -EXTRACT_PRIVATE = NO - -# If the EXTRACT_PACKAGE tag is set to YES all members with package or internal -# scope will be included in the documentation. - -EXTRACT_PACKAGE = NO - -# If the EXTRACT_STATIC tag is set to YES all static members of a file -# will be included in the documentation. - -EXTRACT_STATIC = NO - -# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) -# defined locally in source files will be included in the documentation. -# If set to NO only classes defined in header files are included. - -EXTRACT_LOCAL_CLASSES = YES - -# This flag is only useful for Objective-C code. When set to YES local -# methods, which are defined in the implementation section but not in -# the interface are included in the documentation. -# If set to NO (the default) only methods in the interface are included. - -EXTRACT_LOCAL_METHODS = NO - -# If this flag is set to YES, the members of anonymous namespaces will be -# extracted and appear in the documentation as a namespace called -# 'anonymous_namespace{file}', where file will be replaced with the base -# name of the file that contains the anonymous namespace. By default -# anonymous namespaces are hidden. - -EXTRACT_ANON_NSPACES = NO - -# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all -# undocumented members of documented classes, files or namespaces. -# If set to NO (the default) these members will be included in the -# various overviews, but no documentation section is generated. -# This option has no effect if EXTRACT_ALL is enabled. - -HIDE_UNDOC_MEMBERS = NO - -# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all -# undocumented classes that are normally visible in the class hierarchy. -# If set to NO (the default) these classes will be included in the various -# overviews. This option has no effect if EXTRACT_ALL is enabled. - -HIDE_UNDOC_CLASSES = NO - -# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all -# friend (class|struct|union) declarations. -# If set to NO (the default) these declarations will be included in the -# documentation. - -HIDE_FRIEND_COMPOUNDS = NO - -# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any -# documentation blocks found inside the body of a function. -# If set to NO (the default) these blocks will be appended to the -# function's detailed documentation block. - -HIDE_IN_BODY_DOCS = NO - -# The INTERNAL_DOCS tag determines if documentation -# that is typed after a \internal command is included. If the tag is set -# to NO (the default) then the documentation will be excluded. -# Set it to YES to include the internal documentation. - -INTERNAL_DOCS = NO - -# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate -# file names in lower-case letters. If set to YES upper-case letters are also -# allowed. This is useful if you have classes or files whose names only differ -# in case and if your file system supports case sensitive file names. Windows -# and Mac users are advised to set this option to NO. - -CASE_SENSE_NAMES = NO - -# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen -# will show members with their full class and namespace scopes in the -# documentation. If set to YES the scope will be hidden. - -HIDE_SCOPE_NAMES = YES - -# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen -# will put a list of the files that are included by a file in the documentation -# of that file. - -SHOW_INCLUDE_FILES = YES - -# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen -# will list include files with double quotes in the documentation -# rather than with sharp brackets. - -FORCE_LOCAL_INCLUDES = NO - -# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] -# is inserted in the documentation for inline members. - -INLINE_INFO = YES - -# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen -# will sort the (detailed) documentation of file and class members -# alphabetically by member name. If set to NO the members will appear in -# declaration order. - -SORT_MEMBER_DOCS = YES - -# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the -# brief documentation of file, namespace and class members alphabetically -# by member name. If set to NO (the default) the members will appear in -# declaration order. - -SORT_BRIEF_DOCS = NO - -# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen -# will sort the (brief and detailed) documentation of class members so that -# constructors and destructors are listed first. If set to NO (the default) -# the constructors will appear in the respective orders defined by -# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS. -# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO -# and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO. - -SORT_MEMBERS_CTORS_1ST = NO - -# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the -# hierarchy of group names into alphabetical order. If set to NO (the default) -# the group names will appear in their defined order. - -SORT_GROUP_NAMES = NO - -# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be -# sorted by fully-qualified names, including namespaces. If set to -# NO (the default), the class list will be sorted only by class name, -# not including the namespace part. -# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. -# Note: This option applies only to the class list, not to the -# alphabetical list. - -SORT_BY_SCOPE_NAME = NO - -# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to -# do proper type resolution of all parameters of a function it will reject a -# match between the prototype and the implementation of a member function even -# if there is only one candidate or it is obvious which candidate to choose -# by doing a simple string match. By disabling STRICT_PROTO_MATCHING doxygen -# will still accept a match between prototype and implementation in such cases. - -STRICT_PROTO_MATCHING = NO - -# The GENERATE_TODOLIST tag can be used to enable (YES) or -# disable (NO) the todo list. This list is created by putting \todo -# commands in the documentation. - -GENERATE_TODOLIST = YES - -# The GENERATE_TESTLIST tag can be used to enable (YES) or -# disable (NO) the test list. This list is created by putting \test -# commands in the documentation. - -GENERATE_TESTLIST = YES - -# The GENERATE_BUGLIST tag can be used to enable (YES) or -# disable (NO) the bug list. This list is created by putting \bug -# commands in the documentation. - -GENERATE_BUGLIST = YES - -# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or -# disable (NO) the deprecated list. This list is created by putting -# \deprecated commands in the documentation. - -GENERATE_DEPRECATEDLIST= YES - -# The ENABLED_SECTIONS tag can be used to enable conditional -# documentation sections, marked by \if section-label ... \endif -# and \cond section-label ... \endcond blocks. - -ENABLED_SECTIONS = - -# The MAX_INITIALIZER_LINES tag determines the maximum number of lines -# the initial value of a variable or macro consists of for it to appear in -# the documentation. If the initializer consists of more lines than specified -# here it will be hidden. Use a value of 0 to hide initializers completely. -# The appearance of the initializer of individual variables and macros in the -# documentation can be controlled using \showinitializer or \hideinitializer -# command in the documentation regardless of this setting. - -MAX_INITIALIZER_LINES = 30 - -# Set the SHOW_USED_FILES tag to NO to disable the list of files generated -# at the bottom of the documentation of classes and structs. If set to YES the -# list will mention the files that were used to generate the documentation. - -SHOW_USED_FILES = YES - -# Set the SHOW_FILES tag to NO to disable the generation of the Files page. -# This will remove the Files entry from the Quick Index and from the -# Folder Tree View (if specified). The default is YES. - -SHOW_FILES = YES - -# Set the SHOW_NAMESPACES tag to NO to disable the generation of the -# Namespaces page. This will remove the Namespaces entry from the Quick Index -# and from the Folder Tree View (if specified). The default is YES. - -SHOW_NAMESPACES = YES - -# The FILE_VERSION_FILTER tag can be used to specify a program or script that -# doxygen should invoke to get the current version for each file (typically from -# the version control system). Doxygen will invoke the program by executing (via -# popen()) the command , where is the value of -# the FILE_VERSION_FILTER tag, and is the name of an input file -# provided by doxygen. Whatever the program writes to standard output -# is used as the file version. See the manual for examples. - -FILE_VERSION_FILTER = - -# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed -# by doxygen. The layout file controls the global structure of the generated -# output files in an output format independent way. To create the layout file -# that represents doxygen's defaults, run doxygen with the -l option. -# You can optionally specify a file name after the option, if omitted -# DoxygenLayout.xml will be used as the name of the layout file. - -LAYOUT_FILE = - -# The CITE_BIB_FILES tag can be used to specify one or more bib files -# containing the references data. This must be a list of .bib files. The -# .bib extension is automatically appended if omitted. Using this command -# requires the bibtex tool to be installed. See also -# http://en.wikipedia.org/wiki/BibTeX for more info. For LaTeX the style -# of the bibliography can be controlled using LATEX_BIB_STYLE. To use this -# feature you need bibtex and perl available in the search path. Do not use -# file names with spaces, bibtex cannot handle them. - -CITE_BIB_FILES = - -#--------------------------------------------------------------------------- -# configuration options related to warning and progress messages -#--------------------------------------------------------------------------- - -# The QUIET tag can be used to turn on/off the messages that are generated -# by doxygen. Possible values are YES and NO. If left blank NO is used. - -QUIET = NO - -# The WARNINGS tag can be used to turn on/off the warning messages that are -# generated by doxygen. Possible values are YES and NO. If left blank -# NO is used. - -WARNINGS = YES - -# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings -# for undocumented members. If EXTRACT_ALL is set to YES then this flag will -# automatically be disabled. - -WARN_IF_UNDOCUMENTED = YES - -# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for -# potential errors in the documentation, such as not documenting some -# parameters in a documented function, or documenting parameters that -# don't exist or using markup commands wrongly. - -WARN_IF_DOC_ERROR = YES - -# The WARN_NO_PARAMDOC option can be enabled to get warnings for -# functions that are documented, but have no documentation for their parameters -# or return value. If set to NO (the default) doxygen will only warn about -# wrong or incomplete parameter documentation, but not about the absence of -# documentation. - -WARN_NO_PARAMDOC = NO - -# The WARN_FORMAT tag determines the format of the warning messages that -# doxygen can produce. The string should contain the $file, $line, and $text -# tags, which will be replaced by the file and line number from which the -# warning originated and the warning text. Optionally the format may contain -# $version, which will be replaced by the version of the file (if it could -# be obtained via FILE_VERSION_FILTER) - -WARN_FORMAT = "$file:$line: $text" - -# The WARN_LOGFILE tag can be used to specify a file to which warning -# and error messages should be written. If left blank the output is written -# to stderr. - -WARN_LOGFILE = - -#--------------------------------------------------------------------------- -# configuration options related to the input files -#--------------------------------------------------------------------------- - -# The INPUT tag can be used to specify the files and/or directories that contain -# documented source files. You may enter file names like "myfile.cpp" or -# directories like "/usr/src/myproject". Separate the files or directories -# with spaces. - -INPUT = ../ - -# This tag can be used to specify the character encoding of the source files -# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is -# also the default input encoding. Doxygen uses libiconv (or the iconv built -# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for -# the list of possible encodings. - -INPUT_ENCODING = UTF-8 - -# If the value of the INPUT tag contains directories, you can use the -# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp -# and *.h) to filter out the source-files in the directories. If left -# blank the following patterns are tested: -# *.c *.cc *.cxx *.cpp *.c++ *.d *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh -# *.hxx *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.dox *.py -# *.f90 *.f *.for *.vhd *.vhdl - -FILE_PATTERNS = *.c \ - *.cc \ - *.cxx \ - *.cpp \ - *.c++ \ - *.d \ - *.java \ - *.ii \ - *.ixx \ - *.ipp \ - *.i++ \ - *.inl \ - *.h \ - *.hh \ - *.hxx \ - *.hpp \ - *.h++ \ - *.idl \ - *.odl \ - *.cs \ - *.php \ - *.php3 \ - *.inc \ - *.m \ - *.markdown \ - *.md \ - *.mm \ - *.dox \ - *.py \ - *.f90 \ - *.f \ - *.for \ - *.vhd \ - *.vhdl \ - README.txt - -# The RECURSIVE tag can be used to turn specify whether or not subdirectories -# should be searched for input files as well. Possible values are YES and NO. -# If left blank NO is used. - -RECURSIVE = YES - -# The EXCLUDE tag can be used to specify files and/or directories that should be -# excluded from the INPUT source files. This way you can easily exclude a -# subdirectory from a directory tree whose root is specified with the INPUT tag. -# Note that relative paths are relative to the directory from which doxygen is -# run. - -EXCLUDE = - -# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or -# directories that are symbolic links (a Unix file system feature) are excluded -# from the input. - -EXCLUDE_SYMLINKS = NO - -# If the value of the INPUT tag contains directories, you can use the -# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude -# certain files from those directories. Note that the wildcards are matched -# against the file with absolute path, so to exclude all test directories -# for example use the pattern */test/* - -EXCLUDE_PATTERNS = - -# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names -# (namespaces, classes, functions, etc.) that should be excluded from the -# output. The symbol name can be a fully qualified name, a word, or if the -# wildcard * is used, a substring. Examples: ANamespace, AClass, -# AClass::ANamespace, ANamespace::*Test - -EXCLUDE_SYMBOLS = - -# The EXAMPLE_PATH tag can be used to specify one or more files or -# directories that contain example code fragments that are included (see -# the \include command). - -EXAMPLE_PATH = - -# If the value of the EXAMPLE_PATH tag contains directories, you can use the -# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp -# and *.h) to filter out the source-files in the directories. If left -# blank all files are included. - -EXAMPLE_PATTERNS = * - -# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be -# searched for input files to be used with the \include or \dontinclude -# commands irrespective of the value of the RECURSIVE tag. -# Possible values are YES and NO. If left blank NO is used. - -EXAMPLE_RECURSIVE = NO - -# The IMAGE_PATH tag can be used to specify one or more files or -# directories that contain image that are included in the documentation (see -# the \image command). - -IMAGE_PATH = - -# The INPUT_FILTER tag can be used to specify a program that doxygen should -# invoke to filter for each input file. Doxygen will invoke the filter program -# by executing (via popen()) the command , where -# is the value of the INPUT_FILTER tag, and is the name of an -# input file. Doxygen will then use the output that the filter program writes -# to standard output. If FILTER_PATTERNS is specified, this tag will be ignored. -# Note that the filter must not add or remove lines; it is applied before the -# code is scanned, but not when the output code is generated. If lines are added -# or removed, the anchors will not be placed correctly. - -INPUT_FILTER = - -# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern -# basis. Doxygen will compare the file name with each pattern and apply the -# filter if there is a match. The filters are a list of the form: -# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further -# info on how filters are used. If FILTER_PATTERNS is empty or if -# non of the patterns match the file name, INPUT_FILTER is applied. - -FILTER_PATTERNS = - -# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using -# INPUT_FILTER) will be used to filter the input files when producing source -# files to browse (i.e. when SOURCE_BROWSER is set to YES). - -FILTER_SOURCE_FILES = NO - -# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file -# pattern. A pattern will override the setting for FILTER_PATTERN (if any) -# and it is also possible to disable source filtering for a specific pattern -# using *.ext= (so without naming a filter). This option only has effect when -# FILTER_SOURCE_FILES is enabled. - -FILTER_SOURCE_PATTERNS = - -# If the USE_MD_FILE_AS_MAINPAGE tag refers to the name of a markdown file that -# is part of the input, its contents will be placed on the main page -# (index.html). This can be useful if you have a project on for instance GitHub -# and want reuse the introduction page also for the doxygen output. - -USE_MDFILE_AS_MAINPAGE = - -#--------------------------------------------------------------------------- -# configuration options related to source browsing -#--------------------------------------------------------------------------- - -# If the SOURCE_BROWSER tag is set to YES then a list of source files will -# be generated. Documented entities will be cross-referenced with these sources. -# Note: To get rid of all source code in the generated output, make sure also -# VERBATIM_HEADERS is set to NO. - -SOURCE_BROWSER = NO - -# Setting the INLINE_SOURCES tag to YES will include the body -# of functions and classes directly in the documentation. - -INLINE_SOURCES = NO - -# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct -# doxygen to hide any special comment blocks from generated source code -# fragments. Normal C, C++ and Fortran comments will always remain visible. - -STRIP_CODE_COMMENTS = YES - -# If the REFERENCED_BY_RELATION tag is set to YES -# then for each documented function all documented -# functions referencing it will be listed. - -REFERENCED_BY_RELATION = NO - -# If the REFERENCES_RELATION tag is set to YES -# then for each documented function all documented entities -# called/used by that function will be listed. - -REFERENCES_RELATION = NO - -# If the REFERENCES_LINK_SOURCE tag is set to YES (the default) -# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from -# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will -# link to the source code. Otherwise they will link to the documentation. - -REFERENCES_LINK_SOURCE = YES - -# If the USE_HTAGS tag is set to YES then the references to source code -# will point to the HTML generated by the htags(1) tool instead of doxygen -# built-in source browser. The htags tool is part of GNU's global source -# tagging system (see http://www.gnu.org/software/global/global.html). You -# will need version 4.8.6 or higher. - -USE_HTAGS = NO - -# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen -# will generate a verbatim copy of the header file for each class for -# which an include is specified. Set to NO to disable this. - -VERBATIM_HEADERS = YES - -# If CLANG_ASSISTED_PARSING is set to YES, then doxygen will use the clang parser -# for more acurate parsing at the cost of reduced performance. This can be -# particularly helpful with template rich C++ code for which doxygen's built-in -# parser lacks the necessairy type information. - -CLANG_ASSISTED_PARSING = NO - -# If clang assisted parsing is enabled you can provide the compiler with command -# line options that you would normally use when invoking the compiler. Note that -# the include paths will already be set by doxygen for the files and directories -# specified at INPUT and INCLUDE_PATH. - -CLANG_OPTIONS = - -#--------------------------------------------------------------------------- -# configuration options related to the alphabetical class index -#--------------------------------------------------------------------------- - -# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index -# of all compounds will be generated. Enable this if the project -# contains a lot of classes, structs, unions or interfaces. - -ALPHABETICAL_INDEX = YES - -# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then -# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns -# in which this list will be split (can be a number in the range [1..20]) - -COLS_IN_ALPHA_INDEX = 5 - -# In case all classes in a project start with a common prefix, all -# classes will be put under the same header in the alphabetical index. -# The IGNORE_PREFIX tag can be used to specify one or more prefixes that -# should be ignored while generating the index headers. - -IGNORE_PREFIX = - -#--------------------------------------------------------------------------- -# configuration options related to the HTML output -#--------------------------------------------------------------------------- - -# If the GENERATE_HTML tag is set to YES (the default) Doxygen will -# generate HTML output. - -GENERATE_HTML = YES - -# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `html' will be used as the default path. - -HTML_OUTPUT = html - -# The HTML_FILE_EXTENSION tag can be used to specify the file extension for -# each generated HTML page (for example: .htm,.php,.asp). If it is left blank -# doxygen will generate files with .html extension. - -HTML_FILE_EXTENSION = .html - -# The HTML_HEADER tag can be used to specify a personal HTML header for -# each generated HTML page. If it is left blank doxygen will generate a -# standard header. Note that when using a custom header you are responsible -# for the proper inclusion of any scripts and style sheets that doxygen -# needs, which is dependent on the configuration options used. -# It is advised to generate a default header using "doxygen -w html -# header.html footer.html stylesheet.css YourConfigFile" and then modify -# that header. Note that the header is subject to change so you typically -# have to redo this when upgrading to a newer version of doxygen or when -# changing the value of configuration settings such as GENERATE_TREEVIEW! - -HTML_HEADER = - -# The HTML_FOOTER tag can be used to specify a personal HTML footer for -# each generated HTML page. If it is left blank doxygen will generate a -# standard footer. - -HTML_FOOTER = - -# The HTML_STYLESHEET tag can be used to specify a user-defined cascading -# style sheet that is used by each HTML page. It can be used to -# fine-tune the look of the HTML output. If left blank doxygen will -# generate a default style sheet. Note that it is recommended to use -# HTML_EXTRA_STYLESHEET instead of this one, as it is more robust and this -# tag will in the future become obsolete. - -HTML_STYLESHEET = - -# The HTML_EXTRA_STYLESHEET tag can be used to specify an additional -# user-defined cascading style sheet that is included after the standard -# style sheets created by doxygen. Using this option one can overrule -# certain style aspects. This is preferred over using HTML_STYLESHEET -# since it does not replace the standard style sheet and is therefor more -# robust against future updates. Doxygen will copy the style sheet file to -# the output directory. - -HTML_EXTRA_STYLESHEET = - -# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or -# other source files which should be copied to the HTML output directory. Note -# that these files will be copied to the base HTML output directory. Use the -# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these -# files. In the HTML_STYLESHEET file, use the file name only. Also note that -# the files will be copied as-is; there are no commands or markers available. - -HTML_EXTRA_FILES = - -# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. -# Doxygen will adjust the colors in the style sheet and background images -# according to this color. Hue is specified as an angle on a colorwheel, -# see http://en.wikipedia.org/wiki/Hue for more information. -# For instance the value 0 represents red, 60 is yellow, 120 is green, -# 180 is cyan, 240 is blue, 300 purple, and 360 is red again. -# The allowed range is 0 to 359. - -HTML_COLORSTYLE_HUE = 220 - -# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of -# the colors in the HTML output. For a value of 0 the output will use -# grayscales only. A value of 255 will produce the most vivid colors. - -HTML_COLORSTYLE_SAT = 100 - -# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to -# the luminance component of the colors in the HTML output. Values below -# 100 gradually make the output lighter, whereas values above 100 make -# the output darker. The value divided by 100 is the actual gamma applied, -# so 80 represents a gamma of 0.8, The value 220 represents a gamma of 2.2, -# and 100 does not change the gamma. - -HTML_COLORSTYLE_GAMMA = 80 - -# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML -# page will contain the date and time when the page was generated. Setting -# this to NO can help when comparing the output of multiple runs. - -HTML_TIMESTAMP = YES - -# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML -# documentation will contain sections that can be hidden and shown after the -# page has loaded. - -HTML_DYNAMIC_SECTIONS = NO - -# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of -# entries shown in the various tree structured indices initially; the user -# can expand and collapse entries dynamically later on. Doxygen will expand -# the tree to such a level that at most the specified number of entries are -# visible (unless a fully collapsed tree already exceeds this amount). -# So setting the number of entries 1 will produce a full collapsed tree by -# default. 0 is a special value representing an infinite number of entries -# and will result in a full expanded tree by default. - -HTML_INDEX_NUM_ENTRIES = 100 - -# If the GENERATE_DOCSET tag is set to YES, additional index files -# will be generated that can be used as input for Apple's Xcode 3 -# integrated development environment, introduced with OSX 10.5 (Leopard). -# To create a documentation set, doxygen will generate a Makefile in the -# HTML output directory. Running make will produce the docset in that -# directory and running "make install" will install the docset in -# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find -# it at startup. -# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html -# for more information. - -GENERATE_DOCSET = NO - -# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the -# feed. A documentation feed provides an umbrella under which multiple -# documentation sets from a single provider (such as a company or product suite) -# can be grouped. - -DOCSET_FEEDNAME = "Doxygen generated docs" - -# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that -# should uniquely identify the documentation set bundle. This should be a -# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen -# will append .docset to the name. - -DOCSET_BUNDLE_ID = org.doxygen.Project - -# When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely -# identify the documentation publisher. This should be a reverse domain-name -# style string, e.g. com.mycompany.MyDocSet.documentation. - -DOCSET_PUBLISHER_ID = org.doxygen.Publisher - -# The GENERATE_PUBLISHER_NAME tag identifies the documentation publisher. - -DOCSET_PUBLISHER_NAME = Publisher - -# If the GENERATE_HTMLHELP tag is set to YES, additional index files -# will be generated that can be used as input for tools like the -# Microsoft HTML help workshop to generate a compiled HTML help file (.chm) -# of the generated HTML documentation. - -GENERATE_HTMLHELP = NO - -# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can -# be used to specify the file name of the resulting .chm file. You -# can add a path in front of the file if the result should not be -# written to the html output directory. - -CHM_FILE = - -# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can -# be used to specify the location (absolute path including file name) of -# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run -# the HTML help compiler on the generated index.hhp. - -HHC_LOCATION = - -# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag -# controls if a separate .chi index file is generated (YES) or that -# it should be included in the master .chm file (NO). - -GENERATE_CHI = NO - -# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING -# is used to encode HtmlHelp index (hhk), content (hhc) and project file -# content. - -CHM_INDEX_ENCODING = - -# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag -# controls whether a binary table of contents is generated (YES) or a -# normal table of contents (NO) in the .chm file. - -BINARY_TOC = NO - -# The TOC_EXPAND flag can be set to YES to add extra items for group members -# to the contents of the HTML help documentation and to the tree view. - -TOC_EXPAND = NO - -# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and -# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated -# that can be used as input for Qt's qhelpgenerator to generate a -# Qt Compressed Help (.qch) of the generated HTML documentation. - -GENERATE_QHP = NO - -# If the QHG_LOCATION tag is specified, the QCH_FILE tag can -# be used to specify the file name of the resulting .qch file. -# The path specified is relative to the HTML output folder. - -QCH_FILE = - -# The QHP_NAMESPACE tag specifies the namespace to use when generating -# Qt Help Project output. For more information please see -# http://doc.trolltech.com/qthelpproject.html#namespace - -QHP_NAMESPACE = org.doxygen.Project - -# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating -# Qt Help Project output. For more information please see -# http://doc.trolltech.com/qthelpproject.html#virtual-folders - -QHP_VIRTUAL_FOLDER = doc - -# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to -# add. For more information please see -# http://doc.trolltech.com/qthelpproject.html#custom-filters - -QHP_CUST_FILTER_NAME = - -# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the -# custom filter to add. For more information please see -# -# Qt Help Project / Custom Filters. - -QHP_CUST_FILTER_ATTRS = - -# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this -# project's -# filter section matches. -# -# Qt Help Project / Filter Attributes. - -QHP_SECT_FILTER_ATTRS = - -# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can -# be used to specify the location of Qt's qhelpgenerator. -# If non-empty doxygen will try to run qhelpgenerator on the generated -# .qhp file. - -QHG_LOCATION = - -# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files -# will be generated, which together with the HTML files, form an Eclipse help -# plugin. To install this plugin and make it available under the help contents -# menu in Eclipse, the contents of the directory containing the HTML and XML -# files needs to be copied into the plugins directory of eclipse. The name of -# the directory within the plugins directory should be the same as -# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before -# the help appears. - -GENERATE_ECLIPSEHELP = NO - -# A unique identifier for the eclipse help plugin. When installing the plugin -# the directory name containing the HTML and XML files should also have -# this name. - -ECLIPSE_DOC_ID = org.doxygen.Project - -# The DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) -# at top of each HTML page. The value NO (the default) enables the index and -# the value YES disables it. Since the tabs have the same information as the -# navigation tree you can set this option to NO if you already set -# GENERATE_TREEVIEW to YES. - -DISABLE_INDEX = NO - -# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index -# structure should be generated to display hierarchical information. -# If the tag value is set to YES, a side panel will be generated -# containing a tree-like index structure (just like the one that -# is generated for HTML Help). For this to work a browser that supports -# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser). -# Windows users are probably better off using the HTML help feature. -# Since the tree basically has the same information as the tab index you -# could consider to set DISABLE_INDEX to NO when enabling this option. - -GENERATE_TREEVIEW = NO - -# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values -# (range [0,1..20]) that doxygen will group on one line in the generated HTML -# documentation. Note that a value of 0 will completely suppress the enum -# values from appearing in the overview section. - -ENUM_VALUES_PER_LINE = 4 - -# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be -# used to set the initial width (in pixels) of the frame in which the tree -# is shown. - -TREEVIEW_WIDTH = 250 - -# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open -# links to external symbols imported via tag files in a separate window. - -EXT_LINKS_IN_WINDOW = NO - -# Use this tag to change the font size of Latex formulas included -# as images in the HTML documentation. The default is 10. Note that -# when you change the font size after a successful doxygen run you need -# to manually remove any form_*.png images from the HTML output directory -# to force them to be regenerated. - -FORMULA_FONTSIZE = 10 - -# Use the FORMULA_TRANPARENT tag to determine whether or not the images -# generated for formulas are transparent PNGs. Transparent PNGs are -# not supported properly for IE 6.0, but are supported on all modern browsers. -# Note that when changing this option you need to delete any form_*.png files -# in the HTML output before the changes have effect. - -FORMULA_TRANSPARENT = YES - -# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax -# (see http://www.mathjax.org) which uses client side Javascript for the -# rendering instead of using prerendered bitmaps. Use this if you do not -# have LaTeX installed or if you want to formulas look prettier in the HTML -# output. When enabled you may also need to install MathJax separately and -# configure the path to it using the MATHJAX_RELPATH option. - -USE_MATHJAX = NO - -# When MathJax is enabled you can set the default output format to be used for -# the MathJax output. Supported types are HTML-CSS, NativeMML (i.e. MathML) and -# SVG. The default value is HTML-CSS, which is slower, but has the best -# compatibility. - -MATHJAX_FORMAT = HTML-CSS - -# When MathJax is enabled you need to specify the location relative to the -# HTML output directory using the MATHJAX_RELPATH option. The destination -# directory should contain the MathJax.js script. For instance, if the mathjax -# directory is located at the same level as the HTML output directory, then -# MATHJAX_RELPATH should be ../mathjax. The default value points to -# the MathJax Content Delivery Network so you can quickly see the result without -# installing MathJax. However, it is strongly recommended to install a local -# copy of MathJax from http://www.mathjax.org before deployment. - -MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest - -# The MATHJAX_EXTENSIONS tag can be used to specify one or MathJax extension -# names that should be enabled during MathJax rendering. - -MATHJAX_EXTENSIONS = - -# The MATHJAX_CODEFILE tag can be used to specify a file with javascript -# pieces of code that will be used on startup of the MathJax code. - -MATHJAX_CODEFILE = - -# When the SEARCHENGINE tag is enabled doxygen will generate a search box -# for the HTML output. The underlying search engine uses javascript -# and DHTML and should work on any modern browser. Note that when using -# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets -# (GENERATE_DOCSET) there is already a search function so this one should -# typically be disabled. For large projects the javascript based search engine -# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution. - -SEARCHENGINE = YES - -# When the SERVER_BASED_SEARCH tag is enabled the search engine will be -# implemented using a web server instead of a web client using Javascript. -# There are two flavours of web server based search depending on the -# EXTERNAL_SEARCH setting. When disabled, doxygen will generate a PHP script for -# searching and an index file used by the script. When EXTERNAL_SEARCH is -# enabled the indexing and searching needs to be provided by external tools. -# See the manual for details. - -SERVER_BASED_SEARCH = NO - -# When EXTERNAL_SEARCH is enabled doxygen will no longer generate the PHP -# script for searching. Instead the search results are written to an XML file -# which needs to be processed by an external indexer. Doxygen will invoke an -# external search engine pointed to by the SEARCHENGINE_URL option to obtain -# the search results. Doxygen ships with an example indexer (doxyindexer) and -# search engine (doxysearch.cgi) which are based on the open source search -# engine library Xapian. See the manual for configuration details. - -EXTERNAL_SEARCH = NO - -# The SEARCHENGINE_URL should point to a search engine hosted by a web server -# which will returned the search results when EXTERNAL_SEARCH is enabled. -# Doxygen ships with an example search engine (doxysearch) which is based on -# the open source search engine library Xapian. See the manual for configuration -# details. - -SEARCHENGINE_URL = - -# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the unindexed -# search data is written to a file for indexing by an external tool. With the -# SEARCHDATA_FILE tag the name of this file can be specified. - -SEARCHDATA_FILE = searchdata.xml - -# When SERVER_BASED_SEARCH AND EXTERNAL_SEARCH are both enabled the -# EXTERNAL_SEARCH_ID tag can be used as an identifier for the project. This is -# useful in combination with EXTRA_SEARCH_MAPPINGS to search through multiple -# projects and redirect the results back to the right project. - -EXTERNAL_SEARCH_ID = - -# The EXTRA_SEARCH_MAPPINGS tag can be used to enable searching through doxygen -# projects other than the one defined by this configuration file, but that are -# all added to the same external search index. Each project needs to have a -# unique id set via EXTERNAL_SEARCH_ID. The search mapping then maps the id -# of to a relative location where the documentation can be found. -# The format is: EXTRA_SEARCH_MAPPINGS = id1=loc1 id2=loc2 ... - -EXTRA_SEARCH_MAPPINGS = - -#--------------------------------------------------------------------------- -# configuration options related to the LaTeX output -#--------------------------------------------------------------------------- - -# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will -# generate Latex output. - -GENERATE_LATEX = YES - -# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `latex' will be used as the default path. - -LATEX_OUTPUT = latex - -# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be -# invoked. If left blank `latex' will be used as the default command name. -# Note that when enabling USE_PDFLATEX this option is only used for -# generating bitmaps for formulas in the HTML output, but not in the -# Makefile that is written to the output directory. - -LATEX_CMD_NAME = latex - -# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to -# generate index for LaTeX. If left blank `makeindex' will be used as the -# default command name. - -MAKEINDEX_CMD_NAME = makeindex - -# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact -# LaTeX documents. This may be useful for small projects and may help to -# save some trees in general. - -COMPACT_LATEX = NO - -# The PAPER_TYPE tag can be used to set the paper type that is used -# by the printer. Possible values are: a4, letter, legal and -# executive. If left blank a4 will be used. - -PAPER_TYPE = a4 - -# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX -# packages that should be included in the LaTeX output. - -EXTRA_PACKAGES = - -# The LATEX_HEADER tag can be used to specify a personal LaTeX header for -# the generated latex document. The header should contain everything until -# the first chapter. If it is left blank doxygen will generate a -# standard header. Notice: only use this tag if you know what you are doing! - -LATEX_HEADER = - -# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for -# the generated latex document. The footer should contain everything after -# the last chapter. If it is left blank doxygen will generate a -# standard footer. Notice: only use this tag if you know what you are doing! - -LATEX_FOOTER = - -# The LATEX_EXTRA_FILES tag can be used to specify one or more extra images -# or other source files which should be copied to the LaTeX output directory. -# Note that the files will be copied as-is; there are no commands or markers -# available. - -LATEX_EXTRA_FILES = - -# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated -# is prepared for conversion to pdf (using ps2pdf). The pdf file will -# contain links (just like the HTML output) instead of page references -# This makes the output suitable for online browsing using a pdf viewer. - -PDF_HYPERLINKS = YES - -# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of -# plain latex in the generated Makefile. Set this option to YES to get a -# higher quality PDF documentation. - -USE_PDFLATEX = YES - -# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. -# command to the generated LaTeX files. This will instruct LaTeX to keep -# running if errors occur, instead of asking the user for help. -# This option is also used when generating formulas in HTML. - -LATEX_BATCHMODE = NO - -# If LATEX_HIDE_INDICES is set to YES then doxygen will not -# include the index chapters (such as File Index, Compound Index, etc.) -# in the output. - -LATEX_HIDE_INDICES = NO - -# If LATEX_SOURCE_CODE is set to YES then doxygen will include -# source code with syntax highlighting in the LaTeX output. -# Note that which sources are shown also depends on other settings -# such as SOURCE_BROWSER. - -LATEX_SOURCE_CODE = NO - -# The LATEX_BIB_STYLE tag can be used to specify the style to use for the -# bibliography, e.g. plainnat, or ieeetr. The default style is "plain". See -# http://en.wikipedia.org/wiki/BibTeX for more info. - -LATEX_BIB_STYLE = plain - -#--------------------------------------------------------------------------- -# configuration options related to the RTF output -#--------------------------------------------------------------------------- - -# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output -# The RTF output is optimized for Word 97 and may not look very pretty with -# other RTF readers or editors. - -GENERATE_RTF = NO - -# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `rtf' will be used as the default path. - -RTF_OUTPUT = rtf - -# If the COMPACT_RTF tag is set to YES Doxygen generates more compact -# RTF documents. This may be useful for small projects and may help to -# save some trees in general. - -COMPACT_RTF = NO - -# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated -# will contain hyperlink fields. The RTF file will -# contain links (just like the HTML output) instead of page references. -# This makes the output suitable for online browsing using WORD or other -# programs which support those fields. -# Note: wordpad (write) and others do not support links. - -RTF_HYPERLINKS = NO - -# Load style sheet definitions from file. Syntax is similar to doxygen's -# config file, i.e. a series of assignments. You only have to provide -# replacements, missing definitions are set to their default value. - -RTF_STYLESHEET_FILE = - -# Set optional variables used in the generation of an rtf document. -# Syntax is similar to doxygen's config file. - -RTF_EXTENSIONS_FILE = - -#--------------------------------------------------------------------------- -# configuration options related to the man page output -#--------------------------------------------------------------------------- - -# If the GENERATE_MAN tag is set to YES (the default) Doxygen will -# generate man pages - -GENERATE_MAN = NO - -# The MAN_OUTPUT tag is used to specify where the man pages will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `man' will be used as the default path. - -MAN_OUTPUT = man - -# The MAN_EXTENSION tag determines the extension that is added to -# the generated man pages (default is the subroutine's section .3) - -MAN_EXTENSION = .3 - -# If the MAN_LINKS tag is set to YES and Doxygen generates man output, -# then it will generate one additional man file for each entity -# documented in the real man page(s). These additional files -# only source the real man page, but without them the man command -# would be unable to find the correct page. The default is NO. - -MAN_LINKS = NO - -#--------------------------------------------------------------------------- -# configuration options related to the XML output -#--------------------------------------------------------------------------- - -# If the GENERATE_XML tag is set to YES Doxygen will -# generate an XML file that captures the structure of -# the code including all documentation. - -GENERATE_XML = NO - -# The XML_OUTPUT tag is used to specify where the XML pages will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `xml' will be used as the default path. - -XML_OUTPUT = xml - -# The XML_SCHEMA tag can be used to specify an XML schema, -# which can be used by a validating XML parser to check the -# syntax of the XML files. - -XML_SCHEMA = - -# The XML_DTD tag can be used to specify an XML DTD, -# which can be used by a validating XML parser to check the -# syntax of the XML files. - -XML_DTD = - -# If the XML_PROGRAMLISTING tag is set to YES Doxygen will -# dump the program listings (including syntax highlighting -# and cross-referencing information) to the XML output. Note that -# enabling this will significantly increase the size of the XML output. - -XML_PROGRAMLISTING = YES - -#--------------------------------------------------------------------------- -# configuration options related to the DOCBOOK output -#--------------------------------------------------------------------------- - -# If the GENERATE_DOCBOOK tag is set to YES Doxygen will generate DOCBOOK files -# that can be used to generate PDF. - -GENERATE_DOCBOOK = NO - -# The DOCBOOK_OUTPUT tag is used to specify where the DOCBOOK pages will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be put in -# front of it. If left blank docbook will be used as the default path. - -DOCBOOK_OUTPUT = docbook - -#--------------------------------------------------------------------------- -# configuration options for the AutoGen Definitions output -#--------------------------------------------------------------------------- - -# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will -# generate an AutoGen Definitions (see autogen.sf.net) file -# that captures the structure of the code including all -# documentation. Note that this feature is still experimental -# and incomplete at the moment. - -GENERATE_AUTOGEN_DEF = NO - -#--------------------------------------------------------------------------- -# configuration options related to the Perl module output -#--------------------------------------------------------------------------- - -# If the GENERATE_PERLMOD tag is set to YES Doxygen will -# generate a Perl module file that captures the structure of -# the code including all documentation. Note that this -# feature is still experimental and incomplete at the -# moment. - -GENERATE_PERLMOD = NO - -# If the PERLMOD_LATEX tag is set to YES Doxygen will generate -# the necessary Makefile rules, Perl scripts and LaTeX code to be able -# to generate PDF and DVI output from the Perl module output. - -PERLMOD_LATEX = NO - -# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be -# nicely formatted so it can be parsed by a human reader. This is useful -# if you want to understand what is going on. On the other hand, if this -# tag is set to NO the size of the Perl module output will be much smaller -# and Perl will parse it just the same. - -PERLMOD_PRETTY = YES - -# The names of the make variables in the generated doxyrules.make file -# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. -# This is useful so different doxyrules.make files included by the same -# Makefile don't overwrite each other's variables. - -PERLMOD_MAKEVAR_PREFIX = - -#--------------------------------------------------------------------------- -# Configuration options related to the preprocessor -#--------------------------------------------------------------------------- - -# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will -# evaluate all C-preprocessor directives found in the sources and include -# files. - -ENABLE_PREPROCESSING = YES - -# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro -# names in the source code. If set to NO (the default) only conditional -# compilation will be performed. Macro expansion can be done in a controlled -# way by setting EXPAND_ONLY_PREDEF to YES. - -MACRO_EXPANSION = NO - -# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES -# then the macro expansion is limited to the macros specified with the -# PREDEFINED and EXPAND_AS_DEFINED tags. - -EXPAND_ONLY_PREDEF = NO - -# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files -# pointed to by INCLUDE_PATH will be searched when a #include is found. - -SEARCH_INCLUDES = YES - -# The INCLUDE_PATH tag can be used to specify one or more directories that -# contain include files that are not input files but should be processed by -# the preprocessor. - -INCLUDE_PATH = - -# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard -# patterns (like *.h and *.hpp) to filter out the header-files in the -# directories. If left blank, the patterns specified with FILE_PATTERNS will -# be used. - -INCLUDE_FILE_PATTERNS = - -# The PREDEFINED tag can be used to specify one or more macro names that -# are defined before the preprocessor is started (similar to the -D option of -# gcc). The argument of the tag is a list of macros of the form: name -# or name=definition (no spaces). If the definition and the = are -# omitted =1 is assumed. To prevent a macro definition from being -# undefined via #undef or recursively expanded use the := operator -# instead of the = operator. - -PREDEFINED = - -# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then -# this tag can be used to specify a list of macro names that should be expanded. -# The macro definition that is found in the sources will be used. -# Use the PREDEFINED tag if you want to use a different macro definition that -# overrules the definition found in the source code. - -EXPAND_AS_DEFINED = - -# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then -# doxygen's preprocessor will remove all references to function-like macros -# that are alone on a line, have an all uppercase name, and do not end with a -# semicolon, because these will confuse the parser if not removed. - -SKIP_FUNCTION_MACROS = YES - -#--------------------------------------------------------------------------- -# Configuration::additions related to external references -#--------------------------------------------------------------------------- - -# The TAGFILES option can be used to specify one or more tagfiles. For each -# tag file the location of the external documentation should be added. The -# format of a tag file without this location is as follows: -# TAGFILES = file1 file2 ... -# Adding location for the tag files is done as follows: -# TAGFILES = file1=loc1 "file2 = loc2" ... -# where "loc1" and "loc2" can be relative or absolute paths -# or URLs. Note that each tag file must have a unique name (where the name does -# NOT include the path). If a tag file is not located in the directory in which -# doxygen is run, you must also specify the path to the tagfile here. - -TAGFILES = - -# When a file name is specified after GENERATE_TAGFILE, doxygen will create -# a tag file that is based on the input files it reads. - -GENERATE_TAGFILE = - -# If the ALLEXTERNALS tag is set to YES all external classes will be listed -# in the class index. If set to NO only the inherited external classes -# will be listed. - -ALLEXTERNALS = NO - -# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed -# in the modules index. If set to NO, only the current project's groups will -# be listed. - -EXTERNAL_GROUPS = YES - -# If the EXTERNAL_PAGES tag is set to YES all external pages will be listed -# in the related pages index. If set to NO, only the current project's -# pages will be listed. - -EXTERNAL_PAGES = YES - -# The PERL_PATH should be the absolute path and name of the perl script -# interpreter (i.e. the result of `which perl'). - -PERL_PATH = /usr/bin/perl - -#--------------------------------------------------------------------------- -# Configuration options related to the dot tool -#--------------------------------------------------------------------------- - -# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will -# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base -# or super classes. Setting the tag to NO turns the diagrams off. Note that -# this option also works with HAVE_DOT disabled, but it is recommended to -# install and use dot, since it yields more powerful graphs. - -CLASS_DIAGRAMS = YES - -# You can define message sequence charts within doxygen comments using the \msc -# command. Doxygen will then run the mscgen tool (see -# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the -# documentation. The MSCGEN_PATH tag allows you to specify the directory where -# the mscgen tool resides. If left empty the tool is assumed to be found in the -# default search path. - -MSCGEN_PATH = - -# If set to YES, the inheritance and collaboration graphs will hide -# inheritance and usage relations if the target is undocumented -# or is not a class. - -HIDE_UNDOC_RELATIONS = YES - -# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is -# available from the path. This tool is part of Graphviz, a graph visualization -# toolkit from AT&T and Lucent Bell Labs. The other options in this section -# have no effect if this option is set to NO (the default) - -HAVE_DOT = NO - -# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is -# allowed to run in parallel. When set to 0 (the default) doxygen will -# base this on the number of processors available in the system. You can set it -# explicitly to a value larger than 0 to get control over the balance -# between CPU load and processing speed. - -DOT_NUM_THREADS = 0 - -# By default doxygen will use the Helvetica font for all dot files that -# doxygen generates. When you want a differently looking font you can specify -# the font name using DOT_FONTNAME. You need to make sure dot is able to find -# the font, which can be done by putting it in a standard location or by setting -# the DOTFONTPATH environment variable or by setting DOT_FONTPATH to the -# directory containing the font. - -DOT_FONTNAME = Helvetica - -# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs. -# The default size is 10pt. - -DOT_FONTSIZE = 10 - -# By default doxygen will tell dot to use the Helvetica font. -# If you specify a different font using DOT_FONTNAME you can use DOT_FONTPATH to -# set the path where dot can find it. - -DOT_FONTPATH = - -# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for each documented class showing the direct and -# indirect inheritance relations. Setting this tag to YES will force the -# CLASS_DIAGRAMS tag to NO. - -CLASS_GRAPH = YES - -# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for each documented class showing the direct and -# indirect implementation dependencies (inheritance, containment, and -# class references variables) of the class with other documented classes. - -COLLABORATION_GRAPH = YES - -# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for groups, showing the direct groups dependencies - -GROUP_GRAPHS = YES - -# If the UML_LOOK tag is set to YES doxygen will generate inheritance and -# collaboration diagrams in a style similar to the OMG's Unified Modeling -# Language. - -UML_LOOK = NO - -# If the UML_LOOK tag is enabled, the fields and methods are shown inside -# the class node. If there are many fields or methods and many nodes the -# graph may become too big to be useful. The UML_LIMIT_NUM_FIELDS -# threshold limits the number of items for each type to make the size more -# manageable. Set this to 0 for no limit. Note that the threshold may be -# exceeded by 50% before the limit is enforced. - -UML_LIMIT_NUM_FIELDS = 10 - -# If set to YES, the inheritance and collaboration graphs will show the -# relations between templates and their instances. - -TEMPLATE_RELATIONS = NO - -# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT -# tags are set to YES then doxygen will generate a graph for each documented -# file showing the direct and indirect include dependencies of the file with -# other documented files. - -INCLUDE_GRAPH = YES - -# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and -# HAVE_DOT tags are set to YES then doxygen will generate a graph for each -# documented header file showing the documented files that directly or -# indirectly include this file. - -INCLUDED_BY_GRAPH = YES - -# If the CALL_GRAPH and HAVE_DOT options are set to YES then -# doxygen will generate a call dependency graph for every global function -# or class method. Note that enabling this option will significantly increase -# the time of a run. So in most cases it will be better to enable call graphs -# for selected functions only using the \callgraph command. - -CALL_GRAPH = NO - -# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then -# doxygen will generate a caller dependency graph for every global function -# or class method. Note that enabling this option will significantly increase -# the time of a run. So in most cases it will be better to enable caller -# graphs for selected functions only using the \callergraph command. - -CALLER_GRAPH = NO - -# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen -# will generate a graphical hierarchy of all classes instead of a textual one. - -GRAPHICAL_HIERARCHY = YES - -# If the DIRECTORY_GRAPH and HAVE_DOT tags are set to YES -# then doxygen will show the dependencies a directory has on other directories -# in a graphical way. The dependency relations are determined by the #include -# relations between the files in the directories. - -DIRECTORY_GRAPH = YES - -# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images -# generated by dot. Possible values are svg, png, jpg, or gif. -# If left blank png will be used. If you choose svg you need to set -# HTML_FILE_EXTENSION to xhtml in order to make the SVG files -# visible in IE 9+ (other browsers do not have this requirement). - -DOT_IMAGE_FORMAT = png - -# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to -# enable generation of interactive SVG images that allow zooming and panning. -# Note that this requires a modern browser other than Internet Explorer. -# Tested and working are Firefox, Chrome, Safari, and Opera. For IE 9+ you -# need to set HTML_FILE_EXTENSION to xhtml in order to make the SVG files -# visible. Older versions of IE do not have SVG support. - -INTERACTIVE_SVG = NO - -# The tag DOT_PATH can be used to specify the path where the dot tool can be -# found. If left blank, it is assumed the dot tool can be found in the path. - -DOT_PATH = - -# The DOTFILE_DIRS tag can be used to specify one or more directories that -# contain dot files that are included in the documentation (see the -# \dotfile command). - -DOTFILE_DIRS = - -# The MSCFILE_DIRS tag can be used to specify one or more directories that -# contain msc files that are included in the documentation (see the -# \mscfile command). - -MSCFILE_DIRS = - -# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of -# nodes that will be shown in the graph. If the number of nodes in a graph -# becomes larger than this value, doxygen will truncate the graph, which is -# visualized by representing a node as a red box. Note that doxygen if the -# number of direct children of the root node in a graph is already larger than -# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note -# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. - -DOT_GRAPH_MAX_NODES = 50 - -# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the -# graphs generated by dot. A depth value of 3 means that only nodes reachable -# from the root by following a path via at most 3 edges will be shown. Nodes -# that lay further from the root node will be omitted. Note that setting this -# option to 1 or 2 may greatly reduce the computation time needed for large -# code bases. Also note that the size of a graph can be further restricted by -# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. - -MAX_DOT_GRAPH_DEPTH = 0 - -# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent -# background. This is disabled by default, because dot on Windows does not -# seem to support this out of the box. Warning: Depending on the platform used, -# enabling this option may lead to badly anti-aliased labels on the edges of -# a graph (i.e. they become hard to read). - -DOT_TRANSPARENT = NO - -# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output -# files in one run (i.e. multiple -o and -T options on the command line). This -# makes dot run faster, but since only newer versions of dot (>1.8.10) -# support this, this feature is disabled by default. - -DOT_MULTI_TARGETS = NO - -# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will -# generate a legend page explaining the meaning of the various boxes and -# arrows in the dot generated graphs. - -GENERATE_LEGEND = YES - -# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will -# remove the intermediate dot files that are used to generate -# the various graphs. - -DOT_CLEANUP = YES diff --git a/visualtest/include/SDL_visualtest_action_configparser.h b/visualtest/include/SDL_visualtest_action_configparser.h deleted file mode 100644 index 40481f3798..0000000000 --- a/visualtest/include/SDL_visualtest_action_configparser.h +++ /dev/null @@ -1,149 +0,0 @@ -/* See LICENSE.txt for the full license governing this code. */ -/** - * \file SDL_visualtest_action_configparser.h - * - * Header file for the parser for action config files. - */ - -#ifndef SDL_visualtest_action_configparser_h_ -#define SDL_visualtest_action_configparser_h_ - -/** The maximum length of one line in the actions file */ -#define MAX_ACTION_LINE_LENGTH 300 - -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * Type of the action. - */ -typedef enum -{ - /*! Launch an application with some given arguments */ - SDL_ACTION_LAUNCH = 0, - /*! Kill the SUT process */ - SDL_ACTION_KILL, - /*! Quit (Gracefully exit) the SUT process */ - SDL_ACTION_QUIT, - /*! Take a screenshot of the SUT window */ - SDL_ACTION_SCREENSHOT, - /*! Verify a previously taken screenshot */ - SDL_ACTION_VERIFY -} SDLVisualTest_ActionType; - -/** - * Struct that defines an action that will be performed on the SUT process at - * a specific time. - */ -typedef struct SDLVisualTest_Action -{ - /*! The type of action to be performed */ - SDLVisualTest_ActionType type; - /*! The time, in milliseconds from the launch of the SUT, when the action - will be performed */ - int time; - /*! Any additional information needed to perform the action. */ - union - { - /*! The path and arguments to the process to be launched */ - struct - { - char* path; - char* args; - } process; - } extra; -} SDLVisualTest_Action; - -/** - * Struct for a node in the action queue. - */ -typedef struct SDLVisualTest_ActionNode -{ - /*! The action in this node */ - SDLVisualTest_Action action; - /*! Pointer to the next element in the queue */ - struct SDLVisualTest_ActionNode* next; -} SDLVisualTest_ActionNode; - -/** - * Queue structure for actions loaded from the actions config file. - */ -typedef struct SDLVisualTest_ActionQueue -{ - /*! Pointer to the front of the queue */ - SDLVisualTest_ActionNode* front; - /*! Pointer to the rear of the queue */ - SDLVisualTest_ActionNode* rear; - /*! Number of nodes in the queue */ - int size; -} SDLVisualTest_ActionQueue; - -/** - * Add an action pointed to by \c action to the rear of the action queue pointed - * to by \c queue. - * - * \return 1 on success, 0 on failure. - */ -int SDLVisualTest_EnqueueAction(SDLVisualTest_ActionQueue* queue, - SDLVisualTest_Action action); - -/** - * Remove an action from the front of the action queue pointed to by \c queue. - * - * \return 1 on success, 0 on failure. - */ -int SDLVisualTest_DequeueAction(SDLVisualTest_ActionQueue* queue); - -/** - * Initialize the action queue pointed to by \c queue. - */ -void SDLVisualTest_InitActionQueue(SDLVisualTest_ActionQueue* queue); - -/** - * Get the action at the front of the action queue pointed to by \c queue. - * The returned action pointer may become invalid after subsequent dequeues. - * - * \return pointer to the action on success, NULL on failure. - */ -SDLVisualTest_Action* SDLVisualTest_GetQueueFront(SDLVisualTest_ActionQueue* queue); - -/** - * Check if the queue pointed to by \c queue is empty or not. - * - * \return 1 if the queue is empty, 0 otherwise. - */ -int SDLVisualTest_IsActionQueueEmpty(SDLVisualTest_ActionQueue* queue); - -/** - * Dequeues all the elements in the queque pointed to by \c queue. - */ -void SDLVisualTest_EmptyActionQueue(SDLVisualTest_ActionQueue* queue); - -/** - * Inserts an action \c action into the queue pointed to by \c queue such that - * the times of actions in the queue increase as we move from the front to the - * rear. - * - * \return 1 on success, 0 on failure. - */ -int SDLVisualTest_InsertIntoActionQueue(SDLVisualTest_ActionQueue* queue, - SDLVisualTest_Action action); - -/** - * Parses an action config file with path \c file and populates an action queue - * pointed to by \c queue with actions. - * - * \return 1 on success, 0 on failure. - */ -int SDLVisualTest_ParseActionConfig(const char* file, SDLVisualTest_ActionQueue* queue); - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif - -#endif /* SDL_visualtest_action_configparser_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/visualtest/include/SDL_visualtest_exhaustive_variator.h b/visualtest/include/SDL_visualtest_exhaustive_variator.h deleted file mode 100644 index 4637ce29e1..0000000000 --- a/visualtest/include/SDL_visualtest_exhaustive_variator.h +++ /dev/null @@ -1,64 +0,0 @@ -/* See LICENSE.txt for the full license governing this code. */ -/** - * \file SDL_visualtest_exhaustive_variator.h - * - * Header for the exhaustive variator. - */ - -#include "SDL_visualtest_harness_argparser.h" -#include "SDL_visualtest_variator_common.h" - -#ifndef SDL_visualtest_exhaustive_variator_h_ -#define SDL_visualtest_exhaustive_variator_h_ - -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * Struct for the variator that exhaustively iterates through all variations of - * command line arguments to the SUT. - */ -typedef struct SDLVisualTest_ExhaustiveVariator -{ - /*! The current variation. */ - SDLVisualTest_Variation variation; - /*! Configuration object for the SUT that the variator is running for. */ - SDLVisualTest_SUTConfig config; - /*! Buffer to store the arguments string built from the variation */ - char buffer[MAX_SUT_ARGS_LEN]; -} SDLVisualTest_ExhaustiveVariator; - -/** - * Initializes the variator. - * - * \return 1 on success, 0 on failure - */ -int SDLVisualTest_InitExhaustiveVariator(SDLVisualTest_ExhaustiveVariator* variator, - SDLVisualTest_SUTConfig* config); - -/** - * Gets the arguments string for the next variation using the variator and updates - * the variator's current variation object to the next variation. - * - * \return The arguments string representing the next variation on success, and - * NULL on failure or if we have iterated through all possible variations. - * In the latter case subsequent calls will start the variations again from - * the very beginning. The pointer returned should not be freed. - */ -char* SDLVisualTest_GetNextExhaustiveVariation(SDLVisualTest_ExhaustiveVariator* variator); - -/** - * Frees any resources associated with the variator. - */ -void SDLVisualTest_FreeExhaustiveVariator(SDLVisualTest_ExhaustiveVariator* variator); - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif - -#endif /* SDL_visualtest_exhaustive_variator_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/visualtest/include/SDL_visualtest_harness_argparser.h b/visualtest/include/SDL_visualtest_harness_argparser.h deleted file mode 100644 index 75420fe2e6..0000000000 --- a/visualtest/include/SDL_visualtest_harness_argparser.h +++ /dev/null @@ -1,75 +0,0 @@ -/** - * \file SDL_visualtest_harness_argparser.h - * - * Provides functionality to parse command line arguments to the test harness. - */ - -#include -#include "SDL_visualtest_sut_configparser.h" -#include "SDL_visualtest_variator_common.h" -#include "SDL_visualtest_action_configparser.h" - -#ifndef SDL_visualtest_harness_argparser_h_ -#define SDL_visualtest_harness_argparser_h_ - -/** Maximum length of a path string */ -#define MAX_PATH_LEN 300 -/** Maximum length of a string of SUT arguments */ -#define MAX_SUT_ARGS_LEN 600 - -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * Stores the state of the test harness. - */ -typedef struct SDLVisualTest_HarnessState -{ - /*! Path to the System Under Test (SUT) executable */ - char sutapp[MAX_PATH_LEN]; - /*! Command line arguments to be passed to the SUT */ - char sutargs[MAX_SUT_ARGS_LEN]; - /*! Time in milliseconds after which to kill the SUT */ - int timeout; - /*! Configuration object for the SUT */ - SDLVisualTest_SUTConfig sut_config; - /*! What type of variator to use to generate argument strings */ - SDLVisualTest_VariatorType variator_type; - /*! The number of variations to generate */ - int num_variations; - /*! If true, the test harness will just print the different variations - without launching the SUT for each one */ - SDL_bool no_launch; - /*! A queue with actions to be performed while the SUT is running */ - SDLVisualTest_ActionQueue action_queue; - /*! Output directory to save the screenshots */ - char output_dir[MAX_PATH_LEN]; - /*! Path to directory with the verification images */ - char verify_dir[MAX_PATH_LEN]; -} SDLVisualTest_HarnessState; - -/** - * Parse command line paramters to the test harness and populate a state object. - * - * \param argv The array of command line parameters. - * \param state Pointer to the state object to be populated. - * - * \return Non-zero on success, zero on failure. - */ -int SDLVisualTest_ParseHarnessArgs(char** argv, SDLVisualTest_HarnessState* state); - -/** - * Frees any resources associated with the state object pointed to by \c state. - */ -void SDLVisualTest_FreeHarnessState(SDLVisualTest_HarnessState* state); - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif - -#endif /* SDL_visualtest_harness_argparser_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/visualtest/include/SDL_visualtest_mischelper.h b/visualtest/include/SDL_visualtest_mischelper.h deleted file mode 100644 index 5faffa5677..0000000000 --- a/visualtest/include/SDL_visualtest_mischelper.h +++ /dev/null @@ -1,28 +0,0 @@ -/** - * \file mischelper.c - * - * Header with miscellaneous helper functions. - */ - -#ifndef SDL_visualtest_mischelper_h_ -#define SDL_visualtest_mischelper_h_ - -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * Stores a 32 digit hexadecimal string representing the MD5 hash of the - * string \c str in \c hash. - */ -void SDLVisualTest_HashString(char* str, char hash[33]); - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif - -#endif /* SDL_visualtest_mischelper_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/visualtest/include/SDL_visualtest_parsehelper.h b/visualtest/include/SDL_visualtest_parsehelper.h deleted file mode 100644 index 4558552c13..0000000000 --- a/visualtest/include/SDL_visualtest_parsehelper.h +++ /dev/null @@ -1,46 +0,0 @@ -/* See LICENSE.txt for the full license governing this code. */ -/** - * \file SDL_visualtest_parsehelper.h - * - * Header with some helper functions for parsing strings. - */ - -#ifndef SDL_visualtest_parsehelper_h_ -#define SDL_visualtest_parsehelper_h_ - -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * Takes an string of command line arguments and breaks them up into an array - * based on whitespace. - * - * \param args The string of arguments. - * - * \return NULL on failure, an array of strings on success. The last element - * of the array is NULL. The first element of the array is NULL and should - * be set to the path of the executable by the caller. - */ -char** SDLVisualTest_ParseArgsToArgv(char* args); - -/** - * Takes a string and breaks it into tokens by splitting on whitespace. - * - * \param str The string to be split. - * \param max_token_len Length of each element in the array to be returned. - * - * \return NULL on failure; an array of strings with the tokens on success. The - * last element of the array is NULL. - */ -char** SDLVisualTest_Tokenize(char* str, int max_token_len); - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif - -#endif /* SDL_visualtest_parsehelper_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/visualtest/include/SDL_visualtest_process.h b/visualtest/include/SDL_visualtest_process.h deleted file mode 100644 index 26ce5a0988..0000000000 --- a/visualtest/include/SDL_visualtest_process.h +++ /dev/null @@ -1,112 +0,0 @@ -/* See LICENSE.txt for the full license governing this code. */ -/** - * \file SDL_visualtest_process.h - * - * Provides cross-platfrom process launching and termination functionality. - */ - -#include - -#if defined(__WIN32__) -#include -#include -#elif defined(__LINUX__) -#include -#else -#error "Unsupported platform." -#endif - -#ifndef SDL_visualtest_process_h_ -#define SDL_visualtest_process_h_ - -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * Struct to store a platform specific handle to a process. - */ -typedef struct SDL_ProcessInfo -{ -//#if defined(_WIN32) || defined(__WIN32__) -#if defined(__WIN32__) - PROCESS_INFORMATION pi; -//#elif defined(__linux__) -#elif defined(__LINUX__) - int pid; -#endif -} SDL_ProcessInfo; - -/** - * This structure stores the exit status (value returned by main()) and - * whether the process exited sucessfully or not. - */ -typedef struct SDL_ProcessExitStatus -{ - int exit_success; /*!< Zero if the process exited successfully */ - int exit_status; /*!< The exit status of the process. 8-bit value. */ -} SDL_ProcessExitStatus; - -/** - * Launches a process with the given commandline arguments. - * - * \param file The path to the executable to be launched. - * \param args The command line arguments to be passed to the process. - * \param pinfo Pointer to an SDL_ProcessInfo object to be populated with - * platform specific information about the launched process. - * - * \return Non-zero on success, zero on failure. - */ -int SDL_LaunchProcess(char* file, char* args, SDL_ProcessInfo* pinfo); - -/** - * Checks if a process is running or not. - * - * \param pinfo Pointer to SDL_ProcessInfo object of the process that needs to be - * checked. - * - * \return 1 if the process is still running; zero if it is not and -1 if the - * status could not be retrieved. - */ -int SDL_IsProcessRunning(SDL_ProcessInfo* pinfo); - -/** - * Kills a currently running process. - * - * \param pinfo Pointer to a SDL_ProcessInfo object of the process to be terminated. - * \param ps Pointer to a SDL_ProcessExitStatus object which will be populated - * with the exit status. - * - * \return 1 on success, 0 on failure. - */ -int SDL_KillProcess(SDL_ProcessInfo* pinfo, SDL_ProcessExitStatus* ps); - -/** - * Cleanly exits the process represented by \c pinfo and stores the exit status - * in the exit status object pointed to by \c ps. - * - * \return 1 on success, 0 on failure. - */ -int SDL_QuitProcess(SDL_ProcessInfo* pinfo, SDL_ProcessExitStatus* ps); - -/** - * Gets the exit status of a process. If the exit status is -1, the process is - * still running. - * - * \param pinfo Pointer to a SDL_ProcessInfo object of the process to be checked. - * \param ps Pointer to a SDL_ProcessExitStatus object which will be populated - * with the exit status. - * - * \return 1 on success, 0 on failure. - */ -int SDL_GetProcessExitStatus(SDL_ProcessInfo* pinfo, SDL_ProcessExitStatus* ps); - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif - -#endif /* SDL_visualtest_process_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/visualtest/include/SDL_visualtest_random_variator.h b/visualtest/include/SDL_visualtest_random_variator.h deleted file mode 100644 index 0514ce6312..0000000000 --- a/visualtest/include/SDL_visualtest_random_variator.h +++ /dev/null @@ -1,61 +0,0 @@ -/* See LICENSE.txt for the full license governing this code. */ -/** - * \file SDL_visualtest_random_variator.h - * - * Header for the random variator. - */ - -#include "SDL_visualtest_harness_argparser.h" -#include "SDL_visualtest_variator_common.h" - -#ifndef SDL_visualtest_random_variator_h_ -#define SDL_visualtest_random_variator_h_ - -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * Struct for the variator that randomly generates variations of command line - * arguments to the SUT. - */ -typedef struct SDLVisualTest_RandomVariator -{ - /*! The current variation. */ - SDLVisualTest_Variation variation; - /*! Configuration object for the SUT that the variator is running for. */ - SDLVisualTest_SUTConfig config; - /*! Buffer to store the arguments string built from the variation */ - char buffer[MAX_SUT_ARGS_LEN]; -} SDLVisualTest_RandomVariator; - -/** - * Initializes the variator. - * - * \return 1 on success, 0 on failure - */ -int SDLVisualTest_InitRandomVariator(SDLVisualTest_RandomVariator* variator, - SDLVisualTest_SUTConfig* config, Uint64 seed); - -/** - * Generates a new random variation. - * - * \return The arguments string representing the random variation on success, and - * NULL on failure. The pointer returned should not be freed. - */ -char* SDLVisualTest_GetNextRandomVariation(SDLVisualTest_RandomVariator* variator); - -/** - * Frees any resources associated with the variator. - */ -void SDLVisualTest_FreeRandomVariator(SDLVisualTest_RandomVariator* variator); - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif - -#endif /* SDL_visualtest_random_variator_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/visualtest/include/SDL_visualtest_rwhelper.h b/visualtest/include/SDL_visualtest_rwhelper.h deleted file mode 100644 index bc39425948..0000000000 --- a/visualtest/include/SDL_visualtest_rwhelper.h +++ /dev/null @@ -1,87 +0,0 @@ -/* See LICENSE.txt for the full license governing this code. */ -/** - * \file rwhelper.c - * - * Header file with some helper functions for working with SDL_RWops. - */ - -#include - -#ifndef SDL_visualtest_rwhelper_h_ -#define SDL_visualtest_rwhelper_h_ - -/** Length of the buffer in SDLVisualTest_RWHelperBuffer */ -#define RWOPS_BUFFER_LEN 256 - -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * Struct that is used as a buffer by the RW helper functions. Should be initialized by calling - * SDLVisualTest_RWHelperResetBuffer() before being used. - */ -typedef struct SDLVisualTest_RWHelperBuffer -{ - /*! Character buffer that data is read into */ - char buffer[RWOPS_BUFFER_LEN]; - /*! buffer[buffer_pos] is the next character to be read from the buffer */ - int buffer_pos; - /*! Number of character read into the buffer */ - int buffer_width; -} SDLVisualTest_RWHelperBuffer; - -/** - * Resets the buffer pointed to by \c buffer used by some of the helper functions. - * This function should be called when you're using one of the helper functions - * with a new SDL_RWops object. - */ -void SDLVisualTest_RWHelperResetBuffer(SDLVisualTest_RWHelperBuffer* buffer); - -/** - * Reads a single character using the SDL_RWops object pointed to by \c rw. - * This function reads data in blocks and stores them in the buffer pointed to by - * \c buffer, so other SDL_RWops functions should not be used in conjunction - * with this function. - * - * \return The character that was read. - */ -char SDLVisualTest_RWHelperReadChar(SDL_RWops* rw, - SDLVisualTest_RWHelperBuffer* buffer); - -/** - * Reads characters using the SDL_RWops object pointed to by \c rw into the - * character array pointed to by \c str (of size \c size) until either the - * array is full or a new line is encountered. If \c comment_char is encountered, - * all characters from that position till the end of the line are ignored. The new line - * is not included as part of the buffer. Lines with only whitespace and comments - * are ignored. This function reads data in blocks and stores them in the buffer - * pointed to by \c buffer, so other SDL_RWops functions should not be used in - * conjunction with this function. - * - * \return pointer to the string on success, NULL on failure or EOF. - */ -char* SDLVisualTest_RWHelperReadLine(SDL_RWops* rw, char* str, int size, - SDLVisualTest_RWHelperBuffer* buffer, - char comment_char); - -/** - * Counts the number of lines that are not all whitespace and comments using the - * SDL_RWops object pointed to by \c rw. \c comment_char indicates the character - * used for comments. Uses the buffer pointed to by \c buffer to read data in blocks. - * - * \return Number of lines on success, -1 on failure. - */ -int SDLVisualTest_RWHelperCountNonEmptyLines(SDL_RWops* rw, - SDLVisualTest_RWHelperBuffer* buffer, - char comment_char); - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif - -#endif /* SDL_visualtest_rwhelper_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/visualtest/include/SDL_visualtest_screenshot.h b/visualtest/include/SDL_visualtest_screenshot.h deleted file mode 100644 index 69411e99df..0000000000 --- a/visualtest/include/SDL_visualtest_screenshot.h +++ /dev/null @@ -1,52 +0,0 @@ -/* See LICENSE.txt for the full license governing this code. */ -/** - * \file SDL_visualtest_screenshot.h - * - * Header for the screenshot API. - */ - -#include "SDL_visualtest_process.h" - -#ifndef SDL_visualtest_screenshot_h_ -#define SDL_visualtest_screenshot_h_ - -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * Takes a screenshot of each window owned by the process \c pinfo and saves - * it in a file \c prefix-i.png where \c prefix is the full path to the file - * along with a prefix given to each screenshot. - * - * \return 1 on success, 0 on failure. - */ -int SDLVisualTest_ScreenshotProcess(SDL_ProcessInfo* pinfo, char* prefix); - -/** - * Takes a screenshot of the desktop and saves it into the file with path - * \c filename. - * - * \return 1 on success, 0 on failure. - */ -int SDLVisualTest_ScreenshotDesktop(char* filename); - -/** - * Compare a screenshot taken previously with SUT arguments \c args that is - * located in \c test_dir with a verification image that is located in - * \c verify_dir. - * - * \return -1 on failure, 0 if the images were not equal, 1 if the images are equal - * and 2 if the verification image is not present. - */ -int SDLVisualTest_VerifyScreenshots(char* args, char* test_dir, char* verify_dir); - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif - -#endif /* SDL_visualtest_screenshot_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/visualtest/include/SDL_visualtest_sut_configparser.h b/visualtest/include/SDL_visualtest_sut_configparser.h deleted file mode 100644 index 63506f5a02..0000000000 --- a/visualtest/include/SDL_visualtest_sut_configparser.h +++ /dev/null @@ -1,105 +0,0 @@ -/* See LICENSE.txt for the full license governing this code. */ -/** - * \file SDL_visualtest_sut_configparser.h - * - * Header for the parser for SUT config files. - */ - -#ifndef SDL_visualtest_sut_configparser_h_ -#define SDL_visualtest_sut_configparser_h_ - -/** Maximum length of the name of an SUT option */ -#define MAX_SUTOPTION_NAME_LEN 100 -/** Maximum length of the name of a category of an SUT option */ -#define MAX_SUTOPTION_CATEGORY_LEN 40 -/** Maximum length of one enum value of an SUT option */ -#define MAX_SUTOPTION_ENUMVAL_LEN 40 -/** Maximum length of a line in the paramters file */ -#define MAX_SUTOPTION_LINE_LENGTH 256 - -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * Describes the different kinds of options to the SUT. - */ -typedef enum { - SDL_SUT_OPTIONTYPE_STRING = 0, - SDL_SUT_OPTIONTYPE_INT, - SDL_SUT_OPTIONTYPE_ENUM, - SDL_SUT_OPTIONTYPE_BOOL -} SDLVisualTest_SUTOptionType; - -/** - * Represents the range of values an integer option can take. - */ -typedef struct SDLVisualTest_SUTIntRange { - /*! Minimum value of the integer option */ - int min; - /*! Maximum value of the integer option */ - int max; -} SDLVisualTest_SUTIntRange; - -/** - * Struct that defines an option to be passed to the SUT. - */ -typedef struct SDLVisualTest_SUTOption { - /*! The name of the option. This is what you would pass in the command line - along with two leading hyphens. */ - char name[MAX_SUTOPTION_NAME_LEN]; - /*! An array of categories that the option belongs to. The last element is - NULL. */ - char** categories; - /*! Type of the option - integer, boolean, etc. */ - SDLVisualTest_SUTOptionType type; - /*! Whether the option is required or not */ - SDL_bool required; - /*! extra data that is required for certain types */ - union { - /*! This field is valid only for integer type options; it defines the - valid range for such an option */ - SDLVisualTest_SUTIntRange range; - /*! This field is valid only for enum type options; it holds the list of values - that the option can take. The last element is NULL */ - char** enum_values; - } data; -} SDLVisualTest_SUTOption; - -/** - * Struct to hold all the options to an SUT application. - */ -typedef struct SDLVisualTest_SUTConfig -{ - /*! Pointer to an array of options */ - SDLVisualTest_SUTOption* options; - /*! Number of options in \c options */ - int num_options; -} SDLVisualTest_SUTConfig; - -/** - * Parses a configuration file that describes the command line options an SUT - * application will take and populates a SUT config object. All lines in the - * config file must be smaller than - * - * \param file Path to the configuration file. - * \param config Pointer to an object that represents an SUT configuration. - * - * \return zero on failure, non-zero on success - */ -int SDLVisualTest_ParseSUTConfig(char* file, SDLVisualTest_SUTConfig* config); - -/** - * Free any resources associated with the config object pointed to by \c config. - */ -void SDLVisualTest_FreeSUTConfig(SDLVisualTest_SUTConfig* config); - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif - -#endif /* SDL_visualtest_sut_configparser_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/visualtest/include/SDL_visualtest_variator_common.h b/visualtest/include/SDL_visualtest_variator_common.h deleted file mode 100644 index 19a5b37828..0000000000 --- a/visualtest/include/SDL_visualtest_variator_common.h +++ /dev/null @@ -1,122 +0,0 @@ -/* See LICENSE.txt for the full license governing this code. */ -/** - * \file SDL_visualtest_variator_common.h - * - * Header for common functionality used by variators. - */ - -#include -#include "SDL_visualtest_sut_configparser.h" - -#ifndef SDL_visualtest_variator_common_h_ -#define SDL_visualtest_variator_common_h_ - -/** The number of variations one integer option would generate */ -#define SDL_SUT_INTEGER_OPTION_TEST_STEPS 3 - -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** enum for indicating the type of variator being used */ -typedef enum SDLVisualTest_VariatorType -{ - SDL_VARIATOR_NONE = 0, - SDL_VARIATOR_EXHAUSTIVE, - SDL_VARIATOR_RANDOM -} SDLVisualTest_VariatorType; - -/** - * One possible value for a command line option to the SUT. - */ -typedef union SDLVisualTest_SUTOptionValue -{ - /*! Value if the option is of type boolean */ - SDL_bool bool_value; - /*! Value if the option is of type integer. If on is true then the option - will be passed to the SUT, otherwise it will be ignored. */ - struct { - int value; - SDL_bool on; - } integer; - /*! Index of the string in the enum_values field of the corresponding - SDLVisualTest_SUTOption object. If on is true the option will passed - to the SUT, otherwise it will be ignored. */ - struct { - int index; - SDL_bool on; - } enumerated; - /*! Value if the option is of type string. If on is true the option will - be passed to the SUT, otherwise it will be ignored. */ - struct { - char* value; - SDL_bool on; - } string; -} SDLVisualTest_SUTOptionValue; - -/** - * Represents a valid combination of parameters that can be passed to the SUT. - * The ordering of the values here is the same as the ordering of the options in - * the SDLVisualTest_SUTConfig object for this variation. - */ -typedef struct SDLVisualTest_Variation -{ - /*! Pointer to array of option values */ - SDLVisualTest_SUTOptionValue* vars; - /*! Number of option values in \c vars */ - int num_vars; -} SDLVisualTest_Variation; - -/** - * "Increments" the value of the option by one and returns the carry. We wrap - * around to the initial value on overflow which makes the carry one. - * For example: "incrementing" an SDL_FALSE option makes it SDL_TRUE with no - * carry, and "incrementing" an SDL_TRUE option makes it SDL_FALSE with carry - * one. For integers, a random value in the valid range for the option is used. - * - * \param var Value of the option - * \param opt Object with metadata about the option - * - * \return 1 if there is a carry for enum and bool type options, 0 otherwise. - * 1 is always returned for integer and string type options. -1 is - * returned on error. - */ -int SDLVisualTest_NextValue(SDLVisualTest_SUTOptionValue* var, - SDLVisualTest_SUTOption* opt); - -/** - * Converts a variation object into a string of command line arguments. - * - * \param variation Variation object to be converted. - * \param config Config object for the SUT. - * \param buffer Pointer to the buffer the arguments string will be copied into. - * \param size Size of the buffer. - * - * \return 1 on success, 0 on failure - */ -int SDLVisualTest_MakeStrFromVariation(SDLVisualTest_Variation* variation, - SDLVisualTest_SUTConfig* config, - char* buffer, int size); - -/** - * Initializes the variation using the following rules: - * - Boolean options are initialized to SDL_FALSE. - * - Integer options are initialized to the minimum valid value they can hold. - * - Enum options are initialized to the first element in the list of values they - * can take. - * - String options are initialized to the name of the option. - * - * \return 1 on success, 0 on failure. - */ -int SDLVisualTest_InitVariation(SDLVisualTest_Variation* variation, - SDLVisualTest_SUTConfig* config); - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif - -#endif /* SDL_visualtest_variator_common_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/visualtest/include/SDL_visualtest_variators.h b/visualtest/include/SDL_visualtest_variators.h deleted file mode 100644 index e14f67d2a4..0000000000 --- a/visualtest/include/SDL_visualtest_variators.h +++ /dev/null @@ -1,66 +0,0 @@ -/* See LICENSE.txt for the full license governing this code. */ -/** - * \file SDL_visualtest_variators.h - * - * Header for all the variators that vary input parameters to a SUT application. - */ - -#include "SDL_visualtest_exhaustive_variator.h" -#include "SDL_visualtest_random_variator.h" - -#ifndef SDL_visualtest_variators_h_ -#define SDL_visualtest_variators_h_ - -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * Struct that acts like a wrapper around the different types of variators - * available. - */ -typedef struct SDLVisualTest_Variator -{ - /*! Type of the variator */ - SDLVisualTest_VariatorType type; - /*! union object that stores the variator */ - union - { - SDLVisualTest_ExhaustiveVariator exhaustive; - SDLVisualTest_RandomVariator random; - } data; -} SDLVisualTest_Variator; - -/** - * Initializes the variator object pointed to by \c variator of type \c type - * with information from the config object pointed to by \c config. - * - * \return 1 on success, 0 on failure - */ -int SDLVisualTest_InitVariator(SDLVisualTest_Variator* variator, - SDLVisualTest_SUTConfig* config, - SDLVisualTest_VariatorType type, - Uint64 seed); - -/** - * Gets the next variation using the variator. - * - * \return The arguments string representing the variation on success, and - * NULL on failure. The pointer returned should not be freed. - */ -char* SDLVisualTest_GetNextVariation(SDLVisualTest_Variator* variator); - -/** - * Frees any resources associated with the variator. - */ -void SDLVisualTest_FreeVariator(SDLVisualTest_Variator* variator); - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif - -#endif /* SDL_visualtest_variators_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/visualtest/launch_harness.cmd b/visualtest/launch_harness.cmd deleted file mode 100644 index 93462a9d28..0000000000 --- a/visualtest/launch_harness.cmd +++ /dev/null @@ -1,2 +0,0 @@ -start /wait testharness.exe --config testsprite2_crashtest.config > testrun.log 2>&1 -if %ERRORLEVEL% NEQ 0 echo TEST RUN FAILED (see testrun.log) \ No newline at end of file diff --git a/visualtest/launch_harness.sh b/visualtest/launch_harness.sh deleted file mode 100755 index a2d1471c83..0000000000 --- a/visualtest/launch_harness.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash -./testharness.exe --config testsprite2_crashtest.config > testrun.log 2>&1 -if [ "$?" != "0" ]; then - echo TEST RUN FAILED (see testrun.log) - # report error code to CI -fi \ No newline at end of file diff --git a/visualtest/src/action_configparser.c b/visualtest/src/action_configparser.c deleted file mode 100644 index f3b1afd736..0000000000 --- a/visualtest/src/action_configparser.c +++ /dev/null @@ -1,399 +0,0 @@ -/* See LICENSE.txt for the full license governing this code. */ -/** - * \file action_configparser.c - * - * Source file for the parser for action config files. - */ - -#include -#include -#include -#include "SDL_visualtest_action_configparser.h" -#include "SDL_visualtest_rwhelper.h" -#include "SDL_visualtest_parsehelper.h" - -static void -FreeAction(SDLVisualTest_Action* action) -{ - if(!action) - return; - switch(action->type) - { - case SDL_ACTION_LAUNCH: - { - char* path; - char* args; - - path = action->extra.process.path; - args = action->extra.process.args; - - if(path) - SDL_free(path); - if(args) - SDL_free(args); - - action->extra.process.path = NULL; - action->extra.process.args = NULL; - } - break; - - default: - break; - } -} - -int -SDLVisualTest_EnqueueAction(SDLVisualTest_ActionQueue* queue, - SDLVisualTest_Action action) -{ - SDLVisualTest_ActionNode* node; - if(!queue) - { - SDLTest_LogError("queue argument cannot be NULL"); - return 0; - } - - node = (SDLVisualTest_ActionNode*)SDL_malloc( - sizeof(SDLVisualTest_ActionNode)); - if(!node) - { - SDLTest_LogError("SDL_malloc() failed"); - return 0; - } - node->action = action; - node->next = NULL; - queue->size++; - if(!queue->rear) - queue->rear = queue->front = node; - else - { - queue->rear->next = node; - queue->rear = node; - } - return 1; -} - -int -SDLVisualTest_DequeueAction(SDLVisualTest_ActionQueue* queue) -{ - SDLVisualTest_ActionNode* node; - if(!queue) - { - SDLTest_LogError("queue argument cannot be NULL"); - return 0; - } - if(SDLVisualTest_IsActionQueueEmpty(queue)) - { - SDLTest_LogError("cannot dequeue from empty queue"); - return 0; - } - if(queue->front == queue->rear) - { - FreeAction(&queue->front->action); - SDL_free(queue->front); - queue->front = queue->rear = NULL; - } - else - { - node = queue->front; - queue->front = queue->front->next; - FreeAction(&node->action); - SDL_free(node); - } - queue->size--; - return 1; -} - -void -SDLVisualTest_InitActionQueue(SDLVisualTest_ActionQueue* queue) -{ - if(!queue) - { - SDLTest_LogError("queue argument cannot be NULL"); - return; - } - queue->front = NULL; - queue->rear = NULL; - queue->size = 0; -} - -SDLVisualTest_Action* -SDLVisualTest_GetQueueFront(SDLVisualTest_ActionQueue* queue) -{ - if(!queue) - { - SDLTest_LogError("queue argument cannot be NULL"); - return NULL; - } - if(!queue->front) - { - SDLTest_LogError("cannot get front of empty queue"); - return NULL; - } - - return &queue->front->action; -} - -int -SDLVisualTest_IsActionQueueEmpty(SDLVisualTest_ActionQueue* queue) -{ - if(!queue) - { - SDLTest_LogError("queue argument cannot be NULL"); - return 1; - } - - if(queue->size > 0) - return 0; - return 1; -} - -void -SDLVisualTest_EmptyActionQueue(SDLVisualTest_ActionQueue* queue) -{ - if(queue) - { - while(!SDLVisualTest_IsActionQueueEmpty(queue)) - SDLVisualTest_DequeueAction(queue); - } -} - -/* Since the size of the queue is not likely to be larger than 100 elements - we can get away with using insertion sort. */ -static void -SortQueue(SDLVisualTest_ActionQueue* queue) -{ - SDLVisualTest_ActionNode* head; - SDLVisualTest_ActionNode* tail; - - if(!queue || SDLVisualTest_IsActionQueueEmpty(queue)) - return; - - head = queue->front; - for(tail = head; tail && tail->next;) - { - SDLVisualTest_ActionNode* pos; - SDLVisualTest_ActionNode* element = tail->next; - - if(element->action.time < head->action.time) - { - tail->next = tail->next->next; - element->next = head; - head = element; - } - else if(element->action.time >= tail->action.time) - { - tail = tail->next; - } - else - { - for(pos = head; - (pos->next->action.time < element->action.time); - pos = pos->next); - tail->next = tail->next->next; - element->next = pos->next; - pos->next = element; - } - } - - queue->front = head; - queue->rear = tail; -} - -int -SDLVisualTest_InsertIntoActionQueue(SDLVisualTest_ActionQueue* queue, - SDLVisualTest_Action action) -{ - SDLVisualTest_ActionNode* n; - SDLVisualTest_ActionNode* prev; - SDLVisualTest_ActionNode* newnode; - if(!queue) - { - SDLTest_LogError("queue argument cannot be NULL"); - return 0; - } - - if(SDLVisualTest_IsActionQueueEmpty(queue)) - { - if(!SDLVisualTest_EnqueueAction(queue, action)) - { - SDLTest_LogError("SDLVisualTest_EnqueueAction() failed"); - return 0; - } - return 1; - } - - newnode = (SDLVisualTest_ActionNode*)SDL_malloc(sizeof(SDLVisualTest_ActionNode)); - if(!newnode) - { - SDLTest_LogError("SDL_malloc() failed"); - return 0; - } - newnode->action = action; - - queue->size++; - for(n = queue->front, prev = NULL; n; n = n->next) - { - if(action.time < n->action.time) - { - if(prev) - { - prev->next = newnode; - newnode->next = n; - } - else - { - newnode->next = queue->front; - queue->front = newnode; - } - return 1; - } - prev = n; - } - - queue->rear->next = newnode; - newnode->next = NULL; - queue->rear = newnode; - - return 1; -} - -int -SDLVisualTest_ParseActionConfig(const char* file, SDLVisualTest_ActionQueue* queue) -{ - char line[MAX_ACTION_LINE_LENGTH]; - SDLVisualTest_RWHelperBuffer buffer; - char* token_ptr; - int linenum; - SDL_RWops* rw; - - if(!file) - { - SDLTest_LogError("file argument cannot be NULL"); - return 0; - } - if(!queue) - { - SDLTest_LogError("queue argument cannot be NULL"); - return 0; - } - - rw = SDL_RWFromFile(file, "r"); - if(!rw) - { - SDLTest_LogError("SDL_RWFromFile() failed"); - return 0; - } - - SDLVisualTest_RWHelperResetBuffer(&buffer); - SDLVisualTest_InitActionQueue(queue); - linenum = 0; - while(SDLVisualTest_RWHelperReadLine(rw, line, MAX_ACTION_LINE_LENGTH, - &buffer, '#')) - { - SDLVisualTest_Action action; - int hr, min, sec; - - /* parse time */ - token_ptr = strtok(line, " "); - if(!token_ptr || - (SDL_sscanf(token_ptr, "%d:%d:%d", &hr, &min, &sec) != 3)) - { - SDLTest_LogError("Could not parse time token at line: %d", - linenum); - SDLVisualTest_EmptyActionQueue(queue); - SDL_RWclose(rw); - return 0; - } - action.time = (((hr * 60 + min) * 60) + sec) * 1000; - - /* parse type */ - token_ptr = strtok(NULL, " "); - if(SDL_strcasecmp(token_ptr, "launch") == 0) - action.type = SDL_ACTION_LAUNCH; - else if(SDL_strcasecmp(token_ptr, "kill") == 0) - action.type = SDL_ACTION_KILL; - else if(SDL_strcasecmp(token_ptr, "quit") == 0) - action.type = SDL_ACTION_QUIT; - else if(SDL_strcasecmp(token_ptr, "screenshot") == 0) - action.type = SDL_ACTION_SCREENSHOT; - else if(SDL_strcasecmp(token_ptr, "verify") == 0) - action.type = SDL_ACTION_VERIFY; - else - { - SDLTest_LogError("Could not parse type token at line: %d", - linenum); - SDLVisualTest_EmptyActionQueue(queue); - SDL_RWclose(rw); - return 0; - } - - /* parse the extra field */ - if(action.type == SDL_ACTION_LAUNCH) - { - int len; - char* args; - char* path; - token_ptr = strtok(NULL, " "); - len = token_ptr ? SDL_strlen(token_ptr) : 0; - if(len <= 0) - { - SDLTest_LogError("Please specify the process to launch at line: %d", - linenum); - SDLVisualTest_EmptyActionQueue(queue); - SDL_RWclose(rw); - return 0; - } - path = (char*)SDL_malloc(sizeof(char) * (len + 1)); - if(!path) - { - SDLTest_LogError("SDL_malloc() failed"); - SDLVisualTest_EmptyActionQueue(queue); - SDL_RWclose(rw); - return 0; - } - SDL_strlcpy(path, token_ptr, len + 1); - - token_ptr = strtok(NULL, ""); - len = token_ptr ? SDL_strlen(token_ptr) : 0; - if(len > 0) - { - args = (char*)SDL_malloc(sizeof(char) * (len + 1)); - if(!args) - { - SDLTest_LogError("SDL_malloc() failed"); - SDL_free(path); - SDLVisualTest_EmptyActionQueue(queue); - SDL_RWclose(rw); - return 0; - } - SDL_strlcpy(args, token_ptr, len + 1); - } - else - args = NULL; - - action.extra.process.path = path; - action.extra.process.args = args; - } - - /* add the action to the queue */ - if(!SDLVisualTest_EnqueueAction(queue, action)) - { - SDLTest_LogError("SDLVisualTest_EnqueueAction() failed"); - if(action.type == SDL_ACTION_LAUNCH) - { - SDL_free(action.extra.process.path); - if(action.extra.process.args) - SDL_free(action.extra.process.args); - } - SDLVisualTest_EmptyActionQueue(queue); - SDL_RWclose(rw); - return 0; - } - } - /* sort the queue of actions */ - SortQueue(queue); - - SDL_RWclose(rw); - return 1; -} diff --git a/visualtest/src/harness_argparser.c b/visualtest/src/harness_argparser.c deleted file mode 100644 index 8bc57064ba..0000000000 --- a/visualtest/src/harness_argparser.c +++ /dev/null @@ -1,358 +0,0 @@ -/* See LICENSE.txt for the full license governing this code. */ -/** - * \file harness_argparser.c - * - * Source file for functions to parse arguments to the test harness. - */ - -#include -#include -#include - -#include "SDL_visualtest_harness_argparser.h" -#include "SDL_visualtest_rwhelper.h" - -/** Maximum length of one line in the config file */ -#define MAX_CONFIG_LINE_LEN 400 -/** Default value for the timeout after which the SUT is forcefully killed */ -#define DEFAULT_SUT_TIMEOUT (60 * 1000) - -/* String compare s1 and s2 ignoring leading hyphens */ -static int -StrCaseCmpIgnoreHyphen(const char* s1, const char* s2) -{ - /* treat NULL pointer as empty strings */ - if(!s1) - s1 = ""; - if(!s2) - s2 = ""; - - while(*s1 == '-') - s1++; - while(*s2 == '-') - s2++; - - return SDL_strcasecmp(s1, s2); -} - -/* parser an argument, updates the state object and returns the number of - arguments processed; returns -1 on failure */ -static int -ParseArg(char** argv, int index, SDLVisualTest_HarnessState* state) -{ - if(!argv || !argv[index] || !state) - return 0; - - if(StrCaseCmpIgnoreHyphen("sutapp", argv[index]) == 0) - { - index++; - if(!argv[index]) - { - SDLTest_LogError("Arguments parsing error: Invalid argument for sutapp."); - return -1; - } - SDL_strlcpy(state->sutapp, argv[index], MAX_PATH_LEN); - SDLTest_Log("SUT Application: %s", state->sutapp); - return 2; - } - else if(StrCaseCmpIgnoreHyphen("output-dir", argv[index]) == 0) - { - index++; - if(!argv[index]) - { - SDLTest_LogError("Arguments parsing error: Invalid argument for output-dir."); - return -1; - } - SDL_strlcpy(state->output_dir, argv[index], MAX_PATH_LEN); - SDLTest_Log("Screenshot Output Directory: %s", state->output_dir); - return 2; - } - else if(StrCaseCmpIgnoreHyphen("verify-dir", argv[index]) == 0) - { - index++; - if(!argv[index]) - { - SDLTest_LogError("Arguments parsing error: Invalid argument for verify-dir."); - return -1; - } - SDL_strlcpy(state->verify_dir, argv[index], MAX_PATH_LEN); - SDLTest_Log("Screenshot Verification Directory: %s", state->verify_dir); - return 2; - } - else if(StrCaseCmpIgnoreHyphen("sutargs", argv[index]) == 0) - { - index++; - if(!argv[index]) - { - SDLTest_LogError("Arguments parsing error: Invalid argument for sutargs."); - return -1; - } - SDL_strlcpy(state->sutargs, argv[index], MAX_SUT_ARGS_LEN); - SDLTest_Log("SUT Arguments: %s", state->sutargs); - return 2; - } - else if(StrCaseCmpIgnoreHyphen("timeout", argv[index]) == 0) - { - int hr, min, sec; - index++; - if(!argv[index] || SDL_sscanf(argv[index], "%d:%d:%d", &hr, &min, &sec) != 3) - { - SDLTest_LogError("Arguments parsing error: Invalid argument for timeout."); - return -1; - } - state->timeout = (((hr * 60) + min) * 60 + sec) * 1000; - SDLTest_Log("Maximum Timeout for each SUT run: %d milliseconds", - state->timeout); - return 2; - } - else if(StrCaseCmpIgnoreHyphen("parameter-config", argv[index]) == 0) - { - index++; - if(!argv[index]) - { - SDLTest_LogError("Arguments parsing error: Invalid argument for parameter-config."); - return -1; - } - SDLTest_Log("SUT Parameters file: %s", argv[index]); - SDLVisualTest_FreeSUTConfig(&state->sut_config); - if(!SDLVisualTest_ParseSUTConfig(argv[index], &state->sut_config)) - { - SDLTest_LogError("Failed to parse SUT parameters file"); - return -1; - } - return 2; - } - else if(StrCaseCmpIgnoreHyphen("variator", argv[index]) == 0) - { - index++; - if(!argv[index]) - { - SDLTest_LogError("Arguments parsing error: Invalid argument for variator."); - return -1; - } - SDLTest_Log("Variator: %s", argv[index]); - if(SDL_strcasecmp("exhaustive", argv[index]) == 0) - state->variator_type = SDL_VARIATOR_EXHAUSTIVE; - else if(SDL_strcasecmp("random", argv[index]) == 0) - state->variator_type = SDL_VARIATOR_RANDOM; - else - { - SDLTest_LogError("Arguments parsing error: Invalid variator name."); - return -1; - } - return 2; - } - else if(StrCaseCmpIgnoreHyphen("num-variations", argv[index]) == 0) - { - index++; - if(!argv[index]) - { - SDLTest_LogError("Arguments parsing error: Invalid argument for num-variations."); - return -1; - } - state->num_variations = SDL_atoi(argv[index]); - SDLTest_Log("Number of variations to run: %d", state->num_variations); - if(state->num_variations <= 0) - { - SDLTest_LogError("Arguments parsing error: num-variations must be positive."); - return -1; - } - return 2; - } - else if(StrCaseCmpIgnoreHyphen("no-launch", argv[index]) == 0) - { - state->no_launch = SDL_TRUE; - SDLTest_Log("SUT will not be launched."); - return 1; - } - else if(StrCaseCmpIgnoreHyphen("action-config", argv[index]) == 0) - { - index++; - if(!argv[index]) - { - SDLTest_LogError("Arguments parsing error: invalid argument for action-config"); - return -1; - } - SDLTest_Log("Action Config file: %s", argv[index]); - SDLVisualTest_EmptyActionQueue(&state->action_queue); - if(!SDLVisualTest_ParseActionConfig(argv[index], &state->action_queue)) - { - SDLTest_LogError("SDLVisualTest_ParseActionConfig() failed"); - return -1; - } - return 2; - } - else if(StrCaseCmpIgnoreHyphen("config", argv[index]) == 0) - { - index++; - if(!argv[index]) - { - SDLTest_LogError("Arguments parsing error: invalid argument for config"); - return -1; - } - - /* do nothing, this option has already been handled */ - return 2; - } - return 0; -} - -/* TODO: Trailing/leading spaces and spaces between equals sign not supported. */ -static int -ParseConfig(const char* file, SDLVisualTest_HarnessState* state) -{ - SDL_RWops* rw; - SDLVisualTest_RWHelperBuffer buffer; - char line[MAX_CONFIG_LINE_LEN]; - - rw = SDL_RWFromFile(file, "r"); - if(!rw) - { - SDLTest_LogError("SDL_RWFromFile() failed"); - return 0; - } - - SDLVisualTest_RWHelperResetBuffer(&buffer); - while(SDLVisualTest_RWHelperReadLine(rw, line, MAX_CONFIG_LINE_LEN, - &buffer, '#')) - { - char** argv; - int i, num_params; - - /* count number of parameters and replace the trailing newline with 0 */ - num_params = 1; - for(i = 0; line[i]; i++) - { - if(line[i] == '=') - { - num_params = 2; - break; - } - } - - /* populate argv */ - argv = (char**)SDL_malloc((num_params + 1) * sizeof(char*)); - if(!argv) - { - SDLTest_LogError("SDL_malloc() failed."); - SDL_RWclose(rw); - return 0; - } - - argv[num_params] = NULL; - for(i = 0; i < num_params; i++) - { - argv[i] = strtok(i == 0 ? line : NULL, "="); - } - - if(ParseArg(argv, 0, state) == -1) - { - SDLTest_LogError("ParseArg() failed"); - SDL_free(argv); - SDL_RWclose(rw); - return 0; - } - SDL_free(argv); - } - SDL_RWclose(rw); - - if(!state->sutapp[0]) - return 0; - return 1; -} - -int -SDLVisualTest_ParseHarnessArgs(char** argv, SDLVisualTest_HarnessState* state) -{ - int i; - - SDLTest_Log("Parsing commandline arguments.."); - - if(!argv) - { - SDLTest_LogError("argv is NULL"); - return 0; - } - if(!state) - { - SDLTest_LogError("state is NULL"); - return 0; - } - - /* initialize the state object */ - state->sutargs[0] = '\0'; - state->sutapp[0] = '\0'; - state->output_dir[0] = '\0'; - state->verify_dir[0] = '\0'; - state->timeout = DEFAULT_SUT_TIMEOUT; - SDL_memset(&state->sut_config, 0, sizeof(SDLVisualTest_SUTConfig)); - SDL_memset(&state->action_queue, 0, sizeof(SDLVisualTest_ActionQueue)); - state->variator_type = SDL_VARIATOR_RANDOM; - state->num_variations = -1; - state->no_launch = SDL_FALSE; - - /* parse config file if passed */ - for(i = 0; argv[i]; i++) - { - if(StrCaseCmpIgnoreHyphen("config", argv[i]) == 0) - { - if(!argv[i + 1]) - { - SDLTest_Log("Arguments parsing error: invalid argument for config."); - return 0; - } - if(!ParseConfig(argv[i + 1], state)) - { - SDLTest_LogError("ParseConfig() failed"); - return 0; - } - } - } - - /* parse the arguments */ - for(i = 0; argv[i];) - { - int consumed = ParseArg(argv, i, state); - if(consumed == -1 || consumed == 0) - { - SDLTest_LogError("ParseArg() failed"); - return 0; - } - i += consumed; - } - - if(state->variator_type == SDL_VARIATOR_RANDOM && state->num_variations == -1) - state->num_variations = 1; - - /* check to see if required options have been passed */ - if(!state->sutapp[0]) - { - SDLTest_LogError("sutapp must be passed."); - return 0; - } - if(!state->sutargs[0] && !state->sut_config.options) - { - SDLTest_LogError("Either sutargs or parameter-config must be passed."); - return 0; - } - if(!state->output_dir[0]) - { - SDL_strlcpy(state->output_dir, "./output", MAX_PATH_LEN); - } - if(!state->verify_dir[0]) - { - SDL_strlcpy(state->verify_dir, "./verify", MAX_PATH_LEN); - } - - return 1; -} - -void -SDLVisualTest_FreeHarnessState(SDLVisualTest_HarnessState* state) -{ - if(state) - { - SDLVisualTest_EmptyActionQueue(&state->action_queue); - SDLVisualTest_FreeSUTConfig(&state->sut_config); - } -} diff --git a/visualtest/src/linux/linux_process.c b/visualtest/src/linux/linux_process.c deleted file mode 100644 index b93f3407ee..0000000000 --- a/visualtest/src/linux/linux_process.c +++ /dev/null @@ -1,208 +0,0 @@ -/* See LICENSE.txt for the full license governing this code. */ -/** - * \file linux_process.c - * - * Source file for the process API on linux. - */ - - -#include -#include - -#include "SDL_visualtest_process.h" -#include "SDL_visualtest_harness_argparser.h" -#include "SDL_visualtest_parsehelper.h" - -#if defined(__LINUX__) -#include -#include -#include -#include - -static void -LogLastError(const char* str) -{ - const char* error = strerror(errno); - if(!str || !error) - return; - SDLTest_LogError("%s: %s", str, error); -} - -int -SDL_LaunchProcess(char* file, char* args, SDL_ProcessInfo* pinfo) -{ - pid_t pid; - char** argv; - - if(!file) - { - SDLTest_LogError("file argument cannot be NULL"); - return 0; - } - if(!pinfo) - { - SDLTest_LogError("pinfo cannot be NULL"); - return 0; - } - pid = fork(); - if(pid == -1) - { - LogLastError("fork() failed"); - return 0; - } - else if(pid == 0) - { - /* parse the arguments string */ - argv = SDLVisualTest_ParseArgsToArgv(args); - argv[0] = file; - execv(file, argv); - LogLastError("execv() failed"); - return 0; - } - else - { - pinfo->pid = pid; - return 1; - } - - /* never executed */ - return 0; -} - -int -SDL_GetProcessExitStatus(SDL_ProcessInfo* pinfo, SDL_ProcessExitStatus* ps) -{ - int success, status; - if(!pinfo) - { - SDLTest_LogError("pinfo argument cannot be NULL"); - return 0; - } - if(!ps) - { - SDLTest_LogError("ps argument cannot be NULL"); - return 0; - } - success = waitpid(pinfo->pid, &status, WNOHANG); - if(success == -1) - { - LogLastError("waitpid() failed"); - return 0; - } - else if(success == 0) - { - ps->exit_status = -1; - ps->exit_success = 1; - } - else - { - ps->exit_success = WIFEXITED(status); - ps->exit_status = WEXITSTATUS(status); - } - return 1; -} - -int -SDL_IsProcessRunning(SDL_ProcessInfo* pinfo) -{ - int success; - - if(!pinfo) - { - SDLTest_LogError("pinfo cannot be NULL"); - return -1; - } - - success = kill(pinfo->pid, 0); - if(success == -1) - { - if(errno == ESRCH) /* process is not running */ - return 0; - else - { - LogLastError("kill() failed"); - return -1; - } - } - return 1; -} - -int -SDL_QuitProcess(SDL_ProcessInfo* pinfo, SDL_ProcessExitStatus* ps) -{ - int success, status; - - if(!pinfo) - { - SDLTest_LogError("pinfo argument cannot be NULL"); - return 0; - } - if(!ps) - { - SDLTest_LogError("ps argument cannot be NULL"); - return 0; - } - - success = kill(pinfo->pid, SIGQUIT); - if(success == -1) - { - LogLastError("kill() failed"); - return 0; - } - - success = waitpid(pinfo->pid, &status, 0); - if(success == -1) - { - LogLastError("waitpid() failed"); - return 0; - } - - ps->exit_success = WIFEXITED(status); - ps->exit_status = WEXITSTATUS(status); - return 1; -} - -int -SDL_KillProcess(SDL_ProcessInfo* pinfo, SDL_ProcessExitStatus* ps) -{ - int success, status; - - if(!pinfo) - { - SDLTest_LogError("pinfo argument cannot be NULL"); - return 0; - } - if(!ps) - { - SDLTest_LogError("ps argument cannot be NULL"); - return 0; - } - - success = kill(pinfo->pid, SIGKILL); - if(success == -1) - { - LogLastError("kill() failed"); - return 0; - } - success = waitpid(pinfo->pid, &status, 0); - if(success == -1) - { - LogLastError("waitpid() failed"); - return 0; - } - - ps->exit_success = WIFEXITED(status); - ps->exit_status = WEXITSTATUS(status); - return 1; -} - -/* each window of the process will have a screenshot taken. The file name will be - prefix-i.png for the i'th window. */ -int -SDLVisualTest_ScreenshotProcess(SDL_ProcessInfo* pinfo, char* prefix) -{ - SDLTest_LogError("Screenshot process not implemented"); - return 0; -} - -#endif diff --git a/visualtest/src/mischelper.c b/visualtest/src/mischelper.c deleted file mode 100644 index 9684af6f6b..0000000000 --- a/visualtest/src/mischelper.c +++ /dev/null @@ -1,28 +0,0 @@ -/** - * \file mischelper.c - * - * Source file with miscellaneous helper functions. - */ - -#include - -void -SDLVisualTest_HashString(char* str, char hash[33]) -{ - SDLTest_Md5Context md5c; - int i; - - if(!str) - { - SDLTest_LogError("str argument cannot be NULL"); - return; - } - - SDLTest_Md5Init(&md5c); - SDLTest_Md5Update(&md5c, (unsigned char*)str, SDL_strlen(str)); - SDLTest_Md5Final(&md5c); - - /* convert the md5 hash to an array of hexadecimal digits */ - for(i = 0; i < 16; i++) - SDL_snprintf(hash + 2 * i, 33 - 2 * i, "%02x", (int)md5c.digest[i]); -} diff --git a/visualtest/src/parsehelper.c b/visualtest/src/parsehelper.c deleted file mode 100644 index 9d38cb2f24..0000000000 --- a/visualtest/src/parsehelper.c +++ /dev/null @@ -1,231 +0,0 @@ -/* See LICENSE.txt for the full license governing this code. */ -/** - * \file parsehelper.c - * - * Source file with some helper functions for parsing strings. - */ - -#include -#include "SDL_visualtest_harness_argparser.h" - -/* this function uses a DFA to count the number of tokens in an agruments string. - state 0 is taken to be the start and end state. State 1 handles a double quoted - argument and state 2 handles unquoted arguments. */ -static int -CountTokens(char* args) -{ - int index, num_tokens; - int state; /* current state of the DFA */ - - if(!args) - return -1; - - index = 0; - state = 0; - num_tokens = 0; - while(args[index]) - { - char ch = args[index]; - switch(state) - { - case 0: - if(ch == '\"') - { - state = 1; - num_tokens++; - } - else if(!SDL_isspace(ch)) - { - state = 2; - num_tokens++; - } - break; - - case 1: - if(ch == '\"') - { - state = 0; - } - break; - - case 2: - if(SDL_isspace(ch)) - { - state = 0; - } - break; - } - index++; - } - return num_tokens; -} - -/* - size of tokens is num_tokens + 1 -- uses the same DFA used in CountTokens() to split args into an array of strings */ -static int -TokenizeHelper(char* str, char** tokens, int num_tokens, int max_token_len) -{ - int index, state, done, st_index, token_index; - - if(!str) - { - SDLTest_LogError("str argument cannot be NULL"); - return 0; - } - if(!tokens) - { - SDLTest_LogError("tokens argument cannot be NULL"); - return 0; - } - if(num_tokens <= 0) - { - SDLTest_LogError("num_tokens argument must be positive"); - return 0; - } - if(max_token_len <= 0) - { - SDLTest_LogError("max_token_len argument must be positive"); - return 0; - } - - /* allocate memory for the tokens */ - tokens[num_tokens] = NULL; - for(index = 0; index < num_tokens; index++) - { - tokens[index] = (char*)SDL_malloc(max_token_len); - if(!tokens[index]) - { - int i; - SDLTest_LogError("SDL_malloc() failed."); - for(i = 0; i < index; i++) - SDL_free(tokens[i]); - return 0; - } - tokens[index][0] = '\0'; - } - - /* copy the tokens into the array */ - st_index = 0; - index = 0; - token_index = 0; - state = 0; - done = 0; - while(!done) - { - char ch = str[index]; - switch(state) - { - case 0: - if(ch == '\"') - { - state = 1; - st_index = index + 1; - } - else if(!ch) - done = 1; - else if(ch && !SDL_isspace(ch)) - { - state = 2; - st_index = index; - } - break; - - case 1: - if(ch == '\"') - { - int i; - state = 0; - for(i = st_index; i < index; i++) - { - tokens[token_index][i - st_index] = str[i]; - } - tokens[token_index][i - st_index] = '\0'; - token_index++; - } - else if(!ch) - { - SDLTest_LogError("Parsing Error!"); - done = 1; - } - break; - - case 2: - if(!ch) - done = 1; - if(SDL_isspace(ch) || !ch) - { - int i; - state = 0; - for(i = st_index; i < index; i++) - { - tokens[token_index][i - st_index] = str[i]; - } - tokens[token_index][i - st_index] = '\0'; - token_index++; - } - break; - } - index++; - } - return 1; -} - -char** -SDLVisualTest_Tokenize(char* str, int max_token_len) -{ - int num_tokens; - char** tokens; - - if(!str) - { - SDLTest_LogError("str argument cannot be NULL"); - return NULL; - } - if(max_token_len <= 0) - { - SDLTest_LogError("max_token_len argument must be positive"); - return NULL; - } - - num_tokens = CountTokens(str); - if(num_tokens == 0) - return NULL; - - tokens = (char**)SDL_malloc(sizeof(char*) * (num_tokens + 1)); - if(!TokenizeHelper(str, tokens, num_tokens, max_token_len)) - { - SDLTest_LogError("TokenizeHelper() failed"); - SDL_free(tokens); - return NULL; - } - return tokens; -} - -char** -SDLVisualTest_ParseArgsToArgv(char* args) -{ - char** argv; - int num_tokens; - - num_tokens = CountTokens(args); - if(num_tokens == 0) - return NULL; - - /* allocate space for arguments */ - argv = (char**)SDL_malloc((num_tokens + 2) * sizeof(char*)); - if(!argv) - { - SDLTest_LogError("SDL_malloc() failed."); - return NULL; - } - - /* tokenize */ - if(!TokenizeHelper(args, argv + 1, num_tokens, MAX_SUT_ARGS_LEN)) - { - SDLTest_LogError("TokenizeHelper() failed"); - SDL_free(argv); - return NULL; - } - argv[0] = NULL; - return argv; -} diff --git a/visualtest/src/rwhelper.c b/visualtest/src/rwhelper.c deleted file mode 100644 index 1ff9190ff8..0000000000 --- a/visualtest/src/rwhelper.c +++ /dev/null @@ -1,131 +0,0 @@ -/* See LICENSE.txt for the full license governing this code. */ -/** - * \file rwhelper.c - * - * Source file with some helper functions for working with SDL_RWops. - */ - -#include -#include "SDL_visualtest_sut_configparser.h" -#include "SDL_visualtest_rwhelper.h" - -void -SDLVisualTest_RWHelperResetBuffer(SDLVisualTest_RWHelperBuffer* buffer) -{ - if(!buffer) - { - SDLTest_LogError("buffer argument cannot be NULL"); - return; - } - buffer->buffer_pos = 0; - buffer->buffer_width = 0; -} - -char -SDLVisualTest_RWHelperReadChar(SDL_RWops* rw, SDLVisualTest_RWHelperBuffer* buffer) -{ - if(!rw || !buffer) - return 0; - /* if the buffer has been consumed, we fill it up again */ - if(buffer->buffer_pos == buffer->buffer_width) - { - buffer->buffer_width = SDL_RWread(rw, buffer->buffer, 1, RWOPS_BUFFER_LEN); - buffer->buffer_pos = 0; - if(buffer->buffer_width == 0) - return 0; - } - buffer->buffer_pos++; - return buffer->buffer[buffer->buffer_pos - 1]; -} - -/* does not include new lines in the buffer and adds a trailing null character */ -char* -SDLVisualTest_RWHelperReadLine(SDL_RWops* rw, char* str, int size, - SDLVisualTest_RWHelperBuffer* buffer, - char comment_char) -{ - char ch; - int current_pos, done; - if(!rw) - { - SDLTest_LogError("rw argument cannot be NULL"); - return NULL; - } - if(!str) - { - SDLTest_LogError("str argument cannot be NULL"); - return NULL; - } - if(!buffer) - { - SDLTest_LogError("buffer argument cannot be NULL"); - return NULL; - } - if(size <= 0) - { - SDLTest_LogError("size argument should be positive"); - return NULL; - } - - done = 0; - while(!done) - { - /* ignore leading whitespace */ - for(ch = SDLVisualTest_RWHelperReadChar(rw, buffer); ch && SDL_isspace(ch); - ch = SDLVisualTest_RWHelperReadChar(rw, buffer)); - - for(current_pos = 0; - ch && ch != '\n' && ch != '\r' && ch != comment_char; - current_pos++) - { - str[current_pos] = ch; - if(current_pos >= size - 2) - { - current_pos++; - break; - } - ch = SDLVisualTest_RWHelperReadChar(rw, buffer); - } - - done = 1; - if(ch == comment_char) /* discard all characters until the next line */ - { - do - { - ch = SDLVisualTest_RWHelperReadChar(rw, buffer); - }while(ch && ch != '\n' && ch != '\r'); - - if(current_pos == 0) - done = 0; - } - } - if(current_pos == 0) - return NULL; - - str[current_pos] = '\0'; - return str; -} - -/* Lines with all whitespace are ignored */ -int -SDLVisualTest_RWHelperCountNonEmptyLines(SDL_RWops* rw, - SDLVisualTest_RWHelperBuffer* buffer, - char comment_char) -{ - int num_lines = 0; - char str[MAX_SUTOPTION_LINE_LENGTH]; - if(!rw) - { - SDLTest_LogError("rw argument cannot be NULL"); - return -1; - } - if(!buffer) - { - SDLTest_LogError("buffer argument cannot be NULL"); - return -1; - } - while(SDLVisualTest_RWHelperReadLine(rw, str, MAX_SUTOPTION_LINE_LENGTH, - buffer, comment_char)) - num_lines++; - return num_lines; -} diff --git a/visualtest/src/screenshot.c b/visualtest/src/screenshot.c deleted file mode 100644 index be5e4df85b..0000000000 --- a/visualtest/src/screenshot.c +++ /dev/null @@ -1,136 +0,0 @@ -/* See LICENSE.txt for the full license governing this code. */ -/** - * \file screenshot.c - * - * Source file for the screenshot API. - */ - -#include "SDL_visualtest_mischelper.h" -#include - -int -SDLVisualTest_VerifyScreenshots(char* args, char* test_dir, char* verify_dir) -{ - int i, verify_len, return_code, test_len; - char hash[33]; - char* verify_path; /* path to the bmp file used for verification */ - char* test_path; /* path to the bmp file to be verified */ - SDL_RWops* rw; - SDL_Surface* verifybmp; - - return_code = 1; - - if(!args) - { - SDLTest_LogError("args argument cannot be NULL"); - return_code = -1; - goto verifyscreenshots_cleanup_generic; - } - if(!test_dir) - { - SDLTest_LogError("test_dir argument cannot be NULL"); - return_code = -1; - goto verifyscreenshots_cleanup_generic; - } - if(!verify_dir) - { - SDLTest_LogError("verify_dir argument cannot be NULL"); - return_code = -1; - goto verifyscreenshots_cleanup_generic; - } - - /* generate the MD5 hash */ - SDLVisualTest_HashString(args, hash); - - /* find the verification image */ - /* path_len + hash_len + some number of extra characters */ - verify_len = SDL_strlen(verify_dir) + 32 + 10; - verify_path = (char*)SDL_malloc(verify_len * sizeof(char)); - if(!verify_path) - { - SDLTest_LogError("SDL_malloc() failed"); - return_code = -1; - goto verifyscreenshots_cleanup_generic; - } - SDL_snprintf(verify_path, verify_len - 1, - "%s/%s.bmp", verify_dir, hash); - rw = SDL_RWFromFile(verify_path, "rb"); - if(!rw) - { - SDLTest_Log("Verification image does not exist." - " Please manually verify that the SUT is working correctly."); - return_code = 2; - goto verifyscreenshots_cleanup_verifypath; - } - - /* load the verification image */ - verifybmp = SDL_LoadBMP_RW(rw, 1); - if(!verifybmp) - { - SDLTest_LogError("SDL_LoadBMP_RW() failed"); - return_code = -1; - goto verifyscreenshots_cleanup_verifypath; - } - - /* load the test images and compare with the verification image */ - /* path_len + hash_len + some number of extra characters */ - test_len = SDL_strlen(test_dir) + 32 + 10; - test_path = (char*)SDL_malloc(test_len * sizeof(char)); - if(!test_path) - { - SDLTest_LogError("SDL_malloc() failed"); - return_code = -1; - goto verifyscreenshots_cleanup_verifybmp; - } - - for(i = 1; ; i++) - { - SDL_RWops* testrw; - SDL_Surface* testbmp; - - if(i == 1) - SDL_snprintf(test_path, test_len - 1, "%s/%s.bmp", test_dir, hash); - else - SDL_snprintf(test_path, test_len - 1, "%s/%s_%d.bmp", test_dir, hash, i); - testrw = SDL_RWFromFile(test_path, "rb"); - - /* we keep going until we've iterated through the screenshots each - SUT window */ - if(!testrw) - break; - - /* load the test screenshot */ - testbmp = SDL_LoadBMP_RW(testrw, 1); - if(!testbmp) - { - SDLTest_LogError("SDL_LoadBMP_RW() failed"); - return_code = -1; - goto verifyscreenshots_cleanup_verifybmp; - } - - /* compare with the verification image */ - if(SDLTest_CompareSurfaces(testbmp, verifybmp, 0) != 0) - { - return_code = 0; - SDL_FreeSurface(testbmp); - goto verifyscreenshots_cleanup_verifybmp; - } - - SDL_FreeSurface(testbmp); - } - - if(i == 1) - { - SDLTest_LogError("No verification images found"); - return_code = -1; - } - -verifyscreenshots_cleanup_verifybmp: - SDL_FreeSurface(verifybmp); - -verifyscreenshots_cleanup_verifypath: - SDL_free(verify_path); - -verifyscreenshots_cleanup_generic: - return return_code; -} diff --git a/visualtest/src/sut_configparser.c b/visualtest/src/sut_configparser.c deleted file mode 100644 index fa8c2d4bbd..0000000000 --- a/visualtest/src/sut_configparser.c +++ /dev/null @@ -1,232 +0,0 @@ -/* See LICENSE.txt for the full license governing this code. */ -/** - * \file sut_configparser.c - * - * Source file for the parser for SUT config files. - */ - -#include -#include -#include -#include -#include "SDL_visualtest_sut_configparser.h" -#include "SDL_visualtest_parsehelper.h" -#include "SDL_visualtest_rwhelper.h" - -int -SDLVisualTest_ParseSUTConfig(char* file, SDLVisualTest_SUTConfig* config) -{ - char line[MAX_SUTOPTION_LINE_LENGTH]; - SDLVisualTest_RWHelperBuffer buffer; - char* token_ptr; - char* token_end; - int num_lines, i, token_len; - SDL_RWops* rw; - - if(!file) - { - SDLTest_LogError("file argument cannot be NULL"); - return 0; - } - if(!config) - { - SDLTest_LogError("config argument cannot be NULL"); - return 0; - } - - /* count the number of lines */ - rw = SDL_RWFromFile(file, "r"); - if(!rw) - { - SDLTest_LogError("SDL_RWFromFile() failed"); - return 0; - } - SDLVisualTest_RWHelperResetBuffer(&buffer); - num_lines = SDLVisualTest_RWHelperCountNonEmptyLines(rw, &buffer, '#'); - if(num_lines == -1) - return 0; - else if(num_lines == 0) - { - config->options = NULL; - config->num_options = 0; - SDL_RWclose(rw); - return 1; - } - - /* allocate memory */ - SDL_RWseek(rw, 0, RW_SEEK_SET); - SDLVisualTest_RWHelperResetBuffer(&buffer); - config->num_options = num_lines; - config->options = (SDLVisualTest_SUTOption*)SDL_malloc(num_lines * - sizeof(SDLVisualTest_SUTOption)); - if(!config->options) - { - SDLTest_LogError("SDL_malloc() failed"); - SDL_RWclose(rw); - return 0; - } - - /* actually parse the options */ - for(i = 0; i < num_lines; i++) - { - if(!SDLVisualTest_RWHelperReadLine(rw, line, MAX_SUTOPTION_LINE_LENGTH, - &buffer, '#')) - { - SDLTest_LogError("SDLVisualTest_RWHelperReadLine() failed"); - SDL_free(config->options); - SDL_RWclose(rw); - return 0; - } - - /* parse name */ - token_ptr = strtok(line, ", "); - if(!token_ptr) - { - SDLTest_LogError("Could not parse line %d", i + 1); - SDL_free(config->options); - SDL_RWclose(rw); - return 0; - } - token_len = SDL_strlen(token_ptr) + 1; - SDL_strlcpy(config->options[i].name, token_ptr, token_len); - - /* parse type */ - token_ptr = strtok(NULL, ", "); - if(!token_ptr) - { - SDLTest_LogError("Could not parse line %d", i + 1); - SDL_free(config->options); - SDL_RWclose(rw); - return 0; - } - if(SDL_strcmp(token_ptr, "string") == 0) - config->options[i].type = SDL_SUT_OPTIONTYPE_STRING; - else if(SDL_strcmp(token_ptr, "integer") == 0) - config->options[i].type = SDL_SUT_OPTIONTYPE_INT; - else if(SDL_strcmp(token_ptr, "enum") == 0) - config->options[i].type = SDL_SUT_OPTIONTYPE_ENUM; - else if(SDL_strcmp(token_ptr, "boolean") == 0) - config->options[i].type = SDL_SUT_OPTIONTYPE_BOOL; - else - { - SDLTest_LogError("Could not parse type token at line %d", i + 1); - SDL_free(config->options); - SDL_RWclose(rw); - return 0; - } - - /* parse values */ - token_ptr = strtok(NULL, "]"); - if(!token_ptr) - { - SDLTest_LogError("Could not parse line %d", i + 1); - SDL_free(config->options); - SDL_RWclose(rw); - return 0; - } - token_ptr = SDL_strchr(token_ptr, '['); - if(!token_ptr) - { - SDLTest_LogError("Could not parse enum token at line %d", i + 1); - SDL_free(config->options); - SDL_RWclose(rw); - return 0; - } - token_ptr++; - if(config->options[i].type == SDL_SUT_OPTIONTYPE_INT) - { - if(SDL_sscanf(token_ptr, "%d %d", &config->options[i].data.range.min, - &config->options[i].data.range.max) != 2) - { - config->options[i].data.range.min = INT_MIN; - config->options[i].data.range.max = INT_MAX; - } - } - else if(config->options[i].type == SDL_SUT_OPTIONTYPE_ENUM) - { - config->options[i].data.enum_values = SDLVisualTest_Tokenize(token_ptr, - MAX_SUTOPTION_ENUMVAL_LEN); - if(!config->options[i].data.enum_values) - { - SDLTest_LogError("Could not parse enum token at line %d", i + 1); - SDL_free(config->options); - SDL_RWclose(rw); - return 0; - } - } - - /* parse required */ - token_ptr = strtok(NULL, ", "); - if(!token_ptr) - { - SDLTest_LogError("Could not parse line %d", i + 1); - SDL_free(config->options); - SDL_RWclose(rw); - return 0; - } - - if(SDL_strcmp(token_ptr, "true") == 0) - config->options[i].required = SDL_TRUE; - else if(SDL_strcmp(token_ptr, "false") == 0) - config->options[i].required = SDL_FALSE; - else - { - SDLTest_LogError("Could not parse required token at line %d", i + 1); - SDL_free(config->options); - SDL_RWclose(rw); - return 0; - } - - /* parse categories */ - token_ptr = strtok(NULL, ","); - if(!token_ptr) - { - SDLTest_LogError("Could not parse line %d", i + 1); - SDL_free(config->options); - SDL_RWclose(rw); - return 0; - } - token_ptr = SDL_strchr(token_ptr, '['); - if(!token_ptr) - { - SDLTest_LogError("Could not parse enum token at line %d", i + 1); - SDL_free(config->options); - SDL_RWclose(rw); - return 0; - } - token_ptr++; - token_end = SDL_strchr(token_ptr, ']'); - *token_end = '\0'; - if(!token_end) - { - SDLTest_LogError("Could not parse enum token at line %d", i + 1); - SDL_free(config->options); - SDL_RWclose(rw); - return 0; - } - config->options[i].categories = SDLVisualTest_Tokenize(token_ptr, - MAX_SUTOPTION_CATEGORY_LEN); - } - SDL_RWclose(rw); - return 1; -} - -void -SDLVisualTest_FreeSUTConfig(SDLVisualTest_SUTConfig* config) -{ - if(config && config->options) - { - SDLVisualTest_SUTOption* option; - for(option = config->options; - option != config->options + config->num_options; option++) - { - if(option->categories) - SDL_free(option->categories); - if(option->type == SDL_SUT_OPTIONTYPE_ENUM && option->data.enum_values) - SDL_free(option->data.enum_values); - } - SDL_free(config->options); - config->options = NULL; - config->num_options = 0; - } -} diff --git a/visualtest/src/testharness.c b/visualtest/src/testharness.c deleted file mode 100644 index db3ca55b28..0000000000 --- a/visualtest/src/testharness.c +++ /dev/null @@ -1,532 +0,0 @@ -/* See LICENSE.txt for the full license governing this code. */ -/** - * \file testharness.c - * - * Source file for the test harness. - */ - -#include -#include -#include -#include -#include "SDL_visualtest_harness_argparser.h" -#include "SDL_visualtest_process.h" -#include "SDL_visualtest_variators.h" -#include "SDL_visualtest_screenshot.h" -#include "SDL_visualtest_mischelper.h" - -#if defined(__WIN32__) && !defined(__CYGWIN__) -#include -#elif defined(__WIN32__) && defined(__CYGWIN__) -#include -#elif defined(__LINUX__) -#include -#include -#include -#else -#error "Unsupported platform" -#endif - -/** Code for the user event triggered when a new action is to be executed */ -#define ACTION_TIMER_EVENT 0 -/** Code for the user event triggered when the maximum timeout is reached */ -#define KILL_TIMER_EVENT 1 -/** FPS value used for delays in the action loop */ -#define ACTION_LOOP_FPS 10 - -/** Value returned by RunSUTAndTest() when the test has passed */ -#define TEST_PASSED 1 -/** Value returned by RunSUTAndTest() when the test has failed */ -#define TEST_FAILED 0 -/** Value returned by RunSUTAndTest() on a fatal error */ -#define TEST_ERROR -1 - -static SDL_ProcessInfo pinfo; -static SDL_ProcessExitStatus sut_exitstatus; -static SDLVisualTest_HarnessState state; -static SDLVisualTest_Variator variator; -static SDLVisualTest_ActionNode* current; /* the current action being performed */ -static SDL_TimerID action_timer, kill_timer; - -/* returns a char* to be passed as the format argument of a printf-style function. */ -static const char* -usage(void) -{ - return "Usage: \n%s --sutapp xyz" - " [--sutargs abc | --parameter-config xyz.parameters" - " [--variator exhaustive|random]" - " [--num-variations N] [--no-launch]] [--timeout hh:mm:ss]" - " [--action-config xyz.actions]" - " [--output-dir /path/to/output]" - " [--verify-dir /path/to/verify]" - " or --config app.config"; -} - -/* register Ctrl+C handlers */ -#if defined(__LINUX__) || defined(__CYGWIN__) -static void -CtrlCHandlerCallback(int signum) -{ - SDL_Event event; - SDLTest_Log("Ctrl+C received"); - event.type = SDL_QUIT; - SDL_PushEvent(&event); -} -#endif - -static Uint32 -ActionTimerCallback(Uint32 interval, void* param) -{ - SDL_Event event; - SDL_UserEvent userevent; - Uint32 next_action_time; - - /* push an event to handle the action */ - SDL_zero(userevent); - userevent.type = SDL_USEREVENT; - userevent.code = ACTION_TIMER_EVENT; - userevent.data1 = ¤t->action; - - event.type = SDL_USEREVENT; - event.user = userevent; - SDL_PushEvent(&event); - - /* calculate the new interval and return it */ - if(current->next) - next_action_time = current->next->action.time - current->action.time; - else - { - next_action_time = 0; - action_timer = 0; - } - - current = current->next; - return next_action_time; -} - -static Uint32 -KillTimerCallback(Uint32 interval, void* param) -{ - SDL_Event event; - SDL_UserEvent userevent; - - SDL_zero(userevent); - userevent.type = SDL_USEREVENT; - userevent.code = KILL_TIMER_EVENT; - - event.type = SDL_USEREVENT; - event.user = userevent; - SDL_PushEvent(&event); - - kill_timer = 0; - return 0; -} - -static int -ProcessAction(SDLVisualTest_Action* action, int* sut_running, char* args) -{ - if(!action || !sut_running) - return TEST_ERROR; - - switch(action->type) - { - case SDL_ACTION_KILL: - SDLTest_Log("Action: Kill SUT"); - if(SDL_IsProcessRunning(&pinfo) == 1 && - !SDL_KillProcess(&pinfo, &sut_exitstatus)) - { - SDLTest_LogError("SDL_KillProcess() failed"); - return TEST_ERROR; - } - *sut_running = 0; - break; - - case SDL_ACTION_QUIT: - SDLTest_Log("Action: Quit SUT"); - if(SDL_IsProcessRunning(&pinfo) == 1 && - !SDL_QuitProcess(&pinfo, &sut_exitstatus)) - { - SDLTest_LogError("SDL_QuitProcess() failed"); - return TEST_FAILED; - } - *sut_running = 0; - break; - - case SDL_ACTION_LAUNCH: - { - char* path; - char* args; - SDL_ProcessInfo action_process; - SDL_ProcessExitStatus ps; - - path = action->extra.process.path; - args = action->extra.process.args; - if(args) - { - SDLTest_Log("Action: Launch process: %s with arguments: %s", - path, args); - } - else - SDLTest_Log("Action: Launch process: %s", path); - if(!SDL_LaunchProcess(path, args, &action_process)) - { - SDLTest_LogError("SDL_LaunchProcess() failed"); - return TEST_ERROR; - } - - /* small delay so that the process can do its job */ - SDL_Delay(1000); - - if(SDL_IsProcessRunning(&action_process) > 0) - { - SDLTest_LogError("Process %s took too long too complete." - " Force killing...", action->extra.process.path); - if(!SDL_KillProcess(&action_process, &ps)) - { - SDLTest_LogError("SDL_KillProcess() failed"); - return TEST_ERROR; - } - } - } - break; - - case SDL_ACTION_SCREENSHOT: - { - char path[MAX_PATH_LEN], hash[33]; - - SDLTest_Log("Action: Take screenshot"); - /* can't take a screenshot if the SUT isn't running */ - if(SDL_IsProcessRunning(&pinfo) != 1) - { - SDLTest_LogError("SUT has quit."); - *sut_running = 0; - return TEST_FAILED; - } - - /* file name for the screenshot image */ - SDLVisualTest_HashString(args, hash); - SDL_snprintf(path, MAX_PATH_LEN, "%s/%s", state.output_dir, hash); - if(!SDLVisualTest_ScreenshotProcess(&pinfo, path)) - { - SDLTest_LogError("SDLVisualTest_ScreenshotProcess() failed"); - return TEST_ERROR; - } - } - break; - - case SDL_ACTION_VERIFY: - { - int ret; - - SDLTest_Log("Action: Verify screenshot"); - ret = SDLVisualTest_VerifyScreenshots(args, state.output_dir, - state.verify_dir); - - if(ret == -1) - { - SDLTest_LogError("SDLVisualTest_VerifyScreenshots() failed"); - return TEST_ERROR; - } - else if(ret == 0) - { - SDLTest_Log("Verification failed: Images were not equal."); - return TEST_FAILED; - } - else if(ret == 1) - SDLTest_Log("Verification successful."); - else - { - SDLTest_Log("Verfication skipped."); - return TEST_FAILED; - } - } - break; - - default: - SDLTest_LogError("Invalid action type"); - return TEST_ERROR; - break; - } - - return TEST_PASSED; -} - -static int -RunSUTAndTest(char* sutargs, int variation_num) -{ - int success, sut_running, return_code; - char hash[33]; - SDL_Event event; - - return_code = TEST_PASSED; - - if(!sutargs) - { - SDLTest_LogError("sutargs argument cannot be NULL"); - return_code = TEST_ERROR; - goto runsutandtest_cleanup_generic; - } - - SDLVisualTest_HashString(sutargs, hash); - SDLTest_Log("Hash: %s", hash); - - success = SDL_LaunchProcess(state.sutapp, sutargs, &pinfo); - if(!success) - { - SDLTest_Log("Could not launch SUT."); - return_code = TEST_ERROR; - goto runsutandtest_cleanup_generic; - } - SDLTest_Log("SUT launch successful."); - SDLTest_Log("Process will be killed in %d milliseconds", state.timeout); - sut_running = 1; - - /* launch the timers */ - SDLTest_Log("Performing actions.."); - current = state.action_queue.front; - action_timer = 0; - kill_timer = 0; - if(current) - { - action_timer = SDL_AddTimer(current->action.time, ActionTimerCallback, NULL); - if(!action_timer) - { - SDLTest_LogError("SDL_AddTimer() failed"); - return_code = TEST_ERROR; - goto runsutandtest_cleanup_timer; - } - } - kill_timer = SDL_AddTimer(state.timeout, KillTimerCallback, NULL); - if(!kill_timer) - { - SDLTest_LogError("SDL_AddTimer() failed"); - return_code = TEST_ERROR; - goto runsutandtest_cleanup_timer; - } - - /* the timer stops running if the actions queue is empty, and the - SUT stops running if it crashes or if we encounter a KILL/QUIT action */ - while(sut_running) - { - /* process the actions by using an event queue */ - while(SDL_PollEvent(&event)) - { - if(event.type == SDL_USEREVENT) - { - if(event.user.code == ACTION_TIMER_EVENT) - { - SDLVisualTest_Action* action; - - action = (SDLVisualTest_Action*)event.user.data1; - - switch(ProcessAction(action, &sut_running, sutargs)) - { - case TEST_PASSED: - break; - - case TEST_FAILED: - return_code = TEST_FAILED; - goto runsutandtest_cleanup_timer; - break; - - default: - SDLTest_LogError("ProcessAction() failed"); - return_code = TEST_ERROR; - goto runsutandtest_cleanup_timer; - } - } - else if(event.user.code == KILL_TIMER_EVENT) - { - SDLTest_LogError("Maximum timeout reached. Force killing.."); - return_code = TEST_FAILED; - goto runsutandtest_cleanup_timer; - } - } - else if(event.type == SDL_QUIT) - { - SDLTest_LogError("Received QUIT event. Testharness is quitting.."); - return_code = TEST_ERROR; - goto runsutandtest_cleanup_timer; - } - } - SDL_Delay(1000/ACTION_LOOP_FPS); - } - - SDLTest_Log("SUT exit code was: %d", sut_exitstatus.exit_status); - if(sut_exitstatus.exit_status == 0) - { - return_code = TEST_PASSED; - goto runsutandtest_cleanup_timer; - } - else - { - return_code = TEST_FAILED; - goto runsutandtest_cleanup_timer; - } - - return_code = TEST_ERROR; - goto runsutandtest_cleanup_generic; - -runsutandtest_cleanup_timer: - if(action_timer && !SDL_RemoveTimer(action_timer)) - { - SDLTest_Log("SDL_RemoveTimer() failed"); - return_code = TEST_ERROR; - } - - if(kill_timer && !SDL_RemoveTimer(kill_timer)) - { - SDLTest_Log("SDL_RemoveTimer() failed"); - return_code = TEST_ERROR; - } -/* runsutandtest_cleanup_process: */ - if(SDL_IsProcessRunning(&pinfo) && !SDL_KillProcess(&pinfo, &sut_exitstatus)) - { - SDLTest_Log("SDL_KillProcess() failed"); - return_code = TEST_ERROR; - } -runsutandtest_cleanup_generic: - return return_code; -} - -/** Entry point for testharness */ -int -main(int argc, char* argv[]) -{ - int i, passed, return_code, failed; - - /* freeing resources, linux style! */ - return_code = 0; - - if(argc < 2) - { - SDLTest_Log(usage(), argv[0]); - goto cleanup_generic; - } - -#if defined(__LINUX__) || defined(__CYGWIN__) - signal(SIGINT, CtrlCHandlerCallback); -#endif - - /* parse arguments */ - if(!SDLVisualTest_ParseHarnessArgs(argv + 1, &state)) - { - SDLTest_Log(usage(), argv[0]); - return_code = 1; - goto cleanup_generic; - } - SDLTest_Log("Parsed harness arguments successfully."); - - /* initialize SDL */ - if(SDL_Init(SDL_INIT_TIMER) == -1) - { - SDLTest_LogError("SDL_Init() failed."); - SDLVisualTest_FreeHarnessState(&state); - return_code = 1; - goto cleanup_harness_state; - } - - /* create an output directory if none exists */ -#if defined(__LINUX__) || defined(__CYGWIN__) - mkdir(state.output_dir, 0777); -#elif defined(__WIN32__) - _mkdir(state.output_dir); -#else -#error "Unsupported platform" -#endif - - /* test with sutargs */ - if(SDL_strlen(state.sutargs)) - { - SDLTest_Log("Running: %s %s", state.sutapp, state.sutargs); - if(!state.no_launch) - { - switch(RunSUTAndTest(state.sutargs, 0)) - { - case TEST_PASSED: - SDLTest_Log("Status: PASSED"); - break; - - case TEST_FAILED: - SDLTest_Log("Status: FAILED"); - break; - - case TEST_ERROR: - SDLTest_LogError("Some error occurred while testing."); - return_code = 1; - goto cleanup_sdl; - break; - } - } - } - - if(state.sut_config.num_options > 0) - { - const char* variator_name = (state.variator_type == SDL_VARIATOR_RANDOM) ? - "RANDOM" : "EXHAUSTIVE"; - if(state.num_variations > 0) - SDLTest_Log("Testing SUT with variator: %s for %d variations", - variator_name, state.num_variations); - else - SDLTest_Log("Testing SUT with variator: %s and ALL variations", - variator_name); - /* initialize the variator */ - if(!SDLVisualTest_InitVariator(&variator, &state.sut_config, - state.variator_type, 0)) - { - SDLTest_LogError("Could not initialize variator"); - return_code = 1; - goto cleanup_sdl; - } - - /* iterate through all the variations */ - passed = 0; - failed = 0; - for(i = 0; state.num_variations > 0 ? (i < state.num_variations) : 1; i++) - { - char* args = SDLVisualTest_GetNextVariation(&variator); - if(!args) - break; - SDLTest_Log("\nVariation number: %d\nArguments: %s", i + 1, args); - - if(!state.no_launch) - { - switch(RunSUTAndTest(args, i + 1)) - { - case TEST_PASSED: - SDLTest_Log("Status: PASSED"); - passed++; - break; - - case TEST_FAILED: - SDLTest_Log("Status: FAILED"); - failed++; - break; - - case TEST_ERROR: - SDLTest_LogError("Some error occurred while testing."); - goto cleanup_variator; - break; - } - } - } - if(!state.no_launch) - { - /* report stats */ - SDLTest_Log("Testing complete."); - SDLTest_Log("%d/%d tests passed.", passed, passed + failed); - } - goto cleanup_variator; - } - - goto cleanup_sdl; - -cleanup_variator: - SDLVisualTest_FreeVariator(&variator); -cleanup_sdl: - SDL_Quit(); -cleanup_harness_state: - SDLVisualTest_FreeHarnessState(&state); -cleanup_generic: - return return_code; -} diff --git a/visualtest/src/variator_common.c b/visualtest/src/variator_common.c deleted file mode 100644 index e8444b3175..0000000000 --- a/visualtest/src/variator_common.c +++ /dev/null @@ -1,225 +0,0 @@ -/* See LICENSE.txt for the full license governing this code. */ -/** - * \file variator_common.c - * - * Source file for some common functionality used by variators. - */ - -#include -#include "SDL_visualtest_variator_common.h" - -int -SDLVisualTest_NextValue(SDLVisualTest_SUTOptionValue* var, - SDLVisualTest_SUTOption* opt) -{ - if(!var) - { - SDLTest_LogError("var argument cannot be NULL"); - return -1; - } - if(!opt) - { - SDLTest_LogError("opt argument cannot be NULL"); - return -1; - } - - switch(opt->type) - { - case SDL_SUT_OPTIONTYPE_BOOL: - if(var->bool_value) - { - var->bool_value = SDL_FALSE; - return 1; - } - else - { - var->bool_value = SDL_TRUE; - return 0; - } - break; - - case SDL_SUT_OPTIONTYPE_ENUM: - var->enumerated.index++; - if(!opt->data.enum_values[var->enumerated.index]) - { - var->enumerated.index = 0; - return 1; - } - return 0; - break; - - case SDL_SUT_OPTIONTYPE_INT: - { - int increment = (opt->data.range.max - opt->data.range.min) / - SDL_SUT_INTEGER_OPTION_TEST_STEPS; - /* prevents infinite loop when rounding */ - if(increment == 0) - increment = 1; - var->integer.value += increment; - if(var->integer.value > opt->data.range.max) - { - var->integer.value = opt->data.range.min; - return 1; - } - return 0; - } - break; - - case SDL_SUT_OPTIONTYPE_STRING: - return 1; - break; - } - return -1; -} - -int -SDLVisualTest_MakeStrFromVariation(SDLVisualTest_Variation* variation, - SDLVisualTest_SUTConfig* config, - char* buffer, int size) -{ - int i, index; - SDLVisualTest_SUTOptionValue* vars; - SDLVisualTest_SUTOption* options; - if(!variation) - { - SDLTest_LogError("variation argument cannot be NULL"); - return 0; - } - if(!config) - { - SDLTest_LogError("config argument cannot be NULL"); - return 0; - } - if(!buffer) - { - SDLTest_LogError("buffer argument cannot be NULL"); - return 0; - } - if(size <= 0) - { - SDLTest_LogError("size argument should be positive"); - return 0; - } - - index = 0; - buffer[0] = '\0'; - options = config->options; - vars = variation->vars; - for(i = 0; i < variation->num_vars; i++) - { - int n, enum_index; - if(index >= size - 1) - { - SDLTest_LogError("String did not fit in buffer size"); - return 0; - } - switch(options[i].type) - { - case SDL_SUT_OPTIONTYPE_BOOL: - if(vars[i].bool_value) - { - n = SDL_snprintf(buffer + index, size - index, "%s ", - options[i].name); - if(n <= 0) - { - SDLTest_LogError("SDL_snprintf() failed"); - return 0; - } - index += n; - } - break; - - case SDL_SUT_OPTIONTYPE_ENUM: - if(vars[i].enumerated.on) - { - enum_index = vars[i].enumerated.index; - n = SDL_snprintf(buffer + index, size - index, "%s %s ", - options[i].name, options[i].data.enum_values[enum_index]); - index += n; - } - break; - - case SDL_SUT_OPTIONTYPE_INT: - if(vars[i].integer.on) - { - n = SDL_snprintf(buffer + index, size - index, "%s %d ", - options[i].name, vars[i].integer.value); - index += n; - } - break; - - case SDL_SUT_OPTIONTYPE_STRING: - if(vars[i].string.on) - { - n = SDL_snprintf(buffer + index, size - index, "%s %s ", - options[i].name, vars[i].string.value); - index += n; - } - break; - } - } - return 1; -} - -int -SDLVisualTest_InitVariation(SDLVisualTest_Variation* variation, - SDLVisualTest_SUTConfig* config) -{ - int i; - SDLVisualTest_SUTOptionValue* vars; - SDLVisualTest_SUTOption* options; - if(!variation) - { - SDLTest_LogError("variation argument cannot be NULL"); - return 0; - } - if(!config) - { - SDLTest_LogError("config argument cannot be NULL"); - return 0; - } - - /* initialize the first variation */ - if(config->num_options <= 0) - { - SDLTest_LogError("config->num_options must be positive"); - return 0; - } - variation->vars = (SDLVisualTest_SUTOptionValue*)SDL_malloc(config->num_options * - sizeof(SDLVisualTest_SUTOptionValue)); - if(!variation->vars) - { - SDLTest_LogError("SDL_malloc() failed"); - return 0; - } - variation->num_vars = config->num_options; - vars = variation->vars; - options = config->options; - for(i = 0; i < variation->num_vars; i++) - { - switch(options[i].type) - { - case SDL_SUT_OPTIONTYPE_BOOL: - vars[i].bool_value = SDL_FALSE; - break; - - case SDL_SUT_OPTIONTYPE_ENUM: - vars[i].enumerated.on = SDL_TRUE; - vars[i].enumerated.index = 0; - break; - - case SDL_SUT_OPTIONTYPE_INT: - { - vars[i].integer.on = SDL_TRUE; - vars[i].integer.value = options[i].data.range.min; - } - break; - - case SDL_SUT_OPTIONTYPE_STRING: - vars[i].string.on = SDL_TRUE; - vars[i].string.value = options[i].name; - break; - } - } - return 1; -} diff --git a/visualtest/src/variator_exhaustive.c b/visualtest/src/variator_exhaustive.c deleted file mode 100644 index 1e6a79e0ac..0000000000 --- a/visualtest/src/variator_exhaustive.c +++ /dev/null @@ -1,133 +0,0 @@ -/* See LICENSE.txt for the full license governing this code. */ -/** - * \file variator_exhaustive.c - * - * Source file for the variator that tests the SUT with all the different - * variations of input parameters that are valid. - */ - -#include -#include -#include "SDL_visualtest_sut_configparser.h" -#include "SDL_visualtest_exhaustive_variator.h" - -static int -NextVariation(SDLVisualTest_Variation* variation, - SDLVisualTest_SUTConfig* config) -{ - int i, carry; - if(!variation) - { - SDLTest_LogError("variation argument cannot be NULL"); - return -1; - } - if(!config) - { - SDLTest_LogError("config argument cannot be NULL"); - return -1; - } - - carry = 1; - for(i = 0; i < variation->num_vars; i++) - { - carry = SDLVisualTest_NextValue(&variation->vars[i], &config->options[i]); - if(carry != 1) - break; - } - - if(carry == 1) /* we're done, we've tried all possible variations */ - return 0; - if(carry == 0) - return 1; - - SDLTest_LogError("NextVariation() failed"); - return -1; -} - -int -SDLVisualTest_InitExhaustiveVariator(SDLVisualTest_ExhaustiveVariator* variator, - SDLVisualTest_SUTConfig* config) -{ - if(!variator) - { - SDLTest_LogError("variator argument cannot be NULL"); - return 0; - } - if(!config) - { - SDLTest_LogError("config argument cannot be NULL"); - return 0; - } - - SDLTest_FuzzerInit(time(NULL)); - - variator->config = *config; - variator->variation.num_vars = 0; - variator->variation.vars = NULL; - - return 1; -} - -/* TODO: Right now variations where an option is not specified at all are not - tested for. This can be implemented by switching the on attribute for integer, - enum and string options to true and false. */ -char* -SDLVisualTest_GetNextExhaustiveVariation(SDLVisualTest_ExhaustiveVariator* variator) -{ - int success; - if(!variator) - { - SDLTest_LogError("variator argument cannot be NULL"); - return NULL; - } - - if(!variator->variation.vars) /* the first time this function is called */ - { - success = SDLVisualTest_InitVariation(&variator->variation, - &variator->config); - if(!success) - { - SDLTest_LogError("SDLVisualTest_InitVariation() failed"); - return NULL; - } - success = SDLVisualTest_MakeStrFromVariation(&variator->variation, - &variator->config, variator->buffer, MAX_SUT_ARGS_LEN); - if(!success) - { - SDLTest_LogError("SDLVisualTest_MakeStrFromVariation() failed"); - return NULL; - } - return variator->buffer; - } - else - { - success = NextVariation(&variator->variation, &variator->config); - if(success == 1) - { - success = SDLVisualTest_MakeStrFromVariation(&variator->variation, - &variator->config, variator->buffer, MAX_SUT_ARGS_LEN); - if(!success) - { - SDLTest_LogError("SDLVisualTest_MakeStrFromVariation() failed"); - return NULL; - } - return variator->buffer; - } - else if(success == -1) - SDLTest_LogError("NextVariation() failed."); - return NULL; - } - return NULL; -} - -void -SDLVisualTest_FreeExhaustiveVariator(SDLVisualTest_ExhaustiveVariator* variator) -{ - if(!variator) - { - SDLTest_LogError("variator argument cannot be NULL"); - return; - } - SDL_free(variator->variation.vars); - variator->variation.vars = NULL; -} diff --git a/visualtest/src/variator_random.c b/visualtest/src/variator_random.c deleted file mode 100644 index 4da4161e19..0000000000 --- a/visualtest/src/variator_random.c +++ /dev/null @@ -1,113 +0,0 @@ -/* See LICENSE.txt for the full license governing this code. */ -/** - * \file variator_random.c - * - * Source file for the variator that tests the SUT with random variations to the - * input parameters. - */ - -#include -#include -#include "SDL_visualtest_random_variator.h" - -int -SDLVisualTest_InitRandomVariator(SDLVisualTest_RandomVariator* variator, - SDLVisualTest_SUTConfig* config, Uint64 seed) -{ - if(!variator) - { - SDLTest_LogError("variator argument cannot be NULL"); - return 0; - } - if(!config) - { - SDLTest_LogError("config argument cannot be NULL"); - return 0; - } - - if(seed) - SDLTest_FuzzerInit(seed); - else - SDLTest_FuzzerInit(time(NULL)); - - variator->config = *config; - - if(!SDLVisualTest_InitVariation(&variator->variation, &variator->config)) - { - SDLTest_LogError("SDLVisualTest_InitVariation() failed"); - return 0; - } - - return 1; -} - -char* -SDLVisualTest_GetNextRandomVariation(SDLVisualTest_RandomVariator* variator) -{ - SDLVisualTest_SUTOptionValue* vars; - SDLVisualTest_SUTOption* options; - int i; - - if(!variator) - { - SDLTest_LogError("variator argument cannot be NULL"); - return NULL; - } - - /* to save typing */ - vars = variator->variation.vars; - options = variator->config.options; - - /* generate a random variation */ - for(i = 0; i < variator->variation.num_vars; i++) - { - switch(options[i].type) - { - case SDL_SUT_OPTIONTYPE_BOOL: - vars[i].bool_value = SDLTest_RandomIntegerInRange(0, 1) ? SDL_FALSE : - SDL_TRUE; - break; - - case SDL_SUT_OPTIONTYPE_ENUM: - { - int emx = 0; - while(options[i].data.enum_values[emx]) - emx++; - vars[i].enumerated.index = SDLTest_RandomIntegerInRange(0, emx - 1); - } - break; - - case SDL_SUT_OPTIONTYPE_INT: - vars[i].integer.value = SDLTest_RandomIntegerInRange( - options[i].data.range.min, - options[i].data.range.max); - break; - - case SDL_SUT_OPTIONTYPE_STRING: - // String values are left unchanged - break; - } - } - - /* convert variation to an arguments string */ - if(!SDLVisualTest_MakeStrFromVariation(&variator->variation, &variator->config, - variator->buffer, MAX_SUT_ARGS_LEN)) - { - SDLTest_LogError("SDLVisualTest_MakeStrFromVariation() failed"); - return NULL; - } - - return variator->buffer; -} - -void SDLVisualTest_FreeRandomVariator(SDLVisualTest_RandomVariator* variator) -{ - if(!variator) - { - SDLTest_LogError("variator argument cannot be NULL"); - return; - } - - SDL_free(variator->variation.vars); - variator->variation.vars = NULL; -} diff --git a/visualtest/src/variators.c b/visualtest/src/variators.c deleted file mode 100644 index e9485c6f63..0000000000 --- a/visualtest/src/variators.c +++ /dev/null @@ -1,95 +0,0 @@ -/* See LICENSE.txt for the full license governing this code. */ -/** - * \file variators.c - * - * Source file for the operations that act on variators. - */ - -#include -#include "SDL_visualtest_variators.h" - -int -SDLVisualTest_InitVariator(SDLVisualTest_Variator* variator, - SDLVisualTest_SUTConfig* config, - SDLVisualTest_VariatorType type, - Uint64 seed) -{ - if(!variator) - { - SDLTest_LogError("variator argument cannot be NULL"); - return 0; - } - if(!config) - { - SDLTest_LogError("config argument cannot be NULL"); - return 0; - } - - variator->type = type; - switch(type) - { - case SDL_VARIATOR_EXHAUSTIVE: - return SDLVisualTest_InitExhaustiveVariator(&variator->data.exhaustive, - config); - break; - - case SDL_VARIATOR_RANDOM: - return SDLVisualTest_InitRandomVariator(&variator->data.random, - config, seed); - break; - - default: - SDLTest_LogError("Invalid value for variator type"); - return 0; - } - return 0; -} - -char* -SDLVisualTest_GetNextVariation(SDLVisualTest_Variator* variator) -{ - if(!variator) - { - SDLTest_LogError("variator argument cannot be NULL"); - return NULL; - } - - switch(variator->type) - { - case SDL_VARIATOR_EXHAUSTIVE: - return SDLVisualTest_GetNextExhaustiveVariation(&variator->data.exhaustive); - break; - - case SDL_VARIATOR_RANDOM: - return SDLVisualTest_GetNextRandomVariation(&variator->data.random); - break; - - default: - SDLTest_LogError("Invalid value for variator type"); - return NULL; - } - return NULL; -} - -void SDLVisualTest_FreeVariator(SDLVisualTest_Variator* variator) -{ - if(!variator) - { - SDLTest_LogError("variator argument cannot be NULL"); - return; - } - - switch(variator->type) - { - case SDL_VARIATOR_EXHAUSTIVE: - SDLVisualTest_FreeExhaustiveVariator(&variator->data.exhaustive); - break; - - case SDL_VARIATOR_RANDOM: - SDLVisualTest_FreeRandomVariator(&variator->data.random); - break; - - default: - SDLTest_LogError("Invalid value for variator type"); - } -} diff --git a/visualtest/src/windows/windows_process.c b/visualtest/src/windows/windows_process.c deleted file mode 100644 index e7e265c7cb..0000000000 --- a/visualtest/src/windows/windows_process.c +++ /dev/null @@ -1,283 +0,0 @@ -/* See LICENSE.txt for the full license governing this code. */ -/** - * \file windows_process.c - * - * Source file for the process API on windows. - */ - -#include -#include -#include -#include - -#include "SDL_visualtest_process.h" - -#if defined(__WIN32__) - -void -LogLastError(const char* str) -{ - LPVOID buffer; - DWORD dw = GetLastError(); - FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER|FORMAT_MESSAGE_FROM_SYSTEM| - FORMAT_MESSAGE_IGNORE_INSERTS, NULL, dw, - MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR)&buffer, - 0, NULL); - SDLTest_LogError("%s: %s", str, (char*)buffer); - LocalFree(buffer); -} - -int -SDL_LaunchProcess(char* file, char* args, SDL_ProcessInfo* pinfo) -{ - BOOL success; - char* working_directory; - char* command_line; - int path_length, args_length; - STARTUPINFO sui = {0}; - sui.cb = sizeof(sui); - - if(!file) - { - SDLTest_LogError("Path to executable to launched cannot be NULL."); - return 0; - } - if(!pinfo) - { - SDLTest_LogError("pinfo cannot be NULL."); - return 0; - } - - /* get the working directory of the process being launched, so that - the process can load any resources it has in it's working directory */ - path_length = SDL_strlen(file); - if(path_length == 0) - { - SDLTest_LogError("Length of the file parameter is zero."); - return 0; - } - - working_directory = (char*)SDL_malloc(path_length + 1); - if(!working_directory) - { - SDLTest_LogError("Could not allocate working_directory - SDL_malloc() failed."); - return 0; - } - - SDL_memcpy(working_directory, file, path_length + 1); - PathRemoveFileSpec(working_directory); - if(SDL_strlen(working_directory) == 0) - { - SDL_free(working_directory); - working_directory = NULL; - } - - /* join the file path and the args string together */ - if(!args) - args = ""; - args_length = SDL_strlen(args); - command_line = (char*)SDL_malloc(path_length + args_length + 2); - if(!command_line) - { - SDLTest_LogError("Could not allocate command_line - SDL_malloc() failed."); - return 0; - } - SDL_memcpy(command_line, file, path_length); - command_line[path_length] = ' '; - SDL_memcpy(command_line + path_length + 1, args, args_length + 1); - - /* create the process */ - success = CreateProcess(NULL, command_line, NULL, NULL, FALSE, - NORMAL_PRIORITY_CLASS | CREATE_NO_WINDOW, - NULL, working_directory, &sui, &pinfo->pi); - if(working_directory) - { - SDL_free(working_directory); - working_directory = NULL; - } - SDL_free(command_line); - if(!success) - { - LogLastError("CreateProcess() failed"); - return 0; - } - - return 1; -} - -int -SDL_GetProcessExitStatus(SDL_ProcessInfo* pinfo, SDL_ProcessExitStatus* ps) -{ - DWORD exit_status; - BOOL success; - - if(!pinfo) - { - SDLTest_LogError("pinfo cannot be NULL"); - return 0; - } - if(!ps) - { - SDLTest_LogError("ps cannot be NULL"); - return 0; - } - - /* get the exit code */ - success = GetExitCodeProcess(pinfo->pi.hProcess, &exit_status); - if(!success) - { - LogLastError("GetExitCodeProcess() failed"); - return 0; - } - - if(exit_status == STILL_ACTIVE) - ps->exit_status = -1; - else - ps->exit_status = exit_status; - ps->exit_success = 1; - return 1; -} - - -int -SDL_IsProcessRunning(SDL_ProcessInfo* pinfo) -{ - DWORD exit_status; - BOOL success; - - if(!pinfo) - { - SDLTest_LogError("pinfo cannot be NULL"); - return -1; - } - - success = GetExitCodeProcess(pinfo->pi.hProcess, &exit_status); - if(!success) - { - LogLastError("GetExitCodeProcess() failed"); - return -1; - } - - if(exit_status == STILL_ACTIVE) - return 1; - return 0; -} - -static BOOL CALLBACK -CloseWindowCallback(HWND hwnd, LPARAM lparam) -{ - DWORD pid; - SDL_ProcessInfo* pinfo; - - pinfo = (SDL_ProcessInfo*)lparam; - - GetWindowThreadProcessId(hwnd, &pid); - if(pid == pinfo->pi.dwProcessId) - { - DWORD_PTR result; - if(!SendMessageTimeout(hwnd, WM_CLOSE, 0, 0, SMTO_BLOCK, - 1000, &result)) - { - if(GetLastError() != ERROR_TIMEOUT) - { - LogLastError("SendMessageTimeout() failed"); - return FALSE; - } - } - } - return TRUE; -} - -int -SDL_QuitProcess(SDL_ProcessInfo* pinfo, SDL_ProcessExitStatus* ps) -{ - DWORD wait_result; - if(!pinfo) - { - SDLTest_LogError("pinfo argument cannot be NULL"); - return 0; - } - if(!ps) - { - SDLTest_LogError("ps argument cannot be NULL"); - return 0; - } - - /* enumerate through all the windows, trying to close each one */ - if(!EnumWindows(CloseWindowCallback, (LPARAM)pinfo)) - { - SDLTest_LogError("EnumWindows() failed"); - return 0; - } - - /* wait until the process terminates */ - wait_result = WaitForSingleObject(pinfo->pi.hProcess, 1000); - if(wait_result == WAIT_FAILED) - { - LogLastError("WaitForSingleObject() failed"); - return 0; - } - if(wait_result != WAIT_OBJECT_0) - { - SDLTest_LogError("Process did not quit."); - return 0; - } - - /* get the exit code */ - if(!SDL_GetProcessExitStatus(pinfo, ps)) - { - SDLTest_LogError("SDL_GetProcessExitStatus() failed"); - return 0; - } - - return 1; -} - -int -SDL_KillProcess(SDL_ProcessInfo* pinfo, SDL_ProcessExitStatus* ps) -{ - BOOL success; - DWORD exit_status, wait_result; - - if(!pinfo) - { - SDLTest_LogError("pinfo argument cannot be NULL"); - return 0; - } - if(!ps) - { - SDLTest_LogError("ps argument cannot be NULL"); - return 0; - } - - /* initiate termination of the process */ - success = TerminateProcess(pinfo->pi.hProcess, 0); - if(!success) - { - LogLastError("TerminateProcess() failed"); - return 0; - } - - /* wait until the process terminates */ - wait_result = WaitForSingleObject(pinfo->pi.hProcess, INFINITE); - if(wait_result == WAIT_FAILED) - { - LogLastError("WaitForSingleObject() failed"); - return 0; - } - - /* get the exit code */ - success = GetExitCodeProcess(pinfo->pi.hProcess, &exit_status); - if(!success) - { - LogLastError("GetExitCodeProcess() failed"); - return 0; - } - - ps->exit_status = exit_status; - ps->exit_success = 1; - - return 1; -} - -#endif diff --git a/visualtest/src/windows/windows_screenshot.c b/visualtest/src/windows/windows_screenshot.c deleted file mode 100644 index d4ac7d3a1e..0000000000 --- a/visualtest/src/windows/windows_screenshot.c +++ /dev/null @@ -1,349 +0,0 @@ -/* See LICENSE.txt for the full license governing this code. */ -/** - * \file windows_screenshot.c - * - * Source file for the screenshot API on windows. - */ - -#include "SDL_visualtest_process.h" -#include -#include - -#if defined(__CYGWIN__) -#include -#endif - -#if defined(__WIN32__) -#include - -void LogLastError(const char* str); - -static int img_num; -static SDL_ProcessInfo screenshot_pinfo; - -/* Saves a bitmap to a file using hdc as a device context */ -static int -SaveBitmapToFile(HDC hdc, HBITMAP hbitmap, char* filename) -{ - BITMAP bitmap; - BITMAPFILEHEADER bfh; - BITMAPINFOHEADER bih; - DWORD bmpsize, bytes_written; - HANDLE hdib, hfile; - char* bmpdata; - int return_code = 1; - - if(!hdc) - { - SDLTest_LogError("hdc argument is NULL"); - return 0; - } - if(!hbitmap) - { - SDLTest_LogError("hbitmap argument is NULL"); - return 0; - } - if(!filename) - { - SDLTest_LogError("filename argument is NULL"); - return 0; - } - - if(!GetObject(hbitmap, sizeof(BITMAP), (void*)&bitmap)) - { - SDLTest_LogError("GetObject() failed"); - return_code = 0; - goto savebitmaptofile_cleanup_generic; - } - - bih.biSize = sizeof(BITMAPINFOHEADER); - bih.biWidth = bitmap.bmWidth; - bih.biHeight = bitmap.bmHeight; - bih.biPlanes = 1; - bih.biBitCount = 32; - bih.biCompression = BI_RGB; - bih.biSizeImage = 0; - bih.biXPelsPerMeter = 0; - bih.biYPelsPerMeter = 0; - bih.biClrUsed = 0; - bih.biClrImportant = 0; - - bmpsize = ((bitmap.bmWidth * bih.biBitCount + 31) / 32) * 4 * bitmap.bmHeight; - - hdib = GlobalAlloc(GHND, bmpsize); - if(!hdib) - { - LogLastError("GlobalAlloc() failed"); - return_code = 0; - goto savebitmaptofile_cleanup_generic; - } - bmpdata = (char*)GlobalLock(hdib); - if(!bmpdata) - { - LogLastError("GlobalLock() failed"); - return_code = 0; - goto savebitmaptofile_cleanup_hdib; - } - - if(!GetDIBits(hdc, hbitmap, 0, (UINT)bitmap.bmHeight, bmpdata, - (LPBITMAPINFO)&bih, DIB_RGB_COLORS)) - { - SDLTest_LogError("GetDIBits() failed"); - return_code = 0; - goto savebitmaptofile_cleanup_unlockhdib; - } - - hfile = CreateFile(filename, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, - FILE_ATTRIBUTE_NORMAL, NULL); - if(hfile == INVALID_HANDLE_VALUE) - { - LogLastError("CreateFile()"); - return_code = 0; - goto savebitmaptofile_cleanup_unlockhdib; - } - bfh.bfOffBits = sizeof(BITMAPFILEHEADER) + sizeof(BITMAPINFOHEADER); - bfh.bfSize = bmpsize + bfh.bfOffBits; - bfh.bfType = 0x4D42; - - bytes_written = 0; - if(!WriteFile(hfile, (void*)&bfh, sizeof(BITMAPFILEHEADER), &bytes_written, NULL) || - !WriteFile(hfile, (void*)&bih, sizeof(BITMAPINFOHEADER), &bytes_written, NULL) || - !WriteFile(hfile, (void*)bmpdata, bmpsize, &bytes_written, NULL)) - { - LogLastError("WriteFile() failed"); - return_code = 0; - goto savebitmaptofile_cleanup_hfile; - } - -savebitmaptofile_cleanup_hfile: - CloseHandle(hfile); - -/* make the screenshot file writable on cygwin, since it could be overwritten later */ -#if defined(__CYGWIN__) - if(chmod(filename, 0777) == -1) - { - SDLTest_LogError("chmod() failed"); - return_code = 0; - } -#endif - -savebitmaptofile_cleanup_unlockhdib: - GlobalUnlock(hdib); - -savebitmaptofile_cleanup_hdib: - GlobalFree(hdib); - -savebitmaptofile_cleanup_generic: - return return_code; -} - -/* Takes the screenshot of a window and saves it to a file. If only_client_area - is true, then only the client area of the window is considered */ -static int -ScreenshotWindow(HWND hwnd, char* filename, SDL_bool only_client_area) -{ - int width, height; - RECT dimensions; - HDC windowdc, capturedc; - HBITMAP capturebitmap; - HGDIOBJ select_success; - BOOL blt_success; - int return_code = 1; - - if(!filename) - { - SDLTest_LogError("filename argument cannot be NULL"); - return_code = 0; - goto screenshotwindow_cleanup_generic; - } - if(!hwnd) - { - SDLTest_LogError("hwnd argument cannot be NULL"); - return_code = 0; - goto screenshotwindow_cleanup_generic; - } - - if(!GetWindowRect(hwnd, &dimensions)) - { - LogLastError("GetWindowRect() failed"); - return_code = 0; - goto screenshotwindow_cleanup_generic; - } - - if(only_client_area) - { - RECT crect; - if(!GetClientRect(hwnd, &crect)) - { - SDLTest_LogError("GetClientRect() failed"); - return_code = 0; - goto screenshotwindow_cleanup_generic; - } - - width = crect.right; - height = crect.bottom; - windowdc = GetDC(hwnd); - if(!windowdc) - { - SDLTest_LogError("GetDC() failed"); - return_code = 0; - goto screenshotwindow_cleanup_generic; - } - } - else - { - width = dimensions.right - dimensions.left; - height = dimensions.bottom - dimensions.top; - windowdc = GetWindowDC(hwnd); - if(!windowdc) - { - SDLTest_LogError("GetWindowDC() failed"); - return_code = 0; - goto screenshotwindow_cleanup_generic; - } - } - - capturedc = CreateCompatibleDC(windowdc); - if(!capturedc) - { - SDLTest_LogError("CreateCompatibleDC() failed"); - return_code = 0; - goto screenshotwindow_cleanup_windowdc; - } - capturebitmap = CreateCompatibleBitmap(windowdc, width, height); - if(!capturebitmap) - { - SDLTest_LogError("CreateCompatibleBitmap() failed"); - return_code = 0; - goto screenshotwindow_cleanup_capturedc; - } - select_success = SelectObject(capturedc, capturebitmap); - if(!select_success || select_success == HGDI_ERROR) - { - SDLTest_LogError("SelectObject() failed"); - return_code = 0; - goto screenshotwindow_cleanup_capturebitmap; - } - blt_success = BitBlt(capturedc, 0, 0, width, height, windowdc, - 0, 0, SRCCOPY|CAPTUREBLT); - if(!blt_success) - { - LogLastError("BitBlt() failed"); - return_code = 0; - goto screenshotwindow_cleanup_capturebitmap; - } - - /* save bitmap as file */ - if(!SaveBitmapToFile(windowdc, capturebitmap, filename)) - { - SDLTest_LogError("SaveBitmapToFile() failed"); - return_code = 0; - goto screenshotwindow_cleanup_capturebitmap; - } - - /* Free resources */ - -screenshotwindow_cleanup_capturebitmap: - if(!DeleteObject(capturebitmap)) - { - SDLTest_LogError("DeleteObjectFailed"); - return_code = 0; - } - -screenshotwindow_cleanup_capturedc: - if(!DeleteDC(capturedc)) - { - SDLTest_LogError("DeleteDC() failed"); - return_code = 0; - } - -screenshotwindow_cleanup_windowdc: - if(!ReleaseDC(hwnd, windowdc)) - { - SDLTest_LogError("ReleaseDC() failed"); - return_code = 0; - } - -screenshotwindow_cleanup_generic: - return return_code; -} - -/* Takes the screenshot of the entire desktop and saves it to a file */ -int SDLVisualTest_ScreenshotDesktop(char* filename) -{ - HWND hwnd; - hwnd = GetDesktopWindow(); - return ScreenshotWindow(hwnd, filename, SDL_FALSE); -} - -/* take screenshot of a window and save it to a file */ -static BOOL CALLBACK -ScreenshotHwnd(HWND hwnd, LPARAM lparam) -{ - int len; - DWORD pid; - char* prefix; - char* filename; - - GetWindowThreadProcessId(hwnd, &pid); - if(pid != screenshot_pinfo.pi.dwProcessId) - return TRUE; - - if(!IsWindowVisible(hwnd)) - return TRUE; - - prefix = (char*)lparam; - len = SDL_strlen(prefix) + 100; - filename = (char*)SDL_malloc(len * sizeof(char)); - if(!filename) - { - SDLTest_LogError("SDL_malloc() failed"); - return FALSE; - } - - /* restore the window and bring it to the top */ - ShowWindowAsync(hwnd, SW_RESTORE); - /* restore is not instantaneous */ - SDL_Delay(500); - - /* take a screenshot of the client area */ - if(img_num == 1) - SDL_snprintf(filename, len, "%s.bmp", prefix); - else - SDL_snprintf(filename, len, "%s_%d.bmp", prefix, img_num); - img_num++; - ScreenshotWindow(hwnd, filename, SDL_TRUE); - - SDL_free(filename); - return TRUE; -} - - -/* each window of the process will have a screenshot taken. The file name will be - prefix-i.png for the i'th window. */ -int -SDLVisualTest_ScreenshotProcess(SDL_ProcessInfo* pinfo, char* prefix) -{ - if(!pinfo) - { - SDLTest_LogError("pinfo argument cannot be NULL"); - return 0; - } - if(!prefix) - { - SDLTest_LogError("prefix argument cannot be NULL"); - return 0; - } - - img_num = 1; - screenshot_pinfo = *pinfo; - if(!EnumWindows(ScreenshotHwnd, (LPARAM)prefix)) - { - SDLTest_LogError("EnumWindows() failed"); - return 0; - } - - return 1; -} - -#endif diff --git a/visualtest/testsprite2_sample.actions b/visualtest/testsprite2_sample.actions deleted file mode 100644 index c0e9ab8b9e..0000000000 --- a/visualtest/testsprite2_sample.actions +++ /dev/null @@ -1,3 +0,0 @@ -00:00:02 SCREENSHOT # Take a screenshot of each window owned by the SUT process -00:00:05 VERIFY # Verify each screenshot taken with verification images -00:00:10 QUIT # Gracefully quit the SUT process \ No newline at end of file diff --git a/visualtest/testsprite2_sample.config b/visualtest/testsprite2_sample.config deleted file mode 100644 index 14eb4622c2..0000000000 --- a/visualtest/testsprite2_sample.config +++ /dev/null @@ -1,6 +0,0 @@ -parameter-config=testsprite2_sample.parameters -num-variations=10 -variator=random -sutapp=testsprite2 -timeout=00:00:20 -action-config=testsprite2_sample.actions \ No newline at end of file diff --git a/visualtest/testsprite2_sample.parameters b/visualtest/testsprite2_sample.parameters deleted file mode 100644 index 29e34cd284..0000000000 --- a/visualtest/testsprite2_sample.parameters +++ /dev/null @@ -1,29 +0,0 @@ -# parameter name, type, value range, required, categories ---gldebug, boolean, [], false, [] ---info, enum, [all video modes render event], false, [] ---log, enum, [all error system audio video render input], false, [] ---display, integer, [1 5], false, [] ---fullscreen, boolean, [], false, [] ---fullscreen-desktop, boolean, [], false, [] -# --windows, integer, [1 5], false, [] # this option is not supported yet ---title, enum, [vartest bartest footest], false, [] ---icon, enum, [icon.bmp], false, [] ---center, boolean, [], false, [] ---position, enum, [300,300], false, [] ---geometry, enum, [500x500], false, [] ---min-geometry, enum, [100x100], false, [] ---max-geometry, enum, [600x600 700x700], false, [] ---logical, enum, [500x500 550x450], false, [] ---scale, integer, [1 5], false, [] ---depth, integer, [1 5], false, [] ---refresh, integer, [1 5], false, [] ---vsync, boolean, [], false, [] ---noframe, boolean, [], false, [] ---resize, boolean, [], false, [] ---minimize, boolean, [], false, [] ---maximize, boolean, [], false, [] ---grab, boolean, [], false, [mouse] ---blend, enum, [none blend add mod], false, [] ---cyclecolor, boolean, [], false, [] ---cyclealpha, boolean, [], false, [] ---iterations, integer, [10 100], false, [] \ No newline at end of file diff --git a/visualtest/unittest/testquit.actions b/visualtest/unittest/testquit.actions deleted file mode 100644 index fa68805200..0000000000 --- a/visualtest/unittest/testquit.actions +++ /dev/null @@ -1 +0,0 @@ -00:00:05 QUIT \ No newline at end of file diff --git a/visualtest/unittest/testquit.c b/visualtest/unittest/testquit.c deleted file mode 100644 index 04e3c5c5a9..0000000000 --- a/visualtest/unittest/testquit.c +++ /dev/null @@ -1,102 +0,0 @@ -/* - Copyright (C) 2013 Apoorv Upreti - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely. -*/ -/* Quits, hangs or crashes based on the command line options passed. */ - -#include -#include - -static SDLTest_CommonState *state; -static int exit_code; -static SDL_bool hang; -static SDL_bool crash; - -int -main(int argc, char** argv) -{ - int i, done; - SDL_Event event; - - state = SDLTest_CommonCreateState(argv, SDL_INIT_VIDEO); - if(!state) - return 1; - - state->window_flags |= SDL_WINDOW_RESIZABLE; - - exit_code = 0; - hang = SDL_FALSE; - crash = SDL_FALSE; - - for(i = 1; i < argc; ) - { - int consumed; - consumed = SDLTest_CommonArg(state, i); - if(consumed == 0) - { - consumed = -1; - if(SDL_strcasecmp(argv[i], "--exit-code") == 0) - { - if(argv[i + 1]) - { - exit_code = SDL_atoi(argv[i + 1]); - consumed = 2; - } - } - else if(SDL_strcasecmp(argv[i], "--hang") == 0) - { - hang = SDL_TRUE; - consumed = 1; - } - else if(SDL_strcasecmp(argv[i], "--crash") == 0) - { - crash = SDL_TRUE; - consumed = 1; - } - } - - if(consumed < 0) - { - static const char *options[] = { "[--exit-code N]", "[--crash]", "[--hang]", NULL }; - SDLTest_CommonLogUsage(state, argv[0], options); - SDLTest_CommonQuit(state); - return 1; - } - i += consumed; - } - - if(!SDLTest_CommonInit(state)) - { - SDLTest_CommonQuit(state); - return 1; - } - - /* infinite loop to hang the process */ - while(hang) - SDL_Delay(10); - - /* dereference NULL pointer to crash process */ - if(crash) - { - int* p = NULL; - *p = 5; - } - - /* event loop */ - done = 0; - while(!done) - { - while(SDL_PollEvent(&event)) - SDLTest_CommonEvent(state, &event, &done); - SDL_Delay(10); - } - - return exit_code; -} diff --git a/visualtest/unittest/testquit.config b/visualtest/unittest/testquit.config deleted file mode 100644 index 756dec8ac1..0000000000 --- a/visualtest/unittest/testquit.config +++ /dev/null @@ -1,5 +0,0 @@ -sutconfig=testquit.parameters -action-config=testquit.actions -variator=exhaustive -sutapp=testquit -timeout=00:00:10 \ No newline at end of file diff --git a/visualtest/unittest/testquit.parameters b/visualtest/unittest/testquit.parameters deleted file mode 100644 index 6e5887ce57..0000000000 --- a/visualtest/unittest/testquit.parameters +++ /dev/null @@ -1,3 +0,0 @@ ---exit-code, integer, [-1 1], false, [] # The exit code returned by the executable ---crash, boolean, [], false, [] # Crashes the SUT executable ---hang, boolean, [], false, [] # Runs the SUT in the infinite loop and ignores all events \ No newline at end of file From 63243eb3a535bc8e943e4568faa63dd947f7aef4 Mon Sep 17 00:00:00 2001 From: Ozkan Sezer Date: Tue, 22 Nov 2022 18:50:00 +0300 Subject: [PATCH 105/153] removed pandora support --- Makefile.pandora | 64 -- docs/README-pandora.md | 17 - docs/README.md | 1 - include/SDL_config_pandora.h | 141 ---- src/render/opengles/SDL_render_gles.c | 14 - src/render/opengles2/SDL_render_gles2.c | 2 - src/video/SDL_video.c | 3 - src/video/pandora/SDL_pandora.c | 833 ------------------------ src/video/pandora/SDL_pandora.h | 100 --- src/video/pandora/SDL_pandora_events.c | 38 -- src/video/pandora/SDL_pandora_events.h | 25 - test/testgl2.c | 2 - test/testgles2.c | 2 - test/testgles2_sdf.c | 2 - 14 files changed, 1244 deletions(-) delete mode 100644 Makefile.pandora delete mode 100644 docs/README-pandora.md delete mode 100644 include/SDL_config_pandora.h delete mode 100644 src/video/pandora/SDL_pandora.c delete mode 100644 src/video/pandora/SDL_pandora.h delete mode 100644 src/video/pandora/SDL_pandora_events.c delete mode 100644 src/video/pandora/SDL_pandora_events.h diff --git a/Makefile.pandora b/Makefile.pandora deleted file mode 100644 index 4e6465eb58..0000000000 --- a/Makefile.pandora +++ /dev/null @@ -1,64 +0,0 @@ -# Makefile to build the pandora SDL library - -AR = arm-none-linux-gnueabi-ar -RANLIB = arm-none-linux-gnueabi-ranlib -CC = arm-none-linux-gnueabi-gcc -CXX = arm-none-linux-gnueabi-g++ -STRIP = arm-none-linux-gnueabi-strip - -CFLAGS = -O3 -march=armv7-a -mcpu=cortex-a8 -mtune=cortex-a8 -mfloat-abi=softfp \ - -mfpu=neon -ftree-vectorize -ffast-math -fomit-frame-pointer -fno-strict-aliasing -fsingle-precision-constant \ - -I./include -I$(PNDSDK)/usr/include - -TARGET = libSDL3.a - -SOURCES = - ./src/*.c \ - ./src/atomic/*.c \ - ./src/audio/*.c \ - ./src/audio/disk/*.c \ - ./src/audio/dsp/*.c \ - ./src/audio/dummy/*.c \ - ./src/cpuinfo/*.c \ - ./src/events/*.c \ - ./src/file/*.c \ - ./src/filesystem/unix/*.c \ - ./src/haptic/*.c \ - ./src/haptic/linux/*.c \ - ./src/hidapi/*.c \ - ./src/joystick/*.c \ - ./src/joystick/linux/*.c \ - ./src/loadso/dlopen/*.c \ - ./src/locale/*.c \ - ./src/locale/unix/*.c \ - ./src/misc/*.c \ - ./src/misc/unix/*.c \ - ./src/power/*.c \ - ./src/sensor/*.c \ - ./src/sensor/dummy/*.c \ - ./src/stdlib/*.c \ - ./src/thread/*.c \ - ./src/thread/pthread/SDL_syscond.c \ - ./src/thread/pthread/SDL_sysmutex.c \ - ./src/thread/pthread/SDL_syssem.c \ - ./src/thread/pthread/SDL_systhread.c \ - ./src/timer/*.c \ - ./src/timer/unix/*.c \ - ./src/video/*.c \ - ./src/video/yuv2rgb/*.c \ - ./src/video/dummy/*.c \ - ./src/video/x11/*.c \ - ./src/video/pandora/*.c - -OBJECTS = $(shell echo $(SOURCES) | sed -e 's,\.c,\.o,g') - -CONFIG_H = $(shell cp include/SDL_config_pandora.h include/SDL_config.h) - -all: $(TARGET) - -$(TARGET): $(CONFIG_H) $(OBJECTS) - $(AR) crv $@ $^ - $(RANLIB) $@ - -clean: - rm -f $(TARGET) $(OBJECTS) diff --git a/docs/README-pandora.md b/docs/README-pandora.md deleted file mode 100644 index a0277634b5..0000000000 --- a/docs/README-pandora.md +++ /dev/null @@ -1,17 +0,0 @@ -Pandora -===================================================================== - -( http://openpandora.org/ ) -- A pandora specific video driver was written to allow SDL 2.0 with OpenGL ES -support to work on the pandora under the framebuffer. This driver do not have -input support for now, so if you use it you will have to add your own control code. -The video driver name is "pandora" so if you have problem running it from -the framebuffer, try to set the following variable before starting your application : -"export SDL_VIDEODRIVER=pandora" - -- OpenGL ES support was added to the x11 driver, so it's working like the normal -x11 driver one with OpenGLX support, with SDL input event's etc.. - - -David Carré (Cpasjuste) -cpasjuste@gmail.com diff --git a/docs/README.md b/docs/README.md index 6813f75fb3..7666060c91 100644 --- a/docs/README.md +++ b/docs/README.md @@ -36,7 +36,6 @@ More documentation and FAQs are available online at [the wiki](http://wiki.libsd - [macOS](README-macos.md) - [OS/2](README-os2.md) - [Native Client](README-nacl.md) -- [Pandora](README-pandora.md) - [Supported Platforms](README-platforms.md) - [Porting information](README-porting.md) - [PSP](README-psp.md) diff --git a/include/SDL_config_pandora.h b/include/SDL_config_pandora.h deleted file mode 100644 index 01bbf49b06..0000000000 --- a/include/SDL_config_pandora.h +++ /dev/null @@ -1,141 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef SDL_config_pandora_h_ -#define SDL_config_pandora_h_ -#define SDL_config_h_ - -/* This is a set of defines to configure the SDL features */ - -/* General platform specific identifiers */ -#include "SDL_platform.h" - -#ifdef __LP64__ -#define SIZEOF_VOIDP 8 -#else -#define SIZEOF_VOIDP 4 -#endif - -#define SDL_BYTEORDER 1234 - -#define STDC_HEADERS 1 -#define HAVE_ALLOCA_H 1 -#define HAVE_CTYPE_H 1 -#define HAVE_ICONV_H 1 -#define HAVE_INTTYPES_H 1 -#define HAVE_LIMITS_H 1 -#define HAVE_MALLOC_H 1 -#define HAVE_MATH_H 1 -#define HAVE_MEMORY_H 1 -#define HAVE_SIGNAL_H 1 -#define HAVE_STDARG_H 1 -#define HAVE_STDINT_H 1 -#define HAVE_STDIO_H 1 -#define HAVE_STDLIB_H 1 -#define HAVE_STRINGS_H 1 -#define HAVE_STRING_H 1 -#define HAVE_SYS_TYPES_H 1 - -#define HAVE_DLOPEN 1 -#define HAVE_MALLOC 1 -#define HAVE_CALLOC 1 -#define HAVE_REALLOC 1 -#define HAVE_FREE 1 -#define HAVE_ALLOCA 1 -#define HAVE_GETENV 1 -#define HAVE_SETENV 1 -#define HAVE_PUTENV 1 -#define HAVE_UNSETENV 1 -#define HAVE_QSORT 1 -#define HAVE_BSEARCH 1 -#define HAVE_ABS 1 -#define HAVE_BCOPY 1 -#define HAVE_MEMSET 1 -#define HAVE_MEMCPY 1 -#define HAVE_MEMMOVE 1 -#define HAVE_STRLEN 1 -#define HAVE_STRCHR 1 -#define HAVE_STRRCHR 1 -#define HAVE_STRSTR 1 -#define HAVE_STRTOL 1 -#define HAVE_STRTOUL 1 -#define HAVE_STRTOLL 1 -#define HAVE_STRTOULL 1 -#define HAVE_ATOI 1 -#define HAVE_ATOF 1 -#define HAVE_STRCMP 1 -#define HAVE_STRNCMP 1 -#define HAVE_STRCASECMP 1 -#define HAVE_STRNCASECMP 1 -#define HAVE_VSSCANF 1 -#define HAVE_VSNPRINTF 1 -#define HAVE_M_PI 1 -#define HAVE_CEIL 1 -#define HAVE_COPYSIGN 1 -#define HAVE_COS 1 -#define HAVE_COSF 1 -#define HAVE_EXP 1 -#define HAVE_FABS 1 -#define HAVE_FLOOR 1 -#define HAVE_LOG 1 -#define HAVE_LOG10 1 -#define HAVE_LROUND 1 -#define HAVE_LROUNDF 1 -#define HAVE_ROUND 1 -#define HAVE_ROUNDF 1 -#define HAVE_SCALBN 1 -#define HAVE_SIN 1 -#define HAVE_SINF 1 -#define HAVE_SQRT 1 -#define HAVE_SQRTF 1 -#define HAVE_TAN 1 -#define HAVE_TANF 1 -#define HAVE_TRUNC 1 -#define HAVE_TRUNCF 1 -#define HAVE_SIGACTION 1 -#define HAVE_SETJMP 1 -#define HAVE_NANOSLEEP 1 - -#define SDL_AUDIO_DRIVER_DUMMY 1 -#define SDL_AUDIO_DRIVER_OSS 1 - -#define SDL_INPUT_LINUXEV 1 -#define SDL_JOYSTICK_LINUX 1 -#define SDL_JOYSTICK_VIRTUAL 1 -#define SDL_HAPTIC_LINUX 1 - -#define SDL_SENSOR_DUMMY 1 - -#define SDL_LOADSO_DLOPEN 1 - -#define SDL_THREAD_PTHREAD 1 -#define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP 1 - -#define SDL_TIMER_UNIX 1 -#define SDL_FILESYSTEM_UNIX 1 - -#define SDL_VIDEO_DRIVER_DUMMY 1 -#define SDL_VIDEO_DRIVER_X11 1 -#define SDL_VIDEO_DRIVER_PANDORA 1 -#define SDL_VIDEO_RENDER_OGL_ES 1 -#define SDL_VIDEO_OPENGL_ES 1 - -#endif /* SDL_config_pandora_h_ */ diff --git a/src/render/opengles/SDL_render_gles.c b/src/render/opengles/SDL_render_gles.c index ba08a46e28..8e918c6655 100644 --- a/src/render/opengles/SDL_render_gles.c +++ b/src/render/opengles/SDL_render_gles.c @@ -35,18 +35,6 @@ #define RENDERER_CONTEXT_MAJOR 1 #define RENDERER_CONTEXT_MINOR 1 -#if defined(SDL_VIDEO_DRIVER_PANDORA) - -/* Empty function stub to get OpenGL ES 1.x support without */ -/* OpenGL ES extension GL_OES_draw_texture supported */ -GL_API void GL_APIENTRY -glDrawTexiOES(GLint x, GLint y, GLint z, GLint width, GLint height) -{ - return; -} - -#endif /* SDL_VIDEO_DRIVER_PANDORA */ - /* OpenGL ES 1.1 renderer implementation, based on the OpenGL renderer */ /* Used to re-create the window with OpenGL ES capability */ @@ -154,8 +142,6 @@ static int GLES_LoadFunctions(GLES_RenderData * data) #define __SDL_NOGETPROCADDR__ #elif SDL_VIDEO_DRIVER_ANDROID #define __SDL_NOGETPROCADDR__ -#elif SDL_VIDEO_DRIVER_PANDORA -#define __SDL_NOGETPROCADDR__ #endif #ifdef __SDL_NOGETPROCADDR__ diff --git a/src/render/opengles2/SDL_render_gles2.c b/src/render/opengles2/SDL_render_gles2.c index 41bf300f4b..da48e4d6e9 100644 --- a/src/render/opengles2/SDL_render_gles2.c +++ b/src/render/opengles2/SDL_render_gles2.c @@ -249,8 +249,6 @@ static int GLES2_LoadFunctions(GLES2_RenderData * data) #define __SDL_NOGETPROCADDR__ #elif SDL_VIDEO_DRIVER_ANDROID #define __SDL_NOGETPROCADDR__ -#elif SDL_VIDEO_DRIVER_PANDORA -#define __SDL_NOGETPROCADDR__ #endif #if defined __SDL_NOGETPROCADDR__ diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c index 0804c9cfbf..064276cb11 100644 --- a/src/video/SDL_video.c +++ b/src/video/SDL_video.c @@ -89,9 +89,6 @@ static VideoBootStrap *bootstrap[] = { #if SDL_VIDEO_DRIVER_HAIKU &HAIKU_bootstrap, #endif -#if SDL_VIDEO_DRIVER_PANDORA - &PND_bootstrap, -#endif #if SDL_VIDEO_DRIVER_UIKIT &UIKIT_bootstrap, #endif diff --git a/src/video/pandora/SDL_pandora.c b/src/video/pandora/SDL_pandora.c deleted file mode 100644 index 834083838a..0000000000 --- a/src/video/pandora/SDL_pandora.c +++ /dev/null @@ -1,833 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ -#include "../../SDL_internal.h" - -#if SDL_VIDEO_DRIVER_PANDORA - -/* SDL internals */ -#include "../SDL_sysvideo.h" -#include "SDL_version.h" -#include "SDL_syswm.h" -#include "SDL_loadso.h" -#include "SDL_events.h" -#include "../../events/SDL_mouse_c.h" -#include "../../events/SDL_keyboard_c.h" - -/* PND declarations */ -#include "SDL_pandora.h" -#include "SDL_pandora_events.h" - -/* WIZ declarations */ -#include "GLES/gl.h" -#ifdef WIZ_GLES_LITE -static NativeWindowType hNativeWnd = 0; /* A handle to the window we will create. */ -#endif - -static int -PND_available(void) -{ - return 1; -} - -static void -PND_destroy(SDL_VideoDevice * device) -{ - if (device->driverdata != NULL) { - SDL_free(device->driverdata); - device->driverdata = NULL; - } - SDL_free(device); -} - -static SDL_VideoDevice * -PND_create() -{ - SDL_VideoDevice *device; - SDL_VideoData *phdata; - int status; - - /* Check if pandora could be initialized */ - status = PND_available(); - if (status == 0) { - /* PND could not be used */ - return NULL; - } - - /* Initialize SDL_VideoDevice structure */ - device = (SDL_VideoDevice *) SDL_calloc(1, sizeof(SDL_VideoDevice)); - if (device == NULL) { - SDL_OutOfMemory(); - return NULL; - } - - /* Initialize internal Pandora specific data */ - phdata = (SDL_VideoData *) SDL_calloc(1, sizeof(SDL_VideoData)); - if (phdata == NULL) { - SDL_OutOfMemory(); - SDL_free(device); - return NULL; - } - - device->driverdata = phdata; - - phdata->egl_initialized = SDL_TRUE; - - - /* Setup amount of available displays */ - device->num_displays = 0; - - /* Set device free function */ - device->free = PND_destroy; - - /* Setup all functions which we can handle */ - device->VideoInit = PND_videoinit; - device->VideoQuit = PND_videoquit; - device->GetDisplayModes = PND_getdisplaymodes; - device->SetDisplayMode = PND_setdisplaymode; - device->CreateSDLWindow = PND_createwindow; - device->CreateSDLWindowFrom = PND_createwindowfrom; - device->SetWindowTitle = PND_setwindowtitle; - device->SetWindowIcon = PND_setwindowicon; - device->SetWindowPosition = PND_setwindowposition; - device->SetWindowSize = PND_setwindowsize; - device->ShowWindow = PND_showwindow; - device->HideWindow = PND_hidewindow; - device->RaiseWindow = PND_raisewindow; - device->MaximizeWindow = PND_maximizewindow; - device->MinimizeWindow = PND_minimizewindow; - device->RestoreWindow = PND_restorewindow; - device->DestroyWindow = PND_destroywindow; -#if 0 - device->GetWindowWMInfo = PND_getwindowwminfo; -#endif - device->GL_LoadLibrary = PND_gl_loadlibrary; - device->GL_GetProcAddress = PND_gl_getprocaddres; - device->GL_UnloadLibrary = PND_gl_unloadlibrary; - device->GL_CreateContext = PND_gl_createcontext; - device->GL_MakeCurrent = PND_gl_makecurrent; - device->GL_SetSwapInterval = PND_gl_setswapinterval; - device->GL_GetSwapInterval = PND_gl_getswapinterval; - device->GL_SwapWindow = PND_gl_swapwindow; - device->GL_DeleteContext = PND_gl_deletecontext; - device->PumpEvents = PND_PumpEvents; - - /* !!! FIXME: implement SetWindowBordered */ - - return device; -} - -VideoBootStrap PND_bootstrap = { -#ifdef WIZ_GLES_LITE - "wiz", - "SDL Wiz Video Driver", -#else - "pandora", - "SDL Pandora Video Driver", -#endif - PND_available, - PND_create -}; - -/*****************************************************************************/ -/* SDL Video and Display initialization/handling functions */ -/*****************************************************************************/ -int -PND_videoinit(_THIS) -{ - SDL_VideoDisplay display; - SDL_DisplayMode current_mode; - - SDL_zero(current_mode); -#ifdef WIZ_GLES_LITE - current_mode.w = 320; - current_mode.h = 240; -#else - current_mode.w = 800; - current_mode.h = 480; -#endif - current_mode.refresh_rate = 60; - current_mode.format = SDL_PIXELFORMAT_RGB565; - current_mode.driverdata = NULL; - - SDL_zero(display); - display.desktop_mode = current_mode; - display.current_mode = current_mode; - display.driverdata = NULL; - - SDL_AddVideoDisplay(&display, SDL_FALSE); - - return 1; -} - -void -PND_videoquit(_THIS) -{ - -} - -void -PND_getdisplaymodes(_THIS, SDL_VideoDisplay * display) -{ - -} - -int -PND_setdisplaymode(_THIS, SDL_VideoDisplay * display, SDL_DisplayMode * mode) -{ - return 0; -} - -int -PND_createwindow(_THIS, SDL_Window * window) -{ - SDL_VideoData *phdata = (SDL_VideoData *) _this->driverdata; - - SDL_WindowData *wdata; - - /* Allocate window internal data */ - wdata = (SDL_WindowData *) SDL_calloc(1, sizeof(SDL_WindowData)); - if (wdata == NULL) { - return SDL_OutOfMemory(); - } - - /* Setup driver data for this window */ - window->driverdata = wdata; - - /* Check if window must support OpenGL ES rendering */ - if ((window->flags & SDL_WINDOW_OPENGL) == SDL_WINDOW_OPENGL) { - - EGLBoolean initstatus; - - /* Mark this window as OpenGL ES compatible */ - wdata->uses_gles = SDL_TRUE; - - /* Create connection to OpenGL ES */ - if (phdata->egl_display == EGL_NO_DISPLAY) { - phdata->egl_display = eglGetDisplay((NativeDisplayType) 0); - if (phdata->egl_display == EGL_NO_DISPLAY) { - return SDL_SetError("PND: Can't get connection to OpenGL ES"); - } - - initstatus = eglInitialize(phdata->egl_display, NULL, NULL); - if (initstatus != EGL_TRUE) { - return SDL_SetError("PND: Can't init OpenGL ES library"); - } - } - - phdata->egl_refcount++; - } - - /* Window has been successfully created */ - return 0; -} - -int -PND_createwindowfrom(_THIS, SDL_Window * window, const void *data) -{ - return -1; -} - -void -PND_setwindowtitle(_THIS, SDL_Window * window) -{ -} -void -PND_setwindowicon(_THIS, SDL_Window * window, SDL_Surface * icon) -{ -} -void -PND_setwindowposition(_THIS, SDL_Window * window) -{ -} -void -PND_setwindowsize(_THIS, SDL_Window * window) -{ -} -void -PND_showwindow(_THIS, SDL_Window * window) -{ -} -void -PND_hidewindow(_THIS, SDL_Window * window) -{ -} -void -PND_raisewindow(_THIS, SDL_Window * window) -{ -} -void -PND_maximizewindow(_THIS, SDL_Window * window) -{ -} -void -PND_minimizewindow(_THIS, SDL_Window * window) -{ -} -void -PND_restorewindow(_THIS, SDL_Window * window) -{ -} -void -PND_destroywindow(_THIS, SDL_Window * window) -{ - SDL_VideoData *phdata = (SDL_VideoData *) _this->driverdata; - eglTerminate(phdata->egl_display); -} - -/*****************************************************************************/ -/* SDL Window Manager function */ -/*****************************************************************************/ -#if 0 -SDL_bool -PND_getwindowwminfo(_THIS, SDL_Window * window, struct SDL_SysWMinfo *info) -{ - if (info->version.major <= SDL_MAJOR_VERSION) { - return SDL_TRUE; - } else { - SDL_SetError("application not compiled with SDL %d", - SDL_MAJOR_VERSION); - return SDL_FALSE; - } - - /* Failed to get window manager information */ - return SDL_FALSE; -} -#endif - -/*****************************************************************************/ -/* SDL OpenGL/OpenGL ES functions */ -/*****************************************************************************/ -int -PND_gl_loadlibrary(_THIS, const char *path) -{ - /* Check if OpenGL ES library is specified for GF driver */ - if (path == NULL) { - path = SDL_getenv("SDL_OPENGL_LIBRARY"); - if (path == NULL) { - path = SDL_getenv("SDL_OPENGLES_LIBRARY"); - } - } - - /* Check if default library loading requested */ - if (path == NULL) { - /* Already linked with GF library which provides egl* subset of */ - /* functions, use Common profile of OpenGL ES library by default */ -#ifdef WIZ_GLES_LITE - path = "/lib/libopengles_lite.so"; -#else - path = "/usr/lib/libGLES_CM.so"; -#endif - } - - /* Load dynamic library */ - _this->gl_config.dll_handle = SDL_LoadObject(path); - if (!_this->gl_config.dll_handle) { - /* Failed to load new GL ES library */ - return SDL_SetError("PND: Failed to locate OpenGL ES library"); - } - - /* Store OpenGL ES library path and name */ - SDL_strlcpy(_this->gl_config.driver_path, path, - SDL_arraysize(_this->gl_config.driver_path)); - - /* New OpenGL ES library is loaded */ - return 0; -} - -void * -PND_gl_getprocaddres(_THIS, const char *proc) -{ - void *function_address; - - /* Try to get function address through the egl interface */ - function_address = eglGetProcAddress(proc); - if (function_address != NULL) { - return function_address; - } - - /* Then try to get function in the OpenGL ES library */ - if (_this->gl_config.dll_handle) { - function_address = - SDL_LoadFunction(_this->gl_config.dll_handle, proc); - if (function_address != NULL) { - return function_address; - } - } - - /* Failed to get GL ES function address pointer */ - SDL_SetError("PND: Cannot locate OpenGL ES function name"); - return NULL; -} - -void -PND_gl_unloadlibrary(_THIS) -{ - SDL_VideoData *phdata = (SDL_VideoData *) _this->driverdata; - - if (phdata->egl_initialized == SDL_TRUE) { - /* Unload OpenGL ES library */ - if (_this->gl_config.dll_handle) { - SDL_UnloadObject(_this->gl_config.dll_handle); - _this->gl_config.dll_handle = NULL; - } - } else { - SDL_SetError("PND: GF initialization failed, no OpenGL ES support"); - } -} - -SDL_GLContext -PND_gl_createcontext(_THIS, SDL_Window * window) -{ - SDL_VideoData *phdata = (SDL_VideoData *) _this->driverdata; - SDL_WindowData *wdata = (SDL_WindowData *) window->driverdata; - EGLBoolean status; - EGLint configs; - uint32_t attr_pos; - EGLint attr_value; - EGLint cit; - - /* Check if EGL was initialized */ - if (phdata->egl_initialized != SDL_TRUE) { - SDL_SetError("PND: EGL initialization failed, no OpenGL ES support"); - return NULL; - } - - /* Prepare attributes list to pass them to OpenGL ES */ - attr_pos = 0; - wdata->gles_attributes[attr_pos++] = EGL_SURFACE_TYPE; - wdata->gles_attributes[attr_pos++] = EGL_WINDOW_BIT; - wdata->gles_attributes[attr_pos++] = EGL_RED_SIZE; - wdata->gles_attributes[attr_pos++] = _this->gl_config.red_size; - wdata->gles_attributes[attr_pos++] = EGL_GREEN_SIZE; - wdata->gles_attributes[attr_pos++] = _this->gl_config.green_size; - wdata->gles_attributes[attr_pos++] = EGL_BLUE_SIZE; - wdata->gles_attributes[attr_pos++] = _this->gl_config.blue_size; - wdata->gles_attributes[attr_pos++] = EGL_ALPHA_SIZE; - - /* Setup alpha size in bits */ - if (_this->gl_config.alpha_size) { - wdata->gles_attributes[attr_pos++] = _this->gl_config.alpha_size; - } else { - wdata->gles_attributes[attr_pos++] = EGL_DONT_CARE; - } - - /* Setup color buffer size */ - if (_this->gl_config.buffer_size) { - wdata->gles_attributes[attr_pos++] = EGL_BUFFER_SIZE; - wdata->gles_attributes[attr_pos++] = _this->gl_config.buffer_size; - } else { - wdata->gles_attributes[attr_pos++] = EGL_BUFFER_SIZE; - wdata->gles_attributes[attr_pos++] = EGL_DONT_CARE; - } - - /* Setup depth buffer bits */ - wdata->gles_attributes[attr_pos++] = EGL_DEPTH_SIZE; - wdata->gles_attributes[attr_pos++] = _this->gl_config.depth_size; - - /* Setup stencil bits */ - if (_this->gl_config.stencil_size) { - wdata->gles_attributes[attr_pos++] = EGL_STENCIL_SIZE; - wdata->gles_attributes[attr_pos++] = _this->gl_config.buffer_size; - } else { - wdata->gles_attributes[attr_pos++] = EGL_STENCIL_SIZE; - wdata->gles_attributes[attr_pos++] = EGL_DONT_CARE; - } - - /* Set number of samples in multisampling */ - if (_this->gl_config.multisamplesamples) { - wdata->gles_attributes[attr_pos++] = EGL_SAMPLES; - wdata->gles_attributes[attr_pos++] = - _this->gl_config.multisamplesamples; - } - - /* Multisample buffers, OpenGL ES 1.0 spec defines 0 or 1 buffer */ - if (_this->gl_config.multisamplebuffers) { - wdata->gles_attributes[attr_pos++] = EGL_SAMPLE_BUFFERS; - wdata->gles_attributes[attr_pos++] = - _this->gl_config.multisamplebuffers; - } - - /* Finish attributes list */ - wdata->gles_attributes[attr_pos] = EGL_NONE; - - /* Request first suitable framebuffer configuration */ - status = eglChooseConfig(phdata->egl_display, wdata->gles_attributes, - wdata->gles_configs, 1, &configs); - if (status != EGL_TRUE) { - SDL_SetError("PND: Can't find closest configuration for OpenGL ES"); - return NULL; - } - - /* Check if nothing has been found, try "don't care" settings */ - if (configs == 0) { - int32_t it; - int32_t jt; - GLint depthbits[4] = { 32, 24, 16, EGL_DONT_CARE }; - - for (it = 0; it < 4; it++) { - for (jt = 16; jt >= 0; jt--) { - /* Don't care about color buffer bits, use what exist */ - /* Replace previous set data with EGL_DONT_CARE */ - attr_pos = 0; - wdata->gles_attributes[attr_pos++] = EGL_SURFACE_TYPE; - wdata->gles_attributes[attr_pos++] = EGL_WINDOW_BIT; - wdata->gles_attributes[attr_pos++] = EGL_RED_SIZE; - wdata->gles_attributes[attr_pos++] = EGL_DONT_CARE; - wdata->gles_attributes[attr_pos++] = EGL_GREEN_SIZE; - wdata->gles_attributes[attr_pos++] = EGL_DONT_CARE; - wdata->gles_attributes[attr_pos++] = EGL_BLUE_SIZE; - wdata->gles_attributes[attr_pos++] = EGL_DONT_CARE; - wdata->gles_attributes[attr_pos++] = EGL_ALPHA_SIZE; - wdata->gles_attributes[attr_pos++] = EGL_DONT_CARE; - wdata->gles_attributes[attr_pos++] = EGL_BUFFER_SIZE; - wdata->gles_attributes[attr_pos++] = EGL_DONT_CARE; - - /* Try to find requested or smallest depth */ - if (_this->gl_config.depth_size) { - wdata->gles_attributes[attr_pos++] = EGL_DEPTH_SIZE; - wdata->gles_attributes[attr_pos++] = depthbits[it]; - } else { - wdata->gles_attributes[attr_pos++] = EGL_DEPTH_SIZE; - wdata->gles_attributes[attr_pos++] = EGL_DONT_CARE; - } - - if (_this->gl_config.stencil_size) { - wdata->gles_attributes[attr_pos++] = EGL_STENCIL_SIZE; - wdata->gles_attributes[attr_pos++] = jt; - } else { - wdata->gles_attributes[attr_pos++] = EGL_STENCIL_SIZE; - wdata->gles_attributes[attr_pos++] = EGL_DONT_CARE; - } - - wdata->gles_attributes[attr_pos++] = EGL_SAMPLES; - wdata->gles_attributes[attr_pos++] = EGL_DONT_CARE; - wdata->gles_attributes[attr_pos++] = EGL_SAMPLE_BUFFERS; - wdata->gles_attributes[attr_pos++] = EGL_DONT_CARE; - wdata->gles_attributes[attr_pos] = EGL_NONE; - - /* Request first suitable framebuffer configuration */ - status = - eglChooseConfig(phdata->egl_display, - wdata->gles_attributes, - wdata->gles_configs, 1, &configs); - - if (status != EGL_TRUE) { - SDL_SetError - ("PND: Can't find closest configuration for OpenGL ES"); - return NULL; - } - if (configs != 0) { - break; - } - } - if (configs != 0) { - break; - } - } - - /* No available configs */ - if (configs == 0) { - SDL_SetError("PND: Can't find any configuration for OpenGL ES"); - return NULL; - } - } - - /* Initialize config index */ - wdata->gles_config = 0; - - /* Now check each configuration to find out the best */ - for (cit = 0; cit < configs; cit++) { - uint32_t stencil_found; - uint32_t depth_found; - - stencil_found = 0; - depth_found = 0; - - if (_this->gl_config.stencil_size) { - status = - eglGetConfigAttrib(phdata->egl_display, - wdata->gles_configs[cit], EGL_STENCIL_SIZE, - &attr_value); - if (status == EGL_TRUE) { - if (attr_value != 0) { - stencil_found = 1; - } - } - } else { - stencil_found = 1; - } - - if (_this->gl_config.depth_size) { - status = - eglGetConfigAttrib(phdata->egl_display, - wdata->gles_configs[cit], EGL_DEPTH_SIZE, - &attr_value); - if (status == EGL_TRUE) { - if (attr_value != 0) { - depth_found = 1; - } - } - } else { - depth_found = 1; - } - - /* Exit from loop if found appropriate configuration */ - if ((depth_found != 0) && (stencil_found != 0)) { - break; - } - } - - /* If best could not be found, use first */ - if (cit == configs) { - cit = 0; - } - wdata->gles_config = cit; - - /* Create OpenGL ES context */ - wdata->gles_context = - eglCreateContext(phdata->egl_display, - wdata->gles_configs[wdata->gles_config], NULL, NULL); - if (wdata->gles_context == EGL_NO_CONTEXT) { - SDL_SetError("PND: OpenGL ES context creation has been failed"); - return NULL; - } - -#ifdef WIZ_GLES_LITE - if( !hNativeWnd ) { - hNativeWnd = (NativeWindowType)SDL_malloc(16*1024); - - if(!hNativeWnd) - printf( "Error: Wiz framebuffer allocatation failed\n" ); - else - printf( "SDL: Wiz framebuffer allocated: %X\n", hNativeWnd ); - } - else { - printf( "SDL: Wiz framebuffer already allocated: %X\n", hNativeWnd ); - } - - wdata->gles_surface = - eglCreateWindowSurface(phdata->egl_display, - wdata->gles_configs[wdata->gles_config], - hNativeWnd, NULL ); -#else - wdata->gles_surface = - eglCreateWindowSurface(phdata->egl_display, - wdata->gles_configs[wdata->gles_config], - (NativeWindowType) 0, NULL); -#endif - - - if (wdata->gles_surface == 0) { - SDL_SetError("Error : eglCreateWindowSurface failed;"); - return NULL; - } - - /* Make just created context current */ - status = - eglMakeCurrent(phdata->egl_display, wdata->gles_surface, - wdata->gles_surface, wdata->gles_context); - if (status != EGL_TRUE) { - /* Destroy OpenGL ES surface */ - eglDestroySurface(phdata->egl_display, wdata->gles_surface); - eglDestroyContext(phdata->egl_display, wdata->gles_context); - wdata->gles_context = EGL_NO_CONTEXT; - SDL_SetError("PND: Can't set OpenGL ES context on creation"); - return NULL; - } - - _this->gl_config.accelerated = 1; - - /* Always clear stereo enable, since OpenGL ES do not supports stereo */ - _this->gl_config.stereo = 0; - - /* Get back samples and samplebuffers configurations. Rest framebuffer */ - /* parameters could be obtained through the OpenGL ES API */ - status = - eglGetConfigAttrib(phdata->egl_display, - wdata->gles_configs[wdata->gles_config], - EGL_SAMPLES, &attr_value); - if (status == EGL_TRUE) { - _this->gl_config.multisamplesamples = attr_value; - } - status = - eglGetConfigAttrib(phdata->egl_display, - wdata->gles_configs[wdata->gles_config], - EGL_SAMPLE_BUFFERS, &attr_value); - if (status == EGL_TRUE) { - _this->gl_config.multisamplebuffers = attr_value; - } - - /* Get back stencil and depth buffer sizes */ - status = - eglGetConfigAttrib(phdata->egl_display, - wdata->gles_configs[wdata->gles_config], - EGL_DEPTH_SIZE, &attr_value); - if (status == EGL_TRUE) { - _this->gl_config.depth_size = attr_value; - } - status = - eglGetConfigAttrib(phdata->egl_display, - wdata->gles_configs[wdata->gles_config], - EGL_STENCIL_SIZE, &attr_value); - if (status == EGL_TRUE) { - _this->gl_config.stencil_size = attr_value; - } - - /* Under PND OpenGL ES output can't be double buffered */ - _this->gl_config.double_buffer = 0; - - /* GL ES context was successfully created */ - return wdata->gles_context; -} - -int -PND_gl_makecurrent(_THIS, SDL_Window * window, SDL_GLContext context) -{ - SDL_VideoData *phdata = (SDL_VideoData *) _this->driverdata; - SDL_WindowData *wdata; - EGLBoolean status; - - if (phdata->egl_initialized != SDL_TRUE) { - return SDL_SetError("PND: GF initialization failed, no OpenGL ES support"); - } - - if ((window == NULL) && (context == NULL)) { - status = - eglMakeCurrent(phdata->egl_display, EGL_NO_SURFACE, - EGL_NO_SURFACE, EGL_NO_CONTEXT); - if (status != EGL_TRUE) { - /* Failed to set current GL ES context */ - return SDL_SetError("PND: Can't set OpenGL ES context"); - } - } else { - wdata = (SDL_WindowData *) window->driverdata; - if (wdata->gles_surface == EGL_NO_SURFACE) { - return SDL_SetError - ("PND: OpenGL ES surface is not initialized for this window"); - } - if (wdata->gles_context == EGL_NO_CONTEXT) { - return SDL_SetError - ("PND: OpenGL ES context is not initialized for this window"); - } - if (wdata->gles_context != context) { - return SDL_SetError - ("PND: OpenGL ES context is not belong to this window"); - } - status = - eglMakeCurrent(phdata->egl_display, wdata->gles_surface, - wdata->gles_surface, wdata->gles_context); - if (status != EGL_TRUE) { - /* Failed to set current GL ES context */ - return SDL_SetError("PND: Can't set OpenGL ES context"); - } - } - return 0; -} - -int -PND_gl_setswapinterval(_THIS, int interval) -{ - SDL_VideoData *phdata = (SDL_VideoData *) _this->driverdata; - EGLBoolean status; - - if (phdata->egl_initialized != SDL_TRUE) { - return SDL_SetError("PND: EGL initialization failed, no OpenGL ES support"); - } - - /* Check if OpenGL ES connection has been initialized */ - if (phdata->egl_display != EGL_NO_DISPLAY) { - /* Set swap OpenGL ES interval */ - status = eglSwapInterval(phdata->egl_display, interval); - if (status == EGL_TRUE) { - /* Return success to upper level */ - phdata->swapinterval = interval; - return 0; - } - } - - /* Failed to set swap interval */ - return SDL_SetError("PND: Cannot set swap interval"); -} - -int -PND_gl_getswapinterval(_THIS) -{ - return ((SDL_VideoData *) _this->driverdata)->swapinterval; -} - -int -PND_gl_swapwindow(_THIS, SDL_Window * window) -{ - SDL_VideoData *phdata = (SDL_VideoData *) _this->driverdata; - SDL_WindowData *wdata = (SDL_WindowData *) window->driverdata; - - if (phdata->egl_initialized != SDL_TRUE) { - return SDL_SetError("PND: GLES initialization failed, no OpenGL ES support"); - } - - /* Many applications do not uses glFinish(), so we call it for them */ - glFinish(); - - /* Wait until OpenGL ES rendering is completed */ - eglWaitGL(); - - eglSwapBuffers(phdata->egl_display, wdata->gles_surface); - return 0; -} - -void -PND_gl_deletecontext(_THIS, SDL_GLContext context) -{ - SDL_VideoData *phdata = (SDL_VideoData *) _this->driverdata; - EGLBoolean status; - - if (phdata->egl_initialized != SDL_TRUE) { - SDL_SetError("PND: GLES initialization failed, no OpenGL ES support"); - return; - } - - /* Check if OpenGL ES connection has been initialized */ - if (phdata->egl_display != EGL_NO_DISPLAY) { - if (context != EGL_NO_CONTEXT) { - status = eglDestroyContext(phdata->egl_display, context); - if (status != EGL_TRUE) { - /* Error during OpenGL ES context destroying */ - SDL_SetError("PND: OpenGL ES context destroy error"); - return; - } - } - } - -#ifdef WIZ_GLES_LITE - if( hNativeWnd != 0 ) - { - SDL_free(hNativeWnd); - hNativeWnd = 0; - printf( "SDL: Wiz framebuffer released\n" ); - } -#endif - - return; -} - -#endif /* SDL_VIDEO_DRIVER_PANDORA */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/video/pandora/SDL_pandora.h b/src/video/pandora/SDL_pandora.h deleted file mode 100644 index 0954cd3af9..0000000000 --- a/src/video/pandora/SDL_pandora.h +++ /dev/null @@ -1,100 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef __SDL_PANDORA_H__ -#define __SDL_PANDORA_H__ - -#include - -#include "../../SDL_internal.h" -#include "../SDL_sysvideo.h" - -typedef struct SDL_VideoData -{ - SDL_bool egl_initialized; /* OpenGL ES device initialization status */ - EGLDisplay egl_display; /* OpenGL ES display connection */ - uint32_t egl_refcount; /* OpenGL ES reference count */ - uint32_t swapinterval; /* OpenGL ES default swap interval */ - -} SDL_VideoData; - - -typedef struct SDL_DisplayData -{ - -} SDL_DisplayData; - - -typedef struct SDL_WindowData -{ - SDL_bool uses_gles; /* if true window must support OpenGL ES */ - - EGLConfig gles_configs[32]; - EGLint gles_config; /* OpenGL ES configuration index */ - EGLContext gles_context; /* OpenGL ES context */ - EGLint gles_attributes[256]; /* OpenGL ES attributes for context */ - EGLSurface gles_surface; /* OpenGL ES target rendering surface */ - -} SDL_WindowData; - - -/****************************************************************************/ -/* SDL_VideoDevice functions declaration */ -/****************************************************************************/ - -/* Display and window functions */ -int PND_videoinit(_THIS); -void PND_videoquit(_THIS); -void PND_getdisplaymodes(_THIS, SDL_VideoDisplay * display); -int PND_setdisplaymode(_THIS, SDL_VideoDisplay * display, SDL_DisplayMode * mode); -int PND_createwindow(_THIS, SDL_Window * window); -int PND_createwindowfrom(_THIS, SDL_Window * window, const void *data); -void PND_setwindowtitle(_THIS, SDL_Window * window); -void PND_setwindowicon(_THIS, SDL_Window * window, SDL_Surface * icon); -void PND_setwindowposition(_THIS, SDL_Window * window); -void PND_setwindowsize(_THIS, SDL_Window * window); -void PND_showwindow(_THIS, SDL_Window * window); -void PND_hidewindow(_THIS, SDL_Window * window); -void PND_raisewindow(_THIS, SDL_Window * window); -void PND_maximizewindow(_THIS, SDL_Window * window); -void PND_minimizewindow(_THIS, SDL_Window * window); -void PND_restorewindow(_THIS, SDL_Window * window); -void PND_destroywindow(_THIS, SDL_Window * window); - -/* Window manager function */ -SDL_bool PND_getwindowwminfo(_THIS, SDL_Window * window, - struct SDL_SysWMinfo *info); - -/* OpenGL/OpenGL ES functions */ -int PND_gl_loadlibrary(_THIS, const char *path); -void *PND_gl_getprocaddres(_THIS, const char *proc); -void PND_gl_unloadlibrary(_THIS); -SDL_GLContext PND_gl_createcontext(_THIS, SDL_Window * window); -int PND_gl_makecurrent(_THIS, SDL_Window * window, SDL_GLContext context); -int PND_gl_setswapinterval(_THIS, int interval); -int PND_gl_getswapinterval(_THIS); -int PND_gl_swapwindow(_THIS, SDL_Window * window); -void PND_gl_deletecontext(_THIS, SDL_GLContext context); - - -#endif /* __SDL_PANDORA_H__ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/video/pandora/SDL_pandora_events.c b/src/video/pandora/SDL_pandora_events.c deleted file mode 100644 index ab077d5dd8..0000000000 --- a/src/video/pandora/SDL_pandora_events.c +++ /dev/null @@ -1,38 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ -#include "../../SDL_internal.h" - -#if SDL_VIDEO_DRIVER_PANDORA - -/* Being a null driver, there's no event stream. We just define stubs for - most of the API. */ - -#include "../../events/SDL_events_c.h" - -void -PND_PumpEvents(_THIS) -{ - /* Not implemented. */ -} - -#endif /* SDL_VIDEO_DRIVER_PANDORA */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/video/pandora/SDL_pandora_events.h b/src/video/pandora/SDL_pandora_events.h deleted file mode 100644 index 8ad8e355dc..0000000000 --- a/src/video/pandora/SDL_pandora_events.h +++ /dev/null @@ -1,25 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ -#include "../../SDL_internal.h" - -extern void PND_PumpEvents(_THIS); - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/test/testgl2.c b/test/testgl2.c index f259ddc93b..4f1f857aef 100644 --- a/test/testgl2.c +++ b/test/testgl2.c @@ -45,8 +45,6 @@ static int LoadContext(GL_Context * data) #define __SDL_NOGETPROCADDR__ #elif SDL_VIDEO_DRIVER_ANDROID #define __SDL_NOGETPROCADDR__ -#elif SDL_VIDEO_DRIVER_PANDORA -#define __SDL_NOGETPROCADDR__ #endif #if defined __SDL_NOGETPROCADDR__ diff --git a/test/testgles2.c b/test/testgles2.c index 903f7a8227..39a10869f3 100644 --- a/test/testgles2.c +++ b/test/testgles2.c @@ -69,8 +69,6 @@ static int LoadContext(GLES2_Context * data) #define __SDL_NOGETPROCADDR__ #elif SDL_VIDEO_DRIVER_ANDROID #define __SDL_NOGETPROCADDR__ -#elif SDL_VIDEO_DRIVER_PANDORA -#define __SDL_NOGETPROCADDR__ #endif #if defined __SDL_NOGETPROCADDR__ diff --git a/test/testgles2_sdf.c b/test/testgles2_sdf.c index e9e79d6e62..e66c188bca 100644 --- a/test/testgles2_sdf.c +++ b/test/testgles2_sdf.c @@ -72,8 +72,6 @@ static int LoadContext(GLES2_Context * data) #define __SDL_NOGETPROCADDR__ #elif SDL_VIDEO_DRIVER_ANDROID #define __SDL_NOGETPROCADDR__ -#elif SDL_VIDEO_DRIVER_PANDORA -#define __SDL_NOGETPROCADDR__ #endif #if defined __SDL_NOGETPROCADDR__ From 01d137592cf47863176638ade668ef6a218c3053 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Tue, 22 Nov 2022 07:56:43 -0800 Subject: [PATCH 106/153] Updated SDL_VERSIONNUM macro for new SDL version convention Fixes https://github.com/libsdl-org/SDL/issues/6578 --- include/SDL_version.h | 26 ++++---------------------- 1 file changed, 4 insertions(+), 22 deletions(-) diff --git a/include/SDL_version.h b/include/SDL_version.h index 75cc891497..6b6c59ba29 100644 --- a/include/SDL_version.h +++ b/include/SDL_version.h @@ -83,44 +83,26 @@ typedef struct SDL_version (x)->patch = SDL_PATCHLEVEL; \ } -/* TODO: Remove this whole block in SDL 3 */ -#if SDL_MAJOR_VERSION <= 3 /** * This macro turns the version numbers into a numeric value: * \verbatim - (1,2,3) -> (1203) + (1,2,3) -> (0x1000203) \endverbatim - * - * This assumes that there will never be more than 100 patchlevels. - * - * In versions higher than 2.9.0, the minor version overflows into - * the thousands digit: for example, 2.23.0 is encoded as 4300, - * and 2.255.99 would be encoded as 25799. - * This macro will not be available in SDL 3.x. */ -#define SDL_VERSIONNUM(X, Y, Z) \ - ((X)*1000 + (Y)*100 + (Z)) +#define SDL_VERSIONNUM(X, Y, Z) \ + ((X) << 24 | (Y) << 8 | (Z) << 0) /** * This is the version number macro for the current SDL version. - * - * In versions higher than 2.9.0, the minor version overflows into - * the thousands digit: for example, 2.23.0 is encoded as 4300. - * This macro will not be available in SDL 3.x. - * - * Deprecated, use SDL_VERSION_ATLEAST or SDL_VERSION instead. */ #define SDL_COMPILEDVERSION \ SDL_VERSIONNUM(SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL) -#endif /* SDL_MAJOR_VERSION < 3 */ /** * This macro will evaluate to true if compiled with SDL at least X.Y.Z. */ #define SDL_VERSION_ATLEAST(X, Y, Z) \ - ((SDL_MAJOR_VERSION >= X) && \ - (SDL_MAJOR_VERSION > X || SDL_MINOR_VERSION >= Y) && \ - (SDL_MAJOR_VERSION > X || SDL_MINOR_VERSION > Y || SDL_PATCHLEVEL >= Z)) + (SDL_COMPILEDVERSION >= SDL_VERSIONUM(X, Y, Z)) /** * Get the version of SDL that is linked against your program. From 8d6fda48103caf25288f0ba67364851c7472ef09 Mon Sep 17 00:00:00 2001 From: Ozkan Sezer Date: Tue, 22 Nov 2022 19:18:47 +0300 Subject: [PATCH 107/153] removed os2 support & support for building SDL with watcom. --- .github/workflows/watcom.yml | 35 - CMakeLists.txt | 75 +- Makefile.os2 | 296 ----- Makefile.w32 | 280 ---- cmake/sdlchecks.cmake | 4 +- configure | 130 -- configure.ac | 101 -- docs/README-os2.md | 89 -- docs/README.md | 1 - include/SDL_config.h | 2 - include/SDL_config.h.cmake | 7 - include/SDL_config.h.in | 7 - include/SDL_config_os2.h | 207 --- include/SDL_config_windows.h | 15 - include/SDL_opengl.h | 7 - include/SDL_syswm.h | 23 - include/SDL_thread.h | 43 - include/begin_code.h | 11 - src/SDL.c | 19 - src/audio/SDL_audio.c | 3 - src/audio/SDL_sysaudio.h | 1 - src/audio/os2/SDL_os2audio.c | 450 ------- src/audio/os2/SDL_os2audio.h | 54 - src/core/os2/SDL_os2.c | 38 - src/core/os2/SDL_os2.h | 57 - src/core/os2/geniconv/geniconv.c | 161 --- src/core/os2/geniconv/geniconv.h | 85 -- src/core/os2/geniconv/iconv.h | 21 - src/core/os2/geniconv/makefile | 37 - src/core/os2/geniconv/os2cp.c | 416 ------ src/core/os2/geniconv/os2cp.h | 32 - src/core/os2/geniconv/os2iconv.c | 286 ---- src/core/os2/geniconv/sys2utf8.c | 119 -- src/core/os2/geniconv/test.c | 69 - src/core/os2/iconv2.lbc | 4 - src/cpuinfo/SDL_cpuinfo.c | 21 - src/dynapi/SDL3.exports | 869 ------------ src/dynapi/SDL_dynapi.c | 21 - src/dynapi/SDL_dynapi_procs.h | 4 - src/dynapi/gendynapi.pl | 4 - src/events/SDL_mouse.c | 6 - src/filesystem/os2/SDL_sysfilesystem.c | 131 -- src/hidapi/libusb/hid.c | 3 - src/joystick/SDL_joystick.c | 3 - src/joystick/SDL_sysjoystick.h | 1 - src/joystick/os2/SDL_os2joystick.c | 799 ----------- src/loadso/os2/SDL_sysloadso.c | 103 -- src/thread/SDL_thread_c.h | 2 - src/thread/os2/SDL_sysmutex.c | 129 -- src/thread/os2/SDL_syssem.c | 190 --- src/thread/os2/SDL_systhread.c | 133 -- src/thread/os2/SDL_systhread_c.h | 25 - src/thread/os2/SDL_systls.c | 89 -- src/thread/os2/SDL_systls_c.h | 38 - src/thread/windows/SDL_systhread.c | 17 - src/timer/os2/SDL_systimer.c | 186 --- src/video/SDL_sysvideo.h | 2 - src/video/SDL_video.c | 16 +- src/video/os2/SDL_gradd.h | 171 --- src/video/os2/SDL_os2dive.c | 331 ----- src/video/os2/SDL_os2messagebox.c | 561 -------- src/video/os2/SDL_os2messagebox.h | 29 - src/video/os2/SDL_os2mouse.c | 194 --- src/video/os2/SDL_os2mouse.h | 33 - src/video/os2/SDL_os2output.h | 59 - src/video/os2/SDL_os2util.c | 114 -- src/video/os2/SDL_os2util.h | 38 - src/video/os2/SDL_os2video.c | 1696 ------------------------ src/video/os2/SDL_os2video.h | 82 -- src/video/os2/SDL_os2vman.c | 483 ------- test/Makefile.in | 8 - test/Makefile.os2 | 18 - test/Makefile.w32 | 21 - test/configure | 9 - test/configure.ac | 8 - test/testnative.c | 3 - test/testnative.h | 6 - test/testnativeos2.c | 57 - test/watcom.mif | 122 -- 79 files changed, 3 insertions(+), 10017 deletions(-) delete mode 100644 .github/workflows/watcom.yml delete mode 100644 Makefile.os2 delete mode 100644 Makefile.w32 delete mode 100644 docs/README-os2.md delete mode 100644 include/SDL_config_os2.h delete mode 100644 src/audio/os2/SDL_os2audio.c delete mode 100644 src/audio/os2/SDL_os2audio.h delete mode 100644 src/core/os2/SDL_os2.c delete mode 100644 src/core/os2/SDL_os2.h delete mode 100644 src/core/os2/geniconv/geniconv.c delete mode 100644 src/core/os2/geniconv/geniconv.h delete mode 100644 src/core/os2/geniconv/iconv.h delete mode 100644 src/core/os2/geniconv/makefile delete mode 100644 src/core/os2/geniconv/os2cp.c delete mode 100644 src/core/os2/geniconv/os2cp.h delete mode 100644 src/core/os2/geniconv/os2iconv.c delete mode 100644 src/core/os2/geniconv/sys2utf8.c delete mode 100644 src/core/os2/geniconv/test.c delete mode 100644 src/core/os2/iconv2.lbc delete mode 100644 src/dynapi/SDL3.exports delete mode 100644 src/filesystem/os2/SDL_sysfilesystem.c delete mode 100644 src/joystick/os2/SDL_os2joystick.c delete mode 100644 src/loadso/os2/SDL_sysloadso.c delete mode 100644 src/thread/os2/SDL_sysmutex.c delete mode 100644 src/thread/os2/SDL_syssem.c delete mode 100644 src/thread/os2/SDL_systhread.c delete mode 100644 src/thread/os2/SDL_systhread_c.h delete mode 100644 src/thread/os2/SDL_systls.c delete mode 100644 src/thread/os2/SDL_systls_c.h delete mode 100644 src/timer/os2/SDL_systimer.c delete mode 100644 src/video/os2/SDL_gradd.h delete mode 100644 src/video/os2/SDL_os2dive.c delete mode 100644 src/video/os2/SDL_os2messagebox.c delete mode 100644 src/video/os2/SDL_os2messagebox.h delete mode 100644 src/video/os2/SDL_os2mouse.c delete mode 100644 src/video/os2/SDL_os2mouse.h delete mode 100644 src/video/os2/SDL_os2output.h delete mode 100644 src/video/os2/SDL_os2util.c delete mode 100644 src/video/os2/SDL_os2util.h delete mode 100644 src/video/os2/SDL_os2video.c delete mode 100644 src/video/os2/SDL_os2video.h delete mode 100644 src/video/os2/SDL_os2vman.c delete mode 100644 test/Makefile.os2 delete mode 100644 test/Makefile.w32 delete mode 100644 test/testnativeos2.c delete mode 100644 test/watcom.mif diff --git a/.github/workflows/watcom.yml b/.github/workflows/watcom.yml deleted file mode 100644 index 13f1505fff..0000000000 --- a/.github/workflows/watcom.yml +++ /dev/null @@ -1,35 +0,0 @@ -name: Build (OpenWatcom) - -on: [push, pull_request] - -jobs: - os2: - name: ${{ matrix.platform.name }} - runs-on: windows-latest - - strategy: - matrix: - platform: - - { name: Windows, makefile: Makefile.w32 } - - { name: OS/2, makefile: Makefile.os2 } - - steps: - - uses: actions/checkout@v3 - - uses: open-watcom/setup-watcom@v0 - - name: Build - run: | - wmake -f ${{ matrix.platform.makefile }} ENABLE_WERROR=1 - - name: Build tests - run: | - cd test && wmake -f ${{ matrix.platform.makefile }} ENABLE_WERROR=1 - cd .. - - name: Run tests - if: "matrix.platform.makefile == 'Makefile.w32'" - run: | - cd test && wmake -f ${{ matrix.platform.makefile }} check-quick - cd .. - - name: distclean - run: | - wmake -f ${{ matrix.platform.makefile }} distclean - cd test && wmake -f ${{ matrix.platform.makefile }} distclean - cd .. diff --git a/CMakeLists.txt b/CMakeLists.txt index 60a4782ae5..702d0c433f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2696,76 +2696,6 @@ elseif(PS2) ps2_drivers ) -elseif(OS2) - list(APPEND EXTRA_CFLAGS "-DOS2EMX_PLAIN_CHAR") - - file(GLOB CORE_SOURCES ${SDL3_SOURCE_DIR}/src/core/os2/*.c) - list(APPEND SOURCE_FILES ${CORE_SOURCES}) - if(NOT (HAVE_ICONV AND HAVE_ICONV_H)) - file(GLOB CORE_SOURCES ${SDL3_SOURCE_DIR}/src/core/os2/geniconv/*.c) - list(APPEND SOURCE_FILES ${CORE_SOURCES}) - endif() - - if(SDL_THREADS) - set(SDL_THREAD_OS2 1) - file(GLOB OS2_THREAD_SOURCES ${SDL3_SOURCE_DIR}/src/thread/os2/*.c) - list(APPEND SOURCE_FILES ${OS2_THREAD_SOURCES}) - set(HAVE_SDL_THREADS TRUE) - endif() - - if(SDL_TIMERS) - set(SDL_TIMER_UNIX 1) - file(GLOB OS2_TIMER_SOURCES ${SDL3_SOURCE_DIR}/src/timer/os2/*.c) - list(APPEND SOURCE_FILES ${OS2_TIMER_SOURCES}) - set(HAVE_SDL_TIMERS TRUE) - endif() - - if(SDL_LOADSO) - set(SDL_LOADSO_OS2 1) - file(GLOB OS2_LOADSO_SOURCES ${SDL3_SOURCE_DIR}/src/loadso/os2/*.c) - list(APPEND SOURCE_FILES ${OS2_LOADSO_SOURCES}) - set(HAVE_SDL_LOADSO TRUE) - endif() - - if(SDL_FILESYSTEM) - set(SDL_FILESYSTEM_OS2 1) - file(GLOB FILESYSTEM_SOURCES ${SDL3_SOURCE_DIR}/src/filesystem/os2/*.c) - list(APPEND SOURCE_FILES ${FILESYSTEM_SOURCES}) - set(HAVE_SDL_FILESYSTEM TRUE) - endif() - - if(SDL_LOCALE) - file(GLOB LOCALE_SOURCES ${SDL3_SOURCE_DIR}/src/locale/unix/*.c) - list(APPEND SOURCE_FILES ${LOCALE_SOURCES}) - set(HAVE_SDL_LOCALE TRUE) - endif() - - if(SDL_VIDEO) - set(SDL_VIDEO_DRIVER_OS2 1) - file(GLOB OS2_VIDEO_SOURCES ${SDL3_SOURCE_DIR}/src/video/os2/*.c) - list(APPEND SOURCE_FILES ${OS2_VIDEO_SOURCES}) - set(HAVE_SDL_VIDEO TRUE) - endif() - - if(SDL_AUDIO) - set(SDL_AUDIO_DRIVER_OS2 1) - file(GLOB OS2_AUDIO_SOURCES ${SDL3_SOURCE_DIR}/src/audio/os2/*.c) - list(APPEND SOURCE_FILES ${OS2_AUDIO_SOURCES}) - set(HAVE_SDL_AUDIO TRUE) - list(APPEND EXTRA_LIBS mmpm2) - endif() - - if(SDL_JOYSTICK) - set(SDL_JOYSTICK_OS2 1) - file(GLOB OS2_JOYSTICK_SOURCES ${SDL3_SOURCE_DIR}/src/joystick/os2/*.c) - list(APPEND SOURCE_FILES ${OS2_JOYSTICK_SOURCES}) - set(HAVE_SDL_JOYSTICK TRUE) - endif() - - if(SDL_HIDAPI) - CheckHIDAPI() - endif() - elseif(N3DS) file(GLOB N3DS_MAIN_SOURCES ${SDL3_SOURCE_DIR}/src/main/n3ds/*.c) set(SDLMAIN_SOURCES ${SDLMAIN_SOURCES} ${N3DS_MAIN_SOURCES}) @@ -3302,9 +3232,6 @@ if(SDL_SHARED) if(WINDOWS OR CYGWIN) set_target_properties(SDL3 PROPERTIES DEFINE_SYMBOL DLL_EXPORT) - elseif(OS2) - set_target_properties(SDL3 PROPERTIES - DEFINE_SYMBOL BUILD_SDL) endif() set_target_properties(SDL3 PROPERTIES VERSION ${SDL_VERSION} @@ -3522,7 +3449,7 @@ if(NOT SDL3_DISABLE_INSTALL) if(SDL_SHARED) set(SOEXT ${CMAKE_SHARED_LIBRARY_SUFFIX}) # ".so", ".dylib", etc. get_target_property(SONAME SDL3 OUTPUT_NAME) - if(NOT ANDROID AND NOT MINGW AND NOT OS2) + if(NOT ANDROID AND NOT MINGW) install(CODE " execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink \"lib${SONAME}${SOPOSTFIX}${SOEXT}\" \"libSDL3${SOPOSTFIX}${SOEXT}\" diff --git a/Makefile.os2 b/Makefile.os2 deleted file mode 100644 index 0cefb4b3eb..0000000000 --- a/Makefile.os2 +++ /dev/null @@ -1,296 +0,0 @@ -# Open Watcom makefile to build SDL3.dll for OS/2 -# wmake -f Makefile.os2 -# -# If you have GNU libiconv installed (iconv2.dll), you -# can compile against it by specifying LIBICONV=1, e.g.: -# wmake -f Makefile.os2 LIBICONV=1 -# -# If you have libusb-1.0 installed (usb100.dll, libusb.h), you -# can compile hidapi joystick support against it (experimental) -# by specifying HIDAPI=1, e.g.: -# wmake -f Makefile.os2 HIDAPI=1 -# -# To error out upon warnings: wmake -f Makefile.os2 ENABLE_WERROR=1 - -LIBNAME = SDL3 -MAJOR_VERSION = 3 -MINOR_VERSION = 0 -MICRO_VERSION = 0 -VERSION = $(MAJOR_VERSION).$(MINOR_VERSION).$(MICRO_VERSION) -DESCRIPTION = Simple DirectMedia Layer 2 - -LIBICONV=0 -ICONVLIB=$(LIBICONV_LIB) - -LIBHOME = . -DLLFILE = $(LIBHOME)/$(LIBNAME).dll -LIBFILE = $(LIBHOME)/$(LIBNAME).lib -LNKFILE = $(LIBNAME).lnk - -INCPATH = -I"$(%WATCOM)/h/os2" -I"$(%WATCOM)/h" -INCPATH+= -Iinclude - -LIBM = SDL3libm.lib -TLIB = SDL3test.lib -LIBS = mmpm2.lib $(LIBM) -CFLAGS = -bt=os2 -d0 -q -bm -5s -fp5 -fpi87 -sg -oeatxhn -ei -# Debug options: -# - debug messages from OS/2 related code to stdout: -#CFLAGS+= -DOS2DEBUG -# - debug messages from OS/2 code via SDL_LogDebug(): -#CFLAGS+= -DOS2DEBUG=2 - -# max warnings: -CFLAGS+= -wx -!ifeq ENABLE_WERROR 1 -CFLAGS+= -we -!endif -# newer OpenWatcom versions enable W303 by default -CFLAGS+= -wcd=303 -# the include paths : -CFLAGS+= $(INCPATH) -CFLAGS_STATIC=$(CFLAGS) -# building dll: -CFLAGS_DLL =$(CFLAGS) -CFLAGS_DLL+= -bd -# iconv: -LIBICONV_LIB=iconv2.lib -!ifeq LIBICONV 1 -CFLAGS_DLL+= -DHAVE_ICONV=1 -DHAVE_ICONV_H=1 -LIBS+= $(ICONVLIB) -!else -LIBS+= libuls.lib libconv.lib -!endif -# hidapi (libusb): -!ifeq HIDAPI 1 -CFLAGS_DLL+= -DHAVE_LIBUSB_H=1 -!endif -# building SDL itself (for DECLSPEC): -CFLAGS_DLL+= -DBUILD_SDL - -CFLAGS_DLL+= -DSDL_BUILD_MAJOR_VERSION=$(MAJOR_VERSION) -CFLAGS_DLL+= -DSDL_BUILD_MINOR_VERSION=$(MINOR_VERSION) -CFLAGS_DLL+= -DSDL_BUILD_MICRO_VERSION=$(MICRO_VERSION) - -SRCS = SDL.c SDL_assert.c SDL_error.c SDL_guid.c SDL_log.c SDL_dataqueue.c SDL_hints.c SDL_list.c SDL_utils.c -SRCS+= SDL_getenv.c SDL_iconv.c SDL_malloc.c SDL_qsort.c SDL_stdlib.c SDL_string.c SDL_strtokr.c SDL_crc16.c SDL_crc32.c -SRCS+= SDL_cpuinfo.c SDL_atomic.c SDL_spinlock.c SDL_thread.c SDL_timer.c -SRCS+= SDL_rwops.c SDL_power.c -SRCS+= SDL_audio.c SDL_audiocvt.c SDL_audiodev.c SDL_audiotypecvt.c SDL_mixer.c SDL_wave.c -SRCS+= SDL_events.c SDL_quit.c SDL_keyboard.c SDL_mouse.c SDL_windowevents.c & - SDL_clipboardevents.c SDL_dropevents.c SDL_displayevents.c SDL_gesture.c & - SDL_sensor.c SDL_touch.c -SRCS+= SDL_haptic.c SDL_hidapi.c SDL_gamecontroller.c SDL_joystick.c controller_type.c -SRCS+= SDL_render.c yuv_rgb.c SDL_yuv.c SDL_yuv_sw.c SDL_blendfillrect.c & - SDL_blendline.c SDL_blendpoint.c SDL_drawline.c SDL_drawpoint.c & - SDL_render_sw.c SDL_rotate.c SDL_triangle.c -SRCS+= SDL_blit.c SDL_blit_0.c SDL_blit_1.c SDL_blit_A.c SDL_blit_auto.c & - SDL_blit_copy.c SDL_blit_N.c SDL_blit_slow.c SDL_fillrect.c SDL_bmp.c & - SDL_pixels.c SDL_rect.c SDL_RLEaccel.c SDL_shape.c SDL_stretch.c & - SDL_surface.c SDL_video.c SDL_clipboard.c SDL_vulkan_utils.c SDL_egl.c - -SRCS+= SDL_syscond.c SDL_sysmutex.c SDL_syssem.c SDL_systhread.c SDL_systls.c -SRCS+= SDL_systimer.c -SRCS+= SDL_sysloadso.c -SRCS+= SDL_sysfilesystem.c -SRCS+= SDL_os2joystick.c SDL_syshaptic.c SDL_sysjoystick.c SDL_virtualjoystick.c -SRCS+= SDL_hidapijoystick.c SDL_hidapi_rumble.c SDL_hidapi_combined.c SDL_hidapi_gamecube.c SDL_hidapi_luna.c SDL_hidapi_ps3.c SDL_hidapi_ps4.c SDL_hidapi_ps5.c SDL_hidapi_shield.c SDL_hidapi_stadia.c SDL_hidapi_switch.c SDL_hidapi_wii.c SDL_hidapi_xbox360.c SDL_hidapi_xbox360w.c SDL_hidapi_xboxone.c SDL_hidapi_steam.c -SRCS+= SDL_dummyaudio.c SDL_diskaudio.c -SRCS+= SDL_nullvideo.c SDL_nullframebuffer.c SDL_nullevents.c -SRCS+= SDL_dummysensor.c -SRCS+= SDL_locale.c SDL_syslocale.c -SRCS+= SDL_url.c SDL_sysurl.c - -SRCS+= SDL_os2.c -!ifeq LIBICONV 0 -SRCS+= geniconv.c os2cp.c os2iconv.c sys2utf8.c -!endif -SRCS+= SDL_os2audio.c -SRCS+= SDL_os2video.c SDL_os2util.c SDL_os2dive.c SDL_os2vman.c & - SDL_os2mouse.c SDL_os2messagebox.c - -SRCS+= SDL_dynapi.c - -OBJS = $(SRCS:.c=.obj) - -.extensions: -.extensions: .lib .dll .obj .c .asm - -.c: ./src;./src/dynapi;./src/audio;./src/cpuinfo;./src/events;./src/file;./src/haptic;./src/joystick;./src/power;./src/render;./src/render/software;./src/sensor;./src/stdlib;./src/thread;./src/timer;./src/video;./src/video/yuv2rgb;./src/atomic;./src/audio/disk; -.c: ./src/haptic/dummy;./src/joystick/dummy;./src/joystick/virtual;./src/audio/dummy;./src/video/dummy;./src/sensor/dummy; -.c: ./src/core/os2;./src/audio/os2;./src/loadso/os2;./src/filesystem/os2;./src/joystick/os2;./src/thread/os2;./src/timer/os2;./src/video/os2; -.c: ./src/core/os2/geniconv; -.c: ./src/locale/;./src/locale/unix;./src/misc;./src/misc/dummy;./src/joystick/hidapi;./src/hidapi - -all: $(DLLFILE) $(LIBFILE) $(TLIB) .symbolic - -build_dll: .symbolic - @echo * Compiling dll objects - -$(DLLFILE): build_dll $(OBJS) $(LIBM) $(LIBICONV_LIB) $(LNKFILE) - @echo * Linking: $@ - wlink @$(LNKFILE) - -$(LIBFILE): $(DLLFILE) - @echo * Creating LIB file: $@ - wlib -q -b -n -c -pa -s -t -zld -ii -io $* $(DLLFILE) - -.c.obj: - wcc386 $(CFLAGS_DLL) -fo=$^@ $< - -SDL_syscond.obj: "src/thread/generic/SDL_syscond.c" - wcc386 $(CFLAGS_DLL) -fo=$^@ $< -SDL_cpuinfo.obj: SDL_cpuinfo.c - wcc386 $(CFLAGS_DLL) -wcd=200 -fo=$^@ $< -SDL_wave.obj: SDL_wave.c - wcc386 $(CFLAGS_DLL) -wcd=124 -fo=$^@ $< -SDL_blendfillrect.obj: SDL_blendfillrect.c - wcc386 $(CFLAGS_DLL) -wcd=200 -fo=$^@ $< -SDL_blendline.obj: SDL_blendline.c - wcc386 $(CFLAGS_DLL) -wcd=200 -fo=$^@ $< -SDL_blendpoint.obj: SDL_blendpoint.c - wcc386 $(CFLAGS_DLL) -wcd=200 -fo=$^@ $< -SDL_RLEaccel.obj: SDL_RLEaccel.c - wcc386 $(CFLAGS_DLL) -wcd=201 -fo=$^@ $< -!ifeq HIDAPI 1 -# c99 mode needed because of structs with flexible array members in libusb.h -SDL_hidapi.obj: SDL_hidapi.c - wcc386 $(CFLAGS_DLL) -za99 -fo=$^@ $< -!endif - -$(LIBICONV_LIB): "src/core/os2/iconv2.lbc" - @echo * Creating: $@ - wlib -q -b -n -c -pa -s -t -zld -ii -io $@ @$< - -# SDL3libm -MSRCS= e_atan2.c e_exp.c e_fmod.c e_log10.c e_log.c e_pow.c e_rem_pio2.c e_sqrt.c & - k_cos.c k_rem_pio2.c k_sin.c k_tan.c & - s_atan.c s_copysign.c s_cos.c s_fabs.c s_floor.c s_scalbn.c s_sin.c s_tan.c -MOBJS= $(MSRCS:.c=.obj) - -.c: ./src/libm; -e_atan2.obj: e_atan2.c - wcc386 $(CFLAGS_STATIC) -fo=$^@ $< -e_exp.obj: e_exp.c - wcc386 $(CFLAGS_STATIC) -fo=$^@ $< -e_fmod.obj: e_fmod.c - wcc386 $(CFLAGS_STATIC) -fo=$^@ $< -e_log10.obj: e_log10.c - wcc386 $(CFLAGS_STATIC) -fo=$^@ $< -e_log.obj: e_log.c - wcc386 $(CFLAGS_STATIC) -fo=$^@ $< -e_pow.obj: e_pow.c - wcc386 $(CFLAGS_STATIC) -fo=$^@ $< -e_rem_pio2.obj: e_rem_pio2.c - wcc386 $(CFLAGS_STATIC) -fo=$^@ $< -e_sqrt.obj: e_sqrt.c - wcc386 $(CFLAGS_STATIC) -fo=$^@ $< -k_cos.obj: k_cos.c - wcc386 $(CFLAGS_STATIC) -fo=$^@ $< -k_rem_pio2.obj: k_rem_pio2.c - wcc386 $(CFLAGS_STATIC) -fo=$^@ $< -k_sin.obj: k_sin.c - wcc386 $(CFLAGS_STATIC) -fo=$^@ $< -k_tan.obj: k_tan.c - wcc386 $(CFLAGS_STATIC) -fo=$^@ $< -s_atan.obj: s_atan.c - wcc386 $(CFLAGS_STATIC) -fo=$^@ $< -s_copysign.obj: s_copysign.c - wcc386 $(CFLAGS_STATIC) -fo=$^@ $< -s_cos.obj: s_cos.c - wcc386 $(CFLAGS_STATIC) -fo=$^@ $< -s_fabs.obj: s_fabs.c - wcc386 $(CFLAGS_STATIC) -fo=$^@ $< -s_floor.obj: s_floor.c - wcc386 $(CFLAGS_STATIC) -fo=$^@ $< -s_scalbn.obj: s_scalbn.c - wcc386 $(CFLAGS_STATIC) -fo=$^@ $< -s_sin.obj: s_sin.c - wcc386 $(CFLAGS_STATIC) -fo=$^@ $< -s_tan.obj: s_tan.c - wcc386 $(CFLAGS_STATIC) -fo=$^@ $< - -build_libm: .symbolic - @echo * Compiling libm objects -$(LIBM): build_libm $(MOBJS) - @echo * Creating: $@ - wlib -q -b -n -c -pa -s -t -zld -ii -io $@ $(MOBJS) - -# SDL3test -TSRCS = SDL_test_assert.c SDL_test_common.c SDL_test_compare.c & - SDL_test_crc32.c SDL_test_font.c SDL_test_fuzzer.c SDL_test_harness.c & - SDL_test_imageBlit.c SDL_test_imageBlitBlend.c SDL_test_imageFace.c & - SDL_test_imagePrimitives.c SDL_test_imagePrimitivesBlend.c & - SDL_test_log.c SDL_test_md5.c SDL_test_random.c SDL_test_memory.c -TOBJS= $(TSRCS:.c=.obj) - -.c: ./src/test; -SDL_test_assert.obj: SDL_test_assert.c - wcc386 $(CFLAGS_STATIC) -fo=$^@ $< -SDL_test_common.obj: SDL_test_common.c - wcc386 $(CFLAGS_STATIC) -fo=$^@ $< -SDL_test_compare.obj: SDL_test_compare.c - wcc386 $(CFLAGS_STATIC) -fo=$^@ $< -SDL_test_crc32.obj: SDL_test_crc32.c - wcc386 $(CFLAGS_STATIC) -fo=$^@ $< -SDL_test_font.obj: SDL_test_font.c - wcc386 $(CFLAGS_STATIC) -fo=$^@ $< -SDL_test_fuzzer.obj: SDL_test_fuzzer.c - wcc386 $(CFLAGS_STATIC) -fo=$^@ $< -SDL_test_harness.obj: SDL_test_harness.c - wcc386 $(CFLAGS_STATIC) -fo=$^@ $< -SDL_test_imageBlit.obj: SDL_test_imageBlit.c - wcc386 $(CFLAGS_STATIC) -fo=$^@ $< -SDL_test_imageBlitBlend.obj: SDL_test_imageBlitBlend.c - wcc386 $(CFLAGS_STATIC) -fo=$^@ $< -SDL_test_imageFace.obj: SDL_test_imageFace.c - wcc386 $(CFLAGS_STATIC) -fo=$^@ $< -SDL_test_imagePrimitives.obj: SDL_test_imagePrimitives.c - wcc386 $(CFLAGS_STATIC) -fo=$^@ $< -SDL_test_imagePrimitivesBlend.obj: SDL_test_imagePrimitivesBlend.c - wcc386 $(CFLAGS_STATIC) -fo=$^@ $< -SDL_test_log.obj: SDL_test_log.c - wcc386 $(CFLAGS_STATIC) -fo=$^@ $< -SDL_test_md5.obj: SDL_test_md5.c - wcc386 $(CFLAGS_STATIC) -fo=$^@ $< -SDL_test_random.obj: SDL_test_random.c - wcc386 $(CFLAGS_STATIC) -fo=$^@ $< -SDL_test_memory.obj: SDL_test_memory.c - wcc386 $(CFLAGS_STATIC) -fo=$^@ $< - -build_tlib: .symbolic - @echo * Compiling testlib objects -$(TLIB): build_tlib $(TOBJS) - @echo * Creating: $@ - wlib -q -b -n -c -pa -s -t -zld -ii -io $@ $(TOBJS) - -$(LNKFILE): - @echo * Creating linker file: $@ - @%create $@ - @%append $@ SYSTEM os2v2_dll INITINSTANCE TERMINSTANCE - @%append $@ NAME $(DLLFILE) - @for %i in ($(OBJS)) do @%append $@ FILE %i - @for %i in ($(LIBS)) do @%append $@ LIB %i - @%append $@ OPTION QUIET - @%append $@ OPTION IMPF=$(LIBHOME)/$^&.exp - @%append $@ OPTION MAP=$(LIBHOME)/$^&.map - @%append $@ OPTION DESCRIPTION '@$#libsdl org:$(VERSION)$#@$(DESCRIPTION)' - @%append $@ OPTION ELIMINATE - @%append $@ OPTION MANYAUTODATA - @%append $@ OPTION OSNAME='OS/2 and eComStation' - @%append $@ OPTION SHOWDEAD - -clean: .SYMBOLIC - @echo * Clean: $(LIBNAME) - @if exist *.obj rm *.obj - @if exist *.err rm *.err - @if exist $(LNKFILE) rm $(LNKFILE) - @if exist $(LIBM) rm $(LIBM) - @if exist $(LIBICONV_LIB) rm $(LIBICONV_LIB) - -distclean: .SYMBOLIC clean - @if exist $(LIBHOME)/*.exp rm $(LIBHOME)/*.exp - @if exist $(LIBHOME)/*.map rm $(LIBHOME)/*.map - @if exist $(LIBFILE) rm $(LIBFILE) - @if exist $(DLLFILE) rm $(DLLFILE) - @if exist $(TLIB) rm $(TLIB) diff --git a/Makefile.w32 b/Makefile.w32 deleted file mode 100644 index b89a44e578..0000000000 --- a/Makefile.w32 +++ /dev/null @@ -1,280 +0,0 @@ -# Open Watcom makefile to build SDL3.dll for Win32 -# wmake -f Makefile.w32 -# -# To error out upon warnings: wmake -f Makefile.w32 ENABLE_WERROR=1 - -LIBNAME = SDL3 -MAJOR_VERSION = 3 -MINOR_VERSION = 0 -MICRO_VERSION = 0 -VERSION = $(MAJOR_VERSION).$(MINOR_VERSION).$(MICRO_VERSION) - -LIBHOME = . -DLLFILE = $(LIBHOME)/$(LIBNAME).dll -LIBFILE = $(LIBHOME)/$(LIBNAME).lib -EXPFILE = $(LIBHOME)/$(LIBNAME).exp -LNKFILE = $(LIBNAME).lnk - -INCPATH = -I"$(%WATCOM)/h/nt" -I"$(%WATCOM)/h/nt/directx" -I"$(%WATCOM)/h" -INCPATH+= -Iinclude -INCPATH+= -I"src/video/khronos" - -LIBM = SDL3libm.lib -TLIB = SDL3test.lib -# user32.lib, gdi32.lib, ole32.lib and oleaut32.lib are actually -# among the default libraries in wlink.lnk for nt_dll linkage... -LIBS = user32.lib gdi32.lib winmm.lib imm32.lib ole32.lib oleaut32.lib shell32.lib setupapi.lib version.lib uuid.lib dxguid.lib $(LIBM) - -CFLAGS = -bt=nt -d0 -q -bm -5s -fp5 -fpi87 -sg -oeatxhn -ei -# max warnings: -CFLAGS+= -wx -!ifeq ENABLE_WERROR 1 -CFLAGS+= -we -!endif -# newer OpenWatcom versions enable W303 by default -CFLAGS+= -wcd=303 -# new vulkan headers result in lots of W202 warnings -CFLAGS+= -wcd=202 -# the include paths : -CFLAGS+= $(INCPATH) -CFLAGS_STATIC=$(CFLAGS) -# building dll: -CFLAGS_DLL =$(CFLAGS) -CFLAGS_DLL+= -bd -# we override the DECLSPEC define in begin_code.h, because we are using -# an exports file to remove the _cdecl '_' prefix from the symbol names -CFLAGS_DLL+= -DDECLSPEC= - -CFLAGS_DLL+= -DSDL_BUILD_MAJOR_VERSION=$(MAJOR_VERSION) -CFLAGS_DLL+= -DSDL_BUILD_MINOR_VERSION=$(MINOR_VERSION) -CFLAGS_DLL+= -DSDL_BUILD_MICRO_VERSION=$(MICRO_VERSION) - -RCFLAGS = -q -r -bt=nt $(INCPATH) - -SRCS = SDL.c SDL_assert.c SDL_error.c SDL_guid.c SDL_log.c SDL_dataqueue.c SDL_hints.c SDL_list.c SDL_utils.c -SRCS+= SDL_getenv.c SDL_iconv.c SDL_malloc.c SDL_qsort.c SDL_stdlib.c SDL_string.c SDL_strtokr.c SDL_crc16.c SDL_crc32.c -SRCS+= SDL_cpuinfo.c SDL_atomic.c SDL_spinlock.c SDL_thread.c SDL_timer.c -SRCS+= SDL_rwops.c SDL_power.c -SRCS+= SDL_audio.c SDL_audiocvt.c SDL_audiodev.c SDL_audiotypecvt.c SDL_mixer.c SDL_wave.c -SRCS+= SDL_events.c SDL_quit.c SDL_keyboard.c SDL_mouse.c SDL_windowevents.c & - SDL_clipboardevents.c SDL_dropevents.c SDL_displayevents.c SDL_gesture.c & - SDL_sensor.c SDL_touch.c -SRCS+= SDL_haptic.c SDL_hidapi.c SDL_gamecontroller.c SDL_joystick.c controller_type.c -SRCS+= SDL_render.c yuv_rgb.c SDL_yuv.c SDL_yuv_sw.c SDL_blendfillrect.c & - SDL_blendline.c SDL_blendpoint.c SDL_drawline.c SDL_drawpoint.c & - SDL_render_sw.c SDL_rotate.c SDL_triangle.c -SRCS+= SDL_blit.c SDL_blit_0.c SDL_blit_1.c SDL_blit_A.c SDL_blit_auto.c & - SDL_blit_copy.c SDL_blit_N.c SDL_blit_slow.c SDL_fillrect.c SDL_bmp.c & - SDL_pixels.c SDL_rect.c SDL_RLEaccel.c SDL_shape.c SDL_stretch.c & - SDL_surface.c SDL_video.c SDL_clipboard.c SDL_vulkan_utils.c SDL_egl.c - -SRCS+= SDL_syscond.c SDL_sysmutex.c SDL_syssem.c SDL_systhread.c SDL_systls.c -SRCS+= SDL_systimer.c -SRCS+= SDL_sysloadso.c -SRCS+= SDL_sysfilesystem.c -SRCS+= SDL_syshaptic.c SDL_sysjoystick.c SDL_virtualjoystick.c -SRCS+= SDL_hidapijoystick.c SDL_hidapi_rumble.c SDL_hidapi_combined.c SDL_hidapi_gamecube.c SDL_hidapi_luna.c SDL_hidapi_ps3.c SDL_hidapi_ps4.c SDL_hidapi_ps5.c SDL_hidapi_shield.c SDL_hidapi_stadia.c SDL_hidapi_switch.c SDL_hidapi_wii.c SDL_hidapi_xbox360.c SDL_hidapi_xbox360w.c SDL_hidapi_xboxone.c SDL_hidapi_steam.c -SRCS+= SDL_dummyaudio.c SDL_diskaudio.c -SRCS+= SDL_nullvideo.c SDL_nullframebuffer.c SDL_nullevents.c -SRCS+= SDL_dummysensor.c -SRCS+= SDL_locale.c SDL_syslocale.c -SRCS+= SDL_url.c SDL_sysurl.c - -SRCS+= SDL_winmm.c SDL_directsound.c SDL_wasapi.c SDL_wasapi_win32.c -SRCS+= SDL_hid.c SDL_immdevice.c SDL_windows.c SDL_xinput.c -SRCS+= SDL_dinputhaptic.c SDL_windowshaptic.c SDL_xinputhaptic.c -SRCS+= SDL_dinputjoystick.c SDL_rawinputjoystick.c SDL_windowsjoystick.c SDL_windows_gaming_input.c SDL_xinputjoystick.c -SRCS+= SDL_syspower.c -SRCS+= SDL_d3dmath.c -SRCS+= SDL_render_d3d.c SDL_shaders_d3d.c -SRCS+= SDL_render_d3d11.c SDL_shaders_d3d11.c -SRCS+= SDL_render_d3d12.c SDL_shaders_d3d12.c -SRCS+= SDL_render_gl.c SDL_shaders_gl.c -SRCS+= SDL_render_gles2.c SDL_shaders_gles2.c -SRCS+= SDL_windowssensor.c -SRCS+= SDL_syscond_cv.c -SRCS+= SDL_windowsclipboard.c SDL_windowsevents.c SDL_windowsframebuffer.c SDL_windowskeyboard.c SDL_windowsmessagebox.c SDL_windowsmodes.c SDL_windowsmouse.c SDL_windowsopengl.c SDL_windowsopengles.c SDL_windowsshape.c SDL_windowsvideo.c SDL_windowsvulkan.c SDL_windowswindow.c - -SRCS+= SDL_dynapi.c - -RCSRCS = version.rc - -OBJS = $(SRCS:.c=.obj) -RCOBJS= $(RCSRCS:.rc=.res) - -.extensions: -.extensions: .lib .dll .obj .res .c .rc .asm - -.c: ./src;./src/dynapi;./src/audio;./src/cpuinfo;./src/events;./src/file;./src/haptic;./src/joystick;./src/power;./src/render;./src/render/software;./src/sensor;./src/stdlib;./src/thread;./src/timer;./src/video;./src/video/yuv2rgb;./src/atomic;./src/audio/disk; -.c: ./src/haptic/dummy;./src/joystick/dummy;./src/joystick/virtual;./src/audio/dummy;./src/video/dummy;./src/sensor/dummy; -.c: ./src/core/windows;./src/audio/winmm;./src/audio/directsound;./src/audio/wasapi;./src/loadso/windows;./src/filesystem/windows;./src/haptic/windows;./src/joystick/windows;./src/sensor/windows;./src/thread/windows;./src/timer/windows;./src/video/windows; -.c: ./src/locale/;./src/locale/windows;./src/misc;./src/misc/windows;./src/power/windows;./src/joystick/hidapi;./src/hidapi;./src/render/direct3d;./src/render/direct3d11;./src/render/direct3d12;./src/render/opengl;./src/render/opengles2 -.rc: ./src/main/windows - -all: $(DLLFILE) $(LIBFILE) $(TLIB) .symbolic - -build_dll: .symbolic - @echo * Compiling dll objects - -$(DLLFILE): build_dll $(OBJS) $(LIBM) $(RCOBJS) $(LNKFILE) - @echo * Linking: $@ - wlink @$(LNKFILE) - -$(LIBFILE): $(DLLFILE) - @echo * Creating LIB file: $@ - wlib -q -b -n -c -pa -s -t -zld -ii -io $* @$(EXPFILE) - -.c.obj: - wcc386 $(CFLAGS_DLL) -fo=$^@ $< - -.rc.res: - wrc $(RCFLAGS) -fo=$^@ $< - -SDL_syscond.obj: "src/thread/generic/SDL_syscond.c" - wcc386 $(CFLAGS_DLL) -fo=$^@ $< -SDL_cpuinfo.obj: SDL_cpuinfo.c - wcc386 $(CFLAGS_DLL) -wcd=200 -fo=$^@ $< -SDL_wave.obj: SDL_wave.c - wcc386 $(CFLAGS_DLL) -wcd=124 -fo=$^@ $< -SDL_blendfillrect.obj: SDL_blendfillrect.c - wcc386 $(CFLAGS_DLL) -wcd=200 -fo=$^@ $< -SDL_blendline.obj: SDL_blendline.c - wcc386 $(CFLAGS_DLL) -wcd=200 -fo=$^@ $< -SDL_blendpoint.obj: SDL_blendpoint.c - wcc386 $(CFLAGS_DLL) -wcd=200 -fo=$^@ $< -SDL_RLEaccel.obj: SDL_RLEaccel.c - wcc386 $(CFLAGS_DLL) -wcd=201 -fo=$^@ $< -SDL_malloc.obj: SDL_malloc.c - wcc386 $(CFLAGS_DLL) -wcd=201 -fo=$^@ $< - -# SDL3libm -MSRCS= e_atan2.c e_exp.c e_fmod.c e_log10.c e_log.c e_pow.c e_rem_pio2.c e_sqrt.c & - k_cos.c k_rem_pio2.c k_sin.c k_tan.c & - s_atan.c s_copysign.c s_cos.c s_fabs.c s_floor.c s_scalbn.c s_sin.c s_tan.c -MOBJS= $(MSRCS:.c=.obj) - -.c: ./src/libm; -e_atan2.obj: e_atan2.c - wcc386 $(CFLAGS_STATIC) -fo=$^@ $< -e_exp.obj: e_exp.c - wcc386 $(CFLAGS_STATIC) -fo=$^@ $< -e_fmod.obj: e_fmod.c - wcc386 $(CFLAGS_STATIC) -fo=$^@ $< -e_log10.obj: e_log10.c - wcc386 $(CFLAGS_STATIC) -fo=$^@ $< -e_log.obj: e_log.c - wcc386 $(CFLAGS_STATIC) -fo=$^@ $< -e_pow.obj: e_pow.c - wcc386 $(CFLAGS_STATIC) -fo=$^@ $< -e_rem_pio2.obj: e_rem_pio2.c - wcc386 $(CFLAGS_STATIC) -fo=$^@ $< -e_sqrt.obj: e_sqrt.c - wcc386 $(CFLAGS_STATIC) -fo=$^@ $< -k_cos.obj: k_cos.c - wcc386 $(CFLAGS_STATIC) -fo=$^@ $< -k_rem_pio2.obj: k_rem_pio2.c - wcc386 $(CFLAGS_STATIC) -fo=$^@ $< -k_sin.obj: k_sin.c - wcc386 $(CFLAGS_STATIC) -fo=$^@ $< -k_tan.obj: k_tan.c - wcc386 $(CFLAGS_STATIC) -fo=$^@ $< -s_atan.obj: s_atan.c - wcc386 $(CFLAGS_STATIC) -fo=$^@ $< -s_copysign.obj: s_copysign.c - wcc386 $(CFLAGS_STATIC) -fo=$^@ $< -s_cos.obj: s_cos.c - wcc386 $(CFLAGS_STATIC) -fo=$^@ $< -s_fabs.obj: s_fabs.c - wcc386 $(CFLAGS_STATIC) -fo=$^@ $< -s_floor.obj: s_floor.c - wcc386 $(CFLAGS_STATIC) -fo=$^@ $< -s_scalbn.obj: s_scalbn.c - wcc386 $(CFLAGS_STATIC) -fo=$^@ $< -s_sin.obj: s_sin.c - wcc386 $(CFLAGS_STATIC) -fo=$^@ $< -s_tan.obj: s_tan.c - wcc386 $(CFLAGS_STATIC) -fo=$^@ $< - -build_libm: .symbolic - @echo * Compiling libm objects -$(LIBM): build_libm $(MOBJS) - @echo * Creating: $@ - wlib -q -b -n -c -pa -s -t -zld -ii -io $@ $(MOBJS) - -# SDL3test -TSRCS = SDL_test_assert.c SDL_test_common.c SDL_test_compare.c & - SDL_test_crc32.c SDL_test_font.c SDL_test_fuzzer.c SDL_test_harness.c & - SDL_test_imageBlit.c SDL_test_imageBlitBlend.c SDL_test_imageFace.c & - SDL_test_imagePrimitives.c SDL_test_imagePrimitivesBlend.c & - SDL_test_log.c SDL_test_md5.c SDL_test_random.c SDL_test_memory.c -TOBJS= $(TSRCS:.c=.obj) - -.c: ./src/test; -SDL_test_assert.obj: SDL_test_assert.c - wcc386 $(CFLAGS_STATIC) -fo=$^@ $< -SDL_test_common.obj: SDL_test_common.c - wcc386 $(CFLAGS_STATIC) -fo=$^@ $< -SDL_test_compare.obj: SDL_test_compare.c - wcc386 $(CFLAGS_STATIC) -fo=$^@ $< -SDL_test_crc32.obj: SDL_test_crc32.c - wcc386 $(CFLAGS_STATIC) -fo=$^@ $< -SDL_test_font.obj: SDL_test_font.c - wcc386 $(CFLAGS_STATIC) -fo=$^@ $< -SDL_test_fuzzer.obj: SDL_test_fuzzer.c - wcc386 $(CFLAGS_STATIC) -fo=$^@ $< -SDL_test_harness.obj: SDL_test_harness.c - wcc386 $(CFLAGS_STATIC) -fo=$^@ $< -SDL_test_imageBlit.obj: SDL_test_imageBlit.c - wcc386 $(CFLAGS_STATIC) -fo=$^@ $< -SDL_test_imageBlitBlend.obj: SDL_test_imageBlitBlend.c - wcc386 $(CFLAGS_STATIC) -fo=$^@ $< -SDL_test_imageFace.obj: SDL_test_imageFace.c - wcc386 $(CFLAGS_STATIC) -fo=$^@ $< -SDL_test_imagePrimitives.obj: SDL_test_imagePrimitives.c - wcc386 $(CFLAGS_STATIC) -fo=$^@ $< -SDL_test_imagePrimitivesBlend.obj: SDL_test_imagePrimitivesBlend.c - wcc386 $(CFLAGS_STATIC) -fo=$^@ $< -SDL_test_log.obj: SDL_test_log.c - wcc386 $(CFLAGS_STATIC) -fo=$^@ $< -SDL_test_md5.obj: SDL_test_md5.c - wcc386 $(CFLAGS_STATIC) -fo=$^@ $< -SDL_test_random.obj: SDL_test_random.c - wcc386 $(CFLAGS_STATIC) -fo=$^@ $< -SDL_test_memory.obj: SDL_test_memory.c - wcc386 $(CFLAGS_STATIC) -fo=$^@ $< - -build_tlib: .symbolic - @echo * Compiling testlib objects -$(TLIB): build_tlib $(TOBJS) - @echo * Creating: $@ - wlib -q -b -n -c -pa -s -t -zld -ii -io $@ $(TOBJS) - -$(LNKFILE): Makefile.w32 - @echo * Creating linker file: $@ - @%create $@ - @%append $@ SYSTEM nt_dll INITINSTANCE TERMINSTANCE - @%append $@ NAME $(DLLFILE) - @for %i in ($(OBJS)) do @%append $@ FILE %i - @for %i in ($(LIBS)) do @%append $@ LIB %i - @%append $@ OPTION RESOURCE=$(RCOBJS) - @%append $@ EXPORT=src/dynapi/SDL3.exports - @%append $@ OPTION QUIET - @%append $@ OPTION IMPF=$(EXPFILE) - @%append $@ OPTION MAP=$(LIBHOME)/$^&.map - @%append $@ OPTION ELIMINATE - @%append $@ OPTION SHOWDEAD - -clean: .SYMBOLIC - @echo * Clean: $(LIBNAME) - @if exist *.obj rm *.obj - @if exist *.res rm *.res - @if exist *.err rm *.err - @if exist $(LNKFILE) rm $(LNKFILE) - @if exist $(LIBM) rm $(LIBM) - -distclean: .SYMBOLIC clean - @if exist $(LIBHOME)/*.exp rm $(LIBHOME)/*.exp - @if exist $(LIBHOME)/*.map rm $(LIBHOME)/*.map - @if exist $(LIBFILE) rm $(LIBFILE) - @if exist $(DLLFILE) rm $(DLLFILE) - @if exist $(TLIB) rm $(TLIB) diff --git a/cmake/sdlchecks.cmake b/cmake/sdlchecks.cmake index 462fdd4ba9..b65d63aabc 100644 --- a/cmake/sdlchecks.cmake +++ b/cmake/sdlchecks.cmake @@ -364,7 +364,7 @@ macro(CheckLibSampleRate) get_property(_samplerate_type TARGET SampleRate::samplerate PROPERTY TYPE) if(_samplerate_type STREQUAL "SHARED_LIBRARY") set(HAVE_LIBSAMPLERATE_SHARED TRUE) - if(WIN32 OR OS2) + if(WIN32) set(SDL_LIBSAMPLERATE_DYNAMIC "\"$\"") else() set(SDL_LIBSAMPLERATE_DYNAMIC "\"$\"") @@ -1172,8 +1172,6 @@ macro(CheckHIDAPI) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${PKG_LIBUSB_CFLAGS}") if(HIDAPI_ONLY_LIBUSB) list(APPEND EXTRA_LIBS ${PKG_LIBUSB_LIBRARIES}) - elseif(OS2) - set(SDL_LIBUSB_DYNAMIC "\"usb100.dll\"") else() # libusb is loaded dynamically, so don't add it to EXTRA_LIBS FindLibraryAndSONAME("usb-1.0" LIBDIRS ${PKG_LIBUSB_LIBRARY_DIRS}) diff --git a/configure b/configure index 677132988f..79763cbba2 100755 --- a/configure +++ b/configure @@ -27236,36 +27236,6 @@ printf "%s\n" "#define HAVE_SHELLSCALINGAPI_H 1" >>confdefs.h fi } -CheckOS2() -{ - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking OS/2 compiler" >&5 -printf %s "checking OS/2 compiler... " >&6; } - have_os2_gcc=no - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - have_os2_gcc=yes -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $have_os2_gcc" >&5 -printf "%s\n" "$have_os2_gcc" >&6; } - if test x$have_os2_gcc != xyes; then - as_fn_error $? " -*** Your compiler ($CC) does not produce OS/2 executables! - " "$LINENO" 5 - fi -} - CheckDIRECTX() { # Check whether --enable-directx was given. @@ -28008,9 +27978,6 @@ fi enable_hidapi_libusb=yes require_hidapi_libusb=yes ;; - *-*-os2* ) - enable_hidapi_libusb=yes - ;; esac hidapi_support=yes @@ -28123,9 +28090,6 @@ printf "%s\n" "$as_me: WARNING: You must have SDL_LoadObject() support for dynam *-*-cygwin* | *-*-mingw* ) libusb_lib="libusb-1.0.dll" ;; - *-*-os2* ) - libusb_lib="usb100.dll" - ;; esac if test x$libusb_lib = x; then libusb_lib=`find_lib "libusb-1.0.so.*" "" | sed 's/.*\/\(.*\)/\1/; q'` @@ -29361,100 +29325,6 @@ printf "%s\n" "#define SDL_TIMER_UNIX 1" >>confdefs.h have_timers=yes fi ;; - *-*-os2*) - ARCH=os2 - if test "$build" != "$host"; then # cross-compiling - # Default cross-compile location - ac_default_prefix=/@unixroot/usr/local/cross-tools/$host - else - # Look for the location of the tools and install there - if test "$BUILD_PREFIX" != ""; then - ac_default_prefix=$BUILD_PREFIX - fi - fi - enable_static=no # disable static builds - EXTRA_CFLAGS="$EXTRA_CFLAGS -DBUILD_SDL -DOS2EMX_PLAIN_CHAR" - CheckOS2 - CheckWerror - CheckDeclarationAfterStatement - CheckDummyVideo - CheckDiskAudio - CheckDummyAudio - CheckHIDAPI - - # Set up the core platform files - SOURCES="$SOURCES $srcdir/src/core/os2/*.c" - if test x$enable_system_iconv = xyes; then - if test x$ac_cv_func_iconv != xyes -o x$ac_cv_header_iconv_h != xyes; then - SOURCES="$SOURCES $srcdir/src/core/os2/geniconv/*.c" - fi - fi - # Use the Unix locale APIs. - if test x$enable_locale = xyes; then - SOURCES="$SOURCES $srcdir/src/locale/unix/*.c" - have_locale=yes - fi - # Set up files for the video library - if test x$enable_video = xyes; then - -printf "%s\n" "#define SDL_VIDEO_DRIVER_OS2 1" >>confdefs.h - - SOURCES="$SOURCES $srcdir/src/video/os2/*.c" - have_video=yes - SUMMARY_video="${SUMMARY_video} os/2" - fi - # Set up files for the audio library - if test x$enable_audio = xyes; then - -printf "%s\n" "#define SDL_AUDIO_DRIVER_OS2 1" >>confdefs.h - - SOURCES="$SOURCES $srcdir/src/audio/os2/*.c" - have_audio=yes - SUMMARY_audio="${SUMMARY_audio} os/2" - EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lmmpm2" - fi - # Set up files for the thread library - if test x$enable_threads = xyes; then - -printf "%s\n" "#define SDL_THREAD_OS2 1" >>confdefs.h - - SOURCES="$SOURCES $srcdir/src/thread/os2/*.c" - SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_syscond.c" - have_threads=yes - fi - # Set up files for the timer library - if test x$enable_timers = xyes; then - -printf "%s\n" "#define SDL_TIMER_OS2 1" >>confdefs.h - - SOURCES="$SOURCES $srcdir/src/timer/os2/*.c" - have_timers=yes - fi - # Set up files for the shared object loading library - if test x$enable_loadso = xyes; then - -printf "%s\n" "#define SDL_LOADSO_OS2 1" >>confdefs.h - - SOURCES="$SOURCES $srcdir/src/loadso/os2/*.c" - have_loadso=yes - fi - # Set up files for the filesystem library - if test x$enable_filesystem = xyes; then - -printf "%s\n" "#define SDL_FILESYSTEM_OS2 1" >>confdefs.h - - SOURCES="$SOURCES $srcdir/src/filesystem/os2/*.c" - have_filesystem=yes - fi - # Set up files for the joystick library - if test x$enable_joystick = xyes; then - -printf "%s\n" "#define SDL_JOYSTICK_OS2 1" >>confdefs.h - - SOURCES="$SOURCES $srcdir/src/joystick/os2/*.c" - have_joystick=yes - fi - ;; *) as_fn_error $? " *** Unsupported host: Please add to configure.ac diff --git a/configure.ac b/configure.ac index 9d2cc2934a..d0bcbf16f8 100644 --- a/configure.ac +++ b/configure.ac @@ -3294,21 +3294,6 @@ CheckWINDOWS() fi } -dnl Determine whether the compiler can produce OS/2 executables -CheckOS2() -{ - AC_MSG_CHECKING(OS/2 compiler) - have_os2_gcc=no - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], - [])],[have_os2_gcc=yes],[]) - AC_MSG_RESULT($have_os2_gcc) - if test x$have_os2_gcc != xyes; then - AC_MSG_ERROR([ -*** Your compiler ($CC) does not produce OS/2 executables! - ]) - fi -} - dnl Find the DirectX includes and libraries CheckDIRECTX() { @@ -3607,9 +3592,6 @@ CheckHIDAPI() enable_hidapi_libusb=yes require_hidapi_libusb=yes ;; - *-*-os2* ) - enable_hidapi_libusb=yes - ;; esac hidapi_support=yes @@ -3643,9 +3625,6 @@ CheckHIDAPI() *-*-cygwin* | *-*-mingw* ) libusb_lib="libusb-1.0.dll" ;; - *-*-os2* ) - libusb_lib="usb100.dll" - ;; esac if test x$libusb_lib = x; then libusb_lib=[`find_lib "libusb-1.0.so.*" "" | sed 's/.*\/\(.*\)/\1/; q'`] @@ -4580,86 +4559,6 @@ dnl BeOS support removed after SDL 2.0.1. Haiku still works. --ryan. have_timers=yes fi ;; - *-*-os2*) - ARCH=os2 - if test "$build" != "$host"; then # cross-compiling - # Default cross-compile location - ac_default_prefix=/@unixroot/usr/local/cross-tools/$host - else - # Look for the location of the tools and install there - if test "$BUILD_PREFIX" != ""; then - ac_default_prefix=$BUILD_PREFIX - fi - fi - enable_static=no # disable static builds - EXTRA_CFLAGS="$EXTRA_CFLAGS -DBUILD_SDL -DOS2EMX_PLAIN_CHAR" - CheckOS2 - CheckWerror - CheckDeclarationAfterStatement - CheckDummyVideo - CheckDiskAudio - CheckDummyAudio - CheckHIDAPI - - # Set up the core platform files - SOURCES="$SOURCES $srcdir/src/core/os2/*.c" - if test x$enable_system_iconv = xyes; then - if test x$ac_cv_func_iconv != xyes -o x$ac_cv_header_iconv_h != xyes; then - SOURCES="$SOURCES $srcdir/src/core/os2/geniconv/*.c" - fi - fi - # Use the Unix locale APIs. - if test x$enable_locale = xyes; then - SOURCES="$SOURCES $srcdir/src/locale/unix/*.c" - have_locale=yes - fi - # Set up files for the video library - if test x$enable_video = xyes; then - AC_DEFINE(SDL_VIDEO_DRIVER_OS2, 1, [ ]) - SOURCES="$SOURCES $srcdir/src/video/os2/*.c" - have_video=yes - SUMMARY_video="${SUMMARY_video} os/2" - fi - # Set up files for the audio library - if test x$enable_audio = xyes; then - AC_DEFINE(SDL_AUDIO_DRIVER_OS2, 1, [ ]) - SOURCES="$SOURCES $srcdir/src/audio/os2/*.c" - have_audio=yes - SUMMARY_audio="${SUMMARY_audio} os/2" - EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lmmpm2" - fi - # Set up files for the thread library - if test x$enable_threads = xyes; then - AC_DEFINE(SDL_THREAD_OS2, 1, [ ]) - SOURCES="$SOURCES $srcdir/src/thread/os2/*.c" - SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_syscond.c" - have_threads=yes - fi - # Set up files for the timer library - if test x$enable_timers = xyes; then - AC_DEFINE(SDL_TIMER_OS2, 1, [ ]) - SOURCES="$SOURCES $srcdir/src/timer/os2/*.c" - have_timers=yes - fi - # Set up files for the shared object loading library - if test x$enable_loadso = xyes; then - AC_DEFINE(SDL_LOADSO_OS2, 1, [ ]) - SOURCES="$SOURCES $srcdir/src/loadso/os2/*.c" - have_loadso=yes - fi - # Set up files for the filesystem library - if test x$enable_filesystem = xyes; then - AC_DEFINE(SDL_FILESYSTEM_OS2, 1, [ ]) - SOURCES="$SOURCES $srcdir/src/filesystem/os2/*.c" - have_filesystem=yes - fi - # Set up files for the joystick library - if test x$enable_joystick = xyes; then - AC_DEFINE(SDL_JOYSTICK_OS2, 1, [ ]) - SOURCES="$SOURCES $srcdir/src/joystick/os2/*.c" - have_joystick=yes - fi - ;; *) AC_MSG_ERROR([ *** Unsupported host: Please add to configure.ac diff --git a/docs/README-os2.md b/docs/README-os2.md deleted file mode 100644 index 3024f11251..0000000000 --- a/docs/README-os2.md +++ /dev/null @@ -1,89 +0,0 @@ -Simple DirectMedia Layer 2 for OS/2 & eComStation -================================================================================ -SDL port for OS/2, authored by Andrey Vasilkin , 2016 - - -OpenGL and audio capture not supported by this port. - -Additional optional environment variables: - -SDL_AUDIO_SHARE - Values: 0 or 1, default is 0 - Initializes the device as shareable or exclusively acquired. - -SDL_VIDEODRIVER - Values: DIVE or VMAN, default is DIVE - Use video subsystem: Direct interface video extensions (DIVE) or - Video Manager (VMAN). - -You may significantly increase video output speed with OS4 kernel and patched -files vman.dll and dive.dll or with latest versions of ACPI support and video -driver Panorama. - -Latest versions of OS/4 kernel: - http://gus.biysk.ru/os4/ - (Info: https://www.os2world.com/wiki/index.php/Phoenix_OS/4) - -Patched files vman.dll and dive.dll: - http://gus.biysk.ru/os4/test/pached_dll/PATCHED_DLL.RAR - - -Compiling: ----------- - -Open Watcom 1.9 or newer is tested. For the new Open Watcom V2 fork, see: -https://github.com/open-watcom/ and https://open-watcom.github.io -WATCOM environment variable must to be set to the Open Watcom install -directory. To compile, run: wmake -f Makefile.os2 - - -Installing: ------------ - -- eComStation: - - If you have previously installed SDL3, make a Backup copy of SDL3.dll - located in D:\ecs\dll (where D: is disk on which installed eComStation). - Stop all programs running with SDL3. Copy SDL3.dll to D:\ecs\dll - -- OS/2: - - Copy SDL3.dll to any directory on your LIBPATH. If you have a previous - version installed, close all SDL3 applications before replacing the old - copy. Also make sure that any other older versions of DLLs are removed - from your system. - - -Joysticks: ------------------- - -The Joystick detection only works for standard joysticks (2 buttons, 2 axes -and the like). Therefore, if you use a non-standard joystick, you should -specify its features in the SDL_OS2_JOYSTICK environment variable in a batch -file or CONFIG.SYS, so SDL applications can provide full capability to your -device. The syntax is: - -SET SDL_OS2_JOYSTICK=[JOYSTICK_NAME] [AXES] [BUTTONS] [HATS] [BALLS] - -So, it you have a Gravis GamePad with 4 axes, 2 buttons, 2 hats and 0 balls, -the line should be: - -SET SDL_OS2_JOYSTICK=Gravis_GamePad 4 2 2 0 - -If you want to add spaces in your joystick name, just surround it with -quotes or double-quotes: - -SET SDL_OS2_JOYSTICK='Gravis GamePad' 4 2 2 0 - -or - -SET SDL_OS2_JOYSTICK="Gravis GamePad" 4 2 2 0 - - Note however that Balls and Hats are not supported under OS/2, and the -value will be ignored... but it is wise to define these correctly because -in the future those can be supported. - - Also the number of buttons is limited to 2 when using two joysticks, -4 when using one joystick with 4 axes, 6 when using a joystick with 3 axes -and 8 when using a joystick with 2 axes. Notice however these are limitations -of the Joystick Port hardware, not OS/2. diff --git a/docs/README.md b/docs/README.md index 7666060c91..9af1ceb6bb 100644 --- a/docs/README.md +++ b/docs/README.md @@ -34,7 +34,6 @@ More documentation and FAQs are available online at [the wiki](http://wiki.libsd - [iOS](README-ios.md) - [Linux](README-linux.md) - [macOS](README-macos.md) -- [OS/2](README-os2.md) - [Native Client](README-nacl.md) - [Supported Platforms](README-platforms.md) - [Porting information](README-porting.md) diff --git a/include/SDL_config.h b/include/SDL_config.h index f91cb47ec7..f59b6bbffd 100644 --- a/include/SDL_config.h +++ b/include/SDL_config.h @@ -43,8 +43,6 @@ #include "SDL_config_iphoneos.h" #elif defined(__ANDROID__) #include "SDL_config_android.h" -#elif defined(__OS2__) -#include "SDL_config_os2.h" #elif defined(__EMSCRIPTEN__) #include "SDL_config_emscripten.h" #elif defined(__NGAGE__) diff --git a/include/SDL_config.h.cmake b/include/SDL_config.h.cmake index 8fcb63d18f..41acf1c714 100644 --- a/include/SDL_config.h.cmake +++ b/include/SDL_config.h.cmake @@ -322,7 +322,6 @@ #cmakedefine SDL_AUDIO_DRIVER_SUNAUDIO @SDL_AUDIO_DRIVER_SUNAUDIO@ #cmakedefine SDL_AUDIO_DRIVER_WASAPI @SDL_AUDIO_DRIVER_WASAPI@ #cmakedefine SDL_AUDIO_DRIVER_WINMM @SDL_AUDIO_DRIVER_WINMM@ -#cmakedefine SDL_AUDIO_DRIVER_OS2 @SDL_AUDIO_DRIVER_OS2@ #cmakedefine SDL_AUDIO_DRIVER_VITA @SDL_AUDIO_DRIVER_VITA@ #cmakedefine SDL_AUDIO_DRIVER_PSP @SDL_AUDIO_DRIVER_PSP@ #cmakedefine SDL_AUDIO_DRIVER_PS2 @SDL_AUDIO_DRIVER_PS2@ @@ -341,7 +340,6 @@ #cmakedefine SDL_JOYSTICK_IOKIT @SDL_JOYSTICK_IOKIT@ #cmakedefine SDL_JOYSTICK_MFI @SDL_JOYSTICK_MFI@ #cmakedefine SDL_JOYSTICK_LINUX @SDL_JOYSTICK_LINUX@ -#cmakedefine SDL_JOYSTICK_OS2 @SDL_JOYSTICK_OS2@ #cmakedefine SDL_JOYSTICK_USBHID @SDL_JOYSTICK_USBHID@ #cmakedefine SDL_HAVE_MACHINE_JOYSTICK_H @SDL_HAVE_MACHINE_JOYSTICK_H@ #cmakedefine SDL_JOYSTICK_HIDAPI @SDL_JOYSTICK_HIDAPI@ @@ -373,7 +371,6 @@ #cmakedefine SDL_LOADSO_DUMMY @SDL_LOADSO_DUMMY@ #cmakedefine SDL_LOADSO_LDG @SDL_LOADSO_LDG@ #cmakedefine SDL_LOADSO_WINDOWS @SDL_LOADSO_WINDOWS@ -#cmakedefine SDL_LOADSO_OS2 @SDL_LOADSO_OS2@ /* Enable various threading systems */ #cmakedefine SDL_THREAD_GENERIC_COND_SUFFIX @SDL_THREAD_GENERIC_COND_SUFFIX@ @@ -381,7 +378,6 @@ #cmakedefine SDL_THREAD_PTHREAD_RECURSIVE_MUTEX @SDL_THREAD_PTHREAD_RECURSIVE_MUTEX@ #cmakedefine SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP @SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP@ #cmakedefine SDL_THREAD_WINDOWS @SDL_THREAD_WINDOWS@ -#cmakedefine SDL_THREAD_OS2 @SDL_THREAD_OS2@ #cmakedefine SDL_THREAD_VITA @SDL_THREAD_VITA@ #cmakedefine SDL_THREAD_PSP @SDL_THREAD_PSP@ #cmakedefine SDL_THREAD_PS2 @SDL_THREAD_PS2@ @@ -392,7 +388,6 @@ #cmakedefine SDL_TIMER_DUMMY @SDL_TIMER_DUMMY@ #cmakedefine SDL_TIMER_UNIX @SDL_TIMER_UNIX@ #cmakedefine SDL_TIMER_WINDOWS @SDL_TIMER_WINDOWS@ -#cmakedefine SDL_TIMER_OS2 @SDL_TIMER_OS2@ #cmakedefine SDL_TIMER_VITA @SDL_TIMER_VITA@ #cmakedefine SDL_TIMER_PSP @SDL_TIMER_PSP@ #cmakedefine SDL_TIMER_PS2 @SDL_TIMER_PS2@ @@ -414,7 +409,6 @@ #cmakedefine SDL_VIDEO_DRIVER_RPI @SDL_VIDEO_DRIVER_RPI@ #cmakedefine SDL_VIDEO_DRIVER_VIVANTE @SDL_VIDEO_DRIVER_VIVANTE@ #cmakedefine SDL_VIDEO_DRIVER_VIVANTE_VDK @SDL_VIDEO_DRIVER_VIVANTE_VDK@ -#cmakedefine SDL_VIDEO_DRIVER_OS2 @SDL_VIDEO_DRIVER_OS2@ #cmakedefine SDL_VIDEO_DRIVER_QNX @SDL_VIDEO_DRIVER_QNX@ #cmakedefine SDL_VIDEO_DRIVER_RISCOS @SDL_VIDEO_DRIVER_RISCOS@ #cmakedefine SDL_VIDEO_DRIVER_PSP @SDL_VIDEO_DRIVER_PSP@ @@ -505,7 +499,6 @@ #cmakedefine SDL_FILESYSTEM_UNIX @SDL_FILESYSTEM_UNIX@ #cmakedefine SDL_FILESYSTEM_WINDOWS @SDL_FILESYSTEM_WINDOWS@ #cmakedefine SDL_FILESYSTEM_EMSCRIPTEN @SDL_FILESYSTEM_EMSCRIPTEN@ -#cmakedefine SDL_FILESYSTEM_OS2 @SDL_FILESYSTEM_OS2@ #cmakedefine SDL_FILESYSTEM_VITA @SDL_FILESYSTEM_VITA@ #cmakedefine SDL_FILESYSTEM_PSP @SDL_FILESYSTEM_PSP@ #cmakedefine SDL_FILESYSTEM_PS2 @SDL_FILESYSTEM_PS2@ diff --git a/include/SDL_config.h.in b/include/SDL_config.h.in index 7b8d848e0b..a4756ee7b0 100644 --- a/include/SDL_config.h.in +++ b/include/SDL_config.h.in @@ -310,7 +310,6 @@ #undef SDL_AUDIO_DRIVER_SUNAUDIO #undef SDL_AUDIO_DRIVER_WASAPI #undef SDL_AUDIO_DRIVER_WINMM -#undef SDL_AUDIO_DRIVER_OS2 /* Enable various input drivers */ #undef SDL_INPUT_LINUXEV @@ -326,7 +325,6 @@ #undef SDL_JOYSTICK_MFI #undef SDL_JOYSTICK_LINUX #undef SDL_JOYSTICK_ANDROID -#undef SDL_JOYSTICK_OS2 #undef SDL_JOYSTICK_USBHID #undef SDL_HAVE_MACHINE_JOYSTICK_H #undef SDL_JOYSTICK_HIDAPI @@ -351,7 +349,6 @@ #undef SDL_LOADSO_DUMMY #undef SDL_LOADSO_LDG #undef SDL_LOADSO_WINDOWS -#undef SDL_LOADSO_OS2 /* Enable various threading systems */ #undef SDL_THREAD_GENERIC_COND_SUFFIX @@ -359,14 +356,12 @@ #undef SDL_THREAD_PTHREAD_RECURSIVE_MUTEX #undef SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP #undef SDL_THREAD_WINDOWS -#undef SDL_THREAD_OS2 /* Enable various timer systems */ #undef SDL_TIMER_HAIKU #undef SDL_TIMER_DUMMY #undef SDL_TIMER_UNIX #undef SDL_TIMER_WINDOWS -#undef SDL_TIMER_OS2 /* Enable various video drivers */ #undef SDL_VIDEO_DRIVER_HAIKU @@ -410,7 +405,6 @@ #undef SDL_VIDEO_DRIVER_NACL #undef SDL_VIDEO_DRIVER_VIVANTE #undef SDL_VIDEO_DRIVER_VIVANTE_VDK -#undef SDL_VIDEO_DRIVER_OS2 #undef SDL_VIDEO_DRIVER_QNX #undef SDL_VIDEO_DRIVER_RISCOS @@ -460,7 +454,6 @@ #undef SDL_FILESYSTEM_WINDOWS #undef SDL_FILESYSTEM_NACL #undef SDL_FILESYSTEM_EMSCRIPTEN -#undef SDL_FILESYSTEM_OS2 #undef SDL_FILESYSTEM_VITA #undef SDL_FILESYSTEM_PSP #undef SDL_FILESYSTEM_PS2 diff --git a/include/SDL_config_os2.h b/include/SDL_config_os2.h deleted file mode 100644 index c86769db4e..0000000000 --- a/include/SDL_config_os2.h +++ /dev/null @@ -1,207 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef SDL_config_os2_h_ -#define SDL_config_os2_h_ -#define SDL_config_h_ - -#include "SDL_platform.h" - -#define SIZEOF_VOIDP 4 - -#define SDL_AUDIO_DRIVER_DUMMY 1 -#define SDL_AUDIO_DRIVER_DISK 1 -#define SDL_AUDIO_DRIVER_OS2 1 - -#define SDL_POWER_DISABLED 1 -#define SDL_HAPTIC_DISABLED 1 - -#define SDL_SENSOR_DUMMY 1 -#define SDL_VIDEO_DRIVER_DUMMY 1 -#define SDL_VIDEO_DRIVER_OS2 1 -#define SDL_JOYSTICK_OS2 1 -#ifndef HAVE_LIBUSB_H /* see Makefile */ -#define SDL_HIDAPI_DISABLED 1 -/*#undef SDL_JOYSTICK_HIDAPI */ -#else -#define SDL_JOYSTICK_HIDAPI 1 -#define HAVE_LIBUSB 1 -/* dynamically loaded libusb-1.0 dll: */ -#define SDL_LIBUSB_DYNAMIC "usb100.dll" -#endif -/*#undef SDL_JOYSTICK_VIRTUAL */ - -/* Enable OpenGL support */ -/* #undef SDL_VIDEO_OPENGL */ - -#define SDL_THREAD_OS2 1 -#define SDL_LOADSO_OS2 1 -#define SDL_TIMER_OS2 1 -#define SDL_FILESYSTEM_OS2 1 - -/* use libsamplerate for audio rate conversion. */ -/*#define HAVE_LIBSAMPLERATE_H 1 */ - -/* Enable dynamic libsamplerate support */ -#define SDL_LIBSAMPLERATE_DYNAMIC "SAMPRATE.DLL" - -#define HAVE_LIBC 1 - -#define HAVE_STDARG_H 1 -#define HAVE_STDDEF_H 1 -#define HAVE_STDINT_H 1 - -#define HAVE_SYS_TYPES_H 1 -#define HAVE_STDIO_H 1 -#define STDC_HEADERS 1 -#define HAVE_STDLIB_H 1 -#define HAVE_MALLOC_H 1 -#define HAVE_MEMORY_H 1 -#define HAVE_STRING_H 1 -#define HAVE_STRINGS_H 1 -#define HAVE_WCHAR_H 1 -#define HAVE_INTTYPES_H 1 -#define HAVE_LIMITS_H 1 -#define HAVE_CTYPE_H 1 -#define HAVE_MATH_H 1 -#define HAVE_FLOAT_H 1 -#define HAVE_SIGNAL_H 1 - -#if 0 /* see Makefile */ -#define HAVE_ICONV 1 -#define HAVE_ICONV_H 1 -#endif - -/* #undef HAVE_DLOPEN */ -#define HAVE_MALLOC 1 -#define HAVE_CALLOC 1 -#define HAVE_REALLOC 1 -#define HAVE_FREE 1 -#if defined(__WATCOMC__) -#define HAVE__FSEEKI64 1 -#define HAVE__FTELLI64 1 -#endif -#define HAVE_ALLOCA 1 -#define HAVE_GETENV 1 -#define HAVE_SETENV 1 -#define HAVE_PUTENV 1 -/* OpenWatcom requires specific calling conventions for qsort and bsearch */ -#ifndef __WATCOMC__ -#define HAVE_QSORT 1 -#define HAVE_BSEARCH 1 -#endif -#define HAVE_ABS 1 -#define HAVE_BCOPY 1 -#define HAVE_MEMSET 1 -#define HAVE_MEMCPY 1 -#define HAVE_MEMMOVE 1 -#define HAVE_MEMCMP 1 -#define HAVE_WCSLEN 1 -#define HAVE_WCSLCPY 1 -#define HAVE_WCSLCAT 1 -#define HAVE_WCSCMP 1 -#define HAVE__WCSICMP 1 -#define HAVE__WCSNICMP 1 -#define HAVE_WCSLEN 1 -#define HAVE_WCSLCPY 1 -#define HAVE_WCSLCAT 1 -/* #undef HAVE_WCSDUP */ -#define HAVE__WCSDUP 1 -#define HAVE_WCSSTR 1 -#define HAVE_WCSCMP 1 -#define HAVE_WCSNCMP 1 -#define HAVE_STRLEN 1 -#define HAVE_STRLCPY 1 -#define HAVE_STRLCAT 1 -#define HAVE__STRREV 1 -#define HAVE__STRUPR 1 -#define HAVE__STRLWR 1 -/* #undef HAVE_INDEX */ -/* #undef HAVE_RINDEX */ -#define HAVE_STRCHR 1 -#define HAVE_STRRCHR 1 -#define HAVE_STRSTR 1 -/* #undef HAVE_STRTOK_R */ -#define HAVE_ITOA 1 -#define HAVE__LTOA 1 -#define HAVE__ULTOA 1 -#define HAVE_STRTOL 1 -#define HAVE_STRTOUL 1 -#define HAVE__I64TOA 1 -#define HAVE__UI64TOA 1 -#define HAVE_STRTOLL 1 -#define HAVE_STRTOULL 1 -#define HAVE_STRTOD 1 -#define HAVE_ATOI 1 -#define HAVE_ATOF 1 -#define HAVE_STRCMP 1 -#define HAVE_STRNCMP 1 -#define HAVE_STRICMP 1 -#define HAVE_STRCASECMP 1 -#define HAVE_STRNCASECMP 1 -#define HAVE_SSCANF 1 -#define HAVE_VSSCANF 1 -#define HAVE_SNPRINTF 1 -#define HAVE_VSNPRINTF 1 -#define HAVE_SETJMP 1 -#define HAVE_ACOS 1 -/* #undef HAVE_ACOSF */ -#define HAVE_ASIN 1 -/* #undef HAVE_ASINF */ -#define HAVE_ATAN 1 -#define HAVE_ATAN2 1 -/* #undef HAVE_ATAN2F */ -#define HAVE_CEIL 1 -/* #undef HAVE_CEILF */ -/* #undef HAVE_COPYSIGN */ -/* #undef HAVE_COPYSIGNF */ -#define HAVE_COS 1 -/* #undef HAVE_COSF */ -#define HAVE_EXP 1 -/* #undef HAVE_EXPF */ -#define HAVE_FABS 1 -/* #undef HAVE_FABSF */ -#define HAVE_FLOOR 1 -/* #undef HAVE_FLOORF */ -#define HAVE_FMOD 1 -/* #undef HAVE_FMODF */ -#define HAVE_LOG 1 -/* #undef HAVE_LOGF */ -#define HAVE_LOG10 1 -/* #undef HAVE_LOG10F */ -#define HAVE_POW 1 -/* #undef HAVE_POWF */ -#define HAVE_SIN 1 -/* #undef HAVE_SINF */ -/* #undef HAVE_SCALBN */ -/* #undef HAVE_SCALBNF */ -#define HAVE_SQRT 1 -/* #undef HAVE_SQRTF */ -#define HAVE_TAN 1 -/* #undef HAVE_TANF */ -/* #undef HAVE_TRUNC */ -/* #undef HAVE_TRUNCF */ -/* #undef HAVE_LROUND */ -/* #undef HAVE_LROUNDF */ -/* #undef HAVE_ROUND */ -/* #undef HAVE_ROUNDF */ - -#endif /* SDL_config_os2_h_ */ diff --git a/include/SDL_config_windows.h b/include/SDL_config_windows.h index 58e0b7ecbf..1ae40aab36 100644 --- a/include/SDL_config_windows.h +++ b/include/SDL_config_windows.h @@ -89,7 +89,6 @@ typedef unsigned int uintptr_t; #define HAVE_DDRAW_H 1 #define HAVE_DINPUT_H 1 #define HAVE_DSOUND_H 1 -#ifndef __WATCOMC__ #define HAVE_DXGI_H 1 #define HAVE_XINPUT_H 1 #if defined(_WIN32_MAXVER) && _WIN32_MAXVER >= 0x0A00 /* Windows 10 SDK */ @@ -101,7 +100,6 @@ typedef unsigned int uintptr_t; #endif #if defined(WDK_NTDDI_VERSION) && WDK_NTDDI_VERSION > 0x0A000008 /* 10.0.19041.0 */ #define HAVE_D3D12_H 1 -#endif #if defined(_WIN32_MAXVER) && _WIN32_MAXVER >= 0x0603 /* Windows 8.1 SDK */ #define HAVE_SHELLSCALINGAPI_H 1 #endif @@ -136,11 +134,8 @@ typedef unsigned int uintptr_t; #define HAVE_REALLOC 1 #define HAVE_FREE 1 #define HAVE_ALLOCA 1 -/* OpenWatcom requires specific calling conventions for qsort and bsearch */ -#ifndef __WATCOMC__ #define HAVE_QSORT 1 #define HAVE_BSEARCH 1 -#endif #define HAVE_ABS 1 #define HAVE_MEMSET 1 #define HAVE_MEMCPY 1 @@ -186,7 +181,6 @@ typedef unsigned int uintptr_t; #define HAVE_SIN 1 #define HAVE_SQRT 1 #define HAVE_TAN 1 -#ifndef __WATCOMC__ #define HAVE_ACOSF 1 #define HAVE_ASINF 1 #define HAVE_ATANF 1 @@ -204,7 +198,6 @@ typedef unsigned int uintptr_t; #define HAVE_SINF 1 #define HAVE_SQRTF 1 #define HAVE_TANF 1 -#endif #if defined(_MSC_VER) /* These functions were added with the VC++ 2013 C runtime library */ #if _MSC_VER >= 1800 @@ -227,14 +220,6 @@ typedef unsigned int uintptr_t; #ifdef _USE_MATH_DEFINES #define HAVE_M_PI 1 #endif -#elif defined(__WATCOMC__) -#define HAVE__FSEEKI64 1 -#define HAVE_STRTOLL 1 -#define HAVE_STRTOULL 1 -#define HAVE_VSSCANF 1 -#define HAVE_ROUND 1 -#define HAVE_SCALBN 1 -#define HAVE_TRUNC 1 #else #define HAVE_M_PI 1 #endif diff --git a/include/SDL_opengl.h b/include/SDL_opengl.h index 0f2b257abb..1816d4eb4b 100644 --- a/include/SDL_opengl.h +++ b/include/SDL_opengl.h @@ -97,13 +97,6 @@ #elif defined(__CYGWIN__) && defined(USE_OPENGL32) /* use native windows opengl32 */ # define GLAPI extern # define GLAPIENTRY __stdcall -#elif defined(__OS2__) || defined(__EMX__) /* native os/2 opengl */ -# define GLAPI extern -# define GLAPIENTRY _System -# define APIENTRY _System -# if defined(__GNUC__) && !defined(_System) -# define _System -# endif #elif (defined(__GNUC__) && __GNUC__ >= 4) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590)) # define GLAPI __attribute__((visibility("default"))) # define GLAPIENTRY diff --git a/include/SDL_syswm.h b/include/SDL_syswm.h index 45f8e7540d..f28b19d570 100644 --- a/include/SDL_syswm.h +++ b/include/SDL_syswm.h @@ -111,10 +111,6 @@ typedef void *EGLSurface; #include "SDL_egl.h" #endif -#if defined(SDL_VIDEO_DRIVER_OS2) -#define INCL_WIN -#include -#endif #endif /* SDL_PROTOTYPES_ONLY */ #if defined(SDL_VIDEO_DRIVER_KMSDRM) @@ -145,7 +141,6 @@ typedef enum SDL_SYSWM_WINRT, SDL_SYSWM_ANDROID, SDL_SYSWM_VIVANTE, - SDL_SYSWM_OS2, SDL_SYSWM_HAIKU, SDL_SYSWM_KMSDRM, SDL_SYSWM_RISCOS @@ -201,16 +196,6 @@ struct SDL_SysWMmsg int dummy; /* No Vivante window events yet */ } vivante; -#endif -#if defined(SDL_VIDEO_DRIVER_OS2) - struct - { - BOOL fFrame; /**< TRUE if hwnd is a frame window */ - HWND hwnd; /**< The window receiving the message */ - ULONG msg; /**< The message identifier */ - MPARAM mp1; /**< The first first message parameter */ - MPARAM mp2; /**< The second first message parameter */ - } os2; #endif /* Can't have an empty union */ int dummy; @@ -318,14 +303,6 @@ struct SDL_SysWMinfo } android; #endif -#if defined(SDL_VIDEO_DRIVER_OS2) - struct - { - HWND hwnd; /**< The window handle */ - HWND hwndFrame; /**< The frame window handle */ - } os2; -#endif - #if defined(SDL_VIDEO_DRIVER_VIVANTE) struct { diff --git a/include/SDL_thread.h b/include/SDL_thread.h index 6bedcb555d..ea8d36fb65 100644 --- a/include/SDL_thread.h +++ b/include/SDL_thread.h @@ -38,13 +38,6 @@ #if defined(__WIN32__) || defined(__GDK__) #include /* _beginthreadex() and _endthreadex() */ #endif -#if defined(__OS2__) /* for _beginthread() and _endthread() */ -#ifndef __EMX__ -#include -#else -#include -#endif -#endif #include "begin_code.h" /* Set up for C function definitions, even when using C++ */ @@ -145,42 +138,6 @@ SDL_CreateThreadWithStackSize(SDL_ThreadFunction fn, #define SDL_CreateThreadWithStackSize(fn, name, stacksize, data) SDL_CreateThreadWithStackSize(fn, name, data, (pfnSDL_CurrentBeginThread)_beginthreadex, (pfnSDL_CurrentEndThread)SDL_endthread) #endif -#elif defined(__OS2__) -/* - * just like the windows case above: We compile SDL3 - * into a dll with Watcom's runtime statically linked. - */ -#define SDL_PASSED_BEGINTHREAD_ENDTHREAD - -typedef int (*pfnSDL_CurrentBeginThread)(void (*func)(void *), void *, unsigned, void * /*arg*/); -typedef void (*pfnSDL_CurrentEndThread)(void); - -#ifndef SDL_beginthread -#define SDL_beginthread _beginthread -#endif -#ifndef SDL_endthread -#define SDL_endthread _endthread -#endif - -extern DECLSPEC SDL_Thread *SDLCALL -SDL_CreateThread(SDL_ThreadFunction fn, const char *name, void *data, - pfnSDL_CurrentBeginThread pfnBeginThread, - pfnSDL_CurrentEndThread pfnEndThread); -extern DECLSPEC SDL_Thread *SDLCALL -SDL_CreateThreadWithStackSize(SDL_ThreadFunction fn, const char *name, const size_t stacksize, void *data, - pfnSDL_CurrentBeginThread pfnBeginThread, - pfnSDL_CurrentEndThread pfnEndThread); - -#if defined(SDL_CreateThread) && SDL_DYNAMIC_API -#undef SDL_CreateThread -#define SDL_CreateThread(fn, name, data) SDL_CreateThread_REAL(fn, name, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread) -#undef SDL_CreateThreadWithStackSize -#define SDL_CreateThreadWithStackSize(fn, name, stacksize, data) SDL_CreateThreadWithStackSize_REAL(fn, name, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread) -#else -#define SDL_CreateThread(fn, name, data) SDL_CreateThread(fn, name, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread) -#define SDL_CreateThreadWithStackSize(fn, name, stacksize, data) SDL_CreateThreadWithStackSize(fn, name, stacksize, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread) -#endif - #else /** diff --git a/include/begin_code.h b/include/begin_code.h index b3e69e85c7..bc248b2e44 100644 --- a/include/begin_code.h +++ b/include/begin_code.h @@ -57,12 +57,6 @@ # else # define DECLSPEC # endif -# elif defined(__OS2__) -# ifdef BUILD_SDL -# define DECLSPEC __declspec(dllexport) -# else -# define DECLSPEC -# endif # else # if defined(__GNUC__) && __GNUC__ >= 4 # define DECLSPEC __attribute__ ((visibility("default"))) @@ -76,11 +70,6 @@ #ifndef SDLCALL #if (defined(__WIN32__) || defined(__WINRT__) || defined(__GDK__)) && !defined(__GNUC__) #define SDLCALL __cdecl -#elif defined(__OS2__) || defined(__EMX__) -#define SDLCALL _System -# if defined (__GNUC__) && !defined(_System) -# define _System /* for old EMX/GCC compat. */ -# endif #else #define SDLCALL #endif diff --git a/src/SDL.c b/src/SDL.c index 6297159e42..90bf7a2cb4 100644 --- a/src/SDL.c +++ b/src/SDL.c @@ -22,17 +22,9 @@ #if defined(__WIN32__) || defined(__GDK__) #include "core/windows/SDL_windows.h" -#elif defined(__OS2__) -#include /* _exit() */ #elif !defined(__WINRT__) #include /* _exit(), etc. */ #endif -#if defined(__OS2__) -#include "core/os2/SDL_os2.h" -#if SDL_THREAD_OS2 -#include "thread/os2/SDL_systls_c.h" -#endif -#endif /* this checks for HAVE_DBUS_DBUS_H internally. */ #include "core/linux/SDL_dbus.h" @@ -198,10 +190,6 @@ SDL_InitSubSystem(Uint32 flags) flags |= SDL_INIT_EVENTS; } -#if SDL_THREAD_OS2 - SDL_OS2TLSAlloc(); /* thread/os2/SDL_systls.c */ -#endif - #if SDL_VIDEO_DRIVER_WINDOWS if ((flags & (SDL_INIT_HAPTIC|SDL_INIT_JOYSTICK))) { if (SDL_HelperWindowCreate() < 0) { @@ -359,13 +347,6 @@ SDL_Init(Uint32 flags) void SDL_QuitSubSystem(Uint32 flags) { -#if defined(__OS2__) -#if SDL_THREAD_OS2 - SDL_OS2TLSFree(); /* thread/os2/SDL_systls.c */ -#endif - SDL_OS2Quit(); -#endif - /* Shut down requested initialized subsystems */ #if !SDL_SENSOR_DISABLED if ((flags & SDL_INIT_SENSOR)) { diff --git a/src/audio/SDL_audio.c b/src/audio/SDL_audio.c index 0888878224..76395f54ff 100644 --- a/src/audio/SDL_audio.c +++ b/src/audio/SDL_audio.c @@ -120,9 +120,6 @@ static const AudioBootStrap *const bootstrap[] = { #if SDL_AUDIO_DRIVER_OSS &DSP_bootstrap, #endif -#if SDL_AUDIO_DRIVER_OS2 - &OS2AUDIO_bootstrap, -#endif #if SDL_AUDIO_DRIVER_DISK &DISKAUDIO_bootstrap, #endif diff --git a/src/audio/SDL_sysaudio.h b/src/audio/SDL_sysaudio.h index a911de041e..a76c5c21b9 100644 --- a/src/audio/SDL_sysaudio.h +++ b/src/audio/SDL_sysaudio.h @@ -211,7 +211,6 @@ extern AudioBootStrap PSPAUDIO_bootstrap; extern AudioBootStrap VITAAUD_bootstrap; extern AudioBootStrap N3DSAUDIO_bootstrap; extern AudioBootStrap EMSCRIPTENAUDIO_bootstrap; -extern AudioBootStrap OS2AUDIO_bootstrap; #endif /* SDL_sysaudio_h_ */ diff --git a/src/audio/os2/SDL_os2audio.c b/src/audio/os2/SDL_os2audio.c deleted file mode 100644 index 9ddfb76079..0000000000 --- a/src/audio/os2/SDL_os2audio.c +++ /dev/null @@ -1,450 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ -#include "../../SDL_internal.h" - -#if SDL_AUDIO_DRIVER_OS2 - -/* Allow access to a raw mixing buffer */ - -#include "../../core/os2/SDL_os2.h" - -#include "SDL_audio.h" -#include "../SDL_audio_c.h" -#include "SDL_os2audio.h" - -/* -void lockIncr(volatile int *piVal); -#pragma aux lockIncr = \ - "lock add [eax], 1 "\ - parm [eax]; - -void lockDecr(volatile int *piVal); -#pragma aux lockDecr = \ - "lock sub [eax], 1 "\ - parm [eax]; -*/ - -static ULONG _getEnvULong(const char *name, ULONG ulMax, ULONG ulDefault) -{ - ULONG ulValue; - char* end; - char* envval = SDL_getenv(name); - - if (envval == NULL) - return ulDefault; - - ulValue = SDL_strtoul(envval, &end, 10); - return (end == envval) || (ulValue > ulMax)? ulDefault : ulMax; -} - -static int _MCIError(const char *func, ULONG ulResult) -{ - CHAR acBuf[128]; - mciGetErrorString(ulResult, acBuf, sizeof(acBuf)); - return SDL_SetError("[%s] %s", func, acBuf); -} - -static void _mixIOError(const char *function, ULONG ulRC) -{ - debug_os2("%s() - failed, rc = 0x%X (%s)", - function, ulRC, - (ulRC == MCIERR_INVALID_MODE) ? "Mixer mode does not match request" : - (ulRC == MCIERR_INVALID_BUFFER) ? "Caller sent an invalid buffer" : "unknown"); -} - -static LONG APIENTRY cbAudioWriteEvent(ULONG ulStatus, PMCI_MIX_BUFFER pBuffer, - ULONG ulFlags) -{ - SDL_PrivateAudioData *pAData = (SDL_PrivateAudioData *)pBuffer->ulUserParm; - ULONG ulRC; - - if (ulFlags != MIX_WRITE_COMPLETE) { - debug_os2("flags = 0x%X", ulFlags); - return 0; - } - - /*lockDecr((int *)&pAData->ulQueuedBuf);*/ - ulRC = DosPostEventSem(pAData->hevBuf); - if (ulRC != NO_ERROR && ulRC != ERROR_ALREADY_POSTED) { - debug_os2("DosPostEventSem(), rc = %u", ulRC); - } - - return 1; /* return value doesn't seem to matter. */ -} - -static LONG APIENTRY cbAudioReadEvent(ULONG ulStatus, PMCI_MIX_BUFFER pBuffer, - ULONG ulFlags) -{ - SDL_PrivateAudioData *pAData = (SDL_PrivateAudioData *)pBuffer->ulUserParm; - ULONG ulRC; - - if (ulFlags != MIX_READ_COMPLETE) { - debug_os2("flags = 0x%X", ulFlags); - return 0; - } - - pAData->stMCIMixSetup.pmixRead(pAData->stMCIMixSetup.ulMixHandle, pBuffer, 1); - - ulRC = DosPostEventSem(pAData->hevBuf); - if (ulRC != NO_ERROR && ulRC != ERROR_ALREADY_POSTED) { - debug_os2("DosPostEventSem(), rc = %u", ulRC); - } - - return 1; -} - - -static void OS2_DetectDevices(void) -{ - MCI_SYSINFO_PARMS stMCISysInfo; - CHAR acBuf[256]; - ULONG ulDevicesNum; - MCI_SYSINFO_LOGDEVICE stLogDevice; - MCI_SYSINFO_PARMS stSysInfoParams; - ULONG ulRC; - ULONG ulHandle = 0; - - acBuf[0] = '\0'; - stMCISysInfo.pszReturn = acBuf; - stMCISysInfo.ulRetSize = sizeof(acBuf); - stMCISysInfo.usDeviceType = MCI_DEVTYPE_AUDIO_AMPMIX; - ulRC = mciSendCommand(0, MCI_SYSINFO, MCI_WAIT | MCI_SYSINFO_QUANTITY, - &stMCISysInfo, 0); - if (ulRC != NO_ERROR) { - debug_os2("MCI_SYSINFO, MCI_SYSINFO_QUANTITY - failed, rc = 0x%X", ulRC); - return; - } - - ulDevicesNum = SDL_strtoul(stMCISysInfo.pszReturn, NULL, 10); - - for (stSysInfoParams.ulNumber = 0; stSysInfoParams.ulNumber < ulDevicesNum; - stSysInfoParams.ulNumber++) { - /* Get device install name. */ - stSysInfoParams.pszReturn = acBuf; - stSysInfoParams.ulRetSize = sizeof(acBuf); - stSysInfoParams.usDeviceType = MCI_DEVTYPE_AUDIO_AMPMIX; - ulRC = mciSendCommand(0, MCI_SYSINFO, MCI_WAIT | MCI_SYSINFO_INSTALLNAME, - &stSysInfoParams, 0); - if (ulRC != NO_ERROR) { - debug_os2("MCI_SYSINFO, MCI_SYSINFO_INSTALLNAME - failed, rc = 0x%X", ulRC); - continue; - } - - /* Get textual product description. */ - stSysInfoParams.ulItem = MCI_SYSINFO_QUERY_DRIVER; - stSysInfoParams.pSysInfoParm = &stLogDevice; - SDL_strlcpy(stLogDevice.szInstallName, stSysInfoParams.pszReturn, MAX_DEVICE_NAME); - ulRC = mciSendCommand(0, MCI_SYSINFO, MCI_WAIT | MCI_SYSINFO_ITEM, - &stSysInfoParams, 0); - if (ulRC != NO_ERROR) { - debug_os2("MCI_SYSINFO, MCI_SYSINFO_ITEM - failed, rc = 0x%X", ulRC); - continue; - } - - ulHandle++; - SDL_AddAudioDevice(0, stLogDevice.szProductInfo, NULL, (void *)(ulHandle)); - ulHandle++; - SDL_AddAudioDevice(1, stLogDevice.szProductInfo, NULL, (void *)(ulHandle)); - } -} - -static void OS2_WaitDevice(_THIS) -{ - SDL_PrivateAudioData *pAData = (SDL_PrivateAudioData *)_this->hidden; - ULONG ulRC; - - /* Wait for an audio chunk to finish */ - ulRC = DosWaitEventSem(pAData->hevBuf, 5000); - if (ulRC != NO_ERROR) { - debug_os2("DosWaitEventSem(), rc = %u", ulRC); - } -} - -static Uint8 *OS2_GetDeviceBuf(_THIS) -{ - SDL_PrivateAudioData *pAData = (SDL_PrivateAudioData *)_this->hidden; - return (Uint8 *) pAData->aMixBuffers[pAData->ulNextBuf].pBuffer; -} - -static void OS2_PlayDevice(_THIS) -{ - SDL_PrivateAudioData *pAData = (SDL_PrivateAudioData *)_this->hidden; - ULONG ulRC; - PMCI_MIX_BUFFER pMixBuffer = &pAData->aMixBuffers[pAData->ulNextBuf]; - - /* Queue it up */ - /*lockIncr((int *)&pAData->ulQueuedBuf);*/ - ulRC = pAData->stMCIMixSetup.pmixWrite(pAData->stMCIMixSetup.ulMixHandle, - pMixBuffer, 1); - if (ulRC != MCIERR_SUCCESS) { - _mixIOError("pmixWrite", ulRC); - } else { - pAData->ulNextBuf = (pAData->ulNextBuf + 1) % pAData->cMixBuffers; - } -} - -static void OS2_CloseDevice(_THIS) -{ - SDL_PrivateAudioData *pAData = (SDL_PrivateAudioData *)_this->hidden; - MCI_GENERIC_PARMS sMCIGenericParms; - ULONG ulRC; - - if (pAData == NULL) - return; - - /* Close up audio */ - if (pAData->usDeviceId != (USHORT)~0) { /* Device is open. */ - if (pAData->stMCIMixSetup.ulBitsPerSample != 0) { /* Mixer was initialized. */ - ulRC = mciSendCommand(pAData->usDeviceId, MCI_MIXSETUP, - MCI_WAIT | MCI_MIXSETUP_DEINIT, - &pAData->stMCIMixSetup, 0); - if (ulRC != MCIERR_SUCCESS) { - debug_os2("MCI_MIXSETUP, MCI_MIXSETUP_DEINIT - failed"); - } - } - - if (pAData->cMixBuffers != 0) { /* Buffers was allocated. */ - MCI_BUFFER_PARMS stMCIBuffer; - - stMCIBuffer.ulBufferSize = pAData->aMixBuffers[0].ulBufferLength; - stMCIBuffer.ulNumBuffers = pAData->cMixBuffers; - stMCIBuffer.pBufList = pAData->aMixBuffers; - - ulRC = mciSendCommand(pAData->usDeviceId, MCI_BUFFER, - MCI_WAIT | MCI_DEALLOCATE_MEMORY, &stMCIBuffer, 0); - if (ulRC != MCIERR_SUCCESS) { - debug_os2("MCI_BUFFER, MCI_DEALLOCATE_MEMORY - failed"); - } - } - - ulRC = mciSendCommand(pAData->usDeviceId, MCI_CLOSE, MCI_WAIT, - &sMCIGenericParms, 0); - if (ulRC != MCIERR_SUCCESS) { - debug_os2("MCI_CLOSE - failed"); - } - } - - if (pAData->hevBuf != NULLHANDLE) - DosCloseEventSem(pAData->hevBuf); - - SDL_free(pAData); -} - -static int OS2_OpenDevice(_THIS, const char *devname) -{ - SDL_PrivateAudioData *pAData; - SDL_AudioFormat test_format; - MCI_AMP_OPEN_PARMS stMCIAmpOpen; - MCI_BUFFER_PARMS stMCIBuffer; - ULONG ulRC; - ULONG ulIdx; - BOOL new_freq; - SDL_bool iscapture = _this->iscapture; - - new_freq = FALSE; - SDL_zero(stMCIAmpOpen); - SDL_zero(stMCIBuffer); - - for (test_format = SDL_FirstAudioFormat(_this->spec.format); test_format; test_format = SDL_NextAudioFormat()) { - if (test_format == AUDIO_U8 || test_format == AUDIO_S16) - break; - } - if (!test_format) { - debug_os2("Unsupported audio format, AUDIO_S16 used"); - test_format = AUDIO_S16; - } - - pAData = (SDL_PrivateAudioData *) SDL_calloc(1, sizeof(struct SDL_PrivateAudioData)); - if (pAData == NULL) - return SDL_OutOfMemory(); - _this->hidden = pAData; - - ulRC = DosCreateEventSem(NULL, &pAData->hevBuf, DCE_AUTORESET, TRUE); - if (ulRC != NO_ERROR) { - debug_os2("DosCreateEventSem() failed, rc = %u", ulRC); - return -1; - } - - /* Open audio device */ - stMCIAmpOpen.usDeviceID = (_this->handle != NULL) ? ((ULONG)_this->handle - 1) : 0; - stMCIAmpOpen.pszDeviceType = (PSZ)MCI_DEVTYPE_AUDIO_AMPMIX; - ulRC = mciSendCommand(0, MCI_OPEN, - (_getEnvULong("SDL_AUDIO_SHARE", 1, 0) != 0)? - MCI_WAIT | MCI_OPEN_TYPE_ID | MCI_OPEN_SHAREABLE : - MCI_WAIT | MCI_OPEN_TYPE_ID, - &stMCIAmpOpen, 0); - if (ulRC != MCIERR_SUCCESS) { - stMCIAmpOpen.usDeviceID = (USHORT)~0; - return _MCIError("MCI_OPEN", ulRC); - } - pAData->usDeviceId = stMCIAmpOpen.usDeviceID; - - if (iscapture) { - MCI_CONNECTOR_PARMS stMCIConnector; - MCI_AMP_SET_PARMS stMCIAmpSet; - BOOL fLineIn = _getEnvULong("SDL_AUDIO_LINEIN", 1, 0); - - /* Set particular connector. */ - SDL_zero(stMCIConnector); - stMCIConnector.ulConnectorType = (fLineIn)? MCI_LINE_IN_CONNECTOR : - MCI_MICROPHONE_CONNECTOR; - mciSendCommand(stMCIAmpOpen.usDeviceID, MCI_CONNECTOR, - MCI_WAIT | MCI_ENABLE_CONNECTOR | - MCI_CONNECTOR_TYPE, &stMCIConnector, 0); - - /* Disable monitor. */ - SDL_zero(stMCIAmpSet); - stMCIAmpSet.ulItem = MCI_AMP_SET_MONITOR; - mciSendCommand(stMCIAmpOpen.usDeviceID, MCI_SET, - MCI_WAIT | MCI_SET_OFF | MCI_SET_ITEM, - &stMCIAmpSet, 0); - - /* Set record volume. */ - stMCIAmpSet.ulLevel = _getEnvULong("SDL_AUDIO_RECVOL", 100, 90); - stMCIAmpSet.ulItem = MCI_AMP_SET_AUDIO; - stMCIAmpSet.ulAudio = MCI_SET_AUDIO_ALL; /* Both cnannels. */ - stMCIAmpSet.ulValue = (fLineIn) ? MCI_LINE_IN_CONNECTOR : - MCI_MICROPHONE_CONNECTOR ; - - mciSendCommand(stMCIAmpOpen.usDeviceID, MCI_SET, - MCI_WAIT | MCI_SET_AUDIO | MCI_AMP_SET_GAIN, - &stMCIAmpSet, 0); - } - - _this->spec.format = test_format; - _this->spec.channels = _this->spec.channels > 1 ? 2 : 1; - if (_this->spec.freq < 8000) { - _this->spec.freq = 8000; - new_freq = TRUE; - } else if (_this->spec.freq > 48000) { - _this->spec.freq = 48000; - new_freq = TRUE; - } - - /* Setup mixer. */ - pAData->stMCIMixSetup.ulFormatTag = MCI_WAVE_FORMAT_PCM; - pAData->stMCIMixSetup.ulBitsPerSample = SDL_AUDIO_BITSIZE(test_format); - pAData->stMCIMixSetup.ulSamplesPerSec = _this->spec.freq; - pAData->stMCIMixSetup.ulChannels = _this->spec.channels; - pAData->stMCIMixSetup.ulDeviceType = MCI_DEVTYPE_WAVEFORM_AUDIO; - if (!iscapture) { - pAData->stMCIMixSetup.ulFormatMode= MCI_PLAY; - pAData->stMCIMixSetup.pmixEvent = cbAudioWriteEvent; - } else { - pAData->stMCIMixSetup.ulFormatMode= MCI_RECORD; - pAData->stMCIMixSetup.pmixEvent = cbAudioReadEvent; - } - - ulRC = mciSendCommand(pAData->usDeviceId, MCI_MIXSETUP, - MCI_WAIT | MCI_MIXSETUP_INIT, &pAData->stMCIMixSetup, 0); - if (ulRC != MCIERR_SUCCESS && _this->spec.freq > 44100) { - new_freq = TRUE; - pAData->stMCIMixSetup.ulSamplesPerSec = 44100; - _this->spec.freq = 44100; - ulRC = mciSendCommand(pAData->usDeviceId, MCI_MIXSETUP, - MCI_WAIT | MCI_MIXSETUP_INIT, &pAData->stMCIMixSetup, 0); - } - - debug_os2("Setup mixer [BPS: %u, Freq.: %u, Channels: %u]: %s", - pAData->stMCIMixSetup.ulBitsPerSample, - pAData->stMCIMixSetup.ulSamplesPerSec, - pAData->stMCIMixSetup.ulChannels, - (ulRC == MCIERR_SUCCESS)? "SUCCESS" : "FAIL"); - - if (ulRC != MCIERR_SUCCESS) { - pAData->stMCIMixSetup.ulBitsPerSample = 0; - return _MCIError("MCI_MIXSETUP", ulRC); - } - - if (_this->spec.samples == 0 || new_freq == TRUE) { - /* also see SDL_audio.c:prepare_audiospec() */ - /* Pick a default of ~46 ms at desired frequency */ - Uint32 samples = (_this->spec.freq / 1000) * 46; - Uint32 power2 = 1; - while (power2 < samples) { - power2 <<= 1; - } - _this->spec.samples = power2; - } - /* Update the fragment size as size in bytes */ - SDL_CalculateAudioSpec(&_this->spec); - - /* Allocate memory buffers */ - stMCIBuffer.ulBufferSize = _this->spec.size;/* (_this->spec.freq / 1000) * 100 */ - stMCIBuffer.ulNumBuffers = NUM_BUFFERS; - stMCIBuffer.pBufList = pAData->aMixBuffers; - - ulRC = mciSendCommand(pAData->usDeviceId, MCI_BUFFER, - MCI_WAIT | MCI_ALLOCATE_MEMORY, &stMCIBuffer, 0); - if (ulRC != MCIERR_SUCCESS) { - return _MCIError("MCI_BUFFER", ulRC); - } - pAData->cMixBuffers = stMCIBuffer.ulNumBuffers; - _this->spec.size = stMCIBuffer.ulBufferSize; - - /* Fill all device buffers with data */ - for (ulIdx = 0; ulIdx < stMCIBuffer.ulNumBuffers; ulIdx++) { - pAData->aMixBuffers[ulIdx].ulFlags = 0; - pAData->aMixBuffers[ulIdx].ulBufferLength = stMCIBuffer.ulBufferSize; - pAData->aMixBuffers[ulIdx].ulUserParm = (ULONG)pAData; - - SDL_memset(((PMCI_MIX_BUFFER)stMCIBuffer.pBufList)[ulIdx].pBuffer, - _this->spec.silence, stMCIBuffer.ulBufferSize); - } - - /* Write buffers to kick off the amp mixer */ - ulRC = pAData->stMCIMixSetup.pmixWrite(pAData->stMCIMixSetup.ulMixHandle, - pAData->aMixBuffers, 1); - if (ulRC != MCIERR_SUCCESS) { - _mixIOError("pmixWrite", ulRC); - return -1; - } - - return 0; -} - - -static SDL_bool OS2_Init(SDL_AudioDriverImpl * impl) -{ - /* Set the function pointers */ - impl->DetectDevices = OS2_DetectDevices; - impl->OpenDevice = OS2_OpenDevice; - impl->PlayDevice = OS2_PlayDevice; - impl->WaitDevice = OS2_WaitDevice; - impl->GetDeviceBuf = OS2_GetDeviceBuf; - impl->CloseDevice = OS2_CloseDevice; - - /* TODO: IMPLEMENT CAPTURE SUPPORT: - impl->CaptureFromDevice = ; - impl->FlushCapture = ; - impl->HasCaptureSupport = SDL_TRUE; - */ - return SDL_TRUE; /* this audio target is available. */ -} - - -AudioBootStrap OS2AUDIO_bootstrap = { - "DART", "OS/2 DART", OS2_Init, SDL_FALSE -}; - -#endif /* SDL_AUDIO_DRIVER_OS2 */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/audio/os2/SDL_os2audio.h b/src/audio/os2/SDL_os2audio.h deleted file mode 100644 index 07ebbae399..0000000000 --- a/src/audio/os2/SDL_os2audio.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ -#include "../../SDL_internal.h" - -#ifndef SDL_os2mm_h_ -#define SDL_os2mm_h_ - -#include "../SDL_sysaudio.h" - -#define INCL_OS2MM -#define INCL_PM -#define INCL_DOS -#define INCL_DOSERRORS -#include -#include - -/* Hidden "this" pointer for the audio functions */ -#define _THIS SDL_AudioDevice *_this - -#define NUM_BUFFERS 3 - -typedef struct SDL_PrivateAudioData -{ - USHORT usDeviceId; - BYTE _pad[2]; - MCI_MIXSETUP_PARMS stMCIMixSetup; - HEV hevBuf; - ULONG ulNextBuf; - ULONG cMixBuffers; - MCI_MIX_BUFFER aMixBuffers[NUM_BUFFERS]; -/* ULONG ulQueuedBuf;*/ -} SDL_PrivateAudioData; - -#endif /* SDL_os2mm_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/core/os2/SDL_os2.c b/src/core/os2/SDL_os2.c deleted file mode 100644 index 553f88cfd5..0000000000 --- a/src/core/os2/SDL_os2.c +++ /dev/null @@ -1,38 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -#include "../../SDL_internal.h" - -#if defined(__OS2__) - -#include "SDL_os2.h" - -/* SDL_OS2Quit() will be called from SDL_QuitSubSystem() */ -void SDL_OS2Quit(void) -{ - /* Unload DLL used for iconv. We can do it at any time and use iconv again - - * dynamic library will be loaded on first call iconv_open() (see geniconv). */ - libiconv_clean(); -} - -#endif - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/core/os2/SDL_os2.h b/src/core/os2/SDL_os2.h deleted file mode 100644 index 84068cc137..0000000000 --- a/src/core/os2/SDL_os2.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ -#ifndef SDL_os2_h_ -#define SDL_os2_h_ - -#include "SDL_log.h" -#include "SDL_stdinc.h" - -#ifdef OS2DEBUG -#if (OS2DEBUG-0 >= 2) -# define debug_os2(s,...) SDL_LogDebug(SDL_LOG_CATEGORY_APPLICATION, \ - __func__ "(): " ##s, ##__VA_ARGS__) -#else -# define debug_os2(s,...) printf(__func__ "(): " ##s "\n", ##__VA_ARGS__) -#endif - -#else /* no debug */ - -# define debug_os2(s,...) do {} while (0) - -#endif /* OS2DEBUG */ - -#if defined(HAVE_ICONV) && defined(HAVE_ICONV_H) -#define OS2_SysToUTF8(S) SDL_iconv_string("UTF-8", "", (char *)(S), SDL_strlen(S)+1) -#define OS2_UTF8ToSys(S) SDL_iconv_string("", "UTF-8", (char *)(S), SDL_strlen(S)+1) -#define libiconv_clean() do {} while(0) -#else -/* StrUTF8New() - geniconv/sys2utf8.c */ -#include "geniconv/geniconv.h" -#define OS2_SysToUTF8(S) StrUTF8New(1, (S), SDL_strlen((S)) + 1) -#define OS2_UTF8ToSys(S) StrUTF8New(0, (char *)(S), SDL_strlen((S)) + 1) -#endif - -/* SDL_OS2Quit() will be called from SDL_QuitSubSystem() */ -void SDL_OS2Quit(void); - -#endif /* SDL_os2_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/core/os2/geniconv/geniconv.c b/src/core/os2/geniconv/geniconv.c deleted file mode 100644 index 5976fe79fd..0000000000 --- a/src/core/os2/geniconv/geniconv.c +++ /dev/null @@ -1,161 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/* - Universal iconv implementation for OS/2. - - Andrey Vasilkin, 2016. -*/ - -#define INCL_DOSMODULEMGR /* Module Manager */ -#define INCL_DOSERRORS /* Error values */ -#include - -#include "geniconv.h" - -/*#define DEBUG*/ -#ifdef DEBUG -# include -# define iconv_debug(s,...) printf(__func__"(): "##s"\n" ,##__VA_ARGS__) -#else -# define iconv_debug(s,...) do {} while (0) -#endif - -/* Exports from os2iconv.c */ -extern iconv_t _System os2_iconv_open (const char* tocode, const char* fromcode); -extern size_t _System os2_iconv (iconv_t cd, - char **inbuf, size_t *inbytesleft, - char **outbuf, size_t *outbytesleft); -extern int _System os2_iconv_close (iconv_t cd); - -/* Functions pointers */ -typedef iconv_t (_System *FNICONV_OPEN)(const char*, const char*); -typedef size_t (_System *FNICONV) (iconv_t, char **, size_t *, char **, size_t *); -typedef int (_System *FNICONV_CLOSE)(iconv_t); - -static HMODULE hmIconv = NULLHANDLE; -static FNICONV_OPEN fn_iconv_open = os2_iconv_open; -static FNICONV fn_iconv = os2_iconv; -static FNICONV_CLOSE fn_iconv_close = os2_iconv_close; - -static int geniconv_init = 0; - - -static BOOL _loadDLL(const char *dllname, - const char *sym_iconvopen, - const char *sym_iconv, - const char *sym_iconvclose) -{ - ULONG rc; - char error[256]; - - rc = DosLoadModule(error, sizeof(error), dllname, &hmIconv); - if (rc != NO_ERROR) { - iconv_debug("DLL %s not loaded: %s", dllname, error); - return FALSE; - } - - rc = DosQueryProcAddr(hmIconv, 0, sym_iconvopen, (PFN *)&fn_iconv_open); - if (rc != NO_ERROR) { - iconv_debug("Error: cannot find entry %s in %s", sym_iconvopen, dllname); - goto fail; - } - - rc = DosQueryProcAddr(hmIconv, 0, sym_iconv, (PFN *)&fn_iconv); - if (rc != NO_ERROR) { - iconv_debug("Error: cannot find entry %s in %s", sym_iconv, dllname); - goto fail; - } - - rc = DosQueryProcAddr(hmIconv, 0, sym_iconvclose, (PFN *)&fn_iconv_close); - if (rc != NO_ERROR) { - iconv_debug("Error: cannot find entry %s in %s", sym_iconvclose, dllname); - goto fail; - } - - iconv_debug("DLL %s used", dllname); - return TRUE; - - fail: - DosFreeModule(hmIconv); - hmIconv = NULLHANDLE; - return FALSE; -} - -static void _init(void) -{ - if (geniconv_init) { - return; /* Already initialized */ - } - - geniconv_init = 1; - - /* Try to load kiconv.dll, iconv2.dll or iconv.dll */ - if (!_loadDLL("KICONV", "_libiconv_open", "_libiconv", "_libiconv_close") && - !_loadDLL("ICONV2", "_libiconv_open", "_libiconv", "_libiconv_close") && - !_loadDLL("ICONV", "_iconv_open", "_iconv", "_iconv_close") ) { - /* No DLL was loaded - use OS/2 conversion objects API */ - iconv_debug("Uni*() API used"); - fn_iconv_open = os2_iconv_open; - fn_iconv = os2_iconv; - fn_iconv_close = os2_iconv_close; - } -} - - -/* Public routines. - * ---------------- - */ - -/* function to unload the used iconv dynamic library */ -void libiconv_clean(void) -{ - geniconv_init = 0; - - /* reset the function pointers. */ - fn_iconv_open = os2_iconv_open; - fn_iconv = os2_iconv; - fn_iconv_close = os2_iconv_close; - - if (hmIconv != NULLHANDLE) { - DosFreeModule(hmIconv); - hmIconv = NULLHANDLE; - } -} - -iconv_t libiconv_open(const char* tocode, const char* fromcode) -{ - _init(); - return fn_iconv_open(tocode, fromcode); -} - -size_t libiconv(iconv_t cd, char* * inbuf, size_t *inbytesleft, - char* * outbuf, size_t *outbytesleft) -{ - return fn_iconv(cd, inbuf, inbytesleft, outbuf, outbytesleft); -} - -int libiconv_close(iconv_t cd) -{ - return fn_iconv_close(cd); -} - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/core/os2/geniconv/geniconv.h b/src/core/os2/geniconv/geniconv.h deleted file mode 100644 index 607fe8f8d3..0000000000 --- a/src/core/os2/geniconv/geniconv.h +++ /dev/null @@ -1,85 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/* - Universal iconv implementation for OS/2. - - Andrey Vasilkin, 2016. -*/ - -#ifndef GENICONV_H -#define GENICONV_H - -#include "iconv.h" - -#ifdef iconv_open -#undef iconv_open -#endif -#define iconv_open libiconv_open - -#ifdef iconv -#undef iconv -#endif -#define iconv libiconv - -#ifdef iconv_close -#undef iconv_close -#endif -#define iconv_close libiconv_close - -#define iconv_clean libiconv_clean - -/* Non-standard function for iconv to unload the used dynamic library */ -void libiconv_clean(void); - -iconv_t libiconv_open (const char *tocode, const char *fromcode); -int libiconv_close(iconv_t cd); -size_t libiconv (iconv_t cd, char **inbuf, size_t *inbytesleft, - char **outbuf, size_t *outbytesleft); - -/* System codepage <-> UTF-8 - * - * StrUTF8() - * Converts string from system cp to UTF-8 (to_utf8 is not 0) or from UTF-8 to - * the system cp (to_utf8 is 0). Converted ASCIIZ string will be placed at the - * buffer dst, up to c_dst - 1 (for sys->utf8) or 2 (for utf8->sys) bytes. - * Returns the number of bytes written into dst, not counting the terminating - * 0 byte(s) or -1 on error. - */ -int StrUTF8(int to_utf8, char *dst, int c_dst, char *src, int c_src); - -/* StrUTF8New() - * Converts string from system cp to UTF-8 (to_utf8 is not 0) or from UTF-8 - * to the system cp (to_utf8 is 0). Memory for the new string is obtained by - * using libc malloc(). - * Returns converted string, terminating two bytes 0 is appended to the result. - * Returns null on error. - */ -char *StrUTF8New(int to_utf8, char *str, int c_str); - -/* StrUTF8Free() - * Deallocates the memory block allocated by StrUTF8New() (just libc free()). - */ -void StrUTF8Free(char *str); - -#endif /* GENICONV_H */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/core/os2/geniconv/iconv.h b/src/core/os2/geniconv/iconv.h deleted file mode 100644 index b336dabe37..0000000000 --- a/src/core/os2/geniconv/iconv.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef ICONV_H_ /* minimal iconv.h header based on public knowledge */ -#define ICONV_H_ - -#include /* size_t */ -#include - -typedef void *iconv_t; - -#ifdef __cplusplus -extern "C" { -#endif - -extern iconv_t iconv_open(const char *, const char *); -extern size_t iconv(iconv_t, char **, size_t *, char **, size_t *); -extern int iconv_close(iconv_t); - -#ifdef __cplusplus -} -#endif - -#endif /* ICONV_H_ */ diff --git a/src/core/os2/geniconv/makefile b/src/core/os2/geniconv/makefile deleted file mode 100644 index 566c13d296..0000000000 --- a/src/core/os2/geniconv/makefile +++ /dev/null @@ -1,37 +0,0 @@ -# -# Universal iconv implementation for OS/2. -# -# OpenWatcom makefile to build a library that uses kiconv.dll / iconv2.dll / -# iconv.dll or OS/2 Uni*() API. -# -# Andrey Vasilkin, 2016. -# - -LIBFILE = geniconv.lib - -all: $(LIBFILE) test.exe .symbolic - -CFLAGS = -I$(%WATCOM)/h/os2 -I$(%WATCOM)/h -I. -bt=os2 -q -d0 -w2 -DGENICONV_STANDALONE=1 - -SRCS = geniconv.c os2cp.c os2iconv.c -SRCS+= sys2utf8.c - -OBJS = $(SRCS:.c=.obj) - -LIBS = libuls.lib libconv.lib $(LIBFILE) - -test.exe: $(LIBFILE) test.obj - wlink op quiet system os2v2 file test.obj lib {$(LIBS)} name $* - -$(LIBFILE): $(OBJS) - @if exist $@ rm $@ - @for %f in ($(OBJS)) do wlib -q -b $* +%f - -.c.obj: - wcc386 $(CFLAGS) -fo=$^@ $< - -clean: .SYMBOLIC - @if exist *.obj rm *.obj - @if exist *.err rm *.err - @if exist $(LIBFILE) rm $(LIBFILE) - @if exist test.exe rm test.exe diff --git a/src/core/os2/geniconv/os2cp.c b/src/core/os2/geniconv/os2cp.c deleted file mode 100644 index 0a651e17db..0000000000 --- a/src/core/os2/geniconv/os2cp.c +++ /dev/null @@ -1,416 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -#define INCL_DOSNLS -#define INCL_DOSERRORS -#include - -#include "os2cp.h" - -#ifndef GENICONV_STANDALONE -#include "../../../SDL_internal.h" -#else -#include -#include -#define SDL_isspace isspace -#define SDL_strchr strchr -#define SDL_memcpy memcpy -#define SDL_strupr strupr -#define SDL_strcmp strcmp -#endif - -typedef struct _CP2NAME { - ULONG ulCode; - PSZ pszName; -} CP2NAME; - -typedef struct _NAME2CP { - PSZ pszName; - ULONG ulCode; -} NAME2CP; - -static CP2NAME aCP2Name[] = { - {367, "ANSI_X3.4-1968"}, - {813, "ECMA-118"}, - {819, "CP819"}, - {850, "850"}, - {862, "862"}, - {866, "866"}, - {874, "ISO-IR-166"}, - {878, "KOI8-R"}, - {896, "JISX0201-1976"}, - {901, "ISO-8859-13"}, - {912, "ISO-8859-2"}, - {913, "ISO-8859-3"}, - {914, "ISO-8859-4"}, - {915, "CYRILLIC"}, - {920, "ISO-8859-9"}, - {923, "ISO-8859-15"}, - {943, "MS_KANJI"}, - {954, "EUC-JP"}, - {964, "EUC-TW"}, - {970, "EUC-KR"}, - {1051, "HP-ROMAN8"}, - {1089, "ARABIC"}, - {1129, "VISCII"}, - {1168, "KOI8-U"}, - {1200, "ISO-10646-UCS-2"}, - {1202, "UTF-16LE"}, - {1204, "UCS-2BE"}, - {1208, "UTF-8"}, - {1232, "UTF-32BE"}, - {1234, "UTF-32LE"}, - {1236, "ISO-10646-UCS-4"}, - {1250, "CP1250"}, - {1251, "CP1251"}, - {1252, "CP1252"}, - {1253, "CP1253"}, - {1254, "CP1254"}, - {1255, "CP1255"}, - {1256, "CP1256"}, - {1257, "CP1257"}, - {1275, "MAC"}, - {1383, "CN-GB"}, - {1386, "GBK"}, - {1392, "GB18030"}, - {62210, "HEBREW"} -}; - -static NAME2CP aName2CP[] = { - {"850", 850}, - {"862", 862}, - {"866", 866}, - {"ANSI_X3.4-1968", 367}, - {"ANSI_X3.4-1986", 367}, - {"ARABIC", 1089}, - {"ASCII", 367}, - {"ASMO-708", 1089}, - {"CN-GB", 1383}, - {"CP1250", 1250}, - {"CP1251", 1251}, - {"CP1252", 1252}, - {"CP1253", 1253}, - {"CP1254", 1254}, - {"CP1255", 1255}, - {"CP1256", 1256}, - {"CP1257", 1257}, - {"CP367", 367}, - {"CP819", 819}, - {"CP850", 850}, - {"CP862", 862}, - {"CP866", 866}, - {"CP936", 1386}, - {"CSASCII", 367}, - {"CSEUCKR", 970}, - {"CSEUCPKDFMTJAPANESE", 954}, - {"CSEUCTW", 964}, - {"CSGB2312", 1383}, - {"CSHALFWIDTHKATAKANA", 896}, - {"CSHPROMAN8", 1051}, - {"CSIBM866", 866}, - {"CSISOLATIN1", 819}, - {"CSISOLATIN2", 912}, - {"CSISOLATIN3", 913}, - {"CSISOLATIN4", 914}, - {"CSISOLATIN5", 920}, - {"CSISOLATINARABIC", 1089}, - {"CSISOLATINCYRILLIC", 915}, - {"CSISOLATINGREEK", 813}, - {"CSISOLATINHEBREW", 62210}, - {"CSKOI8R", 878}, - {"CSKSC56011987", 970}, - {"CSMACINTOSH", 1275}, - {"CSPC850MULTILINGUAL", 850}, - {"CSPC862LATINHEBREW", 862}, - {"CSSHIFTJIS", 943}, - {"CSUCS4", 1236}, - {"CSUNICODE", 1200}, - {"CSUNICODE11", 1204}, - {"CSVISCII", 1129}, - {"CYRILLIC", 915}, - {"ECMA-114", 1089}, - {"ECMA-118", 813}, - {"ELOT_928", 813}, - {"EUC-CN", 1383}, - {"EUC-JP", 954}, - {"EUC-KR", 970}, - {"EUC-TW", 964}, - {"EUCCN", 1383}, - {"EUCJP", 954}, - {"EUCKR", 970}, - {"EUCTW", 964}, - {"EXTENDED_UNIX_CODE_PACKED_FORMAT_FOR_JAPANESE", 954}, - {"GB18030", 1392}, - {"GB2312", 1383}, - {"GBK", 1386}, - {"GREEK", 813}, - {"GREEK8", 813}, - {"HEBREW", 62210}, - {"HP-ROMAN8", 1051}, - {"IBM367", 367}, - {"IBM819", 819}, - {"IBM850", 850}, - {"IBM862", 862}, - {"IBM866", 866}, - {"ISO-10646-UCS-2", 1200}, - {"ISO-10646-UCS-4", 1236}, - {"ISO-8859-1", 819}, - {"ISO-8859-13", 901}, - {"ISO-8859-15", 923}, - {"ISO-8859-2", 912}, - {"ISO-8859-3", 913}, - {"ISO-8859-4", 914}, - {"ISO-8859-5", 915}, - {"ISO-8859-6", 1089}, - {"ISO-8859-7", 813}, - {"ISO-8859-8", 62210}, - {"ISO-8859-9", 920}, - {"ISO-IR-100", 819}, - {"ISO-IR-101", 912}, - {"ISO-IR-109", 913}, - {"ISO-IR-110", 914}, - {"ISO-IR-126", 813}, - {"ISO-IR-127", 1089}, - {"ISO-IR-138", 62210}, - {"ISO-IR-144", 915}, - {"ISO-IR-148", 920}, - {"ISO-IR-149", 970}, - {"ISO-IR-166", 874}, - {"ISO-IR-179", 901}, - {"ISO-IR-203", 923}, - {"ISO-IR-6", 367}, - {"ISO646-US", 367}, - {"ISO8859-1", 819}, - {"ISO8859-13", 901}, - {"ISO8859-15", 923}, - {"ISO8859-2", 912}, - {"ISO8859-3", 913}, - {"ISO8859-4", 914}, - {"ISO8859-5", 915}, - {"ISO8859-6", 1089}, - {"ISO8859-7", 813}, - {"ISO8859-8", 62210}, - {"ISO8859-9", 920}, - {"ISO_646.IRV:1991", 367}, - {"ISO_8859-1", 819}, - {"ISO_8859-13", 901}, - {"ISO_8859-15", 923}, - {"ISO_8859-15:1998", 923}, - {"ISO_8859-1:1987", 819}, - {"ISO_8859-2", 912}, - {"ISO_8859-2:1987", 912}, - {"ISO_8859-3", 913}, - {"ISO_8859-3:1988", 913}, - {"ISO_8859-4", 914}, - {"ISO_8859-4:1988", 914}, - {"ISO_8859-5", 915}, - {"ISO_8859-5:1988", 915}, - {"ISO_8859-6", 1089}, - {"ISO_8859-6:1987", 1089}, - {"ISO_8859-7", 813}, - {"ISO_8859-7:1987", 813}, - {"ISO_8859-7:2003", 813}, - {"ISO_8859-8", 62210}, - {"ISO_8859-8:1988", 62210}, - {"ISO_8859-9", 920}, - {"ISO_8859-9:1989", 920}, - {"JISX0201-1976", 896}, - {"JIS_X0201", 896}, - {"KOI8-R", 878}, - {"KOI8-U", 1168}, - {"KOREAN", 970}, - {"KSC_5601", 970}, - {"KS_C_5601-1987", 970}, - {"KS_C_5601-1989", 970}, - {"L1", 819}, - {"L2", 912}, - {"L3", 913}, - {"L4", 914}, - {"L5", 920}, - {"L7", 901}, - {"LATIN-9", 923}, - {"LATIN1", 819}, - {"LATIN2", 912}, - {"LATIN3", 913}, - {"LATIN4", 914}, - {"LATIN5", 920}, - {"LATIN7", 901}, - {"MAC", 1275}, - {"MACINTOSH", 1275}, - {"MACROMAN", 1275}, - {"MS-ANSI", 1252}, - {"MS-ARAB", 1256}, - {"MS-CYRL", 1251}, - {"MS-EE", 1250}, - {"MS-GREEK", 1253}, - {"MS-HEBR", 1255}, - {"MS-TURK", 1254}, - {"MS936", 1386}, - {"MS_KANJI", 943}, - {"R8", 1051}, - {"ROMAN8", 1051}, - {"SHIFT-JIS", 943}, - {"SHIFT_JIS", 943}, - {"SJIS", 943}, - {"TIS-620", 874}, - {"TIS620", 874}, - {"TIS620-0", 874}, - {"TIS620.2529-1", 874}, - {"TIS620.2533-0", 874}, - {"TIS620.2533-1", 874}, - {"UCS-2", 1200}, - {"UCS-2BE", 1204}, - {"UCS-4", 1236}, - {"UNICODE-1-1", 1204}, - {"UNICODEBIG", 1204}, - {"US", 367}, - {"US-ASCII", 367}, - {"UTF-16", 1204}, - {"UTF-16BE", 1200}, - {"UTF-16LE", 1202}, - {"UTF-32", 1236}, - {"UTF-32BE", 1232}, - {"UTF-32LE", 1234}, - {"UTF-8", 1208}, - {"VISCII", 1129}, - {"VISCII1.1-1", 1129}, - {"WINBALTRIM", 1257}, - {"WINDOWS-1250", 1250}, - {"WINDOWS-1251", 1251}, - {"WINDOWS-1252", 1252}, - {"WINDOWS-1253", 1253}, - {"WINDOWS-1254", 1254}, - {"WINDOWS-1255", 1255}, - {"WINDOWS-1256", 1256}, - {"WINDOWS-1257", 1257}, - {"WINDOWS-936", 1386}, - {"X0201", 896} -}; - -char *os2cpToName(unsigned long cp) -{ - ULONG ulLo = 0; - ULONG ulHi = (sizeof(aCP2Name) / sizeof(struct _CP2NAME)) - 1; - ULONG ulNext; - LONG lFound = -1; - - if (cp == SYSTEM_CP) { - ULONG aulCP[3]; - ULONG cCP; - if (DosQueryCp(sizeof(aulCP), aulCP, &cCP) != NO_ERROR) { - return NULL; - } - cp = aulCP[0]; - } - - if (aCP2Name[0].ulCode > cp || aCP2Name[ulHi].ulCode < cp) { - return NULL; - } - if (aCP2Name[0].ulCode == cp) { - return aCP2Name[0].pszName; - } - if (aCP2Name[ulHi].ulCode == cp) { - return aCP2Name[ulHi].pszName; - } - - while ((ulHi - ulLo) > 1) { - ulNext = (ulLo + ulHi) / 2; - - if (aCP2Name[ulNext].ulCode < cp) { - ulLo = ulNext; - } else if (aCP2Name[ulNext].ulCode > cp) { - ulHi = ulNext; - } else { - lFound = ulNext; - break; - } - } - - return (lFound == -1)? NULL : aCP2Name[lFound].pszName; -} - -unsigned long os2cpFromName(char *cp) -{ - ULONG ulLo = 0; - ULONG ulHi = (sizeof(aName2CP) / sizeof(struct _NAME2CP)) - 1; - ULONG ulNext; - LONG lFound = -1; - LONG lCmp; - PCHAR pcEnd; - CHAR acBuf[64]; - - if (cp == NULL) { - ULONG aulCP[3]; - ULONG cCP; - return (DosQueryCp(sizeof(aulCP), aulCP, &cCP) != NO_ERROR)? 0 : aulCP[0]; - } - - while (SDL_isspace((unsigned char) *cp)) { - cp++; - } - - pcEnd = SDL_strchr(cp, ' '); - if (pcEnd == NULL) { - pcEnd = SDL_strchr(cp, '\0'); - } - ulNext = pcEnd - cp; - if (ulNext >= sizeof(acBuf)) { - return 0; - } - - SDL_memcpy(acBuf, cp, ulNext); - acBuf[ulNext] = '\0'; - SDL_strupr(acBuf); - - lCmp = SDL_strcmp(aName2CP[0].pszName, acBuf); - if (lCmp > 0) { - return 0; - } - if (lCmp == 0) { - return aName2CP[0].ulCode; - } - - lCmp = SDL_strcmp(aName2CP[ulHi].pszName, acBuf); - if (lCmp < 0) { - return 0; - } - if (lCmp == 0) { - return aName2CP[ulHi].ulCode; - } - - while ((ulHi - ulLo) > 1) { - ulNext = (ulLo + ulHi) / 2; - - lCmp = SDL_strcmp(aName2CP[ulNext].pszName, acBuf); - if (lCmp < 0) { - ulLo = ulNext; - } else if (lCmp > 0) { - ulHi = ulNext; - } else { - lFound = ulNext; - break; - } - } - - return (lFound == -1)? 0 : aName2CP[lFound].ulCode; -} - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/core/os2/geniconv/os2cp.h b/src/core/os2/geniconv/os2cp.h deleted file mode 100644 index db3e167ec5..0000000000 --- a/src/core/os2/geniconv/os2cp.h +++ /dev/null @@ -1,32 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef OS2CP_H -#define OS2CP_H 1 - -#define SYSTEM_CP 0 - -char *os2cpToName(unsigned long cp); -unsigned long os2cpFromName(char *cp); - -#endif /* OS2CP_H */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/core/os2/geniconv/os2iconv.c b/src/core/os2/geniconv/os2iconv.c deleted file mode 100644 index 13ad2cdc60..0000000000 --- a/src/core/os2/geniconv/os2iconv.c +++ /dev/null @@ -1,286 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/* - Implementation iconv via OS/2 conversion objects API. - - Andrey Vasilkin. -*/ - -#define ICONV_THREAD_SAFE 1 - -#include "geniconv.h" -#define _ULS_CALLCONV_ -#define CALLCONV _System -#include -#ifdef ICONV_THREAD_SAFE -#define INCL_DOSSEMAPHORES -#define INCL_DOSERRORS -#include -#endif - -#include "os2cp.h" - -#ifndef GENICONV_STANDALONE -#include "../../../SDL_internal.h" -#else -#include -#include -#include -#if !defined(min) -#define min(a, b) (((a) < (b)) ? (a) : (b)) -#endif -#define SDL_min min -#define SDL_strcasecmp stricmp -#define SDL_snprintf _snprintf -#define SDL_malloc malloc -#define SDL_free free -#define SDL_memcpy memcpy -#endif - -#define MAX_CP_NAME_LEN 64 - -typedef struct iuconv_obj { - UconvObject uo_tocode; - UconvObject uo_fromcode; - int buf_len; - UniChar *buf; -#ifdef ICONV_THREAD_SAFE - HMTX hMtx; -#endif -} iuconv_obj; - - -static int _createUconvObj(const char *code, UconvObject *uobj) -{ - UniChar uc_code[MAX_CP_NAME_LEN]; - int i; - const unsigned char *ch = - (const unsigned char *)code; - - if (code == NULL) - uc_code[0] = 0; - else { - for (i = 0; i < MAX_CP_NAME_LEN; i++) { - uc_code[i] = (unsigned short)*ch; - if (! (*ch)) - break; - ch++; - } - } - - return UniCreateUconvObject(uc_code, uobj); -} - -static int uconv_open(const char *code, UconvObject *uobj) -{ - int rc; - - if (!SDL_strcasecmp(code, "UTF-16")) { - *uobj = NULL; - return ULS_SUCCESS; - } - - rc = _createUconvObj(code, uobj); - if (rc != ULS_SUCCESS) { - unsigned long cp = os2cpFromName((char *)code); - char cp_name[16]; - if (cp != 0 && SDL_snprintf(cp_name, sizeof(cp_name), "IBM-%u", cp) > 0) { - rc = _createUconvObj(cp_name, uobj); - } - } - - return rc; -} - - -iconv_t _System os2_iconv_open(const char* tocode, const char* fromcode) -{ - UconvObject uo_tocode; - UconvObject uo_fromcode; - int rc; - iuconv_obj *iuobj; - - if (tocode == NULL) { - tocode = ""; - } - if (fromcode == NULL) { - fromcode = ""; - } - - if (SDL_strcasecmp(tocode, fromcode) != 0) { - rc = uconv_open(fromcode, &uo_fromcode); - if (rc != ULS_SUCCESS) { - errno = EINVAL; - return (iconv_t)(-1); - } - rc = uconv_open(tocode, &uo_tocode); - if (rc != ULS_SUCCESS) { - UniFreeUconvObject(uo_fromcode); - errno = EINVAL; - return (iconv_t)(-1); - } - } else { - uo_tocode = NULL; - uo_fromcode = NULL; - } - - iuobj = (iuconv_obj *) SDL_malloc(sizeof(iuconv_obj)); - iuobj->uo_tocode = uo_tocode; - iuobj->uo_fromcode = uo_fromcode; - iuobj->buf_len = 0; - iuobj->buf = NULL; -#ifdef ICONV_THREAD_SAFE - DosCreateMutexSem(NULL, &iuobj->hMtx, 0, FALSE); -#endif - - return iuobj; -} - -size_t _System os2_iconv(iconv_t cd, - char **inbuf, size_t *inbytesleft , - char **outbuf, size_t *outbytesleft) -{ - UconvObject uo_tocode = ((iuconv_obj *)(cd))->uo_tocode; - UconvObject uo_fromcode = ((iuconv_obj *)(cd))->uo_fromcode; - size_t nonIdenticalConv = 0; - UniChar *uc_buf; - size_t uc_buf_len; - UniChar **uc_str; - size_t *uc_str_len; - int rc; - size_t ret = (size_t)(-1); - - if (uo_tocode == NULL && uo_fromcode == NULL) { - uc_buf_len = SDL_min(*inbytesleft, *outbytesleft); - SDL_memcpy(*outbuf, *inbuf, uc_buf_len); - *inbytesleft -= uc_buf_len; - *outbytesleft -= uc_buf_len; - outbuf += uc_buf_len; - inbuf += uc_buf_len; - return uc_buf_len; - } - -#ifdef ICONV_THREAD_SAFE - DosRequestMutexSem(((iuconv_obj *)(cd))->hMtx, SEM_INDEFINITE_WAIT); -#endif - - if (uo_tocode && uo_fromcode && (((iuconv_obj *)cd)->buf_len >> 1) < *inbytesleft) { - if (((iuconv_obj *)cd)->buf != NULL) { - SDL_free(((iuconv_obj *)cd)->buf); - } - ((iuconv_obj *)cd)->buf_len = *inbytesleft << 1; - ((iuconv_obj *)cd)->buf = (UniChar *) SDL_malloc(((iuconv_obj *)cd)->buf_len); - } - - if (uo_fromcode) { - if (uo_tocode) { - uc_buf = ((iuconv_obj *)cd)->buf; - uc_buf_len = ((iuconv_obj *)cd)->buf_len; - uc_str = &uc_buf; - } else { - uc_str = (UniChar **)outbuf; - uc_buf_len = *outbytesleft; - } - uc_buf_len = uc_buf_len >> 1; - uc_str_len = &uc_buf_len; - rc = UniUconvToUcs(uo_fromcode, (void **)inbuf, inbytesleft, - uc_str, uc_str_len, &nonIdenticalConv); - uc_buf_len = uc_buf_len << 1; - if (!uo_tocode) { - *outbytesleft = uc_buf_len; - } - - if (rc != ULS_SUCCESS) { - errno = EILSEQ; - goto done; - } else if (*inbytesleft && !*uc_str_len) { - errno = E2BIG; - goto done; - } - - if (!uo_tocode) { - return nonIdenticalConv; - } - - uc_buf = ((iuconv_obj *)cd)->buf; - uc_buf_len = ((iuconv_obj *)cd)->buf_len - uc_buf_len; - uc_str = &uc_buf; - uc_str_len = &uc_buf_len; - } else { - uc_str = (UniChar **)inbuf; - uc_str_len = inbytesleft; - } - - *uc_str_len = *uc_str_len>>1; - rc = UniUconvFromUcs(uo_tocode, uc_str, uc_str_len, (void **)outbuf, - outbytesleft, &nonIdenticalConv); - if (rc != ULS_SUCCESS) { - switch (rc) { - case ULS_BUFFERFULL: - errno = E2BIG; - break; - case ULS_ILLEGALSEQUENCE: - errno = EILSEQ; - break; - case ULS_INVALID: - errno = EINVAL; - break; - } - goto done; - } else if (*uc_str_len && !*outbytesleft) { - errno = E2BIG; - goto done; - } - - ret = nonIdenticalConv; - -done: - -#ifdef ICONV_THREAD_SAFE - DosReleaseMutexSem(((iuconv_obj *)cd)->hMtx); -#endif - return ret; -} - -int _System os2_iconv_close(iconv_t cd) -{ - if (!cd) return 0; - -#ifdef ICONV_THREAD_SAFE - DosCloseMutexSem(((iuconv_obj *)cd)->hMtx); -#endif - if (((iuconv_obj *)cd)->uo_tocode != NULL) { - UniFreeUconvObject(((iuconv_obj *)cd)->uo_tocode); - } - if (((iuconv_obj *)cd)->uo_fromcode != NULL) { - UniFreeUconvObject(((iuconv_obj *)cd)->uo_fromcode); - } - - if (((iuconv_obj *)cd)->buf != NULL) { - SDL_free(((iuconv_obj *)cd)->buf); - } - SDL_free(cd); - - return 0; -} - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/core/os2/geniconv/sys2utf8.c b/src/core/os2/geniconv/sys2utf8.c deleted file mode 100644 index 753e9b67fc..0000000000 --- a/src/core/os2/geniconv/sys2utf8.c +++ /dev/null @@ -1,119 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -#include "geniconv.h" - -#ifndef GENICONV_STANDALONE -#include "../../../SDL_internal.h" -#else -#include -#define SDL_malloc malloc -#define SDL_realloc realloc -#define SDL_free free -#endif - -int StrUTF8(int to_utf8, char *dst, int c_dst, char *src, int c_src) -{ - size_t rc; - char *dststart = dst; - iconv_t cd; - char *tocp, *fromcp; - int err = 0; - - if (c_dst < 4) { - return -1; - } - - if (to_utf8) { - tocp = "UTF-8"; - fromcp = ""; - } else { - tocp = ""; - fromcp = "UTF-8"; - } - - cd = iconv_open(tocp, fromcp); - if (cd == (iconv_t)-1) { - return -1; - } - - while (c_src > 0) { - rc = iconv(cd, &src, (size_t *)&c_src, &dst, (size_t *)&c_dst); - if (rc == (size_t)-1) { - if (errno == EILSEQ) { - /* Try to skip invalid character */ - src++; - c_src--; - continue; - } - - err = 1; - break; - } - } - - iconv_close(cd); - - /* Write trailing ZERO (1 byte for UTF-8, 2 bytes for the system cp) */ - if (to_utf8) { - if (c_dst < 1) { - dst--; - err = 1; /* The destination buffer overflow */ - } - *dst = '\0'; - } else { - if (c_dst < 2) { - dst -= (c_dst == 0) ? 2 : 1; - err = 1; /* The destination buffer overflow */ - } - *((short *)dst) = '\0'; - } - - return (err) ? -1 : (dst - dststart); -} - -char *StrUTF8New(int to_utf8, char *str, int c_str) -{ - int c_newstr = (((c_str > 4) ? c_str : 4) + 1) * 2; - char * newstr = (char *) SDL_malloc(c_newstr); - - if (newstr == NULL) { - return NULL; - } - - c_newstr = StrUTF8(to_utf8, newstr, c_newstr, str, c_str); - if (c_newstr != -1) { - str = (char *) SDL_realloc(newstr, c_newstr + ((to_utf8) ? 1 : sizeof(short))); - if (str) { - return str; - } - } - - SDL_free(newstr); - return NULL; -} - -void StrUTF8Free(char *str) -{ - SDL_free(str); -} - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/core/os2/geniconv/test.c b/src/core/os2/geniconv/test.c deleted file mode 100644 index 25e16228ae..0000000000 --- a/src/core/os2/geniconv/test.c +++ /dev/null @@ -1,69 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include -#include -#include "geniconv.h" - -int main(void) -{ - char acBuf[128]; - char *inbuf = "ôÅÓÔ - ÐÒÏ×ÅÒËÁ"; /* KOI8-R string */ - size_t inbytesleft = strlen(inbuf); - char *outbuf = acBuf; - size_t outbytesleft = sizeof(acBuf); - iconv_t ic; - - /* KOI8 -> system cp */ - ic = iconv_open("", "KOI8-R"); - if (ic == (iconv_t)(-1)) { - puts("iconv_open() fail"); - return 1; - } - - iconv(ic, &inbuf, &inbytesleft, &outbuf, &outbytesleft); - printf("KOI8-R to system cp: %s\n", acBuf); - - iconv_close(ic); - - /* System cp -> UTF-8 -> system cp: */ - - /* System cp -> UTF-8 by StrUTF8New() */ - inbuf = StrUTF8New(1, acBuf, strlen(acBuf)); - - /* UTF-8 -> system cp. by StrUTF8() */ - if (StrUTF8(0, acBuf, sizeof(acBuf), inbuf, strlen(inbuf)) == -1) { - puts("StrUTF8() failed"); - } else { - printf("system cp. -> UTF-8 -> system cp.: %s\n", acBuf); - } - - free(inbuf); - - /* Unload used DLL */ - iconv_clean(); - - puts("Done."); - return 0; -} - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/core/os2/iconv2.lbc b/src/core/os2/iconv2.lbc deleted file mode 100644 index d9c68753f9..0000000000 --- a/src/core/os2/iconv2.lbc +++ /dev/null @@ -1,4 +0,0 @@ -# OpenWatcom exports file for libiconv -++'libiconv'.'ICONV2'..'_libiconv' -++'libiconv_close'.'ICONV2'..'_libiconv_close' -++'libiconv_open'.'ICONV2'..'_libiconv_open' diff --git a/src/cpuinfo/SDL_cpuinfo.c b/src/cpuinfo/SDL_cpuinfo.c index 540f6a54e5..b922418a1a 100644 --- a/src/cpuinfo/SDL_cpuinfo.c +++ b/src/cpuinfo/SDL_cpuinfo.c @@ -27,14 +27,6 @@ #if defined(__WIN32__) || defined(__WINRT__) || defined(__GDK__) #include "../core/windows/SDL_windows.h" #endif -#if defined(__OS2__) -#undef HAVE_SYSCTLBYNAME -#define INCL_DOS -#include -#ifndef QSV_NUMPROCESSORS -#define QSV_NUMPROCESSORS 26 -#endif -#endif /* CPU feature detection for SDL */ @@ -680,12 +672,6 @@ SDL_GetCPUCount(void) SDL_CPUCount = info.dwNumberOfProcessors; } #endif -#ifdef __OS2__ - if (SDL_CPUCount <= 0) { - DosQuerySysInfo(QSV_NUMPROCESSORS, QSV_NUMPROCESSORS, - &SDL_CPUCount, sizeof(SDL_CPUCount) ); - } -#endif #endif /* There has to be at least 1, right? :) */ if (SDL_CPUCount <= 0) { @@ -1064,13 +1050,6 @@ SDL_GetSystemRAM(void) } } #endif -#ifdef __OS2__ - if (SDL_SystemRAM <= 0) { - Uint32 sysram = 0; - DosQuerySysInfo(QSV_TOTPHYSMEM, QSV_TOTPHYSMEM, &sysram, 4); - SDL_SystemRAM = (int) (sysram / 0x100000U); - } -#endif #ifdef __RISCOS__ if (SDL_SystemRAM <= 0) { _kernel_swi_regs regs; diff --git a/src/dynapi/SDL3.exports b/src/dynapi/SDL3.exports deleted file mode 100644 index 7bc5863a3e..0000000000 --- a/src/dynapi/SDL3.exports +++ /dev/null @@ -1,869 +0,0 @@ -# Windows exports file for Watcom -# DO NOT EDIT THIS FILE BY HAND. It is autogenerated by gendynapi.pl. -++'_SDL_DYNAPI_entry'.'SDL3.dll'.'SDL_DYNAPI_entry' -++'_SDL_SetError'.'SDL3.dll'.'SDL_SetError' -++'_SDL_Log'.'SDL3.dll'.'SDL_Log' -++'_SDL_LogVerbose'.'SDL3.dll'.'SDL_LogVerbose' -++'_SDL_LogDebug'.'SDL3.dll'.'SDL_LogDebug' -++'_SDL_LogInfo'.'SDL3.dll'.'SDL_LogInfo' -++'_SDL_LogWarn'.'SDL3.dll'.'SDL_LogWarn' -++'_SDL_LogError'.'SDL3.dll'.'SDL_LogError' -++'_SDL_LogCritical'.'SDL3.dll'.'SDL_LogCritical' -++'_SDL_LogMessage'.'SDL3.dll'.'SDL_LogMessage' -++'_SDL_sscanf'.'SDL3.dll'.'SDL_sscanf' -++'_SDL_snprintf'.'SDL3.dll'.'SDL_snprintf' -++'_SDL_CreateThread'.'SDL3.dll'.'SDL_CreateThread' -++'_SDL_RWFromFP'.'SDL3.dll'.'SDL_RWFromFP' -++'_SDL_RegisterApp'.'SDL3.dll'.'SDL_RegisterApp' -++'_SDL_UnregisterApp'.'SDL3.dll'.'SDL_UnregisterApp' -++'_SDL_Direct3D9GetAdapterIndex'.'SDL3.dll'.'SDL_Direct3D9GetAdapterIndex' -++'_SDL_RenderGetD3D9Device'.'SDL3.dll'.'SDL_RenderGetD3D9Device' -# ++'_SDL_iPhoneSetAnimationCallback'.'SDL3.dll'.'SDL_iPhoneSetAnimationCallback' -# ++'_SDL_iPhoneSetEventPump'.'SDL3.dll'.'SDL_iPhoneSetEventPump' -# ++'_SDL_AndroidGetJNIEnv'.'SDL3.dll'.'SDL_AndroidGetJNIEnv' -# ++'_SDL_AndroidGetActivity'.'SDL3.dll'.'SDL_AndroidGetActivity' -# ++'_SDL_AndroidGetInternalStoragePath'.'SDL3.dll'.'SDL_AndroidGetInternalStoragePath' -# ++'_SDL_AndroidGetExternalStorageState'.'SDL3.dll'.'SDL_AndroidGetExternalStorageState' -# ++'_SDL_AndroidGetExternalStoragePath'.'SDL3.dll'.'SDL_AndroidGetExternalStoragePath' -++'_SDL_Init'.'SDL3.dll'.'SDL_Init' -++'_SDL_InitSubSystem'.'SDL3.dll'.'SDL_InitSubSystem' -++'_SDL_QuitSubSystem'.'SDL3.dll'.'SDL_QuitSubSystem' -++'_SDL_WasInit'.'SDL3.dll'.'SDL_WasInit' -++'_SDL_Quit'.'SDL3.dll'.'SDL_Quit' -++'_SDL_ReportAssertion'.'SDL3.dll'.'SDL_ReportAssertion' -++'_SDL_SetAssertionHandler'.'SDL3.dll'.'SDL_SetAssertionHandler' -++'_SDL_GetAssertionReport'.'SDL3.dll'.'SDL_GetAssertionReport' -++'_SDL_ResetAssertionReport'.'SDL3.dll'.'SDL_ResetAssertionReport' -++'_SDL_AtomicTryLock'.'SDL3.dll'.'SDL_AtomicTryLock' -++'_SDL_AtomicLock'.'SDL3.dll'.'SDL_AtomicLock' -++'_SDL_AtomicUnlock'.'SDL3.dll'.'SDL_AtomicUnlock' -++'_SDL_AtomicCAS'.'SDL3.dll'.'SDL_AtomicCAS' -++'_SDL_AtomicSet'.'SDL3.dll'.'SDL_AtomicSet' -++'_SDL_AtomicGet'.'SDL3.dll'.'SDL_AtomicGet' -++'_SDL_AtomicAdd'.'SDL3.dll'.'SDL_AtomicAdd' -++'_SDL_AtomicCASPtr'.'SDL3.dll'.'SDL_AtomicCASPtr' -++'_SDL_AtomicSetPtr'.'SDL3.dll'.'SDL_AtomicSetPtr' -++'_SDL_AtomicGetPtr'.'SDL3.dll'.'SDL_AtomicGetPtr' -++'_SDL_GetNumAudioDrivers'.'SDL3.dll'.'SDL_GetNumAudioDrivers' -++'_SDL_GetAudioDriver'.'SDL3.dll'.'SDL_GetAudioDriver' -++'_SDL_AudioInit'.'SDL3.dll'.'SDL_AudioInit' -++'_SDL_AudioQuit'.'SDL3.dll'.'SDL_AudioQuit' -++'_SDL_GetCurrentAudioDriver'.'SDL3.dll'.'SDL_GetCurrentAudioDriver' -++'_SDL_OpenAudio'.'SDL3.dll'.'SDL_OpenAudio' -++'_SDL_GetNumAudioDevices'.'SDL3.dll'.'SDL_GetNumAudioDevices' -++'_SDL_GetAudioDeviceName'.'SDL3.dll'.'SDL_GetAudioDeviceName' -++'_SDL_OpenAudioDevice'.'SDL3.dll'.'SDL_OpenAudioDevice' -++'_SDL_GetAudioStatus'.'SDL3.dll'.'SDL_GetAudioStatus' -++'_SDL_GetAudioDeviceStatus'.'SDL3.dll'.'SDL_GetAudioDeviceStatus' -++'_SDL_PauseAudio'.'SDL3.dll'.'SDL_PauseAudio' -++'_SDL_PauseAudioDevice'.'SDL3.dll'.'SDL_PauseAudioDevice' -++'_SDL_LoadWAV_RW'.'SDL3.dll'.'SDL_LoadWAV_RW' -++'_SDL_FreeWAV'.'SDL3.dll'.'SDL_FreeWAV' -++'_SDL_BuildAudioCVT'.'SDL3.dll'.'SDL_BuildAudioCVT' -++'_SDL_ConvertAudio'.'SDL3.dll'.'SDL_ConvertAudio' -++'_SDL_MixAudio'.'SDL3.dll'.'SDL_MixAudio' -++'_SDL_MixAudioFormat'.'SDL3.dll'.'SDL_MixAudioFormat' -++'_SDL_LockAudio'.'SDL3.dll'.'SDL_LockAudio' -++'_SDL_LockAudioDevice'.'SDL3.dll'.'SDL_LockAudioDevice' -++'_SDL_UnlockAudio'.'SDL3.dll'.'SDL_UnlockAudio' -++'_SDL_UnlockAudioDevice'.'SDL3.dll'.'SDL_UnlockAudioDevice' -++'_SDL_CloseAudio'.'SDL3.dll'.'SDL_CloseAudio' -++'_SDL_CloseAudioDevice'.'SDL3.dll'.'SDL_CloseAudioDevice' -++'_SDL_SetClipboardText'.'SDL3.dll'.'SDL_SetClipboardText' -++'_SDL_GetClipboardText'.'SDL3.dll'.'SDL_GetClipboardText' -++'_SDL_HasClipboardText'.'SDL3.dll'.'SDL_HasClipboardText' -++'_SDL_GetCPUCount'.'SDL3.dll'.'SDL_GetCPUCount' -++'_SDL_GetCPUCacheLineSize'.'SDL3.dll'.'SDL_GetCPUCacheLineSize' -++'_SDL_HasRDTSC'.'SDL3.dll'.'SDL_HasRDTSC' -++'_SDL_HasAltiVec'.'SDL3.dll'.'SDL_HasAltiVec' -++'_SDL_HasMMX'.'SDL3.dll'.'SDL_HasMMX' -++'_SDL_Has3DNow'.'SDL3.dll'.'SDL_Has3DNow' -++'_SDL_HasSSE'.'SDL3.dll'.'SDL_HasSSE' -++'_SDL_HasSSE2'.'SDL3.dll'.'SDL_HasSSE2' -++'_SDL_HasSSE3'.'SDL3.dll'.'SDL_HasSSE3' -++'_SDL_HasSSE41'.'SDL3.dll'.'SDL_HasSSE41' -++'_SDL_HasSSE42'.'SDL3.dll'.'SDL_HasSSE42' -++'_SDL_GetSystemRAM'.'SDL3.dll'.'SDL_GetSystemRAM' -++'_SDL_GetError'.'SDL3.dll'.'SDL_GetError' -++'_SDL_ClearError'.'SDL3.dll'.'SDL_ClearError' -++'_SDL_Error'.'SDL3.dll'.'SDL_Error' -++'_SDL_PumpEvents'.'SDL3.dll'.'SDL_PumpEvents' -++'_SDL_PeepEvents'.'SDL3.dll'.'SDL_PeepEvents' -++'_SDL_HasEvent'.'SDL3.dll'.'SDL_HasEvent' -++'_SDL_HasEvents'.'SDL3.dll'.'SDL_HasEvents' -++'_SDL_FlushEvent'.'SDL3.dll'.'SDL_FlushEvent' -++'_SDL_FlushEvents'.'SDL3.dll'.'SDL_FlushEvents' -++'_SDL_PollEvent'.'SDL3.dll'.'SDL_PollEvent' -++'_SDL_WaitEvent'.'SDL3.dll'.'SDL_WaitEvent' -++'_SDL_WaitEventTimeout'.'SDL3.dll'.'SDL_WaitEventTimeout' -++'_SDL_PushEvent'.'SDL3.dll'.'SDL_PushEvent' -++'_SDL_SetEventFilter'.'SDL3.dll'.'SDL_SetEventFilter' -++'_SDL_GetEventFilter'.'SDL3.dll'.'SDL_GetEventFilter' -++'_SDL_AddEventWatch'.'SDL3.dll'.'SDL_AddEventWatch' -++'_SDL_DelEventWatch'.'SDL3.dll'.'SDL_DelEventWatch' -++'_SDL_FilterEvents'.'SDL3.dll'.'SDL_FilterEvents' -++'_SDL_EventState'.'SDL3.dll'.'SDL_EventState' -++'_SDL_RegisterEvents'.'SDL3.dll'.'SDL_RegisterEvents' -++'_SDL_GetBasePath'.'SDL3.dll'.'SDL_GetBasePath' -++'_SDL_GetPrefPath'.'SDL3.dll'.'SDL_GetPrefPath' -++'_SDL_GameControllerAddMapping'.'SDL3.dll'.'SDL_GameControllerAddMapping' -++'_SDL_GameControllerMappingForGUID'.'SDL3.dll'.'SDL_GameControllerMappingForGUID' -++'_SDL_GameControllerMapping'.'SDL3.dll'.'SDL_GameControllerMapping' -++'_SDL_IsGameController'.'SDL3.dll'.'SDL_IsGameController' -++'_SDL_GameControllerNameForIndex'.'SDL3.dll'.'SDL_GameControllerNameForIndex' -++'_SDL_GameControllerOpen'.'SDL3.dll'.'SDL_GameControllerOpen' -++'_SDL_GameControllerName'.'SDL3.dll'.'SDL_GameControllerName' -++'_SDL_GameControllerGetAttached'.'SDL3.dll'.'SDL_GameControllerGetAttached' -++'_SDL_GameControllerGetJoystick'.'SDL3.dll'.'SDL_GameControllerGetJoystick' -++'_SDL_GameControllerEventState'.'SDL3.dll'.'SDL_GameControllerEventState' -++'_SDL_GameControllerUpdate'.'SDL3.dll'.'SDL_GameControllerUpdate' -++'_SDL_GameControllerGetAxisFromString'.'SDL3.dll'.'SDL_GameControllerGetAxisFromString' -++'_SDL_GameControllerGetStringForAxis'.'SDL3.dll'.'SDL_GameControllerGetStringForAxis' -++'_SDL_GameControllerGetBindForAxis'.'SDL3.dll'.'SDL_GameControllerGetBindForAxis' -++'_SDL_GameControllerGetAxis'.'SDL3.dll'.'SDL_GameControllerGetAxis' -++'_SDL_GameControllerGetButtonFromString'.'SDL3.dll'.'SDL_GameControllerGetButtonFromString' -++'_SDL_GameControllerGetStringForButton'.'SDL3.dll'.'SDL_GameControllerGetStringForButton' -++'_SDL_GameControllerGetBindForButton'.'SDL3.dll'.'SDL_GameControllerGetBindForButton' -++'_SDL_GameControllerGetButton'.'SDL3.dll'.'SDL_GameControllerGetButton' -++'_SDL_GameControllerClose'.'SDL3.dll'.'SDL_GameControllerClose' -++'_SDL_RecordGesture'.'SDL3.dll'.'SDL_RecordGesture' -++'_SDL_SaveAllDollarTemplates'.'SDL3.dll'.'SDL_SaveAllDollarTemplates' -++'_SDL_SaveDollarTemplate'.'SDL3.dll'.'SDL_SaveDollarTemplate' -++'_SDL_LoadDollarTemplates'.'SDL3.dll'.'SDL_LoadDollarTemplates' -++'_SDL_NumHaptics'.'SDL3.dll'.'SDL_NumHaptics' -++'_SDL_HapticName'.'SDL3.dll'.'SDL_HapticName' -++'_SDL_HapticOpen'.'SDL3.dll'.'SDL_HapticOpen' -++'_SDL_HapticOpened'.'SDL3.dll'.'SDL_HapticOpened' -++'_SDL_HapticIndex'.'SDL3.dll'.'SDL_HapticIndex' -++'_SDL_MouseIsHaptic'.'SDL3.dll'.'SDL_MouseIsHaptic' -++'_SDL_HapticOpenFromMouse'.'SDL3.dll'.'SDL_HapticOpenFromMouse' -++'_SDL_JoystickIsHaptic'.'SDL3.dll'.'SDL_JoystickIsHaptic' -++'_SDL_HapticOpenFromJoystick'.'SDL3.dll'.'SDL_HapticOpenFromJoystick' -++'_SDL_HapticClose'.'SDL3.dll'.'SDL_HapticClose' -++'_SDL_HapticNumEffects'.'SDL3.dll'.'SDL_HapticNumEffects' -++'_SDL_HapticNumEffectsPlaying'.'SDL3.dll'.'SDL_HapticNumEffectsPlaying' -++'_SDL_HapticQuery'.'SDL3.dll'.'SDL_HapticQuery' -++'_SDL_HapticNumAxes'.'SDL3.dll'.'SDL_HapticNumAxes' -++'_SDL_HapticEffectSupported'.'SDL3.dll'.'SDL_HapticEffectSupported' -++'_SDL_HapticNewEffect'.'SDL3.dll'.'SDL_HapticNewEffect' -++'_SDL_HapticUpdateEffect'.'SDL3.dll'.'SDL_HapticUpdateEffect' -++'_SDL_HapticRunEffect'.'SDL3.dll'.'SDL_HapticRunEffect' -++'_SDL_HapticStopEffect'.'SDL3.dll'.'SDL_HapticStopEffect' -++'_SDL_HapticDestroyEffect'.'SDL3.dll'.'SDL_HapticDestroyEffect' -++'_SDL_HapticGetEffectStatus'.'SDL3.dll'.'SDL_HapticGetEffectStatus' -++'_SDL_HapticSetGain'.'SDL3.dll'.'SDL_HapticSetGain' -++'_SDL_HapticSetAutocenter'.'SDL3.dll'.'SDL_HapticSetAutocenter' -++'_SDL_HapticPause'.'SDL3.dll'.'SDL_HapticPause' -++'_SDL_HapticUnpause'.'SDL3.dll'.'SDL_HapticUnpause' -++'_SDL_HapticStopAll'.'SDL3.dll'.'SDL_HapticStopAll' -++'_SDL_HapticRumbleSupported'.'SDL3.dll'.'SDL_HapticRumbleSupported' -++'_SDL_HapticRumbleInit'.'SDL3.dll'.'SDL_HapticRumbleInit' -++'_SDL_HapticRumblePlay'.'SDL3.dll'.'SDL_HapticRumblePlay' -++'_SDL_HapticRumbleStop'.'SDL3.dll'.'SDL_HapticRumbleStop' -++'_SDL_SetHintWithPriority'.'SDL3.dll'.'SDL_SetHintWithPriority' -++'_SDL_SetHint'.'SDL3.dll'.'SDL_SetHint' -++'_SDL_GetHint'.'SDL3.dll'.'SDL_GetHint' -++'_SDL_AddHintCallback'.'SDL3.dll'.'SDL_AddHintCallback' -++'_SDL_DelHintCallback'.'SDL3.dll'.'SDL_DelHintCallback' -++'_SDL_ClearHints'.'SDL3.dll'.'SDL_ClearHints' -++'_SDL_NumJoysticks'.'SDL3.dll'.'SDL_NumJoysticks' -++'_SDL_JoystickNameForIndex'.'SDL3.dll'.'SDL_JoystickNameForIndex' -++'_SDL_JoystickOpen'.'SDL3.dll'.'SDL_JoystickOpen' -++'_SDL_JoystickName'.'SDL3.dll'.'SDL_JoystickName' -++'_SDL_JoystickGetDeviceGUID'.'SDL3.dll'.'SDL_JoystickGetDeviceGUID' -++'_SDL_JoystickGetGUID'.'SDL3.dll'.'SDL_JoystickGetGUID' -++'_SDL_JoystickGetGUIDString'.'SDL3.dll'.'SDL_JoystickGetGUIDString' -++'_SDL_JoystickGetGUIDFromString'.'SDL3.dll'.'SDL_JoystickGetGUIDFromString' -++'_SDL_JoystickGetAttached'.'SDL3.dll'.'SDL_JoystickGetAttached' -++'_SDL_JoystickInstanceID'.'SDL3.dll'.'SDL_JoystickInstanceID' -++'_SDL_JoystickNumAxes'.'SDL3.dll'.'SDL_JoystickNumAxes' -++'_SDL_JoystickNumBalls'.'SDL3.dll'.'SDL_JoystickNumBalls' -++'_SDL_JoystickNumHats'.'SDL3.dll'.'SDL_JoystickNumHats' -++'_SDL_JoystickNumButtons'.'SDL3.dll'.'SDL_JoystickNumButtons' -++'_SDL_JoystickUpdate'.'SDL3.dll'.'SDL_JoystickUpdate' -++'_SDL_JoystickEventState'.'SDL3.dll'.'SDL_JoystickEventState' -++'_SDL_JoystickGetAxis'.'SDL3.dll'.'SDL_JoystickGetAxis' -++'_SDL_JoystickGetHat'.'SDL3.dll'.'SDL_JoystickGetHat' -++'_SDL_JoystickGetBall'.'SDL3.dll'.'SDL_JoystickGetBall' -++'_SDL_JoystickGetButton'.'SDL3.dll'.'SDL_JoystickGetButton' -++'_SDL_JoystickClose'.'SDL3.dll'.'SDL_JoystickClose' -++'_SDL_GetKeyboardFocus'.'SDL3.dll'.'SDL_GetKeyboardFocus' -++'_SDL_GetKeyboardState'.'SDL3.dll'.'SDL_GetKeyboardState' -++'_SDL_GetModState'.'SDL3.dll'.'SDL_GetModState' -++'_SDL_SetModState'.'SDL3.dll'.'SDL_SetModState' -++'_SDL_GetKeyFromScancode'.'SDL3.dll'.'SDL_GetKeyFromScancode' -++'_SDL_GetScancodeFromKey'.'SDL3.dll'.'SDL_GetScancodeFromKey' -++'_SDL_GetScancodeName'.'SDL3.dll'.'SDL_GetScancodeName' -++'_SDL_GetScancodeFromName'.'SDL3.dll'.'SDL_GetScancodeFromName' -++'_SDL_GetKeyName'.'SDL3.dll'.'SDL_GetKeyName' -++'_SDL_GetKeyFromName'.'SDL3.dll'.'SDL_GetKeyFromName' -++'_SDL_StartTextInput'.'SDL3.dll'.'SDL_StartTextInput' -++'_SDL_IsTextInputActive'.'SDL3.dll'.'SDL_IsTextInputActive' -++'_SDL_StopTextInput'.'SDL3.dll'.'SDL_StopTextInput' -++'_SDL_SetTextInputRect'.'SDL3.dll'.'SDL_SetTextInputRect' -++'_SDL_HasScreenKeyboardSupport'.'SDL3.dll'.'SDL_HasScreenKeyboardSupport' -++'_SDL_IsScreenKeyboardShown'.'SDL3.dll'.'SDL_IsScreenKeyboardShown' -++'_SDL_LoadObject'.'SDL3.dll'.'SDL_LoadObject' -++'_SDL_LoadFunction'.'SDL3.dll'.'SDL_LoadFunction' -++'_SDL_UnloadObject'.'SDL3.dll'.'SDL_UnloadObject' -++'_SDL_LogSetAllPriority'.'SDL3.dll'.'SDL_LogSetAllPriority' -++'_SDL_LogSetPriority'.'SDL3.dll'.'SDL_LogSetPriority' -++'_SDL_LogGetPriority'.'SDL3.dll'.'SDL_LogGetPriority' -++'_SDL_LogResetPriorities'.'SDL3.dll'.'SDL_LogResetPriorities' -++'_SDL_LogMessageV'.'SDL3.dll'.'SDL_LogMessageV' -++'_SDL_LogGetOutputFunction'.'SDL3.dll'.'SDL_LogGetOutputFunction' -++'_SDL_LogSetOutputFunction'.'SDL3.dll'.'SDL_LogSetOutputFunction' -++'_SDL_SetMainReady'.'SDL3.dll'.'SDL_SetMainReady' -++'_SDL_ShowMessageBox'.'SDL3.dll'.'SDL_ShowMessageBox' -++'_SDL_ShowSimpleMessageBox'.'SDL3.dll'.'SDL_ShowSimpleMessageBox' -++'_SDL_GetMouseFocus'.'SDL3.dll'.'SDL_GetMouseFocus' -++'_SDL_GetMouseState'.'SDL3.dll'.'SDL_GetMouseState' -++'_SDL_GetRelativeMouseState'.'SDL3.dll'.'SDL_GetRelativeMouseState' -++'_SDL_WarpMouseInWindow'.'SDL3.dll'.'SDL_WarpMouseInWindow' -++'_SDL_SetRelativeMouseMode'.'SDL3.dll'.'SDL_SetRelativeMouseMode' -++'_SDL_GetRelativeMouseMode'.'SDL3.dll'.'SDL_GetRelativeMouseMode' -++'_SDL_CreateCursor'.'SDL3.dll'.'SDL_CreateCursor' -++'_SDL_CreateColorCursor'.'SDL3.dll'.'SDL_CreateColorCursor' -++'_SDL_CreateSystemCursor'.'SDL3.dll'.'SDL_CreateSystemCursor' -++'_SDL_SetCursor'.'SDL3.dll'.'SDL_SetCursor' -++'_SDL_GetCursor'.'SDL3.dll'.'SDL_GetCursor' -++'_SDL_GetDefaultCursor'.'SDL3.dll'.'SDL_GetDefaultCursor' -++'_SDL_FreeCursor'.'SDL3.dll'.'SDL_FreeCursor' -++'_SDL_ShowCursor'.'SDL3.dll'.'SDL_ShowCursor' -++'_SDL_CreateMutex'.'SDL3.dll'.'SDL_CreateMutex' -++'_SDL_LockMutex'.'SDL3.dll'.'SDL_LockMutex' -++'_SDL_TryLockMutex'.'SDL3.dll'.'SDL_TryLockMutex' -++'_SDL_UnlockMutex'.'SDL3.dll'.'SDL_UnlockMutex' -++'_SDL_DestroyMutex'.'SDL3.dll'.'SDL_DestroyMutex' -++'_SDL_CreateSemaphore'.'SDL3.dll'.'SDL_CreateSemaphore' -++'_SDL_DestroySemaphore'.'SDL3.dll'.'SDL_DestroySemaphore' -++'_SDL_SemWait'.'SDL3.dll'.'SDL_SemWait' -++'_SDL_SemTryWait'.'SDL3.dll'.'SDL_SemTryWait' -++'_SDL_SemWaitTimeout'.'SDL3.dll'.'SDL_SemWaitTimeout' -++'_SDL_SemPost'.'SDL3.dll'.'SDL_SemPost' -++'_SDL_SemValue'.'SDL3.dll'.'SDL_SemValue' -++'_SDL_CreateCond'.'SDL3.dll'.'SDL_CreateCond' -++'_SDL_DestroyCond'.'SDL3.dll'.'SDL_DestroyCond' -++'_SDL_CondSignal'.'SDL3.dll'.'SDL_CondSignal' -++'_SDL_CondBroadcast'.'SDL3.dll'.'SDL_CondBroadcast' -++'_SDL_CondWait'.'SDL3.dll'.'SDL_CondWait' -++'_SDL_CondWaitTimeout'.'SDL3.dll'.'SDL_CondWaitTimeout' -++'_SDL_GetPixelFormatName'.'SDL3.dll'.'SDL_GetPixelFormatName' -++'_SDL_PixelFormatEnumToMasks'.'SDL3.dll'.'SDL_PixelFormatEnumToMasks' -++'_SDL_MasksToPixelFormatEnum'.'SDL3.dll'.'SDL_MasksToPixelFormatEnum' -++'_SDL_AllocFormat'.'SDL3.dll'.'SDL_AllocFormat' -++'_SDL_FreeFormat'.'SDL3.dll'.'SDL_FreeFormat' -++'_SDL_AllocPalette'.'SDL3.dll'.'SDL_AllocPalette' -++'_SDL_SetPixelFormatPalette'.'SDL3.dll'.'SDL_SetPixelFormatPalette' -++'_SDL_SetPaletteColors'.'SDL3.dll'.'SDL_SetPaletteColors' -++'_SDL_FreePalette'.'SDL3.dll'.'SDL_FreePalette' -++'_SDL_MapRGB'.'SDL3.dll'.'SDL_MapRGB' -++'_SDL_MapRGBA'.'SDL3.dll'.'SDL_MapRGBA' -++'_SDL_GetRGB'.'SDL3.dll'.'SDL_GetRGB' -++'_SDL_GetRGBA'.'SDL3.dll'.'SDL_GetRGBA' -++'_SDL_CalculateGammaRamp'.'SDL3.dll'.'SDL_CalculateGammaRamp' -++'_SDL_GetPlatform'.'SDL3.dll'.'SDL_GetPlatform' -++'_SDL_GetPowerInfo'.'SDL3.dll'.'SDL_GetPowerInfo' -++'_SDL_HasIntersection'.'SDL3.dll'.'SDL_HasIntersection' -++'_SDL_IntersectRect'.'SDL3.dll'.'SDL_IntersectRect' -++'_SDL_UnionRect'.'SDL3.dll'.'SDL_UnionRect' -++'_SDL_EnclosePoints'.'SDL3.dll'.'SDL_EnclosePoints' -++'_SDL_IntersectRectAndLine'.'SDL3.dll'.'SDL_IntersectRectAndLine' -++'_SDL_GetNumRenderDrivers'.'SDL3.dll'.'SDL_GetNumRenderDrivers' -++'_SDL_GetRenderDriverInfo'.'SDL3.dll'.'SDL_GetRenderDriverInfo' -++'_SDL_CreateWindowAndRenderer'.'SDL3.dll'.'SDL_CreateWindowAndRenderer' -++'_SDL_CreateRenderer'.'SDL3.dll'.'SDL_CreateRenderer' -++'_SDL_CreateSoftwareRenderer'.'SDL3.dll'.'SDL_CreateSoftwareRenderer' -++'_SDL_GetRenderer'.'SDL3.dll'.'SDL_GetRenderer' -++'_SDL_GetRendererInfo'.'SDL3.dll'.'SDL_GetRendererInfo' -++'_SDL_GetRendererOutputSize'.'SDL3.dll'.'SDL_GetRendererOutputSize' -++'_SDL_CreateTexture'.'SDL3.dll'.'SDL_CreateTexture' -++'_SDL_CreateTextureFromSurface'.'SDL3.dll'.'SDL_CreateTextureFromSurface' -++'_SDL_QueryTexture'.'SDL3.dll'.'SDL_QueryTexture' -++'_SDL_SetTextureColorMod'.'SDL3.dll'.'SDL_SetTextureColorMod' -++'_SDL_GetTextureColorMod'.'SDL3.dll'.'SDL_GetTextureColorMod' -++'_SDL_SetTextureAlphaMod'.'SDL3.dll'.'SDL_SetTextureAlphaMod' -++'_SDL_GetTextureAlphaMod'.'SDL3.dll'.'SDL_GetTextureAlphaMod' -++'_SDL_SetTextureBlendMode'.'SDL3.dll'.'SDL_SetTextureBlendMode' -++'_SDL_GetTextureBlendMode'.'SDL3.dll'.'SDL_GetTextureBlendMode' -++'_SDL_UpdateTexture'.'SDL3.dll'.'SDL_UpdateTexture' -++'_SDL_UpdateYUVTexture'.'SDL3.dll'.'SDL_UpdateYUVTexture' -++'_SDL_LockTexture'.'SDL3.dll'.'SDL_LockTexture' -++'_SDL_UnlockTexture'.'SDL3.dll'.'SDL_UnlockTexture' -++'_SDL_RenderTargetSupported'.'SDL3.dll'.'SDL_RenderTargetSupported' -++'_SDL_SetRenderTarget'.'SDL3.dll'.'SDL_SetRenderTarget' -++'_SDL_GetRenderTarget'.'SDL3.dll'.'SDL_GetRenderTarget' -++'_SDL_RenderSetLogicalSize'.'SDL3.dll'.'SDL_RenderSetLogicalSize' -++'_SDL_RenderGetLogicalSize'.'SDL3.dll'.'SDL_RenderGetLogicalSize' -++'_SDL_RenderSetViewport'.'SDL3.dll'.'SDL_RenderSetViewport' -++'_SDL_RenderGetViewport'.'SDL3.dll'.'SDL_RenderGetViewport' -++'_SDL_RenderSetClipRect'.'SDL3.dll'.'SDL_RenderSetClipRect' -++'_SDL_RenderGetClipRect'.'SDL3.dll'.'SDL_RenderGetClipRect' -++'_SDL_RenderSetScale'.'SDL3.dll'.'SDL_RenderSetScale' -++'_SDL_RenderGetScale'.'SDL3.dll'.'SDL_RenderGetScale' -++'_SDL_SetRenderDrawColor'.'SDL3.dll'.'SDL_SetRenderDrawColor' -++'_SDL_GetRenderDrawColor'.'SDL3.dll'.'SDL_GetRenderDrawColor' -++'_SDL_SetRenderDrawBlendMode'.'SDL3.dll'.'SDL_SetRenderDrawBlendMode' -++'_SDL_GetRenderDrawBlendMode'.'SDL3.dll'.'SDL_GetRenderDrawBlendMode' -++'_SDL_RenderClear'.'SDL3.dll'.'SDL_RenderClear' -++'_SDL_RenderDrawPoint'.'SDL3.dll'.'SDL_RenderDrawPoint' -++'_SDL_RenderDrawPoints'.'SDL3.dll'.'SDL_RenderDrawPoints' -++'_SDL_RenderDrawLine'.'SDL3.dll'.'SDL_RenderDrawLine' -++'_SDL_RenderDrawLines'.'SDL3.dll'.'SDL_RenderDrawLines' -++'_SDL_RenderDrawRect'.'SDL3.dll'.'SDL_RenderDrawRect' -++'_SDL_RenderDrawRects'.'SDL3.dll'.'SDL_RenderDrawRects' -++'_SDL_RenderFillRect'.'SDL3.dll'.'SDL_RenderFillRect' -++'_SDL_RenderFillRects'.'SDL3.dll'.'SDL_RenderFillRects' -++'_SDL_RenderCopy'.'SDL3.dll'.'SDL_RenderCopy' -++'_SDL_RenderCopyEx'.'SDL3.dll'.'SDL_RenderCopyEx' -++'_SDL_RenderReadPixels'.'SDL3.dll'.'SDL_RenderReadPixels' -++'_SDL_RenderPresent'.'SDL3.dll'.'SDL_RenderPresent' -++'_SDL_DestroyTexture'.'SDL3.dll'.'SDL_DestroyTexture' -++'_SDL_DestroyRenderer'.'SDL3.dll'.'SDL_DestroyRenderer' -++'_SDL_GL_BindTexture'.'SDL3.dll'.'SDL_GL_BindTexture' -++'_SDL_GL_UnbindTexture'.'SDL3.dll'.'SDL_GL_UnbindTexture' -++'_SDL_RWFromFile'.'SDL3.dll'.'SDL_RWFromFile' -++'_SDL_RWFromMem'.'SDL3.dll'.'SDL_RWFromMem' -++'_SDL_RWFromConstMem'.'SDL3.dll'.'SDL_RWFromConstMem' -++'_SDL_AllocRW'.'SDL3.dll'.'SDL_AllocRW' -++'_SDL_FreeRW'.'SDL3.dll'.'SDL_FreeRW' -++'_SDL_ReadU8'.'SDL3.dll'.'SDL_ReadU8' -++'_SDL_ReadLE16'.'SDL3.dll'.'SDL_ReadLE16' -++'_SDL_ReadBE16'.'SDL3.dll'.'SDL_ReadBE16' -++'_SDL_ReadLE32'.'SDL3.dll'.'SDL_ReadLE32' -++'_SDL_ReadBE32'.'SDL3.dll'.'SDL_ReadBE32' -++'_SDL_ReadLE64'.'SDL3.dll'.'SDL_ReadLE64' -++'_SDL_ReadBE64'.'SDL3.dll'.'SDL_ReadBE64' -++'_SDL_WriteU8'.'SDL3.dll'.'SDL_WriteU8' -++'_SDL_WriteLE16'.'SDL3.dll'.'SDL_WriteLE16' -++'_SDL_WriteBE16'.'SDL3.dll'.'SDL_WriteBE16' -++'_SDL_WriteLE32'.'SDL3.dll'.'SDL_WriteLE32' -++'_SDL_WriteBE32'.'SDL3.dll'.'SDL_WriteBE32' -++'_SDL_WriteLE64'.'SDL3.dll'.'SDL_WriteLE64' -++'_SDL_WriteBE64'.'SDL3.dll'.'SDL_WriteBE64' -++'_SDL_CreateShapedWindow'.'SDL3.dll'.'SDL_CreateShapedWindow' -++'_SDL_IsShapedWindow'.'SDL3.dll'.'SDL_IsShapedWindow' -++'_SDL_SetWindowShape'.'SDL3.dll'.'SDL_SetWindowShape' -++'_SDL_GetShapedWindowMode'.'SDL3.dll'.'SDL_GetShapedWindowMode' -++'_SDL_malloc'.'SDL3.dll'.'SDL_malloc' -++'_SDL_calloc'.'SDL3.dll'.'SDL_calloc' -++'_SDL_realloc'.'SDL3.dll'.'SDL_realloc' -++'_SDL_free'.'SDL3.dll'.'SDL_free' -++'_SDL_getenv'.'SDL3.dll'.'SDL_getenv' -++'_SDL_setenv'.'SDL3.dll'.'SDL_setenv' -++'_SDL_qsort'.'SDL3.dll'.'SDL_qsort' -++'_SDL_abs'.'SDL3.dll'.'SDL_abs' -++'_SDL_isdigit'.'SDL3.dll'.'SDL_isdigit' -++'_SDL_isspace'.'SDL3.dll'.'SDL_isspace' -++'_SDL_toupper'.'SDL3.dll'.'SDL_toupper' -++'_SDL_tolower'.'SDL3.dll'.'SDL_tolower' -++'_SDL_memset'.'SDL3.dll'.'SDL_memset' -++'_SDL_memcpy'.'SDL3.dll'.'SDL_memcpy' -++'_SDL_memmove'.'SDL3.dll'.'SDL_memmove' -++'_SDL_memcmp'.'SDL3.dll'.'SDL_memcmp' -++'_SDL_wcslen'.'SDL3.dll'.'SDL_wcslen' -++'_SDL_wcslcpy'.'SDL3.dll'.'SDL_wcslcpy' -++'_SDL_wcslcat'.'SDL3.dll'.'SDL_wcslcat' -++'_SDL_strlen'.'SDL3.dll'.'SDL_strlen' -++'_SDL_strlcpy'.'SDL3.dll'.'SDL_strlcpy' -++'_SDL_utf8strlcpy'.'SDL3.dll'.'SDL_utf8strlcpy' -++'_SDL_strlcat'.'SDL3.dll'.'SDL_strlcat' -++'_SDL_strdup'.'SDL3.dll'.'SDL_strdup' -++'_SDL_strrev'.'SDL3.dll'.'SDL_strrev' -++'_SDL_strupr'.'SDL3.dll'.'SDL_strupr' -++'_SDL_strlwr'.'SDL3.dll'.'SDL_strlwr' -++'_SDL_strchr'.'SDL3.dll'.'SDL_strchr' -++'_SDL_strrchr'.'SDL3.dll'.'SDL_strrchr' -++'_SDL_strstr'.'SDL3.dll'.'SDL_strstr' -++'_SDL_itoa'.'SDL3.dll'.'SDL_itoa' -++'_SDL_uitoa'.'SDL3.dll'.'SDL_uitoa' -++'_SDL_ltoa'.'SDL3.dll'.'SDL_ltoa' -++'_SDL_ultoa'.'SDL3.dll'.'SDL_ultoa' -++'_SDL_lltoa'.'SDL3.dll'.'SDL_lltoa' -++'_SDL_ulltoa'.'SDL3.dll'.'SDL_ulltoa' -++'_SDL_atoi'.'SDL3.dll'.'SDL_atoi' -++'_SDL_atof'.'SDL3.dll'.'SDL_atof' -++'_SDL_strtol'.'SDL3.dll'.'SDL_strtol' -++'_SDL_strtoul'.'SDL3.dll'.'SDL_strtoul' -++'_SDL_strtoll'.'SDL3.dll'.'SDL_strtoll' -++'_SDL_strtoull'.'SDL3.dll'.'SDL_strtoull' -++'_SDL_strtod'.'SDL3.dll'.'SDL_strtod' -++'_SDL_strcmp'.'SDL3.dll'.'SDL_strcmp' -++'_SDL_strncmp'.'SDL3.dll'.'SDL_strncmp' -++'_SDL_strcasecmp'.'SDL3.dll'.'SDL_strcasecmp' -++'_SDL_strncasecmp'.'SDL3.dll'.'SDL_strncasecmp' -++'_SDL_vsnprintf'.'SDL3.dll'.'SDL_vsnprintf' -++'_SDL_acos'.'SDL3.dll'.'SDL_acos' -++'_SDL_asin'.'SDL3.dll'.'SDL_asin' -++'_SDL_atan'.'SDL3.dll'.'SDL_atan' -++'_SDL_atan2'.'SDL3.dll'.'SDL_atan2' -++'_SDL_ceil'.'SDL3.dll'.'SDL_ceil' -++'_SDL_copysign'.'SDL3.dll'.'SDL_copysign' -++'_SDL_cos'.'SDL3.dll'.'SDL_cos' -++'_SDL_cosf'.'SDL3.dll'.'SDL_cosf' -++'_SDL_fabs'.'SDL3.dll'.'SDL_fabs' -++'_SDL_floor'.'SDL3.dll'.'SDL_floor' -++'_SDL_log'.'SDL3.dll'.'SDL_log' -++'_SDL_pow'.'SDL3.dll'.'SDL_pow' -++'_SDL_scalbn'.'SDL3.dll'.'SDL_scalbn' -++'_SDL_sin'.'SDL3.dll'.'SDL_sin' -++'_SDL_sinf'.'SDL3.dll'.'SDL_sinf' -++'_SDL_sqrt'.'SDL3.dll'.'SDL_sqrt' -++'_SDL_iconv_open'.'SDL3.dll'.'SDL_iconv_open' -++'_SDL_iconv_close'.'SDL3.dll'.'SDL_iconv_close' -++'_SDL_iconv'.'SDL3.dll'.'SDL_iconv' -++'_SDL_iconv_string'.'SDL3.dll'.'SDL_iconv_string' -++'_SDL_CreateRGBSurface'.'SDL3.dll'.'SDL_CreateRGBSurface' -++'_SDL_CreateRGBSurfaceFrom'.'SDL3.dll'.'SDL_CreateRGBSurfaceFrom' -++'_SDL_FreeSurface'.'SDL3.dll'.'SDL_FreeSurface' -++'_SDL_SetSurfacePalette'.'SDL3.dll'.'SDL_SetSurfacePalette' -++'_SDL_LockSurface'.'SDL3.dll'.'SDL_LockSurface' -++'_SDL_UnlockSurface'.'SDL3.dll'.'SDL_UnlockSurface' -++'_SDL_LoadBMP_RW'.'SDL3.dll'.'SDL_LoadBMP_RW' -++'_SDL_SaveBMP_RW'.'SDL3.dll'.'SDL_SaveBMP_RW' -++'_SDL_SetSurfaceRLE'.'SDL3.dll'.'SDL_SetSurfaceRLE' -++'_SDL_SetColorKey'.'SDL3.dll'.'SDL_SetColorKey' -++'_SDL_GetColorKey'.'SDL3.dll'.'SDL_GetColorKey' -++'_SDL_SetSurfaceColorMod'.'SDL3.dll'.'SDL_SetSurfaceColorMod' -++'_SDL_GetSurfaceColorMod'.'SDL3.dll'.'SDL_GetSurfaceColorMod' -++'_SDL_SetSurfaceAlphaMod'.'SDL3.dll'.'SDL_SetSurfaceAlphaMod' -++'_SDL_GetSurfaceAlphaMod'.'SDL3.dll'.'SDL_GetSurfaceAlphaMod' -++'_SDL_SetSurfaceBlendMode'.'SDL3.dll'.'SDL_SetSurfaceBlendMode' -++'_SDL_GetSurfaceBlendMode'.'SDL3.dll'.'SDL_GetSurfaceBlendMode' -++'_SDL_SetClipRect'.'SDL3.dll'.'SDL_SetClipRect' -++'_SDL_GetClipRect'.'SDL3.dll'.'SDL_GetClipRect' -++'_SDL_ConvertSurface'.'SDL3.dll'.'SDL_ConvertSurface' -++'_SDL_ConvertSurfaceFormat'.'SDL3.dll'.'SDL_ConvertSurfaceFormat' -++'_SDL_ConvertPixels'.'SDL3.dll'.'SDL_ConvertPixels' -++'_SDL_FillRect'.'SDL3.dll'.'SDL_FillRect' -++'_SDL_FillRects'.'SDL3.dll'.'SDL_FillRects' -++'_SDL_UpperBlit'.'SDL3.dll'.'SDL_UpperBlit' -++'_SDL_LowerBlit'.'SDL3.dll'.'SDL_LowerBlit' -++'_SDL_SoftStretch'.'SDL3.dll'.'SDL_SoftStretch' -++'_SDL_UpperBlitScaled'.'SDL3.dll'.'SDL_UpperBlitScaled' -++'_SDL_LowerBlitScaled'.'SDL3.dll'.'SDL_LowerBlitScaled' -++'_SDL_GetWindowWMInfo'.'SDL3.dll'.'SDL_GetWindowWMInfo' -++'_SDL_GetThreadName'.'SDL3.dll'.'SDL_GetThreadName' -++'_SDL_ThreadID'.'SDL3.dll'.'SDL_ThreadID' -++'_SDL_GetThreadID'.'SDL3.dll'.'SDL_GetThreadID' -++'_SDL_SetThreadPriority'.'SDL3.dll'.'SDL_SetThreadPriority' -++'_SDL_WaitThread'.'SDL3.dll'.'SDL_WaitThread' -++'_SDL_DetachThread'.'SDL3.dll'.'SDL_DetachThread' -++'_SDL_TLSCreate'.'SDL3.dll'.'SDL_TLSCreate' -++'_SDL_TLSGet'.'SDL3.dll'.'SDL_TLSGet' -++'_SDL_TLSSet'.'SDL3.dll'.'SDL_TLSSet' -++'_SDL_GetTicks'.'SDL3.dll'.'SDL_GetTicks' -++'_SDL_GetPerformanceCounter'.'SDL3.dll'.'SDL_GetPerformanceCounter' -++'_SDL_GetPerformanceFrequency'.'SDL3.dll'.'SDL_GetPerformanceFrequency' -++'_SDL_Delay'.'SDL3.dll'.'SDL_Delay' -++'_SDL_AddTimer'.'SDL3.dll'.'SDL_AddTimer' -++'_SDL_RemoveTimer'.'SDL3.dll'.'SDL_RemoveTimer' -++'_SDL_GetNumTouchDevices'.'SDL3.dll'.'SDL_GetNumTouchDevices' -++'_SDL_GetTouchDevice'.'SDL3.dll'.'SDL_GetTouchDevice' -++'_SDL_GetNumTouchFingers'.'SDL3.dll'.'SDL_GetNumTouchFingers' -++'_SDL_GetTouchFinger'.'SDL3.dll'.'SDL_GetTouchFinger' -++'_SDL_GetVersion'.'SDL3.dll'.'SDL_GetVersion' -++'_SDL_GetRevision'.'SDL3.dll'.'SDL_GetRevision' -++'_SDL_GetRevisionNumber'.'SDL3.dll'.'SDL_GetRevisionNumber' -++'_SDL_GetNumVideoDrivers'.'SDL3.dll'.'SDL_GetNumVideoDrivers' -++'_SDL_GetVideoDriver'.'SDL3.dll'.'SDL_GetVideoDriver' -++'_SDL_VideoInit'.'SDL3.dll'.'SDL_VideoInit' -++'_SDL_VideoQuit'.'SDL3.dll'.'SDL_VideoQuit' -++'_SDL_GetCurrentVideoDriver'.'SDL3.dll'.'SDL_GetCurrentVideoDriver' -++'_SDL_GetNumVideoDisplays'.'SDL3.dll'.'SDL_GetNumVideoDisplays' -++'_SDL_GetDisplayName'.'SDL3.dll'.'SDL_GetDisplayName' -++'_SDL_GetDisplayBounds'.'SDL3.dll'.'SDL_GetDisplayBounds' -++'_SDL_GetDisplayDPI'.'SDL3.dll'.'SDL_GetDisplayDPI' -++'_SDL_GetNumDisplayModes'.'SDL3.dll'.'SDL_GetNumDisplayModes' -++'_SDL_GetDisplayMode'.'SDL3.dll'.'SDL_GetDisplayMode' -++'_SDL_GetDesktopDisplayMode'.'SDL3.dll'.'SDL_GetDesktopDisplayMode' -++'_SDL_GetCurrentDisplayMode'.'SDL3.dll'.'SDL_GetCurrentDisplayMode' -++'_SDL_GetClosestDisplayMode'.'SDL3.dll'.'SDL_GetClosestDisplayMode' -++'_SDL_GetWindowDisplayIndex'.'SDL3.dll'.'SDL_GetWindowDisplayIndex' -++'_SDL_SetWindowDisplayMode'.'SDL3.dll'.'SDL_SetWindowDisplayMode' -++'_SDL_GetWindowDisplayMode'.'SDL3.dll'.'SDL_GetWindowDisplayMode' -++'_SDL_GetWindowPixelFormat'.'SDL3.dll'.'SDL_GetWindowPixelFormat' -++'_SDL_CreateWindow'.'SDL3.dll'.'SDL_CreateWindow' -++'_SDL_CreateWindowFrom'.'SDL3.dll'.'SDL_CreateWindowFrom' -++'_SDL_GetWindowID'.'SDL3.dll'.'SDL_GetWindowID' -++'_SDL_GetWindowFromID'.'SDL3.dll'.'SDL_GetWindowFromID' -++'_SDL_GetWindowFlags'.'SDL3.dll'.'SDL_GetWindowFlags' -++'_SDL_SetWindowTitle'.'SDL3.dll'.'SDL_SetWindowTitle' -++'_SDL_GetWindowTitle'.'SDL3.dll'.'SDL_GetWindowTitle' -++'_SDL_SetWindowIcon'.'SDL3.dll'.'SDL_SetWindowIcon' -++'_SDL_SetWindowData'.'SDL3.dll'.'SDL_SetWindowData' -++'_SDL_GetWindowData'.'SDL3.dll'.'SDL_GetWindowData' -++'_SDL_SetWindowPosition'.'SDL3.dll'.'SDL_SetWindowPosition' -++'_SDL_GetWindowPosition'.'SDL3.dll'.'SDL_GetWindowPosition' -++'_SDL_SetWindowSize'.'SDL3.dll'.'SDL_SetWindowSize' -++'_SDL_GetWindowSize'.'SDL3.dll'.'SDL_GetWindowSize' -++'_SDL_SetWindowMinimumSize'.'SDL3.dll'.'SDL_SetWindowMinimumSize' -++'_SDL_GetWindowMinimumSize'.'SDL3.dll'.'SDL_GetWindowMinimumSize' -++'_SDL_SetWindowMaximumSize'.'SDL3.dll'.'SDL_SetWindowMaximumSize' -++'_SDL_GetWindowMaximumSize'.'SDL3.dll'.'SDL_GetWindowMaximumSize' -++'_SDL_SetWindowBordered'.'SDL3.dll'.'SDL_SetWindowBordered' -++'_SDL_ShowWindow'.'SDL3.dll'.'SDL_ShowWindow' -++'_SDL_HideWindow'.'SDL3.dll'.'SDL_HideWindow' -++'_SDL_RaiseWindow'.'SDL3.dll'.'SDL_RaiseWindow' -++'_SDL_MaximizeWindow'.'SDL3.dll'.'SDL_MaximizeWindow' -++'_SDL_MinimizeWindow'.'SDL3.dll'.'SDL_MinimizeWindow' -++'_SDL_RestoreWindow'.'SDL3.dll'.'SDL_RestoreWindow' -++'_SDL_SetWindowFullscreen'.'SDL3.dll'.'SDL_SetWindowFullscreen' -++'_SDL_GetWindowSurface'.'SDL3.dll'.'SDL_GetWindowSurface' -++'_SDL_UpdateWindowSurface'.'SDL3.dll'.'SDL_UpdateWindowSurface' -++'_SDL_UpdateWindowSurfaceRects'.'SDL3.dll'.'SDL_UpdateWindowSurfaceRects' -++'_SDL_SetWindowGrab'.'SDL3.dll'.'SDL_SetWindowGrab' -++'_SDL_GetWindowGrab'.'SDL3.dll'.'SDL_GetWindowGrab' -++'_SDL_SetWindowBrightness'.'SDL3.dll'.'SDL_SetWindowBrightness' -++'_SDL_GetWindowBrightness'.'SDL3.dll'.'SDL_GetWindowBrightness' -++'_SDL_SetWindowGammaRamp'.'SDL3.dll'.'SDL_SetWindowGammaRamp' -++'_SDL_GetWindowGammaRamp'.'SDL3.dll'.'SDL_GetWindowGammaRamp' -++'_SDL_DestroyWindow'.'SDL3.dll'.'SDL_DestroyWindow' -++'_SDL_IsScreenSaverEnabled'.'SDL3.dll'.'SDL_IsScreenSaverEnabled' -++'_SDL_EnableScreenSaver'.'SDL3.dll'.'SDL_EnableScreenSaver' -++'_SDL_DisableScreenSaver'.'SDL3.dll'.'SDL_DisableScreenSaver' -++'_SDL_GL_LoadLibrary'.'SDL3.dll'.'SDL_GL_LoadLibrary' -++'_SDL_GL_GetProcAddress'.'SDL3.dll'.'SDL_GL_GetProcAddress' -++'_SDL_GL_UnloadLibrary'.'SDL3.dll'.'SDL_GL_UnloadLibrary' -++'_SDL_GL_ExtensionSupported'.'SDL3.dll'.'SDL_GL_ExtensionSupported' -++'_SDL_GL_SetAttribute'.'SDL3.dll'.'SDL_GL_SetAttribute' -++'_SDL_GL_GetAttribute'.'SDL3.dll'.'SDL_GL_GetAttribute' -++'_SDL_GL_CreateContext'.'SDL3.dll'.'SDL_GL_CreateContext' -++'_SDL_GL_MakeCurrent'.'SDL3.dll'.'SDL_GL_MakeCurrent' -++'_SDL_GL_GetCurrentWindow'.'SDL3.dll'.'SDL_GL_GetCurrentWindow' -++'_SDL_GL_GetCurrentContext'.'SDL3.dll'.'SDL_GL_GetCurrentContext' -++'_SDL_GL_GetDrawableSize'.'SDL3.dll'.'SDL_GL_GetDrawableSize' -++'_SDL_GL_SetSwapInterval'.'SDL3.dll'.'SDL_GL_SetSwapInterval' -++'_SDL_GL_GetSwapInterval'.'SDL3.dll'.'SDL_GL_GetSwapInterval' -++'_SDL_GL_SwapWindow'.'SDL3.dll'.'SDL_GL_SwapWindow' -++'_SDL_GL_DeleteContext'.'SDL3.dll'.'SDL_GL_DeleteContext' -++'_SDL_vsscanf'.'SDL3.dll'.'SDL_vsscanf' -++'_SDL_GameControllerAddMappingsFromRW'.'SDL3.dll'.'SDL_GameControllerAddMappingsFromRW' -++'_SDL_GL_ResetAttributes'.'SDL3.dll'.'SDL_GL_ResetAttributes' -++'_SDL_HasAVX'.'SDL3.dll'.'SDL_HasAVX' -++'_SDL_GetDefaultAssertionHandler'.'SDL3.dll'.'SDL_GetDefaultAssertionHandler' -++'_SDL_GetAssertionHandler'.'SDL3.dll'.'SDL_GetAssertionHandler' -++'_SDL_DXGIGetOutputInfo'.'SDL3.dll'.'SDL_DXGIGetOutputInfo' -++'_SDL_RenderIsClipEnabled'.'SDL3.dll'.'SDL_RenderIsClipEnabled' -# ++'_SDL_WinRTRunApp'.'SDL3.dll'.'SDL_WinRTRunApp' -++'_SDL_WarpMouseGlobal'.'SDL3.dll'.'SDL_WarpMouseGlobal' -# ++'_SDL_WinRTGetFSPathUNICODE'.'SDL3.dll'.'SDL_WinRTGetFSPathUNICODE' -# ++'_SDL_WinRTGetFSPathUTF8'.'SDL3.dll'.'SDL_WinRTGetFSPathUTF8' -++'_SDL_sqrtf'.'SDL3.dll'.'SDL_sqrtf' -++'_SDL_tan'.'SDL3.dll'.'SDL_tan' -++'_SDL_tanf'.'SDL3.dll'.'SDL_tanf' -++'_SDL_CaptureMouse'.'SDL3.dll'.'SDL_CaptureMouse' -++'_SDL_SetWindowHitTest'.'SDL3.dll'.'SDL_SetWindowHitTest' -++'_SDL_GetGlobalMouseState'.'SDL3.dll'.'SDL_GetGlobalMouseState' -++'_SDL_HasAVX2'.'SDL3.dll'.'SDL_HasAVX2' -++'_SDL_QueueAudio'.'SDL3.dll'.'SDL_QueueAudio' -++'_SDL_GetQueuedAudioSize'.'SDL3.dll'.'SDL_GetQueuedAudioSize' -++'_SDL_ClearQueuedAudio'.'SDL3.dll'.'SDL_ClearQueuedAudio' -++'_SDL_GetGrabbedWindow'.'SDL3.dll'.'SDL_GetGrabbedWindow' -++'_SDL_SetWindowsMessageHook'.'SDL3.dll'.'SDL_SetWindowsMessageHook' -++'_SDL_JoystickCurrentPowerLevel'.'SDL3.dll'.'SDL_JoystickCurrentPowerLevel' -++'_SDL_GameControllerFromInstanceID'.'SDL3.dll'.'SDL_GameControllerFromInstanceID' -++'_SDL_JoystickFromInstanceID'.'SDL3.dll'.'SDL_JoystickFromInstanceID' -++'_SDL_GetDisplayUsableBounds'.'SDL3.dll'.'SDL_GetDisplayUsableBounds' -++'_SDL_GetWindowBordersSize'.'SDL3.dll'.'SDL_GetWindowBordersSize' -++'_SDL_SetWindowOpacity'.'SDL3.dll'.'SDL_SetWindowOpacity' -++'_SDL_GetWindowOpacity'.'SDL3.dll'.'SDL_GetWindowOpacity' -++'_SDL_SetWindowInputFocus'.'SDL3.dll'.'SDL_SetWindowInputFocus' -++'_SDL_SetWindowModalFor'.'SDL3.dll'.'SDL_SetWindowModalFor' -++'_SDL_RenderSetIntegerScale'.'SDL3.dll'.'SDL_RenderSetIntegerScale' -++'_SDL_RenderGetIntegerScale'.'SDL3.dll'.'SDL_RenderGetIntegerScale' -++'_SDL_DequeueAudio'.'SDL3.dll'.'SDL_DequeueAudio' -++'_SDL_SetWindowResizable'.'SDL3.dll'.'SDL_SetWindowResizable' -++'_SDL_CreateRGBSurfaceWithFormat'.'SDL3.dll'.'SDL_CreateRGBSurfaceWithFormat' -++'_SDL_CreateRGBSurfaceWithFormatFrom'.'SDL3.dll'.'SDL_CreateRGBSurfaceWithFormatFrom' -++'_SDL_GetHintBoolean'.'SDL3.dll'.'SDL_GetHintBoolean' -++'_SDL_JoystickGetDeviceVendor'.'SDL3.dll'.'SDL_JoystickGetDeviceVendor' -++'_SDL_JoystickGetDeviceProduct'.'SDL3.dll'.'SDL_JoystickGetDeviceProduct' -++'_SDL_JoystickGetDeviceProductVersion'.'SDL3.dll'.'SDL_JoystickGetDeviceProductVersion' -++'_SDL_JoystickGetVendor'.'SDL3.dll'.'SDL_JoystickGetVendor' -++'_SDL_JoystickGetProduct'.'SDL3.dll'.'SDL_JoystickGetProduct' -++'_SDL_JoystickGetProductVersion'.'SDL3.dll'.'SDL_JoystickGetProductVersion' -++'_SDL_GameControllerGetVendor'.'SDL3.dll'.'SDL_GameControllerGetVendor' -++'_SDL_GameControllerGetProduct'.'SDL3.dll'.'SDL_GameControllerGetProduct' -++'_SDL_GameControllerGetProductVersion'.'SDL3.dll'.'SDL_GameControllerGetProductVersion' -++'_SDL_HasNEON'.'SDL3.dll'.'SDL_HasNEON' -++'_SDL_GameControllerNumMappings'.'SDL3.dll'.'SDL_GameControllerNumMappings' -++'_SDL_GameControllerMappingForIndex'.'SDL3.dll'.'SDL_GameControllerMappingForIndex' -++'_SDL_JoystickGetAxisInitialState'.'SDL3.dll'.'SDL_JoystickGetAxisInitialState' -++'_SDL_JoystickGetDeviceType'.'SDL3.dll'.'SDL_JoystickGetDeviceType' -++'_SDL_JoystickGetType'.'SDL3.dll'.'SDL_JoystickGetType' -++'_SDL_MemoryBarrierReleaseFunction'.'SDL3.dll'.'SDL_MemoryBarrierReleaseFunction' -++'_SDL_MemoryBarrierAcquireFunction'.'SDL3.dll'.'SDL_MemoryBarrierAcquireFunction' -++'_SDL_JoystickGetDeviceInstanceID'.'SDL3.dll'.'SDL_JoystickGetDeviceInstanceID' -++'_SDL_utf8strlen'.'SDL3.dll'.'SDL_utf8strlen' -++'_SDL_LoadFile_RW'.'SDL3.dll'.'SDL_LoadFile_RW' -++'_SDL_wcscmp'.'SDL3.dll'.'SDL_wcscmp' -++'_SDL_ComposeCustomBlendMode'.'SDL3.dll'.'SDL_ComposeCustomBlendMode' -++'_SDL_DuplicateSurface'.'SDL3.dll'.'SDL_DuplicateSurface' -++'_SDL_Vulkan_LoadLibrary'.'SDL3.dll'.'SDL_Vulkan_LoadLibrary' -++'_SDL_Vulkan_GetVkGetInstanceProcAddr'.'SDL3.dll'.'SDL_Vulkan_GetVkGetInstanceProcAddr' -++'_SDL_Vulkan_UnloadLibrary'.'SDL3.dll'.'SDL_Vulkan_UnloadLibrary' -++'_SDL_Vulkan_GetInstanceExtensions'.'SDL3.dll'.'SDL_Vulkan_GetInstanceExtensions' -++'_SDL_Vulkan_CreateSurface'.'SDL3.dll'.'SDL_Vulkan_CreateSurface' -++'_SDL_Vulkan_GetDrawableSize'.'SDL3.dll'.'SDL_Vulkan_GetDrawableSize' -++'_SDL_LockJoysticks'.'SDL3.dll'.'SDL_LockJoysticks' -++'_SDL_UnlockJoysticks'.'SDL3.dll'.'SDL_UnlockJoysticks' -++'_SDL_GetMemoryFunctions'.'SDL3.dll'.'SDL_GetMemoryFunctions' -++'_SDL_SetMemoryFunctions'.'SDL3.dll'.'SDL_SetMemoryFunctions' -++'_SDL_GetNumAllocations'.'SDL3.dll'.'SDL_GetNumAllocations' -++'_SDL_NewAudioStream'.'SDL3.dll'.'SDL_NewAudioStream' -++'_SDL_AudioStreamPut'.'SDL3.dll'.'SDL_AudioStreamPut' -++'_SDL_AudioStreamGet'.'SDL3.dll'.'SDL_AudioStreamGet' -++'_SDL_AudioStreamClear'.'SDL3.dll'.'SDL_AudioStreamClear' -++'_SDL_AudioStreamAvailable'.'SDL3.dll'.'SDL_AudioStreamAvailable' -++'_SDL_FreeAudioStream'.'SDL3.dll'.'SDL_FreeAudioStream' -++'_SDL_AudioStreamFlush'.'SDL3.dll'.'SDL_AudioStreamFlush' -++'_SDL_acosf'.'SDL3.dll'.'SDL_acosf' -++'_SDL_asinf'.'SDL3.dll'.'SDL_asinf' -++'_SDL_atanf'.'SDL3.dll'.'SDL_atanf' -++'_SDL_atan2f'.'SDL3.dll'.'SDL_atan2f' -++'_SDL_ceilf'.'SDL3.dll'.'SDL_ceilf' -++'_SDL_copysignf'.'SDL3.dll'.'SDL_copysignf' -++'_SDL_fabsf'.'SDL3.dll'.'SDL_fabsf' -++'_SDL_floorf'.'SDL3.dll'.'SDL_floorf' -++'_SDL_logf'.'SDL3.dll'.'SDL_logf' -++'_SDL_powf'.'SDL3.dll'.'SDL_powf' -++'_SDL_scalbnf'.'SDL3.dll'.'SDL_scalbnf' -++'_SDL_fmod'.'SDL3.dll'.'SDL_fmod' -++'_SDL_fmodf'.'SDL3.dll'.'SDL_fmodf' -++'_SDL_SetYUVConversionMode'.'SDL3.dll'.'SDL_SetYUVConversionMode' -++'_SDL_GetYUVConversionMode'.'SDL3.dll'.'SDL_GetYUVConversionMode' -++'_SDL_GetYUVConversionModeForResolution'.'SDL3.dll'.'SDL_GetYUVConversionModeForResolution' -++'_SDL_RenderGetMetalLayer'.'SDL3.dll'.'SDL_RenderGetMetalLayer' -++'_SDL_RenderGetMetalCommandEncoder'.'SDL3.dll'.'SDL_RenderGetMetalCommandEncoder' -# ++'_SDL_IsAndroidTV'.'SDL3.dll'.'SDL_IsAndroidTV' -# ++'_SDL_WinRTGetDeviceFamily'.'SDL3.dll'.'SDL_WinRTGetDeviceFamily' -++'_SDL_log10'.'SDL3.dll'.'SDL_log10' -++'_SDL_log10f'.'SDL3.dll'.'SDL_log10f' -++'_SDL_GameControllerMappingForDeviceIndex'.'SDL3.dll'.'SDL_GameControllerMappingForDeviceIndex' -# ++'_SDL_LinuxSetThreadPriority'.'SDL3.dll'.'SDL_LinuxSetThreadPriority' -++'_SDL_HasAVX512F'.'SDL3.dll'.'SDL_HasAVX512F' -# ++'_SDL_IsChromebook'.'SDL3.dll'.'SDL_IsChromebook' -# ++'_SDL_IsDeXMode'.'SDL3.dll'.'SDL_IsDeXMode' -# ++'_SDL_AndroidBackButton'.'SDL3.dll'.'SDL_AndroidBackButton' -++'_SDL_exp'.'SDL3.dll'.'SDL_exp' -++'_SDL_expf'.'SDL3.dll'.'SDL_expf' -++'_SDL_wcsdup'.'SDL3.dll'.'SDL_wcsdup' -++'_SDL_GameControllerRumble'.'SDL3.dll'.'SDL_GameControllerRumble' -++'_SDL_JoystickRumble'.'SDL3.dll'.'SDL_JoystickRumble' -++'_SDL_NumSensors'.'SDL3.dll'.'SDL_NumSensors' -++'_SDL_SensorGetDeviceName'.'SDL3.dll'.'SDL_SensorGetDeviceName' -++'_SDL_SensorGetDeviceType'.'SDL3.dll'.'SDL_SensorGetDeviceType' -++'_SDL_SensorGetDeviceNonPortableType'.'SDL3.dll'.'SDL_SensorGetDeviceNonPortableType' -++'_SDL_SensorGetDeviceInstanceID'.'SDL3.dll'.'SDL_SensorGetDeviceInstanceID' -++'_SDL_SensorOpen'.'SDL3.dll'.'SDL_SensorOpen' -++'_SDL_SensorFromInstanceID'.'SDL3.dll'.'SDL_SensorFromInstanceID' -++'_SDL_SensorGetName'.'SDL3.dll'.'SDL_SensorGetName' -++'_SDL_SensorGetType'.'SDL3.dll'.'SDL_SensorGetType' -++'_SDL_SensorGetNonPortableType'.'SDL3.dll'.'SDL_SensorGetNonPortableType' -++'_SDL_SensorGetInstanceID'.'SDL3.dll'.'SDL_SensorGetInstanceID' -++'_SDL_SensorGetData'.'SDL3.dll'.'SDL_SensorGetData' -++'_SDL_SensorClose'.'SDL3.dll'.'SDL_SensorClose' -++'_SDL_SensorUpdate'.'SDL3.dll'.'SDL_SensorUpdate' -++'_SDL_IsTablet'.'SDL3.dll'.'SDL_IsTablet' -++'_SDL_GetDisplayOrientation'.'SDL3.dll'.'SDL_GetDisplayOrientation' -++'_SDL_HasColorKey'.'SDL3.dll'.'SDL_HasColorKey' -++'_SDL_CreateThreadWithStackSize'.'SDL3.dll'.'SDL_CreateThreadWithStackSize' -++'_SDL_JoystickGetDevicePlayerIndex'.'SDL3.dll'.'SDL_JoystickGetDevicePlayerIndex' -++'_SDL_JoystickGetPlayerIndex'.'SDL3.dll'.'SDL_JoystickGetPlayerIndex' -++'_SDL_GameControllerGetPlayerIndex'.'SDL3.dll'.'SDL_GameControllerGetPlayerIndex' -++'_SDL_RenderFlush'.'SDL3.dll'.'SDL_RenderFlush' -++'_SDL_RenderDrawPointF'.'SDL3.dll'.'SDL_RenderDrawPointF' -++'_SDL_RenderDrawPointsF'.'SDL3.dll'.'SDL_RenderDrawPointsF' -++'_SDL_RenderDrawLineF'.'SDL3.dll'.'SDL_RenderDrawLineF' -++'_SDL_RenderDrawLinesF'.'SDL3.dll'.'SDL_RenderDrawLinesF' -++'_SDL_RenderDrawRectF'.'SDL3.dll'.'SDL_RenderDrawRectF' -++'_SDL_RenderDrawRectsF'.'SDL3.dll'.'SDL_RenderDrawRectsF' -++'_SDL_RenderFillRectF'.'SDL3.dll'.'SDL_RenderFillRectF' -++'_SDL_RenderFillRectsF'.'SDL3.dll'.'SDL_RenderFillRectsF' -++'_SDL_RenderCopyF'.'SDL3.dll'.'SDL_RenderCopyF' -++'_SDL_RenderCopyExF'.'SDL3.dll'.'SDL_RenderCopyExF' -++'_SDL_GetTouchDeviceType'.'SDL3.dll'.'SDL_GetTouchDeviceType' -# ++'_SDL_UIKitRunApp'.'SDL3.dll'.'SDL_UIKitRunApp' -++'_SDL_SIMDGetAlignment'.'SDL3.dll'.'SDL_SIMDGetAlignment' -++'_SDL_SIMDAlloc'.'SDL3.dll'.'SDL_SIMDAlloc' -++'_SDL_SIMDFree'.'SDL3.dll'.'SDL_SIMDFree' -++'_SDL_RWsize'.'SDL3.dll'.'SDL_RWsize' -++'_SDL_RWseek'.'SDL3.dll'.'SDL_RWseek' -++'_SDL_RWtell'.'SDL3.dll'.'SDL_RWtell' -++'_SDL_RWread'.'SDL3.dll'.'SDL_RWread' -++'_SDL_RWwrite'.'SDL3.dll'.'SDL_RWwrite' -++'_SDL_RWclose'.'SDL3.dll'.'SDL_RWclose' -++'_SDL_LoadFile'.'SDL3.dll'.'SDL_LoadFile' -++'_SDL_Metal_CreateView'.'SDL3.dll'.'SDL_Metal_CreateView' -++'_SDL_Metal_DestroyView'.'SDL3.dll'.'SDL_Metal_DestroyView' -++'_SDL_LockTextureToSurface'.'SDL3.dll'.'SDL_LockTextureToSurface' -++'_SDL_HasARMSIMD'.'SDL3.dll'.'SDL_HasARMSIMD' -++'_SDL_strtokr'.'SDL3.dll'.'SDL_strtokr' -++'_SDL_wcsstr'.'SDL3.dll'.'SDL_wcsstr' -++'_SDL_wcsncmp'.'SDL3.dll'.'SDL_wcsncmp' -++'_SDL_GameControllerTypeForIndex'.'SDL3.dll'.'SDL_GameControllerTypeForIndex' -++'_SDL_GameControllerGetType'.'SDL3.dll'.'SDL_GameControllerGetType' -++'_SDL_GameControllerFromPlayerIndex'.'SDL3.dll'.'SDL_GameControllerFromPlayerIndex' -++'_SDL_GameControllerSetPlayerIndex'.'SDL3.dll'.'SDL_GameControllerSetPlayerIndex' -++'_SDL_JoystickFromPlayerIndex'.'SDL3.dll'.'SDL_JoystickFromPlayerIndex' -++'_SDL_JoystickSetPlayerIndex'.'SDL3.dll'.'SDL_JoystickSetPlayerIndex' -++'_SDL_SetTextureScaleMode'.'SDL3.dll'.'SDL_SetTextureScaleMode' -++'_SDL_GetTextureScaleMode'.'SDL3.dll'.'SDL_GetTextureScaleMode' -++'_SDL_OnApplicationWillTerminate'.'SDL3.dll'.'SDL_OnApplicationWillTerminate' -++'_SDL_OnApplicationDidReceiveMemoryWarning'.'SDL3.dll'.'SDL_OnApplicationDidReceiveMemoryWarning' -++'_SDL_OnApplicationWillResignActive'.'SDL3.dll'.'SDL_OnApplicationWillResignActive' -++'_SDL_OnApplicationDidEnterBackground'.'SDL3.dll'.'SDL_OnApplicationDidEnterBackground' -++'_SDL_OnApplicationWillEnterForeground'.'SDL3.dll'.'SDL_OnApplicationWillEnterForeground' -++'_SDL_OnApplicationDidBecomeActive'.'SDL3.dll'.'SDL_OnApplicationDidBecomeActive' -# ++'_SDL_OnApplicationDidChangeStatusBarOrientation'.'SDL3.dll'.'SDL_OnApplicationDidChangeStatusBarOrientation' -# ++'_SDL_GetAndroidSDKVersion'.'SDL3.dll'.'SDL_GetAndroidSDKVersion' -++'_SDL_isupper'.'SDL3.dll'.'SDL_isupper' -++'_SDL_islower'.'SDL3.dll'.'SDL_islower' -++'_SDL_JoystickAttachVirtual'.'SDL3.dll'.'SDL_JoystickAttachVirtual' -++'_SDL_JoystickDetachVirtual'.'SDL3.dll'.'SDL_JoystickDetachVirtual' -++'_SDL_JoystickIsVirtual'.'SDL3.dll'.'SDL_JoystickIsVirtual' -++'_SDL_JoystickSetVirtualAxis'.'SDL3.dll'.'SDL_JoystickSetVirtualAxis' -++'_SDL_JoystickSetVirtualButton'.'SDL3.dll'.'SDL_JoystickSetVirtualButton' -++'_SDL_JoystickSetVirtualHat'.'SDL3.dll'.'SDL_JoystickSetVirtualHat' -++'_SDL_GetErrorMsg'.'SDL3.dll'.'SDL_GetErrorMsg' -++'_SDL_LockSensors'.'SDL3.dll'.'SDL_LockSensors' -++'_SDL_UnlockSensors'.'SDL3.dll'.'SDL_UnlockSensors' -++'_SDL_Metal_GetLayer'.'SDL3.dll'.'SDL_Metal_GetLayer' -++'_SDL_Metal_GetDrawableSize'.'SDL3.dll'.'SDL_Metal_GetDrawableSize' -++'_SDL_trunc'.'SDL3.dll'.'SDL_trunc' -++'_SDL_truncf'.'SDL3.dll'.'SDL_truncf' -++'_SDL_GetPreferredLocales'.'SDL3.dll'.'SDL_GetPreferredLocales' -++'_SDL_SIMDRealloc'.'SDL3.dll'.'SDL_SIMDRealloc' -# ++'_SDL_AndroidRequestPermission'.'SDL3.dll'.'SDL_AndroidRequestPermission' -++'_SDL_OpenURL'.'SDL3.dll'.'SDL_OpenURL' -++'_SDL_HasSurfaceRLE'.'SDL3.dll'.'SDL_HasSurfaceRLE' -++'_SDL_GameControllerHasLED'.'SDL3.dll'.'SDL_GameControllerHasLED' -++'_SDL_GameControllerSetLED'.'SDL3.dll'.'SDL_GameControllerSetLED' -++'_SDL_JoystickHasLED'.'SDL3.dll'.'SDL_JoystickHasLED' -++'_SDL_JoystickSetLED'.'SDL3.dll'.'SDL_JoystickSetLED' -++'_SDL_GameControllerRumbleTriggers'.'SDL3.dll'.'SDL_GameControllerRumbleTriggers' -++'_SDL_JoystickRumbleTriggers'.'SDL3.dll'.'SDL_JoystickRumbleTriggers' -++'_SDL_GameControllerHasAxis'.'SDL3.dll'.'SDL_GameControllerHasAxis' -++'_SDL_GameControllerHasButton'.'SDL3.dll'.'SDL_GameControllerHasButton' -++'_SDL_GameControllerGetNumTouchpads'.'SDL3.dll'.'SDL_GameControllerGetNumTouchpads' -++'_SDL_GameControllerGetNumTouchpadFingers'.'SDL3.dll'.'SDL_GameControllerGetNumTouchpadFingers' -++'_SDL_GameControllerGetTouchpadFinger'.'SDL3.dll'.'SDL_GameControllerGetTouchpadFinger' -++'_SDL_crc32'.'SDL3.dll'.'SDL_crc32' -++'_SDL_GameControllerGetSerial'.'SDL3.dll'.'SDL_GameControllerGetSerial' -++'_SDL_JoystickGetSerial'.'SDL3.dll'.'SDL_JoystickGetSerial' -++'_SDL_GameControllerHasSensor'.'SDL3.dll'.'SDL_GameControllerHasSensor' -++'_SDL_GameControllerSetSensorEnabled'.'SDL3.dll'.'SDL_GameControllerSetSensorEnabled' -++'_SDL_GameControllerIsSensorEnabled'.'SDL3.dll'.'SDL_GameControllerIsSensorEnabled' -++'_SDL_GameControllerGetSensorData'.'SDL3.dll'.'SDL_GameControllerGetSensorData' -++'_SDL_wcscasecmp'.'SDL3.dll'.'SDL_wcscasecmp' -++'_SDL_wcsncasecmp'.'SDL3.dll'.'SDL_wcsncasecmp' -++'_SDL_round'.'SDL3.dll'.'SDL_round' -++'_SDL_roundf'.'SDL3.dll'.'SDL_roundf' -++'_SDL_lround'.'SDL3.dll'.'SDL_lround' -++'_SDL_lroundf'.'SDL3.dll'.'SDL_lroundf' -++'_SDL_SoftStretchLinear'.'SDL3.dll'.'SDL_SoftStretchLinear' -++'_SDL_RenderGetD3D11Device'.'SDL3.dll'.'SDL_RenderGetD3D11Device' -++'_SDL_UpdateNVTexture'.'SDL3.dll'.'SDL_UpdateNVTexture' -++'_SDL_SetWindowKeyboardGrab'.'SDL3.dll'.'SDL_SetWindowKeyboardGrab' -++'_SDL_SetWindowMouseGrab'.'SDL3.dll'.'SDL_SetWindowMouseGrab' -++'_SDL_GetWindowKeyboardGrab'.'SDL3.dll'.'SDL_GetWindowKeyboardGrab' -++'_SDL_GetWindowMouseGrab'.'SDL3.dll'.'SDL_GetWindowMouseGrab' -++'_SDL_isalpha'.'SDL3.dll'.'SDL_isalpha' -++'_SDL_isalnum'.'SDL3.dll'.'SDL_isalnum' -++'_SDL_isblank'.'SDL3.dll'.'SDL_isblank' -++'_SDL_iscntrl'.'SDL3.dll'.'SDL_iscntrl' -++'_SDL_isxdigit'.'SDL3.dll'.'SDL_isxdigit' -++'_SDL_ispunct'.'SDL3.dll'.'SDL_ispunct' -++'_SDL_isprint'.'SDL3.dll'.'SDL_isprint' -++'_SDL_isgraph'.'SDL3.dll'.'SDL_isgraph' -# ++'_SDL_AndroidShowToast'.'SDL3.dll'.'SDL_AndroidShowToast' -++'_SDL_GetAudioDeviceSpec'.'SDL3.dll'.'SDL_GetAudioDeviceSpec' -++'_SDL_TLSCleanup'.'SDL3.dll'.'SDL_TLSCleanup' -++'_SDL_SetWindowAlwaysOnTop'.'SDL3.dll'.'SDL_SetWindowAlwaysOnTop' -++'_SDL_FlashWindow'.'SDL3.dll'.'SDL_FlashWindow' -++'_SDL_GameControllerSendEffect'.'SDL3.dll'.'SDL_GameControllerSendEffect' -++'_SDL_JoystickSendEffect'.'SDL3.dll'.'SDL_JoystickSendEffect' -++'_SDL_GameControllerGetSensorDataRate'.'SDL3.dll'.'SDL_GameControllerGetSensorDataRate' -++'_SDL_SetTextureUserData'.'SDL3.dll'.'SDL_SetTextureUserData' -++'_SDL_GetTextureUserData'.'SDL3.dll'.'SDL_GetTextureUserData' -++'_SDL_RenderGeometry'.'SDL3.dll'.'SDL_RenderGeometry' -++'_SDL_RenderGeometryRaw'.'SDL3.dll'.'SDL_RenderGeometryRaw' -++'_SDL_RenderSetVSync'.'SDL3.dll'.'SDL_RenderSetVSync' -++'_SDL_asprintf'.'SDL3.dll'.'SDL_asprintf' -++'_SDL_vasprintf'.'SDL3.dll'.'SDL_vasprintf' -++'_SDL_GetWindowICCProfile'.'SDL3.dll'.'SDL_GetWindowICCProfile' -++'_SDL_GetTicks64'.'SDL3.dll'.'SDL_GetTicks64' -# ++'_SDL_LinuxSetThreadPriorityAndPolicy'.'SDL3.dll'.'SDL_LinuxSetThreadPriorityAndPolicy' -++'_SDL_GameControllerGetAppleSFSymbolsNameForButton'.'SDL3.dll'.'SDL_GameControllerGetAppleSFSymbolsNameForButton' -++'_SDL_GameControllerGetAppleSFSymbolsNameForAxis'.'SDL3.dll'.'SDL_GameControllerGetAppleSFSymbolsNameForAxis' -++'_SDL_hid_init'.'SDL3.dll'.'SDL_hid_init' -++'_SDL_hid_exit'.'SDL3.dll'.'SDL_hid_exit' -++'_SDL_hid_device_change_count'.'SDL3.dll'.'SDL_hid_device_change_count' -++'_SDL_hid_enumerate'.'SDL3.dll'.'SDL_hid_enumerate' -++'_SDL_hid_free_enumeration'.'SDL3.dll'.'SDL_hid_free_enumeration' -++'_SDL_hid_open'.'SDL3.dll'.'SDL_hid_open' -++'_SDL_hid_open_path'.'SDL3.dll'.'SDL_hid_open_path' -++'_SDL_hid_write'.'SDL3.dll'.'SDL_hid_write' -++'_SDL_hid_read_timeout'.'SDL3.dll'.'SDL_hid_read_timeout' -++'_SDL_hid_read'.'SDL3.dll'.'SDL_hid_read' -++'_SDL_hid_set_nonblocking'.'SDL3.dll'.'SDL_hid_set_nonblocking' -++'_SDL_hid_send_feature_report'.'SDL3.dll'.'SDL_hid_send_feature_report' -++'_SDL_hid_get_feature_report'.'SDL3.dll'.'SDL_hid_get_feature_report' -++'_SDL_hid_close'.'SDL3.dll'.'SDL_hid_close' -++'_SDL_hid_get_manufacturer_string'.'SDL3.dll'.'SDL_hid_get_manufacturer_string' -++'_SDL_hid_get_product_string'.'SDL3.dll'.'SDL_hid_get_product_string' -++'_SDL_hid_get_serial_number_string'.'SDL3.dll'.'SDL_hid_get_serial_number_string' -++'_SDL_hid_get_indexed_string'.'SDL3.dll'.'SDL_hid_get_indexed_string' -++'_SDL_SetWindowMouseRect'.'SDL3.dll'.'SDL_SetWindowMouseRect' -++'_SDL_GetWindowMouseRect'.'SDL3.dll'.'SDL_GetWindowMouseRect' -++'_SDL_RenderWindowToLogical'.'SDL3.dll'.'SDL_RenderWindowToLogical' -++'_SDL_RenderLogicalToWindow'.'SDL3.dll'.'SDL_RenderLogicalToWindow' -++'_SDL_JoystickHasRumble'.'SDL3.dll'.'SDL_JoystickHasRumble' -++'_SDL_JoystickHasRumbleTriggers'.'SDL3.dll'.'SDL_JoystickHasRumbleTriggers' -++'_SDL_GameControllerHasRumble'.'SDL3.dll'.'SDL_GameControllerHasRumble' -++'_SDL_GameControllerHasRumbleTriggers'.'SDL3.dll'.'SDL_GameControllerHasRumbleTriggers' -++'_SDL_hid_ble_scan'.'SDL3.dll'.'SDL_hid_ble_scan' -++'_SDL_PremultiplyAlpha'.'SDL3.dll'.'SDL_PremultiplyAlpha' -# ++'_SDL_AndroidSendMessage'.'SDL3.dll'.'SDL_AndroidSendMessage' -++'_SDL_GetTouchName'.'SDL3.dll'.'SDL_GetTouchName' -++'_SDL_ClearComposition'.'SDL3.dll'.'SDL_ClearComposition' -++'_SDL_IsTextInputShown'.'SDL3.dll'.'SDL_IsTextInputShown' -++'_SDL_HasIntersectionF'.'SDL3.dll'.'SDL_HasIntersectionF' -++'_SDL_IntersectFRect'.'SDL3.dll'.'SDL_IntersectFRect' -++'_SDL_UnionFRect'.'SDL3.dll'.'SDL_UnionFRect' -++'_SDL_EncloseFPoints'.'SDL3.dll'.'SDL_EncloseFPoints' -++'_SDL_IntersectFRectAndLine'.'SDL3.dll'.'SDL_IntersectFRectAndLine' -++'_SDL_RenderGetWindow'.'SDL3.dll'.'SDL_RenderGetWindow' -++'_SDL_bsearch'.'SDL3.dll'.'SDL_bsearch' -++'_SDL_GameControllerPathForIndex'.'SDL3.dll'.'SDL_GameControllerPathForIndex' -++'_SDL_GameControllerPath'.'SDL3.dll'.'SDL_GameControllerPath' -++'_SDL_JoystickPathForIndex'.'SDL3.dll'.'SDL_JoystickPathForIndex' -++'_SDL_JoystickPath'.'SDL3.dll'.'SDL_JoystickPath' -++'_SDL_JoystickAttachVirtualEx'.'SDL3.dll'.'SDL_JoystickAttachVirtualEx' -++'_SDL_GameControllerGetFirmwareVersion'.'SDL3.dll'.'SDL_GameControllerGetFirmwareVersion' -++'_SDL_JoystickGetFirmwareVersion'.'SDL3.dll'.'SDL_JoystickGetFirmwareVersion' -++'_SDL_GUIDToString'.'SDL3.dll'.'SDL_GUIDToString' -++'_SDL_GUIDFromString'.'SDL3.dll'.'SDL_GUIDFromString' -++'_SDL_HasLSX'.'SDL3.dll'.'SDL_HasLSX' -++'_SDL_HasLASX'.'SDL3.dll'.'SDL_HasLASX' -++'_SDL_RenderGetD3D12Device'.'SDL3.dll'.'SDL_RenderGetD3D12Device' -++'_SDL_utf8strnlen'.'SDL3.dll'.'SDL_utf8strnlen' -# ++'_SDL_GDKGetTaskQueue'.'SDL3.dll'.'SDL_GDKGetTaskQueue' -# ++'_SDL_GDKRunApp'.'SDL3.dll'.'SDL_GDKRunApp' -++'_SDL_GetOriginalMemoryFunctions'.'SDL3.dll'.'SDL_GetOriginalMemoryFunctions' -++'_SDL_ResetKeyboard'.'SDL3.dll'.'SDL_ResetKeyboard' -++'_SDL_GetDefaultAudioInfo'.'SDL3.dll'.'SDL_GetDefaultAudioInfo' -++'_SDL_GetPointDisplayIndex'.'SDL3.dll'.'SDL_GetPointDisplayIndex' -++'_SDL_GetRectDisplayIndex'.'SDL3.dll'.'SDL_GetRectDisplayIndex' -++'_SDL_ResetHint'.'SDL3.dll'.'SDL_ResetHint' -++'_SDL_crc16'.'SDL3.dll'.'SDL_crc16' -++'_SDL_GetWindowSizeInPixels'.'SDL3.dll'.'SDL_GetWindowSizeInPixels' -++'_SDL_GetJoystickGUIDInfo'.'SDL3.dll'.'SDL_GetJoystickGUIDInfo' -++'_SDL_SetPrimarySelectionText'.'SDL3.dll'.'SDL_SetPrimarySelectionText' -++'_SDL_GetPrimarySelectionText'.'SDL3.dll'.'SDL_GetPrimarySelectionText' -++'_SDL_HasPrimarySelectionText'.'SDL3.dll'.'SDL_HasPrimarySelectionText' -++'_SDL_GameControllerGetSensorDataWithTimestamp'.'SDL3.dll'.'SDL_GameControllerGetSensorDataWithTimestamp' -++'_SDL_SensorGetDataWithTimestamp'.'SDL3.dll'.'SDL_SensorGetDataWithTimestamp' -++'_SDL_ResetHints'.'SDL3.dll'.'SDL_ResetHints' -++'_SDL_strcasestr'.'SDL3.dll'.'SDL_strcasestr' diff --git a/src/dynapi/SDL_dynapi.c b/src/dynapi/SDL_dynapi.c index 033c4a75d3..58b1898429 100644 --- a/src/dynapi/SDL_dynapi.c +++ b/src/dynapi/SDL_dynapi.c @@ -24,13 +24,6 @@ #if SDL_DYNAMIC_API -#if defined(__OS2__) -#define INCL_DOS -#define INCL_DOSERRORS -#include -#include -#endif - #include "SDL.h" /* These headers have system specific definitions, so aren't included above */ @@ -356,20 +349,6 @@ static SDL_INLINE void *get_sdlapi_entry(const char *fname, const char *sym) return retval; } -#elif defined(__OS2__) -static SDL_INLINE void *get_sdlapi_entry(const char *fname, const char *sym) -{ - HMODULE hmodule; - PFN retval = NULL; - char error[256]; - if (DosLoadModule(error, sizeof(error), fname, &hmodule) == NO_ERROR) { - if (DosQueryProcAddr(hmodule, 0, sym, &retval) != NO_ERROR) { - DosFreeModule(hmodule); - } - } - return (void *)retval; -} - #else #error Please define your platform. #endif diff --git a/src/dynapi/SDL_dynapi_procs.h b/src/dynapi/SDL_dynapi_procs.h index 7b3e02da11..be2c9379b7 100644 --- a/src/dynapi/SDL_dynapi_procs.h +++ b/src/dynapi/SDL_dynapi_procs.h @@ -50,8 +50,6 @@ SDL_DYNAPI_PROC(int,SDL_snprintf,(SDL_OUT_Z_CAP(b) char *a, size_t b, SDL_PRINTF #if defined(__WIN32__) || defined(__GDK__) SDL_DYNAPI_PROC(SDL_Thread*,SDL_CreateThread,(SDL_ThreadFunction a, const char *b, void *c, pfnSDL_CurrentBeginThread d, pfnSDL_CurrentEndThread e),(a,b,c,d,e),return) -#elif defined(__OS2__) -SDL_DYNAPI_PROC(SDL_Thread*,SDL_CreateThread,(SDL_ThreadFunction a, const char *b, void *c, pfnSDL_CurrentBeginThread d, pfnSDL_CurrentEndThread e),(a,b,c,d,e),return) #else SDL_DYNAPI_PROC(SDL_Thread*,SDL_CreateThread,(SDL_ThreadFunction a, const char *b, void *c),(a,b,c),return) #endif @@ -749,8 +747,6 @@ SDL_DYNAPI_PROC(SDL_bool,SDL_HasColorKey,(SDL_Surface *a),(a),return) #if defined(__WIN32__) || defined(__GDK__) SDL_DYNAPI_PROC(SDL_Thread*,SDL_CreateThreadWithStackSize,(SDL_ThreadFunction a, const char *b, const size_t c, void *d, pfnSDL_CurrentBeginThread e, pfnSDL_CurrentEndThread f),(a,b,c,d,e,f),return) -#elif defined(__OS2__) -SDL_DYNAPI_PROC(SDL_Thread*,SDL_CreateThreadWithStackSize,(SDL_ThreadFunction a, const char *b, const size_t c, void *d, pfnSDL_CurrentBeginThread e, pfnSDL_CurrentEndThread f),(a,b,c,d,e,f),return) #else SDL_DYNAPI_PROC(SDL_Thread*,SDL_CreateThreadWithStackSize,(SDL_ThreadFunction a, const char *b, const size_t c, void *d),(a,b,c,d),return) #endif diff --git a/src/dynapi/gendynapi.pl b/src/dynapi/gendynapi.pl index 6c19a8f7d4..b99a8a492e 100755 --- a/src/dynapi/gendynapi.pl +++ b/src/dynapi/gendynapi.pl @@ -33,7 +33,6 @@ use File::Basename; chdir(dirname(__FILE__) . '/../..'); my $sdl_dynapi_procs_h = "src/dynapi/SDL_dynapi_procs.h"; my $sdl_dynapi_overrides_h = "src/dynapi/SDL_dynapi_overrides.h"; -my $sdl3_exports = "src/dynapi/SDL3.exports"; my %existing = (); if (-f $sdl_dynapi_procs_h) { @@ -48,7 +47,6 @@ if (-f $sdl_dynapi_procs_h) { open(SDL_DYNAPI_PROCS_H, '>>', $sdl_dynapi_procs_h) or die("Can't open $sdl_dynapi_procs_h: $!\n"); open(SDL_DYNAPI_OVERRIDES_H, '>>', $sdl_dynapi_overrides_h) or die("Can't open $sdl_dynapi_overrides_h: $!\n"); -open(SDL3_EXPORTS, '>>', $sdl3_exports) or die("Can't open $sdl3_exports: $!\n"); opendir(HEADERS, 'include') or die("Can't open include dir: $!\n"); while (my $d = readdir(HEADERS)) { @@ -135,7 +133,6 @@ while (my $d = readdir(HEADERS)) { print("NEW: $decl\n"); print SDL_DYNAPI_PROCS_H "SDL_DYNAPI_PROC($rc,$fn,$paramstr,$argstr,$retstr)\n"; print SDL_DYNAPI_OVERRIDES_H "#define $fn ${fn}_REAL\n"; - print SDL3_EXPORTS "++'_${fn}'.'SDL3.dll'.'${fn}'\n"; } else { print("Failed to parse decl [$decl]!\n"); } @@ -146,6 +143,5 @@ closedir(HEADERS); close(SDL_DYNAPI_PROCS_H); close(SDL_DYNAPI_OVERRIDES_H); -close(SDL3_EXPORTS); # vi: set ts=4 sw=4 expandtab: diff --git a/src/events/SDL_mouse.c b/src/events/SDL_mouse.c index 994b6a6db2..27ee803932 100644 --- a/src/events/SDL_mouse.c +++ b/src/events/SDL_mouse.c @@ -31,10 +31,6 @@ #if defined(__WIN32__) || defined(__GDK__) #include "../core/windows/SDL_windows.h" // For GetDoubleClickTime() #endif -#if defined(__OS2__) -#define INCL_WIN -#include -#endif /* #define DEBUG_MOUSE */ @@ -57,8 +53,6 @@ SDL_MouseDoubleClickTimeChanged(void *userdata, const char *name, const char *ol } else { #if defined(__WIN32__) || defined(__WINGDK__) mouse->double_click_time = GetDoubleClickTime(); -#elif defined(__OS2__) - mouse->double_click_time = WinQuerySysValue(HWND_DESKTOP, SV_DBLCLKTIME); #else mouse->double_click_time = 500; #endif diff --git a/src/filesystem/os2/SDL_sysfilesystem.c b/src/filesystem/os2/SDL_sysfilesystem.c deleted file mode 100644 index 3203f0b3ad..0000000000 --- a/src/filesystem/os2/SDL_sysfilesystem.c +++ /dev/null @@ -1,131 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ -#include "../../SDL_internal.h" - -#ifdef SDL_FILESYSTEM_OS2 - -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* System dependent filesystem routines */ - -#include "../../core/os2/SDL_os2.h" -#include "SDL_error.h" -#include "SDL_filesystem.h" - -#define INCL_DOSFILEMGR -#define INCL_DOSPROCESS -#define INCL_DOSMODULEMGR -#define INCL_DOSERRORS -#include - - -char * -SDL_GetBasePath(void) -{ - PTIB tib; - PPIB pib; - ULONG ulRC = DosGetInfoBlocks(&tib, &pib); - PCHAR pcEnd; - CHAR acBuf[CCHMAXPATH]; - - if (ulRC != NO_ERROR) { - SDL_SetError("Can't get process information block (E%lu)", ulRC); - return NULL; - } - - ulRC = DosQueryModuleName(pib->pib_hmte, sizeof(acBuf), acBuf); - if (ulRC != NO_ERROR) { - SDL_SetError("Can't query the module name (E%lu)", ulRC); - return NULL; - } - - pcEnd = SDL_strrchr(acBuf, '\\'); - if (pcEnd != NULL) - pcEnd[1] = '\0'; - else { - if (acBuf[1] == ':') /* e.g. "C:FOO" */ - acBuf[2] = '\0'; - else { - SDL_SetError("No path in module name"); - return NULL; - } - } - - return OS2_SysToUTF8(acBuf); -} - -char * -SDL_GetPrefPath(const char *org, const char *app) -{ - PSZ pszPath; - CHAR acBuf[CCHMAXPATH]; - int lPosApp, lPosOrg; - PSZ pszApp, pszOrg; - - if (!app) { - SDL_InvalidParamError("app"); - return NULL; - } - - pszPath = SDL_getenv("HOME"); - if (!pszPath) { - pszPath = SDL_getenv("ETC"); - if (!pszPath) { - SDL_SetError("HOME or ETC environment not set"); - return NULL; - } - } - - if (!org) { - lPosApp = SDL_snprintf(acBuf, sizeof(acBuf) - 1, "%s", pszPath); - } else { - pszOrg = OS2_UTF8ToSys(org); - if (!pszOrg) { - SDL_OutOfMemory(); - return NULL; - } - lPosApp = SDL_snprintf(acBuf, sizeof(acBuf) - 1, "%s\\%s", pszPath, pszOrg); - SDL_free(pszOrg); - } - if (lPosApp < 0) - return NULL; - - DosCreateDir(acBuf, NULL); - - pszApp = OS2_UTF8ToSys(app); - if (!pszApp) { - SDL_OutOfMemory(); - return NULL; - } - - lPosOrg = SDL_snprintf(&acBuf[lPosApp], sizeof(acBuf) - lPosApp - 1, "\\%s", pszApp); - SDL_free(pszApp); - if (lPosOrg < 0) - return NULL; - - DosCreateDir(acBuf, NULL); - *((PUSHORT)&acBuf[lPosApp + lPosOrg]) = (USHORT)'\0\\'; - - return OS2_SysToUTF8(acBuf); -} - -#endif /* SDL_FILESYSTEM_OS2 */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/hidapi/libusb/hid.c b/src/hidapi/libusb/hid.c index 9e2a435899..1998701970 100644 --- a/src/hidapi/libusb/hid.c +++ b/src/hidapi/libusb/hid.c @@ -418,9 +418,6 @@ static int is_language_supported(libusb_device_handle *dev, uint16_t lang) /* This function returns a newly allocated wide string containing the USB device string numbered by the index. The returned string must be freed by using free(). */ -#if defined(__OS2__) /* don't use iconv on OS/2: no support for wchar_t. */ -#define NO_ICONV -#endif static wchar_t *get_usb_string(libusb_device_handle *dev, uint8_t idx) { char buf[512]; diff --git a/src/joystick/SDL_joystick.c b/src/joystick/SDL_joystick.c index 0339296949..de15d5d128 100644 --- a/src/joystick/SDL_joystick.c +++ b/src/joystick/SDL_joystick.c @@ -87,9 +87,6 @@ static SDL_JoystickDriver *SDL_joystick_drivers[] = { #ifdef SDL_JOYSTICK_USBHID /* !!! FIXME: "USBHID" is a generic name, and doubly-confusing with HIDAPI next to it. This is the *BSD interface, rename this. */ &SDL_BSD_JoystickDriver, #endif -#ifdef SDL_JOYSTICK_OS2 - &SDL_OS2_JoystickDriver, -#endif #ifdef SDL_JOYSTICK_PS2 &SDL_PS2_JoystickDriver, #endif diff --git a/src/joystick/SDL_sysjoystick.h b/src/joystick/SDL_sysjoystick.h index 015007c59e..ae8372ef7c 100644 --- a/src/joystick/SDL_sysjoystick.h +++ b/src/joystick/SDL_sysjoystick.h @@ -239,7 +239,6 @@ extern SDL_JoystickDriver SDL_VIRTUAL_JoystickDriver; extern SDL_JoystickDriver SDL_WGI_JoystickDriver; extern SDL_JoystickDriver SDL_WINDOWS_JoystickDriver; extern SDL_JoystickDriver SDL_WINMM_JoystickDriver; -extern SDL_JoystickDriver SDL_OS2_JoystickDriver; extern SDL_JoystickDriver SDL_PS2_JoystickDriver; extern SDL_JoystickDriver SDL_PSP_JoystickDriver; extern SDL_JoystickDriver SDL_VITA_JoystickDriver; diff --git a/src/joystick/os2/SDL_os2joystick.c b/src/joystick/os2/SDL_os2joystick.c deleted file mode 100644 index bf2dc605ca..0000000000 --- a/src/joystick/os2/SDL_os2joystick.c +++ /dev/null @@ -1,799 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ -#include "../../SDL_internal.h" - -#ifdef SDL_JOYSTICK_OS2 - -/* OS/2 Joystick driver, contributed by Daniel Caetano */ - -#define INCL_DOSDEVICES -#define INCL_DOSDEVIOCTL -#define INCL_DOSMEMMGR -#include - -/***************************************************************** - * OS/2 Joystick driver defs. Based on docs at edm2.com and in old - * drivers available at hobbes.nmsu.edu and www.os2site.com - *****************************************************************/ - -#define GAME_GET_VERSION 0x01 -#define GAME_GET_PARMS 0x02 -#define GAME_GET_CALIB 0x04 -#define GAME_GET_STATUS 0x10 - -#define IOCTL_CAT_USER 0x80 -#define GAME_PORT_GET 0x20 -#define GAME_PORT_RESET 0x60 - -#pragma pack(push,1) -typedef struct { - USHORT uJs_AxCnt, uJs_AyCnt; /* A joystick X/Y pos */ - USHORT uJs_BxCnt, uJs_ByCnt; /* B joystick X/Y pos */ - USHORT usJs_ButtonA1Cnt, usJs_ButtonA2Cnt;/* A1/A2 press cnts */ - USHORT usJs_ButtonB1Cnt, usJs_ButtonB2Cnt;/* B1/B2 press cnts */ - UCHAR ucJs_JoyStickMask; /* mask of connected joystick pots */ - UCHAR ucJs_ButtonStatus; /* bits of switches down */ - ULONG ulJs_Ticks; /* total clock ticks (60 Hz) */ -} GAME_PORT_STRUCT; -#pragma pack(pop) - -typedef struct { - USHORT useA, useB; - USHORT mode; - USHORT format; - USHORT sampDiv; - USHORT scale; - USHORT res1, res2; -} GAME_PARM_STRUCT; - -typedef struct { - SHORT x, y; -} GAME_2DPOS_STRUCT; - -typedef struct { - SHORT lower, centre, upper; -} GAME_3POS_STRUCT; - -typedef struct { - GAME_3POS_STRUCT Ax, Ay, Bx, By; -} GAME_CALIB_STRUCT; - -typedef struct { - GAME_2DPOS_STRUCT A, B; - USHORT butMask; -} GAME_DATA_STRUCT; - -typedef struct { - GAME_DATA_STRUCT curdata; - USHORT b1cnt, b2cnt, b3cnt, b4cnt; -} GAME_STATUS_STRUCT; - -/*****************************************************************/ - -#include "SDL_joystick.h" -#include "SDL_events.h" -#include "../SDL_sysjoystick.h" -#include "../SDL_joystick_c.h" - -static HFILE hJoyPort = NULLHANDLE; /* Joystick GAME$ Port Address */ -#define MAX_JOYSTICKS 2 /* Maximum of two joysticks */ -#define MAX_AXES 4 /* each joystick can have up to 4 axes */ -#define MAX_BUTTONS 8 /* 8 buttons */ -#define MAX_HATS 0 /* 0 hats - OS/2 doesn't support it */ -#define MAX_BALLS 0 /* and 0 balls - OS/2 doesn't support it */ -#define MAX_JOYNAME 128 /* Joystick name may have 128 characters */ -/* Calc Button Flag for buttons A to D */ -#define JOY_BUTTON_FLAG(n) (1< MAX_JOYSTICKS) maxdevs = MAX_JOYSTICKS; - - /* Defines min/max axes values (callibration) */ - ulDataLen = sizeof(stGameCalib); - rc = DosDevIOCtl(hJoyPort, IOCTL_CAT_USER, GAME_GET_CALIB, - NULL, 0, NULL, &stGameCalib, ulDataLen, &ulDataLen); - if (rc != 0) - { - joyPortClose(&hJoyPort); - return SDL_SetError("Could not read callibration data."); - } - - /* Determine how many joysticks are active */ - numdevs = 0; /* Points no device */ - ucNewJoystickMask = 0x0F; /* read all 4 joystick axis */ - ulDataLen = sizeof(ucNewJoystickMask); - rc = DosDevIOCtl(hJoyPort, IOCTL_CAT_USER, GAME_PORT_RESET, - &ucNewJoystickMask, ulDataLen, &ulDataLen, NULL, 0, NULL); - if (rc == 0) - { - ulDataLen = sizeof(stJoyStatus); - rc = DosDevIOCtl(hJoyPort, IOCTL_CAT_USER, GAME_PORT_GET, - NULL, 0, NULL, &stJoyStatus, ulDataLen, &ulDataLen); - if (rc != 0) - { - joyPortClose(&hJoyPort); - return SDL_SetError("Could not call joystick port."); - } - ulLastTick = stJoyStatus.ulJs_Ticks; - while (stJoyStatus.ulJs_Ticks == ulLastTick) - { - rc = DosDevIOCtl(hJoyPort, IOCTL_CAT_USER, GAME_PORT_GET, - NULL, 0, NULL, &stJoyStatus, ulDataLen, &ulDataLen); - } - if ((stJoyStatus.ucJs_JoyStickMask & 0x03) > 0) numdevs++; - if (((stJoyStatus.ucJs_JoyStickMask >> 2) & 0x03) > 0) numdevs++; - } - - if (numdevs > maxdevs) numdevs = maxdevs; - - /* If *any* joystick was detected... Let's configure SDL for them */ - if (numdevs > 0) - { - /* Verify if it is a "user defined" joystick */ - if (joyGetEnv(&joycfg)) - { - GAME_3POS_STRUCT * axis[4]; - axis[0] = &stGameCalib.Ax; - axis[1] = &stGameCalib.Ay; - axis[2] = &stGameCalib.Bx; - axis[3] = &stGameCalib.By; - - /* Say it has one device only (user defined is always one device only) */ - numdevs = 1; - - /* Define Device 0 as... */ - SYS_JoyData[0].id = 0; - - /* Define Number of Axes... up to 4 */ - if (joycfg.axes>MAX_AXES) joycfg.axes = MAX_AXES; - SYS_JoyData[0].axes = joycfg.axes; - - /* Define number of buttons... 8 if 2 axes, 6 if 3 axes and 4 if 4 axes */ - maxbut = MAX_BUTTONS; - if (joycfg.axes>2) maxbut -= ((joycfg.axes - 2)<<1); /* MAX_BUTTONS - 2*(axes-2) */ - if (joycfg.buttons > maxbut) joycfg.buttons = maxbut; - SYS_JoyData[0].buttons = joycfg.buttons; - - /* Define number of hats */ - if (joycfg.hats > MAX_HATS) joycfg.hats = MAX_HATS; - SYS_JoyData[0].hats = joycfg.hats; - - /* Define number of balls */ - if (joycfg.balls > MAX_BALLS) joycfg.balls = MAX_BALLS; - SYS_JoyData[0].balls = joycfg.balls; - - /* Initialize Axes Callibration Values */ - for (i=0; ilower; - SYS_JoyData[0].axes_med[i] = axis[i]->centre; - SYS_JoyData[0].axes_max[i] = axis[i]->upper; - } - /* Initialize Buttons 5 to 8 structures */ - if (joycfg.buttons>=5) SYS_JoyData[0].buttoncalc[0] = ((axis[2]->lower+axis[3]->centre)>>1); - if (joycfg.buttons>=6) SYS_JoyData[0].buttoncalc[1] = ((axis[3]->lower+axis[3]->centre)>>1); - if (joycfg.buttons>=7) SYS_JoyData[0].buttoncalc[2] = ((axis[2]->upper+axis[3]->centre)>>1); - if (joycfg.buttons>=8) SYS_JoyData[0].buttoncalc[3] = ((axis[3]->upper+axis[3]->centre)>>1); - /* Intialize Joystick Name */ - SDL_strlcpy (SYS_JoyData[0].szDeviceName,joycfg.name, SDL_arraysize(SYS_JoyData[0].szDeviceName)); - } - /* Default Init ... autoconfig */ - else - { - /* if two devices were detected... configure as Joy1 4 axis and Joy2 2 axis */ - if (numdevs == 2) - { - /* Define Device 0 as 4 axes, 4 buttons */ - SYS_JoyData[0].id=0; - SYS_JoyData[0].axes = 4; - SYS_JoyData[0].buttons = 4; - SYS_JoyData[0].hats = 0; - SYS_JoyData[0].balls = 0; - SYS_JoyData[0].axes_min[0] = stGameCalib.Ax.lower; - SYS_JoyData[0].axes_med[0] = stGameCalib.Ax.centre; - SYS_JoyData[0].axes_max[0] = stGameCalib.Ax.upper; - SYS_JoyData[0].axes_min[1] = stGameCalib.Ay.lower; - SYS_JoyData[0].axes_med[1] = stGameCalib.Ay.centre; - SYS_JoyData[0].axes_max[1] = stGameCalib.Ay.upper; - SYS_JoyData[0].axes_min[2] = stGameCalib.Bx.lower; - SYS_JoyData[0].axes_med[2] = stGameCalib.Bx.centre; - SYS_JoyData[0].axes_max[2] = stGameCalib.Bx.upper; - SYS_JoyData[0].axes_min[3] = stGameCalib.By.lower; - SYS_JoyData[0].axes_med[3] = stGameCalib.By.centre; - SYS_JoyData[0].axes_max[3] = stGameCalib.By.upper; - /* Define Device 1 as 2 axes, 2 buttons */ - SYS_JoyData[1].id=1; - SYS_JoyData[1].axes = 2; - SYS_JoyData[1].buttons = 2; - SYS_JoyData[1].hats = 0; - SYS_JoyData[1].balls = 0; - SYS_JoyData[1].axes_min[0] = stGameCalib.Bx.lower; - SYS_JoyData[1].axes_med[0] = stGameCalib.Bx.centre; - SYS_JoyData[1].axes_max[0] = stGameCalib.Bx.upper; - SYS_JoyData[1].axes_min[1] = stGameCalib.By.lower; - SYS_JoyData[1].axes_med[1] = stGameCalib.By.centre; - SYS_JoyData[1].axes_max[1] = stGameCalib.By.upper; - } - /* One joystick only? */ - else - { - /* If it is joystick A... */ - if ((stJoyStatus.ucJs_JoyStickMask & 0x03) > 0) - { - /* Define Device 0 as 2 axes, 4 buttons */ - SYS_JoyData[0].id=0; - SYS_JoyData[0].axes = 2; - SYS_JoyData[0].buttons = 4; - SYS_JoyData[0].hats = 0; - SYS_JoyData[0].balls = 0; - SYS_JoyData[0].axes_min[0] = stGameCalib.Ax.lower; - SYS_JoyData[0].axes_med[0] = stGameCalib.Ax.centre; - SYS_JoyData[0].axes_max[0] = stGameCalib.Ax.upper; - SYS_JoyData[0].axes_min[1] = stGameCalib.Ay.lower; - SYS_JoyData[0].axes_med[1] = stGameCalib.Ay.centre; - SYS_JoyData[0].axes_max[1] = stGameCalib.Ay.upper; - } - /* If not, it is joystick B */ - else - { - /* Define Device 1 as 2 axes, 2 buttons */ - SYS_JoyData[0].id=1; - SYS_JoyData[0].axes = 2; - SYS_JoyData[0].buttons = 2; - SYS_JoyData[0].hats = 0; - SYS_JoyData[0].balls = 0; - SYS_JoyData[0].axes_min[0] = stGameCalib.Bx.lower; - SYS_JoyData[0].axes_med[0] = stGameCalib.Bx.centre; - SYS_JoyData[0].axes_max[0] = stGameCalib.Bx.upper; - SYS_JoyData[0].axes_min[1] = stGameCalib.By.lower; - SYS_JoyData[0].axes_med[1] = stGameCalib.By.centre; - SYS_JoyData[0].axes_max[1] = stGameCalib.By.upper; - } - } - - /* Hack to define Joystick Port Names */ - if (numdevs > maxdevs) numdevs = maxdevs; - - for (i = 0; i < numdevs; i++) - { - SDL_snprintf(SYS_JoyData[i].szDeviceName, - SDL_arraysize(SYS_JoyData[i].szDeviceName), - "Default Joystick %c", 'A'+SYS_JoyData[i].id); - } - } - } - /* Return the number of devices found */ - numjoysticks = numdevs; - return numdevs; -} - -static int OS2_NumJoysticks(void) -{ - return numjoysticks; -} - -static void OS2_JoystickDetect(void) -{ -} - -static const char *OS2_JoystickGetDeviceName(int device_index) -{ - /* No need to verify if device exists, already done in upper layer */ - return SYS_JoyData[device_index].szDeviceName; -} - -static const char *OS2_JoystickGetDevicePath(int device_index) -{ - return NULL; -} - -static int OS2_JoystickGetDevicePlayerIndex(int device_index) -{ - return -1; -} - -static void OS2_JoystickSetDevicePlayerIndex(int device_index, int player_index) -{ -} - -static SDL_JoystickGUID OS2_JoystickGetDeviceGUID(int device_index) -{ - /* the GUID is just the name for now */ - const char *name = OS2_JoystickGetDeviceName(device_index); - return SDL_CreateJoystickGUIDForName(name); -} - -static SDL_JoystickID OS2_JoystickGetDeviceInstanceID(int device_index) -{ - return device_index; -} - -/******************************************************************************/ -/* Function to open a joystick for use. */ -/* The joystick to open is specified by the device index. */ -/* This should fill the nbuttons and naxes fields of the joystick structure. */ -/* It returns 0, or -1 if there is an error. */ -/******************************************************************************/ -static int OS2_JoystickOpen(SDL_Joystick *joystick, int device_index) -{ - int index; /* Index shortcut for index in joystick structure */ - int i; /* Generic Counter */ - - /* allocate memory for system specific hardware data */ - joystick->hwdata = (struct joystick_hwdata *) SDL_calloc(1, sizeof(*joystick->hwdata)); - if (!joystick->hwdata) - { - return SDL_OutOfMemory(); - } - - /* ShortCut Pointer */ - index = device_index; - joystick->instance_id = device_index; - - /* Define offsets and scales for all axes */ - joystick->hwdata->id = SYS_JoyData[index].id; - for (i = 0; i < MAX_AXES; ++i) - { - if ((i < 2) || i < SYS_JoyData[index].axes) - { - joystick->hwdata->transaxes[i].offset = ((SDL_JOYSTICK_AXIS_MAX + SDL_JOYSTICK_AXIS_MIN)>>1) - SYS_JoyData[index].axes_med[i]; - joystick->hwdata->transaxes[i].scale1 = (float)SDL_abs((SDL_JOYSTICK_AXIS_MIN/SYS_JoyData[index].axes_min[i])); - joystick->hwdata->transaxes[i].scale2 = (float)SDL_abs((SDL_JOYSTICK_AXIS_MAX/SYS_JoyData[index].axes_max[i])); - } - else - { - joystick->hwdata->transaxes[i].offset = 0; - joystick->hwdata->transaxes[i].scale1 = 1.0f; /* Just in case */ - joystick->hwdata->transaxes[i].scale2 = 1.0f; /* Just in case */ - } - } - - /* fill nbuttons, naxes, and nhats fields */ - joystick->nbuttons = SYS_JoyData[index].buttons; - joystick->naxes = SYS_JoyData[index].axes; - - /* joystick->nhats = SYS_JoyData[index].hats; */ - joystick->nhats = 0; /* No support for hats at this time */ - - /* joystick->nballs = SYS_JoyData[index].balls; */ - joystick->nballs = 0; /* No support for balls at this time */ - - return 0; -} - -static int OS2_JoystickRumble(SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble) -{ - return SDL_Unsupported(); -} - -static int OS2_JoystickRumbleTriggers(SDL_Joystick *joystick, Uint16 left_rumble, Uint16 right_rumble) -{ - return SDL_Unsupported(); -} - -static Uint32 OS2_JoystickGetCapabilities(SDL_Joystick *joystick) -{ - return 0; -} - -static int OS2_JoystickSetLED(SDL_Joystick *joystick, Uint8 red, Uint8 green, Uint8 blue) -{ - return SDL_Unsupported(); -} - -static int OS2_JoystickSendEffect(SDL_Joystick *joystick, const void *data, int size) -{ - return SDL_Unsupported(); -} - -static int OS2_JoystickSetSensorsEnabled(SDL_Joystick *joystick, SDL_bool enabled) -{ - return SDL_Unsupported(); -} - -/***************************************************************************/ -/* Function to update the state of a joystick - called as a device poll. */ -/* This function shouldn't update the joystick structure directly, */ -/* but instead should call SDL_PrivateJoystick*() to deliver events */ -/* and update joystick device state. */ -/***************************************************************************/ -static void OS2_JoystickUpdate(SDL_Joystick *joystick) -{ - APIRET rc; /* Generic OS/2 return code */ - int index; /* index shortcurt to joystick index */ - int i; /* Generic counter */ - int normbut; /* Number of buttons reported by joystick */ - int corr; /* Correction for button names */ - Sint16 value; /* Values used to update axis values */ - struct _transaxes *transaxes; /* Shortcut for Correction structure */ - Uint32 pos[MAX_AXES]; /* Vector to inform the Axis status */ - ULONG ulDataLen; /* Size of data */ - GAME_STATUS_STRUCT stGameStatus; /* Joystick Status Structure */ - - ulDataLen = sizeof(stGameStatus); - rc = DosDevIOCtl(hJoyPort, IOCTL_CAT_USER, GAME_GET_STATUS, - NULL, 0, NULL, &stGameStatus, ulDataLen, &ulDataLen); - if (rc != 0) - { - SDL_SetError("Could not read joystick status."); - return; /* Could not read data */ - } - - /* Shortcut pointer */ - index = joystick->instance_id; - - /* joystick motion events */ - - if (SYS_JoyData[index].id == 0) - { - pos[0] = stGameStatus.curdata.A.x; - pos[1] = stGameStatus.curdata.A.y; - if (SYS_JoyData[index].axes >= 3) pos[2] = stGameStatus.curdata.B.x; - else pos[2] = 0; - if (SYS_JoyData[index].axes >= 4) pos[3] = stGameStatus.curdata.B.y; - else pos[3] = 0; - /* OS/2 basic drivers do not support more than 4 axes joysticks */ - } - else if (SYS_JoyData[index].id == 1) - { - pos[0] = stGameStatus.curdata.B.x; - pos[1] = stGameStatus.curdata.B.y; - pos[2] = 0; - pos[3] = 0; - } - - /* Corrects the movements using the callibration */ - transaxes = joystick->hwdata->transaxes; - for (i = 0; i < joystick->naxes; i++) - { - value = pos[i] + transaxes[i].offset; - if (value < 0) - { - value *= transaxes[i].scale1; - if (value > 0) value = SDL_JOYSTICK_AXIS_MIN; - } - else - { - value *= transaxes[i].scale2; - if (value < 0) value = SDL_JOYSTICK_AXIS_MAX; - } - SDL_PrivateJoystickAxis(joystick, (Uint8)i, (Sint16)value); - } - - /* joystick button A to D events */ - if (SYS_JoyData[index].id == 1) corr = 2; - else corr = 0; - normbut = 4; /* Number of normal buttons */ - if (joystick->nbuttons < normbut) normbut = joystick->nbuttons; - for (i = corr; (i-corr) < normbut; ++i) - { - /* - Button A: 1110 0000 - Button B: 1101 0000 - Button C: 1011 0000 - Button D: 0111 0000 - */ - if ((~stGameStatus.curdata.butMask)>>4 & JOY_BUTTON_FLAG(i)) - { - SDL_PrivateJoystickButton(joystick, (Uint8)(i-corr), SDL_PRESSED); - } - else - { - SDL_PrivateJoystickButton(joystick, (Uint8)(i-corr), SDL_RELEASED); - } - } - - /* Joystick button E to H buttons */ - /* - Button E: Axis 2 X Left - Button F: Axis 2 Y Up - Button G: Axis 2 X Right - Button H: Axis 2 Y Down - */ - if (joystick->nbuttons >= 5) - { - if (stGameStatus.curdata.B.x < SYS_JoyData[index].buttoncalc[0]) SDL_PrivateJoystickButton(joystick, (Uint8)4, SDL_PRESSED); - else SDL_PrivateJoystickButton(joystick, (Uint8)4, SDL_RELEASED); - } - if (joystick->nbuttons >= 6) - { - if (stGameStatus.curdata.B.y < SYS_JoyData[index].buttoncalc[1]) SDL_PrivateJoystickButton(joystick, (Uint8)5, SDL_PRESSED); - else SDL_PrivateJoystickButton(joystick, (Uint8)5, SDL_RELEASED); - } - if (joystick->nbuttons >= 7) - { - if (stGameStatus.curdata.B.x > SYS_JoyData[index].buttoncalc[2]) SDL_PrivateJoystickButton(joystick, (Uint8)6, SDL_PRESSED); - else SDL_PrivateJoystickButton(joystick, (Uint8)6, SDL_RELEASED); - } - if (joystick->nbuttons >= 8) - { - if (stGameStatus.curdata.B.y > SYS_JoyData[index].buttoncalc[3]) SDL_PrivateJoystickButton(joystick, (Uint8)7, SDL_PRESSED); - else SDL_PrivateJoystickButton(joystick, (Uint8)7, SDL_RELEASED); - } - - /* joystick hat events */ - /* Not Supported under OS/2 */ - /* joystick ball events */ - /* Not Supported under OS/2 */ -} - -/******************************************/ -/* Function to close a joystick after use */ -/******************************************/ -static void OS2_JoystickClose(SDL_Joystick *joystick) -{ - /* free system specific hardware data */ - SDL_free(joystick->hwdata); -} - -/********************************************************************/ -/* Function to perform any system-specific joystick related cleanup */ -/********************************************************************/ -static void OS2_JoystickQuit(void) -{ - joyPortClose(&hJoyPort); -} - -static SDL_bool OS2_JoystickGetGamepadMapping(int device_index, SDL_GamepadMapping *out) -{ - return SDL_FALSE; -} - - -/************************/ -/* OS/2 Implementations */ -/************************/ - -/*****************************************/ -/* Open Joystick Port, if not opened yet */ -/*****************************************/ -static int joyPortOpen(HFILE * hGame) -{ - APIRET rc; /* Generic Return Code */ - ULONG ulAction; /* ? */ - ULONG ulVersion; /* Version of joystick driver */ - ULONG ulDataLen; /* Size of version data */ - - /* Verifies if joyport is not already open... */ - if (*hGame != NULLHANDLE) return 0; - - /* Open GAME$ for read */ - rc = DosOpen("GAME$ ", hGame, &ulAction, 0, FILE_READONLY, - FILE_OPEN, OPEN_ACCESS_READONLY | OPEN_SHARE_DENYNONE, NULL); - if (rc != 0) - { - return SDL_SetError("Could not open Joystick Port."); - } - - /* Get Joystick Driver Version... must be 2.0 or higher */ - ulVersion = 0; - ulDataLen = sizeof(ulVersion); - rc = DosDevIOCtl(*hGame, IOCTL_CAT_USER, GAME_GET_VERSION, - NULL, 0, NULL, &ulVersion, ulDataLen, &ulDataLen); - if (rc != 0) - { - joyPortClose(hGame); - return SDL_SetError("Could not get Joystick Driver version."); - } - if (ulVersion < 0x20) - { - joyPortClose(hGame); - return SDL_SetError("Driver too old. At least IBM driver version 2.0 required."); - } - return 0; -} - -/****************************/ -/* Close JoyPort, if opened */ -/****************************/ -static void joyPortClose(HFILE * hGame) -{ - if (*hGame != NULLHANDLE) DosClose(*hGame); - *hGame = NULLHANDLE; -} - -/***************************/ -/* Get SDL Joystick EnvVar */ -/***************************/ -static int joyGetEnv(struct _joycfg * joydata) -{ - const char *joyenv; /* Pointer to tested character */ - char tempnumber[5]; /* Temporary place to put numeric texts */ - - joyenv = SDL_getenv("SDL_OS2_JOYSTICK"); - if (joyenv == NULL) return 0; - - /* Joystick Environment is defined! */ - while (*joyenv == ' ' && *joyenv != 0) joyenv++; /* jump spaces... */ - - /* If the string name starts with '... get if fully */ - if (*joyenv == '\'') { - joyenv++; - joyenv += joyGetData(joyenv,joydata->name,'\'',sizeof(joydata->name)); - } - /* If not, get it until the next space */ - else if (*joyenv == '\"') { - joyenv++; - joyenv += joyGetData(joyenv,joydata->name,'\"',sizeof(joydata->name)); - } - else { - joyenv += joyGetData(joyenv,joydata->name, ' ',sizeof(joydata->name)); - } - - /* Now get the number of axes */ - while (*joyenv == ' ' && *joyenv != 0) joyenv++; /* jump spaces... */ - joyenv += joyGetData(joyenv,tempnumber,' ',sizeof(tempnumber)); - joydata->axes = SDL_atoi(tempnumber); - - /* Now get the number of buttons */ - while (*joyenv == ' ' && *joyenv != 0) joyenv++; /* jump spaces... */ - joyenv += joyGetData(joyenv,tempnumber,' ',sizeof(tempnumber)); - joydata->buttons = SDL_atoi(tempnumber); - - /* Now get the number of hats */ - while (*joyenv == ' ' && *joyenv != 0) joyenv++; /* jump spaces... */ - joyenv += joyGetData(joyenv,tempnumber,' ',sizeof(tempnumber)); - joydata->hats = SDL_atoi(tempnumber); - - /* Now get the number of balls */ - while (*joyenv==' ' && *joyenv != 0) joyenv++; /* jump spaces... */ - joyenv += joyGetData(joyenv,tempnumber,' ',sizeof(tempnumber)); - joydata->balls = SDL_atoi(tempnumber); - return 1; -} - -/************************************************************************/ -/* Get a text from in the string starting in joyenv until it finds */ -/* the stopchar or maxchars is reached. The result is placed in name. */ -/************************************************************************/ -static int joyGetData(const char *joyenv, char *name, char stopchar, size_t maxchars) -{ - char *nameptr; /* Pointer to the selected character */ - int chcnt = 0; /* Count how many characters where copied */ - - nameptr = name; - while (*joyenv!=stopchar && *joyenv!=0) - { - if (nameptr < (name + (maxchars-1))) - { - *nameptr = *joyenv; /* Only copy if smaller than maximum */ - nameptr++; - } - chcnt++; - joyenv++; - } - if (*joyenv == stopchar) - { - joyenv++; /* Jump stopchar */ - chcnt++; - } - *nameptr = 0; /* Mark last byte */ - return chcnt; -} - -SDL_JoystickDriver SDL_OS2_JoystickDriver = -{ - OS2_JoystickInit, - OS2_NumJoysticks, - OS2_JoystickDetect, - OS2_JoystickGetDeviceName, - OS2_JoystickGetDevicePath, - OS2_JoystickGetDevicePlayerIndex, - OS2_JoystickSetDevicePlayerIndex, - OS2_JoystickGetDeviceGUID, - OS2_JoystickGetDeviceInstanceID, - OS2_JoystickOpen, - OS2_JoystickRumble, - OS2_JoystickRumbleTriggers, - OS2_JoystickGetCapabilities, - OS2_JoystickSetLED, - OS2_JoystickSendEffect, - OS2_JoystickSetSensorsEnabled, - OS2_JoystickUpdate, - OS2_JoystickClose, - OS2_JoystickQuit, - OS2_JoystickGetGamepadMapping -}; - -#endif /* SDL_JOYSTICK_OS2 */ diff --git a/src/loadso/os2/SDL_sysloadso.c b/src/loadso/os2/SDL_sysloadso.c deleted file mode 100644 index 292196ecbb..0000000000 --- a/src/loadso/os2/SDL_sysloadso.c +++ /dev/null @@ -1,103 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ -#include "../../SDL_internal.h" - -#ifdef SDL_LOADSO_OS2 - -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* System dependent library loading routines */ - -#include "SDL_loadso.h" -#include "../../core/os2/SDL_os2.h" - -#define INCL_DOSMODULEMGR -#define INCL_DOSERRORS -#include - -void * -SDL_LoadObject(const char *sofile) -{ - ULONG ulRC; - HMODULE hModule; - CHAR acError[256]; - PSZ pszModName; - - if (!sofile) { - SDL_InvalidParamError("sofile"); - return NULL; - } - - pszModName = OS2_UTF8ToSys(sofile); - ulRC = DosLoadModule(acError, sizeof(acError), pszModName, &hModule); - - if (ulRC != NO_ERROR && !SDL_strrchr(pszModName, '\\') && !SDL_strrchr(pszModName, '/')) { - /* strip .dll extension and retry only if name has no path. */ - size_t len = SDL_strlen(pszModName); - if (len > 4 && SDL_strcasecmp(&pszModName[len - 4], ".dll") == 0) { - pszModName[len - 4] = '\0'; - ulRC = DosLoadModule(acError, sizeof(acError), pszModName, &hModule); - } - } - if (ulRC != NO_ERROR) { - SDL_SetError("Failed loading %s: %s (E%u)", sofile, acError, ulRC); - hModule = NULLHANDLE; - } - SDL_free(pszModName); - - return (void *)hModule; -} - -void * -SDL_LoadFunction(void *handle, const char *name) -{ - ULONG ulRC; - PFN pFN; - - ulRC = DosQueryProcAddr((HMODULE)handle, 0, name, &pFN); - if (ulRC != NO_ERROR) { - /* retry with an underscore prepended, e.g. for gcc-built dlls. */ - SDL_bool isstack; - size_t len = SDL_strlen(name) + 1; - char *_name = SDL_small_alloc(char, len + 1, &isstack); - _name[0] = '_'; - SDL_memcpy(&_name[1], name, len); - ulRC = DosQueryProcAddr((HMODULE)handle, 0, _name, &pFN); - SDL_small_free(_name, isstack); - } - if (ulRC != NO_ERROR) { - SDL_SetError("Failed loading procedure %s (E%u)", name, ulRC); - return NULL; - } - - return (void *)pFN; -} - -void -SDL_UnloadObject(void *handle) -{ - if (handle != NULL) { - DosFreeModule((HMODULE)handle); - } -} - -#endif /* SDL_LOADSO_OS2 */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/thread/SDL_thread_c.h b/src/thread/SDL_thread_c.h index f3348eaa98..faa66d7150 100644 --- a/src/thread/SDL_thread_c.h +++ b/src/thread/SDL_thread_c.h @@ -42,8 +42,6 @@ #include "n3ds/SDL_systhread_c.h" #elif SDL_THREAD_STDCPP #include "stdcpp/SDL_systhread_c.h" -#elif SDL_THREAD_OS2 -#include "os2/SDL_systhread_c.h" #elif SDL_THREAD_NGAGE #include "ngage/SDL_systhread_c.h" #else diff --git a/src/thread/os2/SDL_sysmutex.c b/src/thread/os2/SDL_sysmutex.c deleted file mode 100644 index d3fc7a3bd3..0000000000 --- a/src/thread/os2/SDL_sysmutex.c +++ /dev/null @@ -1,129 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ -#include "../../SDL_internal.h" - -#if SDL_THREAD_OS2 - -/* An implementation of mutexes for OS/2 */ - -#include "SDL_thread.h" -#include "SDL_systhread_c.h" -#include "../../core/os2/SDL_os2.h" - -#define INCL_DOSSEMAPHORES -#define INCL_DOSERRORS -#include - -struct SDL_mutex { - HMTX _handle; -}; - -/* Create a mutex */ -SDL_mutex * -SDL_CreateMutex(void) -{ - ULONG ulRC; - HMTX hMtx; - - ulRC = DosCreateMutexSem(NULL, &hMtx, 0, FALSE); - if (ulRC != NO_ERROR) { - debug_os2("DosCreateMutexSem(), rc = %u", ulRC); - return NULL; - } - - return (SDL_mutex *)hMtx; -} - -/* Free the mutex */ -void -SDL_DestroyMutex(SDL_mutex * mutex) -{ - HMTX hMtx = (HMTX)mutex; - if (hMtx != NULLHANDLE) { - const ULONG ulRC = DosCloseMutexSem(hMtx); - if (ulRC != NO_ERROR) { - debug_os2("DosCloseMutexSem(), rc = %u", ulRC); - } - } -} - -/* Lock the mutex */ -int -SDL_LockMutex(SDL_mutex * mutex) -{ - ULONG ulRC; - HMTX hMtx = (HMTX)mutex; - - if (hMtx == NULLHANDLE) - return SDL_InvalidParamError("mutex"); - - ulRC = DosRequestMutexSem(hMtx, SEM_INDEFINITE_WAIT); - if (ulRC != NO_ERROR) { - debug_os2("DosRequestMutexSem(), rc = %u", ulRC); - return -1; - } - - return 0; -} - -/* try Lock the mutex */ -int -SDL_TryLockMutex(SDL_mutex * mutex) -{ - ULONG ulRC; - HMTX hMtx = (HMTX)mutex; - - if (hMtx == NULLHANDLE) - return SDL_InvalidParamError("mutex"); - - ulRC = DosRequestMutexSem(hMtx, SEM_IMMEDIATE_RETURN); - - if (ulRC == ERROR_TIMEOUT) - return SDL_MUTEX_TIMEDOUT; - - if (ulRC != NO_ERROR) { - debug_os2("DosRequestMutexSem(), rc = %u", ulRC); - return -1; - } - - return 0; -} - -/* Unlock the mutex */ -int -SDL_UnlockMutex(SDL_mutex * mutex) -{ - ULONG ulRC; - HMTX hMtx = (HMTX)mutex; - - if (hMtx == NULLHANDLE) - return SDL_InvalidParamError("mutex"); - - ulRC = DosReleaseMutexSem(hMtx); - if (ulRC != NO_ERROR) - return SDL_SetError("DosReleaseMutexSem(), rc = %u", ulRC); - - return 0; -} - -#endif /* SDL_THREAD_OS2 */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/thread/os2/SDL_syssem.c b/src/thread/os2/SDL_syssem.c deleted file mode 100644 index 79bf0673f3..0000000000 --- a/src/thread/os2/SDL_syssem.c +++ /dev/null @@ -1,190 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ -#include "../../SDL_internal.h" - -#if SDL_THREAD_OS2 - -/* An implementation of semaphores for OS/2 */ - -#include "SDL_thread.h" -#include "../../core/os2/SDL_os2.h" - -#define INCL_DOSSEMAPHORES -#define INCL_DOSERRORS -#define INCL_DOSMISC -#include - -struct SDL_semaphore { - HEV hEv; - HMTX hMtx; - ULONG cPost; -}; - - -SDL_sem * -SDL_CreateSemaphore(Uint32 initial_value) -{ - ULONG ulRC; - SDL_sem *pSDLSem = SDL_malloc(sizeof(SDL_sem)); - - if (pSDLSem == NULL) { - SDL_OutOfMemory(); - return NULL; - } - - ulRC = DosCreateEventSem(NULL, &pSDLSem->hEv, DCE_AUTORESET, FALSE); - if (ulRC != NO_ERROR) { - debug_os2("DosCreateEventSem(), rc = %u", ulRC); - SDL_free(pSDLSem); - return NULL; - } - - ulRC = DosCreateMutexSem(NULL, &pSDLSem->hMtx, 0, FALSE); - if (ulRC != NO_ERROR) { - debug_os2("DosCreateMutexSem(), rc = %u", ulRC); - DosCloseEventSem(pSDLSem->hEv); - SDL_free(pSDLSem); - return NULL; - } - - pSDLSem->cPost = initial_value; - - return pSDLSem; -} - -void -SDL_DestroySemaphore(SDL_sem * sem) -{ - if (!sem) return; - - DosCloseMutexSem(sem->hMtx); - DosCloseEventSem(sem->hEv); - SDL_free(sem); -} - -int -SDL_SemWaitTimeout(SDL_sem * sem, Uint32 timeout) -{ - ULONG ulRC; - ULONG ulStartTime, ulCurTime; - ULONG ulTimeout; - ULONG cPost; - - if (sem == NULL) - return SDL_InvalidParamError("sem"); - - if (timeout != SEM_INDEFINITE_WAIT) - DosQuerySysInfo(QSV_MS_COUNT, QSV_MS_COUNT, &ulStartTime, sizeof(ULONG)); - - while (TRUE) { - ulRC = DosRequestMutexSem(sem->hMtx, SEM_INDEFINITE_WAIT); - if (ulRC != NO_ERROR) - return SDL_SetError("DosRequestMutexSem() failed, rc = %u", ulRC); - - cPost = sem->cPost; - if (sem->cPost != 0) - sem->cPost--; - - DosReleaseMutexSem(sem->hMtx); - - if (cPost != 0) - break; - - if (timeout == SEM_INDEFINITE_WAIT) - ulTimeout = SEM_INDEFINITE_WAIT; - else { - DosQuerySysInfo(QSV_MS_COUNT, QSV_MS_COUNT, &ulCurTime, sizeof(ULONG)); - ulTimeout = ulCurTime - ulStartTime; - if (timeout < ulTimeout) - return SDL_MUTEX_TIMEDOUT; - ulTimeout = timeout - ulTimeout; - } - - ulRC = DosWaitEventSem(sem->hEv, ulTimeout); - if (ulRC == ERROR_TIMEOUT) - return SDL_MUTEX_TIMEDOUT; - - if (ulRC != NO_ERROR) - return SDL_SetError("DosWaitEventSem() failed, rc = %u", ulRC); - } - - return 0; -} - -int -SDL_SemTryWait(SDL_sem * sem) -{ - return SDL_SemWaitTimeout(sem, 0); -} - -int -SDL_SemWait(SDL_sem * sem) -{ - return SDL_SemWaitTimeout(sem, SDL_MUTEX_MAXWAIT); -} - -Uint32 -SDL_SemValue(SDL_sem * sem) -{ - ULONG ulRC; - - if (sem == NULL) { - SDL_InvalidParamError("sem"); - return 0; - } - - ulRC = DosRequestMutexSem(sem->hMtx, SEM_INDEFINITE_WAIT); - if (ulRC != NO_ERROR) - return SDL_SetError("DosRequestMutexSem() failed, rc = %u", ulRC); - - ulRC = sem->cPost; - DosReleaseMutexSem(sem->hMtx); - - return ulRC; -} - -int -SDL_SemPost(SDL_sem * sem) -{ - ULONG ulRC; - - if (sem == NULL) - return SDL_InvalidParamError("sem"); - - ulRC = DosRequestMutexSem(sem->hMtx, SEM_INDEFINITE_WAIT); - if (ulRC != NO_ERROR) - return SDL_SetError("DosRequestMutexSem() failed, rc = %u", ulRC); - - sem->cPost++; - - ulRC = DosPostEventSem(sem->hEv); - if (ulRC != NO_ERROR && ulRC != ERROR_ALREADY_POSTED) { - debug_os2("DosPostEventSem() failed, rc = %u", ulRC); - } - - DosReleaseMutexSem(sem->hMtx); - - return 0; -} - -#endif /* SDL_THREAD_OS2 */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/thread/os2/SDL_systhread.c b/src/thread/os2/SDL_systhread.c deleted file mode 100644 index 8c64e9c328..0000000000 --- a/src/thread/os2/SDL_systhread.c +++ /dev/null @@ -1,133 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ -#include "../../SDL_internal.h" - -#if SDL_THREAD_OS2 - -/* Thread management routines for SDL */ - -#include "SDL_thread.h" -#include "../SDL_systhread.h" -#include "../SDL_thread_c.h" -#include "../SDL_systhread.h" -#include "SDL_systls_c.h" -#include "../../core/os2/SDL_os2.h" -#ifndef SDL_PASSED_BEGINTHREAD_ENDTHREAD -#error This source only adjusted for SDL_PASSED_BEGINTHREAD_ENDTHREAD -#endif - -#define INCL_DOSPROCESS -#define INCL_DOSERRORS -#include -#include - - -static void RunThread(void *data) -{ - SDL_Thread *thread = (SDL_Thread *) data; - pfnSDL_CurrentEndThread pfnEndThread = (pfnSDL_CurrentEndThread) thread->endfunc; - - if (ppSDLTLSData != NULL) - *ppSDLTLSData = NULL; - - SDL_RunThread(thread); - - if (pfnEndThread != NULL) - pfnEndThread(); -} - -int -SDL_SYS_CreateThread(SDL_Thread * thread, - pfnSDL_CurrentBeginThread pfnBeginThread, - pfnSDL_CurrentEndThread pfnEndThread) -{ - if (thread->stacksize == 0) - thread->stacksize = 65536; - - if (pfnBeginThread) { - /* Save the function which we will have to call to clear the RTL of calling app! */ - thread->endfunc = pfnEndThread; - /* Start the thread using the runtime library of calling app! */ - thread->handle = (SYS_ThreadHandle) - pfnBeginThread(RunThread, NULL, thread->stacksize, thread); - } else { - thread->endfunc = _endthread; - thread->handle = (SYS_ThreadHandle) - _beginthread(RunThread, NULL, thread->stacksize, thread); - } - - if (thread->handle == -1) - return SDL_SetError("Not enough resources to create thread"); - - return 0; -} - -void -SDL_SYS_SetupThread(const char *name) -{ - /* nothing. */ -} - -SDL_threadID -SDL_ThreadID(void) -{ - PTIB tib; - PPIB pib; - - DosGetInfoBlocks(&tib, &pib); - return tib->tib_ptib2->tib2_ultid; -} - -int -SDL_SYS_SetThreadPriority(SDL_ThreadPriority priority) -{ - ULONG ulRC; - - ulRC = DosSetPriority(PRTYS_THREAD, - (priority < SDL_THREAD_PRIORITY_NORMAL)? PRTYC_IDLETIME : - (priority > SDL_THREAD_PRIORITY_NORMAL)? PRTYC_TIMECRITICAL : - PRTYC_REGULAR, - 0, 0); - if (ulRC != NO_ERROR) - return SDL_SetError("DosSetPriority() failed, rc = %u", ulRC); - - return 0; -} - -void -SDL_SYS_WaitThread(SDL_Thread * thread) -{ - ULONG ulRC = DosWaitThread((PTID)&thread->handle, DCWW_WAIT); - - if (ulRC != NO_ERROR) { - debug_os2("DosWaitThread() failed, rc = %u", ulRC); - } -} - -void -SDL_SYS_DetachThread(SDL_Thread * thread) -{ - /* nothing. */ -} - -#endif /* SDL_THREAD_OS2 */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/thread/os2/SDL_systhread_c.h b/src/thread/os2/SDL_systhread_c.h deleted file mode 100644 index dedceb3965..0000000000 --- a/src/thread/os2/SDL_systhread_c.h +++ /dev/null @@ -1,25 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ -#include "../../SDL_internal.h" - -typedef int SYS_ThreadHandle; - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/thread/os2/SDL_systls.c b/src/thread/os2/SDL_systls.c deleted file mode 100644 index b48a4bd39d..0000000000 --- a/src/thread/os2/SDL_systls.c +++ /dev/null @@ -1,89 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -#include "../../SDL_internal.h" - -#if SDL_THREAD_OS2 - -#include "../../core/os2/SDL_os2.h" - -#include "SDL_thread.h" -#include "../SDL_thread_c.h" - -#define INCL_DOSPROCESS -#define INCL_DOSERRORS -#include - -SDL_TLSData **ppSDLTLSData = NULL; - -static ULONG cTLSAlloc = 0; - -/* SDL_OS2TLSAlloc() called from SDL_InitSubSystem() */ -void SDL_OS2TLSAlloc(void) -{ - ULONG ulRC; - - if (cTLSAlloc == 0 || ppSDLTLSData == NULL) { - /* First call - allocate the thread local memory (1 DWORD) */ - ulRC = DosAllocThreadLocalMemory(1, (PULONG *)&ppSDLTLSData); - if (ulRC != NO_ERROR) { - debug_os2("DosAllocThreadLocalMemory() failed, rc = %u", ulRC); - } - } - cTLSAlloc++; -} - -/* SDL_OS2TLSFree() called from SDL_QuitSubSystem() */ -void SDL_OS2TLSFree(void) -{ - ULONG ulRC; - - if (cTLSAlloc != 0) - cTLSAlloc--; - - if (cTLSAlloc == 0 && ppSDLTLSData != NULL) { - /* Last call - free the thread local memory */ - ulRC = DosFreeThreadLocalMemory((PULONG)ppSDLTLSData); - if (ulRC != NO_ERROR) { - debug_os2("DosFreeThreadLocalMemory() failed, rc = %u", ulRC); - } else { - ppSDLTLSData = NULL; - } - } -} - -SDL_TLSData *SDL_SYS_GetTLSData(void) -{ - return (ppSDLTLSData == NULL)? NULL : *ppSDLTLSData; -} - -int SDL_SYS_SetTLSData(SDL_TLSData *data) -{ - if (!ppSDLTLSData) - return -1; - - *ppSDLTLSData = data; - return 0; -} - -#endif /* SDL_THREAD_OS2 */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/thread/os2/SDL_systls_c.h b/src/thread/os2/SDL_systls_c.h deleted file mode 100644 index e40d5ddcf6..0000000000 --- a/src/thread/os2/SDL_systls_c.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -#include "../../SDL_internal.h" - -#if SDL_THREAD_OS2 - -#include "../SDL_thread_c.h" - -extern SDL_TLSData **ppSDLTLSData; - -/* SDL_OS2TLSAlloc() called from SDL_InitSubSystem() */ -void SDL_OS2TLSAlloc(void); - -/* SDL_OS2TLSFree() called from SDL_QuitSubSystem() */ -void SDL_OS2TLSFree(void); - -#endif /* SDL_THREAD_OS2 */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/thread/windows/SDL_systhread.c b/src/thread/windows/SDL_systhread.c index 8f44e473c3..3701cf01f1 100644 --- a/src/thread/windows/SDL_systhread.c +++ b/src/thread/windows/SDL_systhread.c @@ -45,23 +45,6 @@ typedef unsigned long (__cdecl *pfnSDL_CurrentBeginThread) (void *, unsigned, unsigned, unsigned *threadID); typedef void (__cdecl *pfnSDL_CurrentEndThread)(unsigned code); -#elif defined(__WATCOMC__) -/* This is for Watcom targets except OS2 */ -#if __WATCOMC__ < 1240 -#define __watcall -#endif -typedef unsigned long (__watcall * pfnSDL_CurrentBeginThread) (void *, - unsigned, - unsigned - (__stdcall * - func) (void - *), - void *arg, - unsigned, - unsigned - *threadID); -typedef void (__watcall * pfnSDL_CurrentEndThread) (unsigned code); - #else typedef uintptr_t(__cdecl * pfnSDL_CurrentBeginThread) (void *, unsigned, unsigned (__stdcall * diff --git a/src/timer/os2/SDL_systimer.c b/src/timer/os2/SDL_systimer.c deleted file mode 100644 index 8a8425d29a..0000000000 --- a/src/timer/os2/SDL_systimer.c +++ /dev/null @@ -1,186 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ -#include "../../SDL_internal.h" - -#if SDL_TIMER_OS2 - -#include "SDL_timer.h" -#include "../../core/os2/SDL_os2.h" - -#define INCL_DOSERRORS -#define INCL_DOSMISC -#define INCL_DOSPROFILE -#define INCL_DOSSEMAPHORES -#define INCL_DOSDATETIME -#define INCL_DOSPROCESS -#define INCL_DOSEXCEPTIONS -#include - -/* No need to switch priorities in SDL_Delay() for OS/2 versions > Warp3 fp 42, */ -/*#define _SWITCH_PRIORITY*/ - -typedef unsigned long long ULLONG; - -static SDL_bool ticks_started = SDL_FALSE; -static ULONG ulTmrFreq = 0; -static ULLONG ullTmrStart = 0; - -void -SDL_TicksInit(void) -{ - ULONG ulTmrStart; /* for 32-bit fallback. */ - ULONG ulRC; - - if (ticks_started) { - return; - } - ticks_started = SDL_TRUE; - - ulRC = DosTmrQueryFreq(&ulTmrFreq); - if (ulRC != NO_ERROR) { - debug_os2("DosTmrQueryFreq() failed, rc = %u", ulRC); - } else { - ulRC = DosTmrQueryTime((PQWORD)&ullTmrStart); - if (ulRC == NO_ERROR) { - return; - } - debug_os2("DosTmrQueryTime() failed, rc = %u", ulRC); - } - - ulTmrFreq = 0; /* Error - use DosQuerySysInfo() for timer. */ - DosQuerySysInfo(QSV_MS_COUNT, QSV_MS_COUNT, &ulTmrStart, sizeof (ULONG)); - ullTmrStart = (ULLONG) ulTmrStart; -} - -void -SDL_TicksQuit(void) -{ - ticks_started = SDL_FALSE; -} - -Uint64 -SDL_GetTicks64(void) -{ - Uint64 ui64Result; - ULLONG ullTmrNow; - - if (!ticks_started) { - SDL_TicksInit(); - } - - if (ulTmrFreq != 0) { - DosTmrQueryTime((PQWORD)&ullTmrNow); - ui64Result = (ullTmrNow - ullTmrStart) * 1000 / ulTmrFreq; - } else { - /* note that this counter rolls over to 0 every ~49 days. Fix your system so DosTmrQueryTime works if you need to avoid this. */ - ULONG ulTmrNow; - DosQuerySysInfo(QSV_MS_COUNT, QSV_MS_COUNT, &ulTmrNow, sizeof (ULONG)); - ui64Result = (((Uint64) ulTmrNow) - ullTmrStart); - } - - return ui64Result; -} - -Uint64 -SDL_GetPerformanceCounter(void) -{ - QWORD qwTmrNow; - - if (ulTmrFreq == 0 || (DosTmrQueryTime(&qwTmrNow) != NO_ERROR)) { - return SDL_GetTicks64(); - } - return *((Uint64 *)&qwTmrNow); -} - -Uint64 -SDL_GetPerformanceFrequency(void) -{ - return (ulTmrFreq == 0)? 1000 : (Uint64)ulTmrFreq; -} - -void -SDL_Delay(Uint32 ms) -{ - HTIMER hTimer = NULLHANDLE; - ULONG ulRC; -#ifdef _SWITCH_PRIORITY - PPIB pib; - PTIB tib; - BOOL fSetPriority = ms < 50; - ULONG ulSavePriority; - ULONG ulNesting; -#endif - HEV hevTimer; - - if (ms == 0) { - DosSleep(0); - return; - } - - ulRC = DosCreateEventSem(NULL, &hevTimer, DC_SEM_SHARED, FALSE); - if (ulRC != NO_ERROR) { - debug_os2("DosAsyncTimer() failed, rc = %u", ulRC); - DosSleep(ms); - return; - } - -#ifdef _SWITCH_PRIORITY - if (fSetPriority) { - if (DosGetInfoBlocks(&tib, &pib) != NO_ERROR) - fSetPriority = FALSE; - else { - ulSavePriority = tib->tib_ptib2->tib2_ulpri; - if (((ulSavePriority & 0xFF00) == 0x0300) || /* already have high pr. */ - (DosEnterMustComplete( &ulNesting) != NO_ERROR)) - fSetPriority = FALSE; - else { - DosSetPriority(PRTYS_THREAD, PRTYC_TIMECRITICAL, 0, 0); - } - } - } -#endif - - DosResetEventSem(hevTimer, &ulRC); - ulRC = DosAsyncTimer(ms, (HSEM)hevTimer, &hTimer); - -#ifdef _SWITCH_PRIORITY - if (fSetPriority) { - if (DosSetPriority(PRTYS_THREAD, (ulSavePriority >> 8) & 0xFF, 0, 0) == NO_ERROR) - DosSetPriority(PRTYS_THREAD, 0, ulSavePriority & 0xFF, 0); - DosExitMustComplete(&ulNesting); - } -#endif - - if (ulRC != NO_ERROR) { - debug_os2("DosAsyncTimer() failed, rc = %u", ulRC); - } else { - DosWaitEventSem(hevTimer, SEM_INDEFINITE_WAIT); - } - - if (ulRC != NO_ERROR) - DosSleep(ms); - - DosCloseEventSem(hevTimer); -} - -#endif /* SDL_TIMER_OS2 */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/video/SDL_sysvideo.h b/src/video/SDL_sysvideo.h index 4bc1f111fd..8f2a9308a9 100644 --- a/src/video/SDL_sysvideo.h +++ b/src/video/SDL_sysvideo.h @@ -474,8 +474,6 @@ extern VideoBootStrap Emscripten_bootstrap; extern VideoBootStrap QNX_bootstrap; extern VideoBootStrap OFFSCREEN_bootstrap; extern VideoBootStrap NGAGE_bootstrap; -extern VideoBootStrap OS2DIVE_bootstrap; -extern VideoBootStrap OS2VMAN_bootstrap; /* Use SDL_OnVideoThread() sparingly, to avoid regressions in use cases that currently happen to work */ extern SDL_bool SDL_OnVideoThread(void); diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c index 064276cb11..019aa78aee 100644 --- a/src/video/SDL_video.c +++ b/src/video/SDL_video.c @@ -131,10 +131,6 @@ static VideoBootStrap *bootstrap[] = { #if SDL_VIDEO_DRIVER_NGAGE &NGAGE_bootstrap, #endif -#if SDL_VIDEO_DRIVER_OS2 - &OS2DIVE_bootstrap, - &OS2VMAN_bootstrap, -#endif #if SDL_VIDEO_DRIVER_DUMMY &DUMMY_bootstrap, #if SDL_INPUT_LINUXEV @@ -4456,9 +4452,6 @@ SDL_GetMessageBoxCount(void) #if SDL_VIDEO_DRIVER_HAIKU #include "haiku/SDL_bmessagebox.h" #endif -#if SDL_VIDEO_DRIVER_OS2 -#include "os2/SDL_os2messagebox.h" -#endif #if SDL_VIDEO_DRIVER_RISCOS #include "riscos/SDL_riscosmessagebox.h" #endif @@ -4466,7 +4459,7 @@ SDL_GetMessageBoxCount(void) #include "vita/SDL_vitamessagebox.h" #endif -#if SDL_VIDEO_DRIVER_WINDOWS || SDL_VIDEO_DRIVER_WINRT || SDL_VIDEO_DRIVER_COCOA || SDL_VIDEO_DRIVER_UIKIT || SDL_VIDEO_DRIVER_X11 || SDL_VIDEO_DRIVER_WAYLAND || SDL_VIDEO_DRIVER_HAIKU || SDL_VIDEO_DRIVER_OS2 || SDL_VIDEO_DRIVER_RISCOS +#if SDL_VIDEO_DRIVER_WINDOWS || SDL_VIDEO_DRIVER_WINRT || SDL_VIDEO_DRIVER_COCOA || SDL_VIDEO_DRIVER_UIKIT || SDL_VIDEO_DRIVER_X11 || SDL_VIDEO_DRIVER_WAYLAND || SDL_VIDEO_DRIVER_HAIKU || SDL_VIDEO_DRIVER_RISCOS static SDL_bool SDL_MessageboxValidForDriver(const SDL_MessageBoxData *messageboxdata, SDL_SYSWM_TYPE drivertype) { SDL_SysWMinfo info; @@ -4581,13 +4574,6 @@ SDL_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid) retval = 0; } #endif -#if SDL_VIDEO_DRIVER_OS2 - if (retval == -1 && - SDL_MessageboxValidForDriver(messageboxdata, SDL_SYSWM_OS2) && - OS2_ShowMessageBox(messageboxdata, buttonid) == 0) { - retval = 0; - } -#endif #if SDL_VIDEO_DRIVER_RISCOS if (retval == -1 && SDL_MessageboxValidForDriver(messageboxdata, SDL_SYSWM_RISCOS) && diff --git a/src/video/os2/SDL_gradd.h b/src/video/os2/SDL_gradd.h deleted file mode 100644 index a1369a2600..0000000000 --- a/src/video/os2/SDL_gradd.h +++ /dev/null @@ -1,171 +0,0 @@ -/* -gradd.h structures and constants -- only the ones used by SDL_os2vman.c. - -Based on public knowledge from around the internet including pages from -http://www.osfree.org and http://www.edm2.com -*/ - -#ifndef SDL_gradd_h_ -#define SDL_gradd_h_ - -typedef struct _INITPROCOUT { - ULONG ulLength; /* Length of the INITPROCOUT data structure, in bytes. */ - ULONG ulVRAMVirt; /* 32-bit virtual address of VRAM. */ -} INITPROCOUT; -typedef INITPROCOUT *PINITPROCOUT; - -#define RC_SUCCESS 0 - -typedef ULONG GID; -typedef ULONG (_System FNVMIENTRY) ( - GID gid, ULONG ulFunction, - PVOID pIn, - PVOID pOut /* PINITPROCOUT */ -); - -#define VMI_CMD_INITPROC 1 -#define VMI_CMD_TERMPROC 3 -#define VMI_CMD_QUERYMODES 5 -#define VMI_CMD_SETMODE 6 -#define VMI_CMD_PALETTE 7 -#define VMI_CMD_BITBLT 8 -#define VMI_CMD_LINE 9 -#define VMI_CMD_REQUESTHW 14 -#define VMI_CMD_QUERYCURRENTMODE 0x1001 - -#define QUERYMODE_NUM_MODES 0x01 -#define QUERYMODE_MODE_DATA 0x02 - -typedef struct _HWPALETTEINFO { - ULONG ulLength; /* Size of the HWPALETTEINFO data structure, in bytes. */ - ULONG fFlags; /* Palette flag. */ - ULONG ulStartIndex; /* Starting palette index. */ - ULONG ulNumEntries; /* Number of palette slots to query or set. */ - PRGB2 pRGBs; /* Pointer to the array of RGB values. */ -} HWPALETTEINFO; -typedef HWPALETTEINFO *PHWPALETTEINFO; - -#define PALETTE_GET 0x01 -#define PALETTE_SET 0x02 - -typedef struct _BMAPINFO { - ULONG ulLength; /* Length of the BMAPINFO data structure, in bytes. */ - ULONG ulType; /* Description of the Blt. */ - ULONG ulWidth; /* Width in pels of the bit map. */ - ULONG ulHeight; /* Height in pels of the bit map. */ - ULONG ulBpp; /* Number of bits per pel/color depth. */ - ULONG ulBytesPerLine; /* Number of aligned bytes per line. */ - PBYTE pBits; /* Pointer to bit-map bits. */ -} BMAPINFO; -typedef BMAPINFO *PBMAPINFO; - -#define BMAP_VRAM 0 -#define BMAP_MEMORY 1 - -typedef struct _LINEPACK { - ULONG ulStyleStep; /* Value to be added to ulStyleValue. */ - ULONG ulStyleValue; /* Style value at the current pel. */ - ULONG ulFlags; /* Flags used for the LINEPACK data structure. */ - struct _LINEPACK *plpkNext; /* Pointer to next LINEPACK data structure. */ - ULONG ulAbsDeltaX; /* Clipped Bresenham Delta X, absolute. */ - ULONG ulAbsDeltaY; /* Clipped Bresenham Delta Y, absolute. */ - POINTL ptlClipStart; /* Pointer to location for device to perform Bresenham algorithm. */ - POINTL ptlClipEnd; /* Ending location for Bresenham algorithm (see ptlClipStart). */ - POINTL ptlStart; /* Pointer to starting location for line. */ - POINTL ptlEnd; /* Ending location for line. */ - LONG lClipStartError;/* Standard Bresenham error at the clipped start point. */ -} LINEPACK; -typedef LINEPACK *PLINEPACK; - -typedef struct _LINEINFO { - ULONG ulLength; /* Length of LINEINFO data structure. */ - ULONG ulType; /* Defines line type. */ - ULONG ulStyleMask; /* A 32-bit style mask. */ - ULONG cLines; /* Count of lines to be drawn. */ - ULONG ulFGColor; /* Line Foreground color. */ - ULONG ulBGColor; /* Line Background color. */ - USHORT usForeROP; /* Line Foreground mix. */ - USHORT usBackROP; /* Line Background mix. */ - PBMAPINFO pDstBmapInfo; /* Pointer to destination surface bit map. */ - PLINEPACK alpkLinePack; /* Pointer to LINEPACK data structure. */ - PRECTL prclBounds; /* Pointer to bounding rect of a clipped line. */ -} LINEINFO; -typedef LINEINFO *PLINEINFO; - -#define LINE_DO_FIRST_PEL 0x02 -#define LINE_DIR_Y_POSITIVE 0x04 -#define LINE_HORIZONTAL 0x08 -#define LINE_DIR_X_POSITIVE 0x20 -#define LINE_VERTICAL 0x1000 -#define LINE_DO_LAST_PEL 0x4000 -#define LINE_SOLID 0x01 - -typedef struct _BLTRECT { - ULONG ulXOrg; /* X origin of the destination Blt. */ - ULONG ulYOrg; /* Y origin of the destination Blt. */ - ULONG ulXExt; /* X extent of the BitBlt. */ - ULONG ulYExt; /* Y extent of the BitBlt. */ -} BLTRECT; -typedef BLTRECT *PBLTRECT; - -typedef struct _BITBLTINFO { - ULONG ulLength; /* Length of the BITBLTINFO data structure, in bytes. */ - ULONG ulBltFlags; /* Flags for rendering of rasterized data. */ - ULONG cBlits; /* Count of Blts to be performed. */ - ULONG ulROP; /* Raster operation. */ - ULONG ulMonoBackROP; /* Background mix if B_APPLY_BACK_ROP is set. */ - ULONG ulSrcFGColor; /* Monochrome source Foreground color. */ - ULONG ulSrcBGColor; /* Monochrome source Background color and transparent color. */ - ULONG ulPatFGColor; /* Monochrome pattern Foreground color. */ - ULONG ulPatBGColor; /* Monochrome pattern Background color. */ - PBYTE abColors; /* Pointer to color translation table. */ - PBMAPINFO pSrcBmapInfo; /* Pointer to source bit map (BMAPINFO) */ - PBMAPINFO pDstBmapInfo; /* Pointer to destination bit map (BMAPINFO). */ - PBMAPINFO pPatBmapInfo; /* Pointer to pattern bit map (BMAPINFO). */ - PPOINTL aptlSrcOrg; /* Pointer to array of source origin POINTLs. */ - PPOINTL aptlPatOrg; /* Pointer to array of pattern origin POINTLs. */ - PBLTRECT abrDst; /* Pointer to array of Blt rects. */ - PRECTL prclSrcBounds; /* Pointer to source bounding rect of source Blts. */ - PRECTL prclDstBounds; /* Pointer to destination bounding rect of destination Blts. */ -} BITBLTINFO; -typedef BITBLTINFO *PBITBLTINFO; - -#define BF_DEFAULT_STATE 0x0 -#define BF_ROP_INCL_SRC (0x01 << 2) -#define BF_PAT_HOLLOW (0x01 << 8) - -typedef struct _GDDMODEINFO { - ULONG ulLength; /* Size of the GDDMODEINFO data structure, in bytes. */ - ULONG ulModeId; /* ID used to make SETMODE request. */ - ULONG ulBpp; /* Number of colors (bpp). */ - ULONG ulHorizResolution;/* Number of horizontal pels. */ - ULONG ulVertResolution; /* Number of vertical scan lines. */ - ULONG ulRefreshRate; /* Refresh rate in Hz. */ - PBYTE pbVRAMPhys; /* Physical address of VRAM. */ - ULONG ulApertureSize; /* Size of VRAM, in bytes. */ - ULONG ulScanLineSize; /* Size of one scan line, in bytes. */ - - ULONG fccColorEncoding, ulTotalVRAMSize, cColors; -} GDDMODEINFO; -typedef GDDMODEINFO *PGDDMODEINFO; - -typedef struct _HWREQIN { - ULONG ulLength; /* Size of the HWREQIN data structure, in bytes. */ - ULONG ulFlags; /* Request option flags. */ - ULONG cScrChangeRects; /* Count of screen rectangles affected by HWREQIN. */ - PRECTL arectlScreen; /* Array of screen rectangles affected by HWREQIN. */ -} HWREQIN; -typedef HWREQIN *PHWREQIN; - -#define REQUEST_HW 0x01 - -/* -BOOL GreDeath(HDC hdc, PVOID pInstance, LONG lFunction); -LONG GreResurrection(HDC hdc, LONG cbVmem, PULONG pReserved, PVOID pInstance, LONG lFunction); -*/ -#define GreDeath(h) (BOOL)Gre32Entry3((ULONG)(h), 0, 0x40B7L) -#define GreResurrection(h,n,r) (LONG)Gre32Entry5((ULONG)(h), (ULONG)(n), (ULONG)(r), 0, 0x40B8L) -ULONG _System Gre32Entry3(ULONG, ULONG, ULONG); -ULONG _System Gre32Entry5(ULONG, ULONG, ULONG, ULONG, ULONG); - -#endif /* SDL_gradd_h_ */ diff --git a/src/video/os2/SDL_os2dive.c b/src/video/os2/SDL_os2dive.c deleted file mode 100644 index 56cfde1b3b..0000000000 --- a/src/video/os2/SDL_os2dive.c +++ /dev/null @@ -1,331 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ -#include "../../SDL_internal.h" -#include "../SDL_sysvideo.h" -#define INCL_WIN -#define INCL_GPI -#include -#define _MEERROR_H_ -#include -#include -#define INCL_MM_OS2 -#include -#include -#include "SDL_os2output.h" - -typedef struct _VODATA { - HDIVE hDive; - PVOID pBuffer; - ULONG ulDIVEBufNum; - FOURCC fccColorEncoding; - ULONG ulWidth; - ULONG ulHeight; - BOOL fBlitterReady; -} VODATA; - -static BOOL voQueryInfo(VIDEOOUTPUTINFO *pInfo); -static PVODATA voOpen(void); -static VOID voClose(PVODATA pVOData); -static BOOL voSetVisibleRegion(PVODATA pVOData, HWND hwnd, - SDL_DisplayMode *pSDLDisplayMode, - HRGN hrgnShape, BOOL fVisible); -static PVOID voVideoBufAlloc(PVODATA pVOData, ULONG ulWidth, ULONG ulHeight, - ULONG ulBPP, ULONG fccColorEncoding, - PULONG pulScanLineSize); -static VOID voVideoBufFree(PVODATA pVOData); -static BOOL voUpdate(PVODATA pVOData, HWND hwnd, SDL_Rect *pSDLRects, - ULONG cSDLRects); - -OS2VIDEOOUTPUT voDive = { - voQueryInfo, - voOpen, - voClose, - voSetVisibleRegion, - voVideoBufAlloc, - voVideoBufFree, - voUpdate -}; - - -static BOOL voQueryInfo(VIDEOOUTPUTINFO *pInfo) -{ - DIVE_CAPS sDiveCaps; - FOURCC fccFormats[100]; - - /* Query information about display hardware from DIVE. */ - SDL_zeroa(fccFormats); - SDL_zero(sDiveCaps); - sDiveCaps.pFormatData = fccFormats; - sDiveCaps.ulFormatLength = 100; - sDiveCaps.ulStructLen = sizeof(DIVE_CAPS); - - if (DiveQueryCaps(&sDiveCaps, DIVE_BUFFER_SCREEN)) { - debug_os2("DiveQueryCaps() failed."); - return FALSE; - } - - if (sDiveCaps.ulDepth < 8) { - debug_os2("Not enough screen colors to run DIVE. " - "Must be at least 256 colors."); - return FALSE; - } - - pInfo->ulBPP = sDiveCaps.ulDepth; - pInfo->fccColorEncoding = sDiveCaps.fccColorEncoding; - pInfo->ulScanLineSize = sDiveCaps.ulScanLineBytes; - pInfo->ulHorizResolution = sDiveCaps.ulHorizontalResolution; - pInfo->ulVertResolution = sDiveCaps.ulVerticalResolution; - - return TRUE; -} - -PVODATA voOpen(void) -{ - PVODATA pVOData = SDL_calloc(1, sizeof(VODATA)); - - if (pVOData == NULL) { - SDL_OutOfMemory(); - return NULL; - } - - if (DiveOpen(&pVOData->hDive, FALSE, NULL) != DIVE_SUCCESS) { - SDL_free(pVOData); - SDL_SetError("DIVE: A display engine instance open failed"); - return NULL; - } - - return pVOData; -} - -static VOID voClose(PVODATA pVOData) -{ - voVideoBufFree(pVOData); - DiveClose(pVOData->hDive); - SDL_free(pVOData); -} - -static BOOL voSetVisibleRegion(PVODATA pVOData, HWND hwnd, - SDL_DisplayMode *pSDLDisplayMode, - HRGN hrgnShape, BOOL fVisible) -{ - HPS hps; - HRGN hrgn; - RGNRECT rgnCtl; - PRECTL prectl = NULL; - ULONG ulRC; - - if (!fVisible) { - if (pVOData->fBlitterReady) { - pVOData->fBlitterReady = FALSE; - DiveSetupBlitter(pVOData->hDive, 0); - debug_os2("DIVE blitter is tuned off"); - } - return TRUE; - } - - /* Query visible rectangles */ - hps = WinGetPS(hwnd); - hrgn = GpiCreateRegion(hps, 0, NULL); - if (hrgn == NULLHANDLE) { - WinReleasePS(hps); - SDL_SetError("GpiCreateRegion() failed"); - } else { - WinQueryVisibleRegion(hwnd, hrgn); - if (hrgnShape != NULLHANDLE) - GpiCombineRegion(hps, hrgn, hrgn, hrgnShape, CRGN_AND); - - rgnCtl.ircStart = 1; - rgnCtl.crc = 0; - rgnCtl.ulDirection = 1; - GpiQueryRegionRects(hps, hrgn, NULL, &rgnCtl, NULL); - if (rgnCtl.crcReturned != 0) { - prectl = SDL_malloc(rgnCtl.crcReturned * sizeof(RECTL)); - if (prectl != NULL) { - rgnCtl.ircStart = 1; - rgnCtl.crc = rgnCtl.crcReturned; - rgnCtl.ulDirection = 1; - GpiQueryRegionRects(hps, hrgn, NULL, &rgnCtl, prectl); - } else { - SDL_OutOfMemory(); - } - } - GpiDestroyRegion(hps, hrgn); - WinReleasePS(hps); - - if (prectl != NULL) { - /* Setup DIVE blitter. */ - SETUP_BLITTER sSetupBlitter; - SWP swp; - POINTL pointl = { 0,0 }; - - WinQueryWindowPos(hwnd, &swp); - WinMapWindowPoints(hwnd, HWND_DESKTOP, &pointl, 1); - - sSetupBlitter.ulStructLen = sizeof(SETUP_BLITTER); - sSetupBlitter.fccSrcColorFormat = pVOData->fccColorEncoding; - sSetupBlitter.fInvert = FALSE; - sSetupBlitter.ulSrcWidth = pVOData->ulWidth; - sSetupBlitter.ulSrcHeight = pVOData->ulHeight; - sSetupBlitter.ulSrcPosX = 0; - sSetupBlitter.ulSrcPosY = 0; - sSetupBlitter.ulDitherType = 0; - sSetupBlitter.fccDstColorFormat = FOURCC_SCRN; - sSetupBlitter.ulDstWidth = swp.cx; - sSetupBlitter.ulDstHeight = swp.cy; - sSetupBlitter.lDstPosX = 0; - sSetupBlitter.lDstPosY = 0; - sSetupBlitter.lScreenPosX = pointl.x; - sSetupBlitter.lScreenPosY = pointl.y; - - sSetupBlitter.ulNumDstRects = rgnCtl.crcReturned; - sSetupBlitter.pVisDstRects = prectl; - - ulRC = DiveSetupBlitter(pVOData->hDive, &sSetupBlitter); - SDL_free(prectl); - - if (ulRC == DIVE_SUCCESS) { - pVOData->fBlitterReady = TRUE; - WinInvalidateRect(hwnd, NULL, TRUE); - debug_os2("DIVE blitter is ready now."); - return TRUE; - } - - SDL_SetError("DiveSetupBlitter(), rc = 0x%X", ulRC); - } /* if (prectl != NULL) */ - } /* if (hrgn == NULLHANDLE) else */ - - pVOData->fBlitterReady = FALSE; - DiveSetupBlitter(pVOData->hDive, 0); - return FALSE; -} - -static PVOID voVideoBufAlloc(PVODATA pVOData, ULONG ulWidth, ULONG ulHeight, - ULONG ulBPP, FOURCC fccColorEncoding, - PULONG pulScanLineSize) -{ - ULONG ulRC; - ULONG ulScanLineSize = ulWidth * (ulBPP >> 3); - - /* Destroy previous buffer. */ - voVideoBufFree(pVOData); - - if (ulWidth == 0 || ulHeight == 0 || ulBPP == 0) - return NULL; - - /* Bytes per line. */ - ulScanLineSize = (ulScanLineSize + 3) & ~3; /* 4-byte aligning */ - *pulScanLineSize = ulScanLineSize; - - ulRC = DosAllocMem(&pVOData->pBuffer, - (ulHeight * ulScanLineSize) + sizeof(ULONG), - PAG_COMMIT | PAG_EXECUTE | PAG_READ | PAG_WRITE); - if (ulRC != NO_ERROR) { - debug_os2("DosAllocMem(), rc = %u", ulRC); - return NULL; - } - - ulRC = DiveAllocImageBuffer(pVOData->hDive, &pVOData->ulDIVEBufNum, - fccColorEncoding, ulWidth, ulHeight, - ulScanLineSize, pVOData->pBuffer); - if (ulRC != DIVE_SUCCESS) { - debug_os2("DiveAllocImageBuffer(), rc = 0x%X", ulRC); - DosFreeMem(pVOData->pBuffer); - pVOData->pBuffer = NULL; - pVOData->ulDIVEBufNum = 0; - return NULL; - } - - pVOData->fccColorEncoding = fccColorEncoding; - pVOData->ulWidth = ulWidth; - pVOData->ulHeight = ulHeight; - - debug_os2("buffer: 0x%P, DIVE buffer number: %u", - pVOData->pBuffer, pVOData->ulDIVEBufNum); - - return pVOData->pBuffer; -} - -static VOID voVideoBufFree(PVODATA pVOData) -{ - ULONG ulRC; - - if (pVOData->ulDIVEBufNum != 0) { - ulRC = DiveFreeImageBuffer(pVOData->hDive, pVOData->ulDIVEBufNum); - if (ulRC != DIVE_SUCCESS) { - debug_os2("DiveFreeImageBuffer(,%u), rc = %u", pVOData->ulDIVEBufNum, ulRC); - } else { - debug_os2("DIVE buffer %u destroyed", pVOData->ulDIVEBufNum); - } - pVOData->ulDIVEBufNum = 0; - } - - if (pVOData->pBuffer != NULL) { - ulRC = DosFreeMem(pVOData->pBuffer); - if (ulRC != NO_ERROR) { - debug_os2("DosFreeMem(), rc = %u", ulRC); - } - pVOData->pBuffer = NULL; - } -} - -static BOOL voUpdate(PVODATA pVOData, HWND hwnd, SDL_Rect *pSDLRects, - ULONG cSDLRects) -{ - ULONG ulRC; - - if (!pVOData->fBlitterReady || (pVOData->ulDIVEBufNum == 0)) { - debug_os2("DIVE blitter is not ready"); - return FALSE; - } - - if (pSDLRects != NULL) { - PBYTE pbLineMask; - - pbLineMask = SDL_stack_alloc(BYTE, pVOData->ulHeight); - if (pbLineMask == NULL) { - debug_os2("Not enough stack size"); - return FALSE; - } - SDL_memset(pbLineMask, 0, pVOData->ulHeight); - - for ( ; ((LONG)cSDLRects) > 0; cSDLRects--, pSDLRects++) { - SDL_memset(&pbLineMask[pSDLRects->y], 1, pSDLRects->h); - } - - ulRC = DiveBlitImageLines(pVOData->hDive, pVOData->ulDIVEBufNum, - DIVE_BUFFER_SCREEN, pbLineMask); - SDL_stack_free(pbLineMask); - - if (ulRC != DIVE_SUCCESS) { - debug_os2("DiveBlitImageLines(), rc = 0x%X", ulRC); - } - } else { - ulRC = DiveBlitImage(pVOData->hDive, pVOData->ulDIVEBufNum, - DIVE_BUFFER_SCREEN); - if (ulRC != DIVE_SUCCESS) { - debug_os2("DiveBlitImage(), rc = 0x%X", ulRC); - } - } - - return ulRC == DIVE_SUCCESS; -} - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/video/os2/SDL_os2messagebox.c b/src/video/os2/SDL_os2messagebox.c deleted file mode 100644 index c904fa5cbd..0000000000 --- a/src/video/os2/SDL_os2messagebox.c +++ /dev/null @@ -1,561 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ -#include "../../SDL_internal.h" - -#if SDL_VIDEO_DRIVER_OS2 - -/* Display a OS/2 message box */ - -#include "SDL.h" -#include "../../core/os2/SDL_os2.h" -#include "SDL_os2video.h" -#define INCL_WIN -#include - -#define IDD_TEXT_MESSAGE 1001 -#define IDD_BITMAP 1002 -#define IDD_PB_FIRST 1003 - -typedef struct _MSGBOXDLGDATA { - USHORT cb; - HWND hwndUnder; -} MSGBOXDLGDATA; - -static VOID _wmInitDlg(HWND hwnd, MSGBOXDLGDATA *pDlgData) -{ - HPS hps = WinGetPS(hwnd); - POINTL aptText[TXTBOX_COUNT]; - HENUM hEnum; - HWND hWndNext; - CHAR acBuf[256]; - ULONG cbBuf; - ULONG cButtons = 0; - ULONG ulButtonsCY = 0; - ULONG ulButtonsCX = 0; - RECTL rectl; - ULONG ulX; - ULONG ulIdx; - struct _BUTTON { - HWND hwnd; /* Button window handle. */ - ULONG ulCX; /* Button width in dialog coordinates. */ - } aButtons[32]; - RECTL rectlItem; - HAB hab = WinQueryAnchorBlock(hwnd); - - /* --- Align the buttons to the right/bottom. --- */ - - /* Collect window handles of all buttons in dialog. */ - hEnum = WinBeginEnumWindows(hwnd); - - while ((hWndNext = WinGetNextWindow(hEnum)) != NULLHANDLE) { - if (WinQueryClassName(hWndNext, sizeof(acBuf), acBuf) == 0) { - continue; - } - if (SDL_strcmp(acBuf, "#3") == 0) { /* Class name of button. */ - if (cButtons < sizeof(aButtons) / sizeof(struct _BUTTON)) { - aButtons[cButtons].hwnd = hWndNext; - cButtons++; - } - } - } - WinEndEnumWindows(hEnum); - - /* Query size of text for each button, get width of each button, total - * buttons width (ulButtonsCX) and max. height (ulButtonsCX) in _dialog - * coordinates_. */ - hps = WinGetPS(hwnd); - - for(ulIdx = 0; ulIdx < cButtons; ulIdx++) { - /* Query size of text in window coordinates. */ - cbBuf = WinQueryWindowText(aButtons[ulIdx].hwnd, sizeof(acBuf), acBuf); - GpiQueryTextBox(hps, cbBuf, acBuf, TXTBOX_COUNT, aptText); - aptText[TXTBOX_TOPRIGHT].x -= aptText[TXTBOX_BOTTOMLEFT].x; - aptText[TXTBOX_TOPRIGHT].y -= aptText[TXTBOX_BOTTOMLEFT].y; - /* Convert text size to dialog coordinates. */ - WinMapDlgPoints(hwnd, &aptText[TXTBOX_TOPRIGHT], 1, FALSE); - /* Add vertical and horizontal space for button's frame (dialog coord.). */ - if (aptText[TXTBOX_TOPRIGHT].x < 30) { /* Minimal button width. */ - aptText[TXTBOX_TOPRIGHT].x = 30; - } else { - aptText[TXTBOX_TOPRIGHT].x += 4; - } - aptText[TXTBOX_TOPRIGHT].y += 3; - - aButtons[ulIdx].ulCX = aptText[TXTBOX_TOPRIGHT].x; /* Store button width */ - ulButtonsCX += aptText[TXTBOX_TOPRIGHT].x + 2; /* Add total btn. width */ - /* Get max. height for buttons. */ - if (ulButtonsCY < aptText[TXTBOX_TOPRIGHT].y) - ulButtonsCY = aptText[TXTBOX_TOPRIGHT].y + 1; - } - - WinReleasePS(hps); - - /* Expand horizontal size of the window to fit all buttons and move window - * to the center of parent window. */ - - /* Convert total width of buttons to window coordinates. */ - aptText[0].x = ulButtonsCX + 4; - WinMapDlgPoints(hwnd, &aptText[0], 1, TRUE); - /* Check width of the window and expand as needed. */ - WinQueryWindowRect(hwnd, &rectlItem); - if (rectlItem.xRight <= aptText[0].x) - rectlItem.xRight = aptText[0].x; - - /* Move window rectangle to the center of owner window. */ - WinQueryWindowRect(pDlgData->hwndUnder, &rectl); - /* Left-bottom point of centered dialog on owner window. */ - rectl.xLeft = (rectl.xRight - rectlItem.xRight) / 2; - rectl.yBottom = (rectl.yTop - rectlItem.yTop) / 2; - /* Map left-bottom point to desktop. */ - WinMapWindowPoints(pDlgData->hwndUnder, HWND_DESKTOP, (PPOINTL)&rectl, 1); - WinOffsetRect(hab, &rectlItem, rectl.xLeft, rectl.yBottom); - - /* Set new rectangle for the window. */ - WinSetWindowPos(hwnd, HWND_TOP, rectlItem.xLeft, rectlItem.yBottom, - rectlItem.xRight - rectlItem.xLeft, - rectlItem.yTop - rectlItem.yBottom, - SWP_SIZE | SWP_MOVE); - - /* Set buttons positions. */ - - /* Get horizontal position for the first button. */ - WinMapDlgPoints(hwnd, (PPOINTL)&rectlItem, 2, FALSE); /* Win size to dlg coord. */ - ulX = rectlItem.xRight - rectlItem.xLeft - ulButtonsCX - 2; /* First button position. */ - - /* Set positions and sizes for all buttons. */ - for (ulIdx = 0; ulIdx < cButtons; ulIdx++) { - /* Get poisition and size for the button in dialog coordinates. */ - aptText[0].x = ulX; - aptText[0].y = 2; - aptText[1].x = aButtons[ulIdx].ulCX; - aptText[1].y = ulButtonsCY; - /* Convert to window coordinates. */ - WinMapDlgPoints(hwnd, aptText, 2, TRUE); - - WinSetWindowPos(aButtons[ulIdx].hwnd, HWND_TOP, - aptText[0].x, aptText[0].y, aptText[1].x, aptText[1].y, - SWP_MOVE | SWP_SIZE); - - /* Offset horizontal position for the next button. */ - ulX += aButtons[ulIdx].ulCX + 2; - } - - /* Set right bound of the text to right bound of the last button and - * bottom bound of the text just above the buttons. */ - - aptText[2].x = 25; /* Left bound of text in dlg coordinates. */ - aptText[2].y = ulButtonsCY + 3; /* Bottom bound of the text in dlg coords. */ - WinMapDlgPoints(hwnd, &aptText[2], 1, TRUE); /* Convert ^^^ to win. coords */ - hWndNext = WinWindowFromID(hwnd, IDD_TEXT_MESSAGE); - WinQueryWindowRect(hWndNext, &rectlItem); - rectlItem.xLeft = aptText[2].x; - rectlItem.yBottom = aptText[2].y; - /* Right bound of the text equals right bound of the last button. */ - rectlItem.xRight = aptText[0].x + aptText[1].x; - WinSetWindowPos(hWndNext, HWND_TOP, rectlItem.xLeft, rectlItem.yBottom, - rectlItem.xRight - rectlItem.xLeft, - rectlItem.yTop - rectlItem.yBottom, - SWP_MOVE | SWP_SIZE); -} - -static MRESULT EXPENTRY DynDlgProc(HWND hwnd, USHORT message, MPARAM mp1, MPARAM mp2) -{ - switch (message) { - case WM_INITDLG: - _wmInitDlg(hwnd, (MSGBOXDLGDATA*)mp2); - break; - - case WM_COMMAND: - switch (SHORT1FROMMP(mp1)) { - case DID_OK: - WinDismissDlg(hwnd, FALSE); - break; - default: - break; - } - - default: - return(WinDefDlgProc(hwnd, message, mp1, mp2)); - } - - return FALSE; -} - -static HWND _makeDlg(const SDL_MessageBoxData *messageboxdata) -{ - SDL_MessageBoxButtonData* - pSDLBtnData = (SDL_MessageBoxButtonData *)messageboxdata->buttons; - ULONG cSDLBtnData = messageboxdata->numbuttons; - - PSZ pszTitle = OS2_UTF8ToSys(messageboxdata->title); - ULONG cbTitle = (pszTitle == NULL)? 1 : (SDL_strlen(pszTitle) + 1); - PSZ pszText = OS2_UTF8ToSys(messageboxdata->message); - ULONG cbText = (pszText == NULL)? 1 : (SDL_strlen(pszText) + 1); - - PDLGTEMPLATE pTemplate; - ULONG cbTemplate; - ULONG ulIdx; - PCHAR pcDlgData; - PDLGTITEM pDlgItem; - PSZ pszBtnText; - ULONG cbBtnText; - HWND hwnd; - - const SDL_MessageBoxColor* pSDLColors = (messageboxdata->colorScheme == NULL)? - NULL : messageboxdata->colorScheme->colors; - const SDL_MessageBoxColor* pSDLColor; - - MSGBOXDLGDATA stDlgData; - - /* Build a dialog tamplate in memory */ - - /* Size of template */ - cbTemplate = sizeof(DLGTEMPLATE) + ((2 + cSDLBtnData) * sizeof(DLGTITEM)) + - sizeof(ULONG) + /* First item data - frame control data. */ - cbTitle + /* First item data - frame title + ZERO. */ - cbText + /* Second item data - ststic text + ZERO.*/ - 3; /* Third item data - system icon Id. */ - - /* Button items datas - text for buttons. */ - for (ulIdx = 0; ulIdx < cSDLBtnData; ulIdx++) { - pszBtnText = (PSZ)pSDLBtnData[ulIdx].text; - cbTemplate += (pszBtnText == NULL)? 1 : (SDL_strlen(pszBtnText) + 1); - } - - /* Presentation parameter space. */ - if (pSDLColors != NULL) { - cbTemplate += 26 /* PP for frame. */ + - 26 /* PP for static text. */ + - (48 * cSDLBtnData); /* PP for buttons. */ - } - - /* Allocate memory for the dialog template. */ - pTemplate = (PDLGTEMPLATE) SDL_malloc(cbTemplate); - /* Pointer on data for dialog items in allocated memory. */ - pcDlgData = &((PCHAR)pTemplate)[sizeof(DLGTEMPLATE) + - ((2 + cSDLBtnData) * sizeof(DLGTITEM))]; - - /* Header info */ - pTemplate->cbTemplate = cbTemplate; /* size of dialog template to pass to WinCreateDlg() */ - pTemplate->type = 0; /* Currently always 0. */ - pTemplate->codepage = 0; - pTemplate->offadlgti = 14; /* Offset to array of DLGTITEMs. */ - pTemplate->fsTemplateStatus = 0; /* Reserved field? */ - - /* Index in array of dlg items of item to get focus, */ - /* if 0 then focus goes to first control that can have focus. */ - pTemplate->iItemFocus = 0; - pTemplate->coffPresParams = 0; - - /* First item info - frame */ - pDlgItem = pTemplate->adlgti; - pDlgItem->fsItemStatus = 0; /* Reserved? */ - /* Number of dialog item child windows owned by this item. */ - pDlgItem->cChildren = 2 + cSDLBtnData; /* Ststic text + buttons. */ - /* Length of class name, if 0 then offClassname contains a WC_ value. */ - pDlgItem->cchClassName = 0; - pDlgItem->offClassName = (USHORT)WC_FRAME; - /* Length of text. */ - pDlgItem->cchText = cbTitle; - pDlgItem->offText = pcDlgData - (PCHAR)pTemplate; /* Offset to title text. */ - /* Copy text for the title into the dialog template. */ - if (pszTitle != NULL) { - SDL_memcpy(pcDlgData, pszTitle, cbTitle); - } else { - *pcDlgData = '\0'; - } - pcDlgData += pDlgItem->cchText; - - pDlgItem->flStyle = WS_GROUP | WS_VISIBLE | WS_CLIPSIBLINGS | - FS_DLGBORDER | WS_SAVEBITS; - pDlgItem->x = 100; - pDlgItem->y = 100; - pDlgItem->cx = 175; - pDlgItem->cy = 65; - pDlgItem->id = DID_OK; /* An ID value? */ - if (pSDLColors == NULL) - pDlgItem->offPresParams = 0; - else { - /* Presentation parameter for the frame - dialog colors. */ - pDlgItem->offPresParams = pcDlgData - (PCHAR)pTemplate; - ((PPRESPARAMS)pcDlgData)->cb = 22; - pcDlgData += 4; - ((PPARAM)pcDlgData)->id = PP_FOREGROUNDCOLOR; - ((PPARAM)pcDlgData)->cb = 3; - ((PPARAM)pcDlgData)->ab[0] = pSDLColors[SDL_MESSAGEBOX_COLOR_TEXT].b; - ((PPARAM)pcDlgData)->ab[1] = pSDLColors[SDL_MESSAGEBOX_COLOR_TEXT].g; - ((PPARAM)pcDlgData)->ab[2] = pSDLColors[SDL_MESSAGEBOX_COLOR_TEXT].r; - pcDlgData += 11; - ((PPARAM)pcDlgData)->id = PP_BACKGROUNDCOLOR; - ((PPARAM)pcDlgData)->cb = 3; - ((PPARAM)pcDlgData)->ab[0] = pSDLColors[SDL_MESSAGEBOX_COLOR_BACKGROUND].b; - ((PPARAM)pcDlgData)->ab[1] = pSDLColors[SDL_MESSAGEBOX_COLOR_BACKGROUND].g; - ((PPARAM)pcDlgData)->ab[2] = pSDLColors[SDL_MESSAGEBOX_COLOR_BACKGROUND].r; - pcDlgData += 11; - } - - /* Offset to ctl data. */ - pDlgItem->offCtlData = pcDlgData - (PCHAR)pTemplate; - /* Put CtlData for the dialog in here */ - *((PULONG)pcDlgData) = FCF_TITLEBAR | FCF_SYSMENU; - pcDlgData += sizeof(ULONG); - - /* Second item info - static text (message). */ - pDlgItem++; - pDlgItem->fsItemStatus = 0; - /* No children since its a control, it could have child control */ - /* (ex. a group box). */ - pDlgItem->cChildren = 0; - /* Length of class name, 0 - offClassname contains a WC_ constant. */ - pDlgItem->cchClassName = 0; - pDlgItem->offClassName = (USHORT)WC_STATIC; - - pDlgItem->cchText = cbText; - pDlgItem->offText = pcDlgData - (PCHAR)pTemplate; /* Offset to the text. */ - /* Copy message text into the dialog template. */ - if (pszText != NULL) { - SDL_memcpy(pcDlgData, pszText, cbText); - } else { - *pcDlgData = '\0'; - } - pcDlgData += pDlgItem->cchText; - - pDlgItem->flStyle = SS_TEXT | DT_TOP | DT_LEFT | DT_WORDBREAK | WS_VISIBLE; - /* It will be really set in _wmInitDlg(). */ - pDlgItem->x = 25; - pDlgItem->y = 13; - pDlgItem->cx = 147; - pDlgItem->cy = 62; /* It will be used. */ - - pDlgItem->id = IDD_TEXT_MESSAGE; /* an ID value */ - if (pSDLColors == NULL) - pDlgItem->offPresParams = 0; - else { - /* Presentation parameter for the static text - dialog colors. */ - pDlgItem->offPresParams = pcDlgData - (PCHAR)pTemplate; - ((PPRESPARAMS)pcDlgData)->cb = 22; - pcDlgData += 4; - ((PPARAM)pcDlgData)->id = PP_FOREGROUNDCOLOR; - ((PPARAM)pcDlgData)->cb = 3; - ((PPARAM)pcDlgData)->ab[0] = pSDLColors[SDL_MESSAGEBOX_COLOR_TEXT].b; - ((PPARAM)pcDlgData)->ab[1] = pSDLColors[SDL_MESSAGEBOX_COLOR_TEXT].g; - ((PPARAM)pcDlgData)->ab[2] = pSDLColors[SDL_MESSAGEBOX_COLOR_TEXT].r; - pcDlgData += 11; - ((PPARAM)pcDlgData)->id = PP_BACKGROUNDCOLOR; - ((PPARAM)pcDlgData)->cb = 3; - ((PPARAM)pcDlgData)->ab[0] = pSDLColors[SDL_MESSAGEBOX_COLOR_BACKGROUND].b; - ((PPARAM)pcDlgData)->ab[1] = pSDLColors[SDL_MESSAGEBOX_COLOR_BACKGROUND].g; - ((PPARAM)pcDlgData)->ab[2] = pSDLColors[SDL_MESSAGEBOX_COLOR_BACKGROUND].r; - pcDlgData += 11; - } - pDlgItem->offCtlData = 0; - - /* Third item info - static bitmap. */ - pDlgItem++; - pDlgItem->fsItemStatus = 0; - pDlgItem->cChildren = 0; - pDlgItem->cchClassName = 0; - pDlgItem->offClassName = (USHORT)WC_STATIC; - - pDlgItem->cchText = 3; /* 0xFF, low byte of the icon Id, high byte of icon Id. */ - pDlgItem->offText = pcDlgData - (PCHAR)pTemplate; /* Offset to the Id. */ - /* Write system icon ID into dialog template. */ - *((PBYTE)pcDlgData) = 0xFF; /* First byte is 0xFF, next 2 are system pointer Id. */ - pcDlgData++; - *((PUSHORT)pcDlgData) = ((messageboxdata->flags & SDL_MESSAGEBOX_ERROR) != 0)? - SPTR_ICONERROR : - ((messageboxdata->flags & SDL_MESSAGEBOX_WARNING) != 0)? - SPTR_ICONWARNING : SPTR_ICONINFORMATION; - pcDlgData += 2; - - pDlgItem->flStyle = SS_SYSICON | WS_VISIBLE; - - pDlgItem->x = 4; - pDlgItem->y = 45; /* It will be really set in _wmInitDlg(). */ - pDlgItem->cx = 0; - pDlgItem->cy = 0; - - pDlgItem->id = IDD_BITMAP; - pDlgItem->offPresParams = 0; - pDlgItem->offCtlData = 0; - - /* Next items - buttons. */ - for (ulIdx = 0; ulIdx < cSDLBtnData; ulIdx++) { - pDlgItem++; - - pDlgItem->fsItemStatus = 0; - pDlgItem->cChildren = 0; /* No children. */ - pDlgItem->cchClassName = 0; /* 0 - offClassname is WC_ constant. */ - pDlgItem->offClassName = (USHORT)WC_BUTTON; - - pszBtnText = OS2_UTF8ToSys(pSDLBtnData[ulIdx].text); - cbBtnText = (pszBtnText == NULL)? 1 : (SDL_strlen(pszBtnText) + 1); - pDlgItem->cchText = cbBtnText; - pDlgItem->offText = pcDlgData - (PCHAR)pTemplate; /* Offset to the text. */ - /* Copy text for the button into the dialog template. */ - if (pszBtnText != NULL) { - SDL_memcpy(pcDlgData, pszBtnText, cbBtnText); - } else { - *pcDlgData = '\0'; - } - pcDlgData += pDlgItem->cchText; - SDL_free(pszBtnText); - - pDlgItem->flStyle = BS_PUSHBUTTON | WS_TABSTOP | WS_VISIBLE; - if (pSDLBtnData[ulIdx].flags == SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT) { - pDlgItem->flStyle |= BS_DEFAULT; - pTemplate->iItemFocus = ulIdx + 3; /* +3 - frame, static text and icon. */ - pSDLColor = &pSDLColors[SDL_MESSAGEBOX_COLOR_BUTTON_SELECTED]; - } else { - pSDLColor = &pSDLColors[SDL_MESSAGEBOX_COLOR_TEXT]; - } - - /* It will be really set in _wmInitDlg() */ - pDlgItem->x = 10; - pDlgItem->y = 10; - pDlgItem->cx = 70; - pDlgItem->cy = 15; - - pDlgItem->id = IDD_PB_FIRST + ulIdx; /* an ID value */ - if (pSDLColors == NULL) - pDlgItem->offPresParams = 0; - else { - /* Presentation parameter for the button - dialog colors. */ - pDlgItem->offPresParams = pcDlgData - (PCHAR)pTemplate; - ((PPRESPARAMS)pcDlgData)->cb = 44; - pcDlgData += 4; - ((PPARAM)pcDlgData)->id = PP_FOREGROUNDCOLOR; - ((PPARAM)pcDlgData)->cb = 3; - ((PPARAM)pcDlgData)->ab[0] = pSDLColor->b; - ((PPARAM)pcDlgData)->ab[1] = pSDLColor->g; - ((PPARAM)pcDlgData)->ab[2] = pSDLColor->r; - pcDlgData += 11; - ((PPARAM)pcDlgData)->id = PP_BACKGROUNDCOLOR; - ((PPARAM)pcDlgData)->cb = 3; - ((PPARAM)pcDlgData)->ab[0] = pSDLColors[SDL_MESSAGEBOX_COLOR_BUTTON_BACKGROUND].b; - ((PPARAM)pcDlgData)->ab[1] = pSDLColors[SDL_MESSAGEBOX_COLOR_BUTTON_BACKGROUND].g; - ((PPARAM)pcDlgData)->ab[2] = pSDLColors[SDL_MESSAGEBOX_COLOR_BUTTON_BACKGROUND].r; - pcDlgData += 11; - ((PPARAM)pcDlgData)->id = PP_BORDERLIGHTCOLOR; - ((PPARAM)pcDlgData)->cb = 3; - ((PPARAM)pcDlgData)->ab[0] = pSDLColors[SDL_MESSAGEBOX_COLOR_BUTTON_BORDER].b; - ((PPARAM)pcDlgData)->ab[1] = pSDLColors[SDL_MESSAGEBOX_COLOR_BUTTON_BORDER].g; - ((PPARAM)pcDlgData)->ab[2] = pSDLColors[SDL_MESSAGEBOX_COLOR_BUTTON_BORDER].r; - pcDlgData += 11; - ((PPARAM)pcDlgData)->id = PP_BORDERDARKCOLOR; - ((PPARAM)pcDlgData)->cb = 3; - ((PPARAM)pcDlgData)->ab[0] = pSDLColors[SDL_MESSAGEBOX_COLOR_BUTTON_BORDER].b; - ((PPARAM)pcDlgData)->ab[1] = pSDLColors[SDL_MESSAGEBOX_COLOR_BUTTON_BORDER].g; - ((PPARAM)pcDlgData)->ab[2] = pSDLColors[SDL_MESSAGEBOX_COLOR_BUTTON_BORDER].r; - pcDlgData += 11; - } - pDlgItem->offCtlData = 0; - } - /* Check, end of templ. data: &((PCHAR)pTemplate)[cbTemplate] == pcDlgData */ - - /* Create the dialog from template. */ - stDlgData.cb = sizeof(MSGBOXDLGDATA); - stDlgData.hwndUnder = (messageboxdata->window != NULL && messageboxdata->window->driverdata != NULL)? - ((WINDATA *)messageboxdata->window->driverdata)->hwnd : HWND_DESKTOP; - - hwnd = WinCreateDlg(HWND_DESKTOP, /* Parent is desktop. */ - stDlgData.hwndUnder, - (PFNWP)DynDlgProc, pTemplate, &stDlgData); - SDL_free(pTemplate); - SDL_free(pszTitle); - SDL_free(pszText); - - return hwnd; -} - - -int OS2_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid) -{ - HWND hwnd; - ULONG ulRC; - SDL_MessageBoxButtonData - *pSDLBtnData = (SDL_MessageBoxButtonData *)messageboxdata->buttons; - ULONG cSDLBtnData = messageboxdata->numbuttons; - BOOL fVideoInitialized = SDL_WasInit(SDL_INIT_VIDEO); - HAB hab; - HMQ hmq; - BOOL fSuccess = FALSE; - - if (!fVideoInitialized) { - PTIB tib; - PPIB pib; - - DosGetInfoBlocks(&tib, &pib); - if (pib->pib_ultype == 2 || pib->pib_ultype == 0) { - /* VIO windowable or fullscreen protect-mode session */ - pib->pib_ultype = 3; /* Presentation Manager protect-mode session */ - } - - hab = WinInitialize(0); - if (hab == NULLHANDLE) { - debug_os2("WinInitialize() failed"); - return -1; - } - hmq = WinCreateMsgQueue(hab, 0); - if (hmq == NULLHANDLE) { - debug_os2("WinCreateMsgQueue() failed"); - return -1; - } - } - - /* Create dynamic dialog. */ - hwnd = _makeDlg(messageboxdata); - /* Show dialog and obtain button Id. */ - ulRC = WinProcessDlg(hwnd); - /* Destroy dialog, */ - WinDestroyWindow(hwnd); - - if (ulRC == DID_CANCEL) { - /* Window closed by ESC, Alt+F4 or system menu. */ - ULONG ulIdx; - - for (ulIdx = 0; ulIdx < cSDLBtnData; ulIdx++, pSDLBtnData++) { - if (pSDLBtnData->flags == SDL_MESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT) { - *buttonid = pSDLBtnData->buttonid; - fSuccess = TRUE; - break; - } - } - } else { - /* Button pressed. */ - ulRC -= IDD_PB_FIRST; - if (ulRC < cSDLBtnData) { - *buttonid = pSDLBtnData[ulRC].buttonid; - fSuccess = TRUE; - } - } - - if (!fVideoInitialized) { - WinDestroyMsgQueue(hmq); - WinTerminate(hab); - } - - return (fSuccess)? 0 : -1; -} - -#endif /* SDL_VIDEO_DRIVER_OS2 */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/video/os2/SDL_os2messagebox.h b/src/video/os2/SDL_os2messagebox.h deleted file mode 100644 index c3b8969df7..0000000000 --- a/src/video/os2/SDL_os2messagebox.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ -#include "../../SDL_internal.h" - -#if SDL_VIDEO_DRIVER_OS2 - -extern int OS2_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid); - -#endif /* SDL_VIDEO_DRIVER_OS2 */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/video/os2/SDL_os2mouse.c b/src/video/os2/SDL_os2mouse.c deleted file mode 100644 index dd0b7c1930..0000000000 --- a/src/video/os2/SDL_os2mouse.c +++ /dev/null @@ -1,194 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ -#include "../../SDL_internal.h" - -#if SDL_VIDEO_DRIVER_OS2 - -#include "SDL_os2video.h" -#include "../../events/SDL_mouse_c.h" -#include "SDL_os2util.h" - -HPOINTER hptrCursor = NULLHANDLE; - -static SDL_Cursor* OS2_CreateCursor(SDL_Surface *surface, int hot_x, int hot_y) -{ - ULONG ulMaxW = WinQuerySysValue(HWND_DESKTOP, SV_CXPOINTER); - ULONG ulMaxH = WinQuerySysValue(HWND_DESKTOP, SV_CYPOINTER); - HPOINTER hptr; - SDL_Cursor* pSDLCursor; - - if (surface->w > ulMaxW || surface->h > ulMaxH) { - debug_os2("Given image size is %u x %u, maximum allowed size is %u x %u", - surface->w, surface->h, ulMaxW, ulMaxH); - return NULL; - } - - hptr = utilCreatePointer(surface, hot_x, ulMaxH - hot_y - 1); - if (hptr == NULLHANDLE) - return NULL; - - pSDLCursor = SDL_calloc(1, sizeof(SDL_Cursor)); - if (pSDLCursor == NULL) { - WinDestroyPointer(hptr); - SDL_OutOfMemory(); - return NULL; - } - - pSDLCursor->driverdata = (void *)hptr; - return pSDLCursor; -} - -static SDL_Cursor* OS2_CreateSystemCursor(SDL_SystemCursor id) -{ - SDL_Cursor* pSDLCursor; - LONG lSysId; - HPOINTER hptr; - - switch (id) { - case SDL_SYSTEM_CURSOR_ARROW: lSysId = SPTR_ARROW; break; - case SDL_SYSTEM_CURSOR_IBEAM: lSysId = SPTR_TEXT; break; - case SDL_SYSTEM_CURSOR_WAIT: lSysId = SPTR_WAIT; break; - case SDL_SYSTEM_CURSOR_CROSSHAIR: lSysId = SPTR_MOVE; break; - case SDL_SYSTEM_CURSOR_WAITARROW: lSysId = SPTR_WAIT; break; - case SDL_SYSTEM_CURSOR_SIZENWSE: lSysId = SPTR_SIZENWSE; break; - case SDL_SYSTEM_CURSOR_SIZENESW: lSysId = SPTR_SIZENESW; break; - case SDL_SYSTEM_CURSOR_SIZEWE: lSysId = SPTR_SIZEWE; break; - case SDL_SYSTEM_CURSOR_SIZENS: lSysId = SPTR_SIZENS; break; - case SDL_SYSTEM_CURSOR_SIZEALL: lSysId = SPTR_MOVE; break; - case SDL_SYSTEM_CURSOR_NO: lSysId = SPTR_ILLEGAL; break; - case SDL_SYSTEM_CURSOR_HAND: lSysId = SPTR_ARROW; break; - default: - debug_os2("Unknown cursor id: %u", id); - return NULL; - } - - /* On eCS SPTR_WAIT for last paramether fCopy=TRUE/FALSE gives different - * "wait" icons. -=8( ) */ - hptr = WinQuerySysPointer(HWND_DESKTOP, lSysId, - id == SDL_SYSTEM_CURSOR_WAIT); - if (hptr == NULLHANDLE) { - debug_os2("Cannot load OS/2 system pointer %u for SDL cursor id %u", - lSysId, id); - return NULL; - } - - pSDLCursor = SDL_calloc(1, sizeof(SDL_Cursor)); - if (pSDLCursor == NULL) { - WinDestroyPointer(hptr); - SDL_OutOfMemory(); - return NULL; - } - - pSDLCursor->driverdata = (void *)hptr; - return pSDLCursor; -} - -static void OS2_FreeCursor(SDL_Cursor *cursor) -{ - HPOINTER hptr = (HPOINTER)cursor->driverdata; - - WinDestroyPointer(hptr); - SDL_free(cursor); -} - -static int OS2_ShowCursor(SDL_Cursor *cursor) -{ - hptrCursor = (cursor != NULL)? (HPOINTER)cursor->driverdata : NULLHANDLE; - return ((SDL_GetMouseFocus() == NULL) || - WinSetPointer(HWND_DESKTOP, hptrCursor))? 0 : -1; -} - -static void OS2_WarpMouse(SDL_Window * window, int x, int y) -{ - WINDATA *pWinData = (WINDATA *)window->driverdata; - POINTL pointl; - - pointl.x = x; - pointl.y = window->h - y; - WinMapWindowPoints(pWinData->hwnd, HWND_DESKTOP, &pointl, 1); -/* pWinData->lSkipWMMouseMove++; ???*/ - WinSetPointerPos(HWND_DESKTOP, pointl.x, pointl.y); -} - -static int OS2_WarpMouseGlobal(int x, int y) -{ - WinSetPointerPos(HWND_DESKTOP, x, - WinQuerySysValue(HWND_DESKTOP, SV_CYSCREEN) - y); - return 0; -} - -static int OS2_CaptureMouse(SDL_Window *window) -{ - return WinSetCapture(HWND_DESKTOP, (window == NULL)? NULLHANDLE : - ((WINDATA *)window->driverdata)->hwnd)? 0 : -1; -} - -static Uint32 OS2_GetGlobalMouseState(int *x, int *y) -{ - POINTL pointl; - ULONG ulRes; - - WinQueryPointerPos(HWND_DESKTOP, &pointl); - *x = pointl.x; - *y = WinQuerySysValue(HWND_DESKTOP, SV_CYSCREEN) - pointl.y - 1; - - ulRes = (WinGetKeyState(HWND_DESKTOP, VK_BUTTON1) & 0x8000)? SDL_BUTTON_LMASK : 0; - if (WinGetKeyState(HWND_DESKTOP, VK_BUTTON2) & 0x8000) - ulRes |= SDL_BUTTON_RMASK; - if (WinGetKeyState(HWND_DESKTOP, VK_BUTTON3) & 0x8000) - ulRes |= SDL_BUTTON_MMASK; - - return ulRes; -} - - -void OS2_InitMouse(_THIS, ULONG hab) -{ - SDL_Mouse *pSDLMouse = SDL_GetMouse(); - - pSDLMouse->CreateCursor = OS2_CreateCursor; - pSDLMouse->CreateSystemCursor = OS2_CreateSystemCursor; - pSDLMouse->ShowCursor = OS2_ShowCursor; - pSDLMouse->FreeCursor = OS2_FreeCursor; - pSDLMouse->WarpMouse = OS2_WarpMouse; - pSDLMouse->WarpMouseGlobal = OS2_WarpMouseGlobal; - pSDLMouse->CaptureMouse = OS2_CaptureMouse; - pSDLMouse->GetGlobalMouseState = OS2_GetGlobalMouseState; - - SDL_SetDefaultCursor(OS2_CreateSystemCursor(SDL_SYSTEM_CURSOR_ARROW)); - if (hptrCursor == NULLHANDLE) - hptrCursor = WinQuerySysPointer(HWND_DESKTOP, SPTR_ARROW, TRUE); -} - -void OS2_QuitMouse(_THIS) -{ - SDL_Mouse *pSDLMouse = SDL_GetMouse(); - - if (pSDLMouse->def_cursor != NULL) { - SDL_free(pSDLMouse->def_cursor); - pSDLMouse->def_cursor = NULL; - pSDLMouse->cur_cursor = NULL; - } -} - -#endif /* SDL_VIDEO_DRIVER_OS2 */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/video/os2/SDL_os2mouse.h b/src/video/os2/SDL_os2mouse.h deleted file mode 100644 index 52f5ba3f73..0000000000 --- a/src/video/os2/SDL_os2mouse.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ -#include "../../SDL_internal.h" - -#ifndef SDL_os2mouse_h_ -#define SDL_os2mouse_h_ - -extern HPOINTER hptrCursor; - -extern void OS2_InitMouse(_THIS, ULONG hab); -extern void OS2_QuitMouse(_THIS); - -#endif /* SDL_os2mouse_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/video/os2/SDL_os2output.h b/src/video/os2/SDL_os2output.h deleted file mode 100644 index 7ded650e9c..0000000000 --- a/src/video/os2/SDL_os2output.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ -#ifndef SDL_os2output_ -#define SDL_os2output_ - -#include "../../core/os2/SDL_os2.h" - -typedef struct _VODATA *PVODATA; - -typedef struct _VIDEOOUTPUTINFO { - ULONG ulBPP; - ULONG fccColorEncoding; - ULONG ulScanLineSize; - ULONG ulHorizResolution; - ULONG ulVertResolution; -} VIDEOOUTPUTINFO; - -typedef struct _OS2VIDEOOUTPUT { - BOOL (*QueryInfo)(VIDEOOUTPUTINFO *pInfo); - PVODATA (*Open)(); - VOID (*Close)(PVODATA pVOData); - - BOOL (*SetVisibleRegion)(PVODATA pVOData, HWND hwnd, - SDL_DisplayMode *pSDLDisplayMode, HRGN hrgnShape, - BOOL fVisible); - - PVOID (*VideoBufAlloc)(PVODATA pVOData, ULONG ulWidth, ULONG ulHeight, - ULONG ulBPP, ULONG fccColorEncoding, - PULONG pulScanLineSize); - - VOID (*VideoBufFree)(PVODATA pVOData); - BOOL (*Update)(PVODATA pVOData, HWND hwnd, SDL_Rect *pSDLRects, - ULONG cSDLRects); -} OS2VIDEOOUTPUT; - -extern OS2VIDEOOUTPUT voDive; -extern OS2VIDEOOUTPUT voVMan; - -#endif /* SDL_os2output_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/video/os2/SDL_os2util.c b/src/video/os2/SDL_os2util.c deleted file mode 100644 index bcc6c54e85..0000000000 --- a/src/video/os2/SDL_os2util.c +++ /dev/null @@ -1,114 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ -#include "../../SDL_internal.h" - -#if SDL_VIDEO_DRIVER_OS2 - -#include "SDL_os2util.h" - -HPOINTER utilCreatePointer(SDL_Surface *surface, ULONG ulHotX, ULONG ulHotY) -{ - HBITMAP hbm; - BITMAPINFOHEADER2 bmih; - BITMAPINFO bmi; - HPS hps; - PULONG pulBitmap; - PULONG pulDst, pulSrc, pulDstMask; - ULONG ulY, ulX; - HPOINTER hptr = NULLHANDLE; - - if (surface->format->format != SDL_PIXELFORMAT_ARGB8888) { - debug_os2("Image format should be SDL_PIXELFORMAT_ARGB8888"); - return NULLHANDLE; - } - - pulBitmap = (PULONG) SDL_malloc(surface->h * surface->w * 2 * sizeof(ULONG)); - if (pulBitmap == NULL) { - SDL_OutOfMemory(); - return NULLHANDLE; - } - - /* pulDst - last line of surface (image) part of the result bitmap */ - pulDst = &pulBitmap[ (surface->h - 1) * surface->w ]; - /* pulDstMask - last line of mask part of the result bitmap */ - pulDstMask = &pulBitmap[ (2 * surface->h - 1) * surface->w ]; - /* pulSrc - first line of source image */ - pulSrc = (PULONG)surface->pixels; - - for (ulY = 0; ulY < surface->h; ulY++) { - for (ulX = 0; ulX < surface->w; ulX++) { - if ((pulSrc[ulX] & 0xFF000000) == 0) { - pulDst[ulX] = 0; - pulDstMask[ulX] = 0xFFFFFFFF; - } else { - pulDst[ulX] = pulSrc[ulX] & 0xFFFFFF; - pulDstMask[ulX] = 0; - } - } - - /* Set image and mask pointers on one line up */ - pulDst -= surface->w; - pulDstMask -= surface->w; - /* Set source image pointer to the next line */ - pulSrc = (PULONG) (((PCHAR)pulSrc) + surface->pitch); - } - - /* Create system bitmap object. */ - SDL_zero(bmih); - SDL_zero(bmi); - - bmih.cbFix = sizeof(BITMAPINFOHEADER2); - bmih.cx = surface->w; - bmih.cy = 2 * surface->h; - bmih.cPlanes = 1; - bmih.cBitCount = 32; - bmih.ulCompression = BCA_UNCOMP; - bmih.cbImage = bmih.cx * bmih.cy * 4; - - bmi.cbFix = sizeof(BITMAPINFOHEADER); - bmi.cx = bmih.cx; - bmi.cy = bmih.cy; - bmi.cPlanes = 1; - bmi.cBitCount = 32; - - hps = WinGetPS(HWND_DESKTOP); - hbm = GpiCreateBitmap(hps, (PBITMAPINFOHEADER2)&bmih, CBM_INIT, - (PBYTE)pulBitmap, (PBITMAPINFO2)&bmi); - if (hbm == GPI_ERROR) { - debug_os2("GpiCreateBitmap() failed"); - } else { - /* Create a system pointer object. */ - hptr = WinCreatePointer(HWND_DESKTOP, hbm, TRUE, ulHotX, ulHotY); - if (hptr == NULLHANDLE) { - debug_os2("WinCreatePointer() failed"); - } - } - GpiDeleteBitmap(hbm); - - WinReleasePS(hps); - SDL_free(pulBitmap); - - return hptr; -} - -#endif /* SDL_VIDEO_DRIVER_OS2 */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/video/os2/SDL_os2util.h b/src/video/os2/SDL_os2util.h deleted file mode 100644 index 9379dec543..0000000000 --- a/src/video/os2/SDL_os2util.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef SDL_os2util_h_ -#define SDL_os2util_h_ - -#include "SDL_log.h" -#include "../SDL_sysvideo.h" -#include "../../core/os2/SDL_os2.h" - -#define INCL_WIN -#define INCL_GPI -#include - -HPOINTER utilCreatePointer(SDL_Surface *surface, ULONG ulHotX, ULONG ulHotY); - -#endif /* SDL_os2util_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ - diff --git a/src/video/os2/SDL_os2video.c b/src/video/os2/SDL_os2video.c deleted file mode 100644 index f0147dc080..0000000000 --- a/src/video/os2/SDL_os2video.c +++ /dev/null @@ -1,1696 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -#include "../../SDL_internal.h" - -#if SDL_VIDEO_DRIVER_OS2 - -#include "SDL_video.h" -#include "SDL_mouse.h" -#include "../SDL_pixels_c.h" -#include "../SDL_shape_internals.h" -#include "../../events/SDL_events_c.h" -#include "SDL_os2video.h" -#include "SDL_syswm.h" -#include "SDL_os2util.h" - -#define __MEERROR_H__ -#define _MEERROR_H_ -#include -#include -#ifndef FOURCC_R666 -#define FOURCC_R666 mmioFOURCC('R','6','6','6') -#endif - -#define WIN_CLIENT_CLASS "SDL3" -#define OS2DRIVER_NAME_DIVE "DIVE" -#define OS2DRIVER_NAME_VMAN "VMAN" - - -static const SDL_Scancode aSDLScancode[] = { - /* 0 1 2 3 4 5 6 7 */ - /* 8 9 A B C D E F */ - SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_ESCAPE, SDL_SCANCODE_1, SDL_SCANCODE_2, SDL_SCANCODE_3, SDL_SCANCODE_4, SDL_SCANCODE_5, SDL_SCANCODE_6, /* 0 */ - SDL_SCANCODE_7, SDL_SCANCODE_8, SDL_SCANCODE_9, SDL_SCANCODE_0, SDL_SCANCODE_MINUS, SDL_SCANCODE_EQUALS, SDL_SCANCODE_BACKSPACE, SDL_SCANCODE_TAB, /* 0 */ - - SDL_SCANCODE_Q, SDL_SCANCODE_W, SDL_SCANCODE_E, SDL_SCANCODE_R, SDL_SCANCODE_T, SDL_SCANCODE_Y, SDL_SCANCODE_U, SDL_SCANCODE_I, /* 1 */ - SDL_SCANCODE_O, SDL_SCANCODE_P, SDL_SCANCODE_LEFTBRACKET, SDL_SCANCODE_RIGHTBRACKET, SDL_SCANCODE_RETURN, SDL_SCANCODE_LCTRL, SDL_SCANCODE_A, SDL_SCANCODE_S, /* 1 */ - - SDL_SCANCODE_D, SDL_SCANCODE_F, SDL_SCANCODE_G, SDL_SCANCODE_H, SDL_SCANCODE_J, SDL_SCANCODE_K, SDL_SCANCODE_L, SDL_SCANCODE_SEMICOLON, /* 2 */ - SDL_SCANCODE_APOSTROPHE, SDL_SCANCODE_GRAVE, SDL_SCANCODE_LSHIFT, SDL_SCANCODE_BACKSLASH, SDL_SCANCODE_Z, SDL_SCANCODE_X, SDL_SCANCODE_C, SDL_SCANCODE_V, /* 2 */ - - SDL_SCANCODE_B, SDL_SCANCODE_N, SDL_SCANCODE_M, SDL_SCANCODE_COMMA, SDL_SCANCODE_PERIOD, SDL_SCANCODE_SLASH, SDL_SCANCODE_RSHIFT, /*55*/SDL_SCANCODE_KP_MULTIPLY,/* 3 */ - SDL_SCANCODE_LALT, SDL_SCANCODE_SPACE, SDL_SCANCODE_CAPSLOCK, SDL_SCANCODE_F1, SDL_SCANCODE_F2, SDL_SCANCODE_F3, SDL_SCANCODE_F4, SDL_SCANCODE_F5, /* 3 */ - - SDL_SCANCODE_F6, SDL_SCANCODE_F7, SDL_SCANCODE_F8, SDL_SCANCODE_F9, SDL_SCANCODE_F10, SDL_SCANCODE_NUMLOCKCLEAR, SDL_SCANCODE_SCROLLLOCK, SDL_SCANCODE_KP_7, /* 4 */ - /*72*/ SDL_SCANCODE_KP_8, /*73*/SDL_SCANCODE_KP_9, SDL_SCANCODE_KP_MINUS,/*75*/SDL_SCANCODE_KP_4, /*76*/SDL_SCANCODE_KP_5, /*77*/SDL_SCANCODE_KP_6, /*78*/SDL_SCANCODE_KP_PLUS, /*79*/SDL_SCANCODE_KP_1, /* 4 */ - - /*80*/ SDL_SCANCODE_KP_2, /*81*/SDL_SCANCODE_KP_3, SDL_SCANCODE_KP_0, /*83*/SDL_SCANCODE_KP_PERIOD, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_NONUSBACKSLASH,SDL_SCANCODE_F11, /* 5 */ - /*88*/ SDL_SCANCODE_F12, /*89*/SDL_SCANCODE_PAUSE, /*90*/SDL_SCANCODE_KP_ENTER,/*91*/SDL_SCANCODE_RCTRL, /*92*/SDL_SCANCODE_KP_DIVIDE, SDL_SCANCODE_APPLICATION, SDL_SCANCODE_RALT, /*95*/SDL_SCANCODE_UNKNOWN, /* 5 */ - - /*96*/ SDL_SCANCODE_HOME, /*97*/SDL_SCANCODE_UP, /*98*/SDL_SCANCODE_PAGEUP, SDL_SCANCODE_LEFT, /*100*/SDL_SCANCODE_RIGHT, SDL_SCANCODE_END, /*102*/SDL_SCANCODE_DOWN, /*103*/SDL_SCANCODE_PAGEDOWN, /* 6 */ -/*104*/ SDL_SCANCODE_F17, /*105*/SDL_SCANCODE_DELETE, SDL_SCANCODE_F19, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN,/*110*/SDL_SCANCODE_UNKNOWN,/*111*/SDL_SCANCODE_UNKNOWN, /* 6 */ - -/*112*/ SDL_SCANCODE_INTERNATIONAL2, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_INTERNATIONAL1,SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, /* 7 */ -/*120*/ SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_INTERNATIONAL4,SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_INTERNATIONAL5,SDL_SCANCODE_APPLICATION,SDL_SCANCODE_INTERNATIONAL3,SDL_SCANCODE_LGUI, SDL_SCANCODE_RGUI /* 7 */ -}; - -/* Utilites. - * --------- - */ -static BOOL _getSDLPixelFormatData(SDL_PixelFormat *pSDLPixelFormat, - ULONG ulBPP, ULONG fccColorEncoding) -{ - ULONG ulRshift, ulGshift, ulBshift; - ULONG ulRmask, ulGmask, ulBmask; - ULONG ulRloss, ulGloss, ulBloss; - - pSDLPixelFormat->BitsPerPixel = ulBPP; - pSDLPixelFormat->BytesPerPixel = (pSDLPixelFormat->BitsPerPixel + 7) / 8; - - switch (fccColorEncoding) { - case FOURCC_LUT8: - ulRshift = 0; ulGshift = 0; ulBshift = 0; - ulRmask = 0; ulGmask = 0; ulBmask = 0; - ulRloss = 8; ulGloss = 8; ulBloss = 8; - break; - - case FOURCC_R555: - ulRshift = 10; ulGshift = 5; ulBshift = 0; - ulRmask = 0x7C00; ulGmask = 0x03E0; ulBmask = 0x001F; - ulRloss = 3; ulGloss = 3; ulBloss = 3; - break; - - case FOURCC_R565: - ulRshift = 11; ulGshift = 5; ulBshift = 0; - ulRmask = 0xF800; ulGmask = 0x07E0; ulBmask = 0x001F; - ulRloss = 3; ulGloss = 2; ulBloss = 3; - break; - - case FOURCC_R664: - ulRshift = 10; ulGshift = 4; ulBshift = 0; - ulRmask = 0xFC00; ulGmask = 0x03F0; ulBmask = 0x000F; - ulRloss = 2; ulGloss = 4; ulBloss = 3; - break; - - case FOURCC_R666: - ulRshift = 12; ulGshift = 6; ulBshift = 0; - ulRmask = 0x03F000; ulGmask = 0x000FC0; ulBmask = 0x00003F; - ulRloss = 2; ulGloss = 2; ulBloss = 2; - break; - - case FOURCC_RGB3: - case FOURCC_RGB4: - ulRshift = 0; ulGshift = 8; ulBshift = 16; - ulRmask = 0x0000FF; ulGmask = 0x00FF00; ulBmask = 0xFF0000; - ulRloss = 0x00; ulGloss = 0x00; ulBloss = 0x00; - break; - - case FOURCC_BGR3: - case FOURCC_BGR4: - ulRshift = 16; ulGshift = 8; ulBshift = 0; - ulRmask = 0xFF0000; ulGmask = 0x00FF00; ulBmask = 0x0000FF; - ulRloss = 0; ulGloss = 0; ulBloss = 0; - break; - - default: -/* printf("Unknown color encoding: %.4s\n", fccColorEncoding);*/ - SDL_memset(pSDLPixelFormat, 0, sizeof(SDL_PixelFormat)); - return FALSE; - } - - pSDLPixelFormat->Rshift = ulRshift; - pSDLPixelFormat->Gshift = ulGshift; - pSDLPixelFormat->Bshift = ulBshift; - pSDLPixelFormat->Rmask = ulRmask; - pSDLPixelFormat->Gmask = ulGmask; - pSDLPixelFormat->Bmask = ulBmask; - pSDLPixelFormat->Rloss = ulRloss; - pSDLPixelFormat->Gloss = ulGloss; - pSDLPixelFormat->Bloss = ulBloss; - - pSDLPixelFormat->Ashift = 0x00; - pSDLPixelFormat->Amask = 0x00; - pSDLPixelFormat->Aloss = 0x00; - - return TRUE; -} - -static Uint32 _getSDLPixelFormat(ULONG ulBPP, FOURCC fccColorEncoding) -{ - SDL_PixelFormat stSDLPixelFormat; - Uint32 uiResult = SDL_PIXELFORMAT_UNKNOWN; - - if (_getSDLPixelFormatData(&stSDLPixelFormat, ulBPP, fccColorEncoding)) - uiResult = SDL_MasksToPixelFormatEnum(ulBPP, stSDLPixelFormat.Rmask, - stSDLPixelFormat.Gmask, - stSDLPixelFormat.Bmask, 0); - - return uiResult; -} - -static SDL_DisplayMode *_getDisplayModeForSDLWindow(SDL_Window *window) -{ - SDL_VideoDisplay *pSDLDisplay = SDL_GetDisplayForWindow(window); - - if (pSDLDisplay == NULL) { - debug_os2("No display for the window"); - return FALSE; - } - - return &pSDLDisplay->current_mode; -} - -static VOID _mouseCheck(WINDATA *pWinData) -{ - SDL_Mouse *pSDLMouse = SDL_GetMouse(); - - if ((pSDLMouse->relative_mode || (pWinData->window->flags & SDL_WINDOW_MOUSE_GRABBED) != 0) && - ((pWinData->window->flags & SDL_WINDOW_INPUT_FOCUS) != 0)) { - /* We will make a real capture in _wmMouseButton() */ - } else { - WinSetCapture(HWND_DESKTOP, NULLHANDLE); - } -} - - -/* PM window procedure. - * -------------------- - */ -static int OS2_ResizeWindowShape(SDL_Window *window); - -static VOID _setVisibleRegion(WINDATA *pWinData, BOOL fVisible) -{ - SDL_VideoDisplay *pSDLDisplay; - - if (! pWinData->pVOData) - return; - - pSDLDisplay = (fVisible)? SDL_GetDisplayForWindow(pWinData->window) : NULL; - pWinData->pOutput->SetVisibleRegion(pWinData->pVOData, pWinData->hwnd, - (pSDLDisplay == NULL) ? - NULL : &pSDLDisplay->current_mode, - pWinData->hrgnShape, fVisible); -} - -static VOID _wmPaint(WINDATA *pWinData, HWND hwnd) -{ - if (pWinData->pVOData == NULL || - !pWinData->pOutput->Update(pWinData->pVOData, hwnd, NULL, 0)) { - RECTL rectl; - HPS hps; - - hps = WinBeginPaint(hwnd, 0, &rectl); - WinFillRect(hps, &rectl, CLR_BLACK); - WinEndPaint(hps); - } -} - -static VOID _wmMouseMove(WINDATA *pWinData, SHORT lX, SHORT lY) -{ - SDL_Mouse *pSDLMouse = SDL_GetMouse(); - POINTL pointl; - BOOL fWinActive = (pWinData->window->flags & SDL_WINDOW_INPUT_FOCUS) != 0; - - if (!pSDLMouse->relative_mode || pSDLMouse->relative_mode_warp) { - if (!pSDLMouse->relative_mode && fWinActive && - ((pWinData->window->flags & SDL_WINDOW_MOUSE_GRABBED) != 0) && - (WinQueryCapture(HWND_DESKTOP) == pWinData->hwnd)) { - - pointl.x = lX; - pointl.y = lY; - - if (lX < 0) - lX = 0; - else if (lX >= pWinData->window->w) - lX = pWinData->window->w - 1; - - if (lY < 0) - lY = 0; - else if (lY >= pWinData->window->h) - lY = pWinData->window->h - 1; - - if (lX != pointl.x || lY != pointl.x) { - pointl.x = lX; - pointl.y = lY; - WinMapWindowPoints(pWinData->hwnd, HWND_DESKTOP, &pointl, 1); - pWinData->lSkipWMMouseMove++; - WinSetPointerPos(HWND_DESKTOP, pointl.x, pointl.y); - } - } - - SDL_SendMouseMotion(pWinData->window, 0, 0, lX, - pWinData->window->h - lY - 1); - return; - } - - if (fWinActive) { - pointl.x = pWinData->window->w / 2; - pointl.y = pWinData->window->h / 2; - WinMapWindowPoints(pWinData->hwnd, HWND_DESKTOP, &pointl, 1); - - SDL_SendMouseMotion(pWinData->window, 0, 1, - lX - pointl.x, pointl.y - lY); - - pWinData->lSkipWMMouseMove++; - WinSetPointerPos(HWND_DESKTOP, pointl.x, pointl.y); - } -} - -static VOID _wmMouseButton(WINDATA *pWinData, ULONG ulButton, BOOL fDown) -{ - static ULONG aBtnGROP2SDL[3] = { SDL_BUTTON_LEFT, SDL_BUTTON_RIGHT, - SDL_BUTTON_MIDDLE }; - SDL_Mouse *pSDLMouse = SDL_GetMouse(); - - if ((pSDLMouse->relative_mode || ((pWinData->window->flags & SDL_WINDOW_MOUSE_GRABBED) != 0)) && - ((pWinData->window->flags & SDL_WINDOW_INPUT_FOCUS) != 0) && - (WinQueryCapture(HWND_DESKTOP) != pWinData->hwnd)) { - /* Mouse should be captured. */ - if (pSDLMouse->relative_mode && !pSDLMouse->relative_mode_warp) { - POINTL pointl; - - pointl.x = pWinData->window->w / 2; - pointl.y = pWinData->window->h / 2; - WinMapWindowPoints(pWinData->hwnd, HWND_DESKTOP, &pointl, 1); - pWinData->lSkipWMMouseMove++; - WinSetPointerPos(HWND_DESKTOP, pointl.x, pointl.y); - } - - WinSetCapture(HWND_DESKTOP, pWinData->hwnd); - } - - SDL_SendMouseButton(pWinData->window, 0, - (fDown)? SDL_PRESSED : SDL_RELEASED, - aBtnGROP2SDL[ulButton]); -} - -static VOID _wmChar(WINDATA *pWinData, MPARAM mp1, MPARAM mp2) -{ - ULONG ulFlags = SHORT1FROMMP(mp1); /* WM_CHAR flags */ - ULONG ulVirtualKey = SHORT2FROMMP(mp2); /* Virtual key code VK_* */ - ULONG ulCharCode = SHORT1FROMMP(mp2); /* Character code */ - ULONG ulScanCode = CHAR4FROMMP(mp1); /* Scan code */ - - if (((ulFlags & (KC_VIRTUALKEY | KC_KEYUP | KC_ALT)) == (KC_VIRTUALKEY | KC_ALT)) && - (ulVirtualKey == VK_F4)) { - SDL_SendWindowEvent(pWinData->window, SDL_WINDOWEVENT_CLOSE, 0, 0); - } - - if ((ulFlags & KC_SCANCODE) != 0) { - SDL_SendKeyboardKey(((ulFlags & KC_KEYUP) == 0)? SDL_PRESSED : SDL_RELEASED, aSDLScancode[ulScanCode]); - } - - if ((ulFlags & KC_CHAR) != 0) { -#if defined(HAVE_ICONV) && defined(HAVE_ICONV_H) - char *utf8 = SDL_iconv_string("UTF-8", "", (char *)&ulCharCode, 1); - SDL_SendKeyboardText((utf8 && *utf8) ? utf8 : (char *)&ulCharCode); - SDL_free(utf8); -#else - char utf8[4]; - int rc = StrUTF8(1, utf8, sizeof(utf8), (char *)&ulCharCode, 1); - SDL_SendKeyboardText((rc > 0) ? utf8 : (char *) &ulCharCode); -#endif - } -} - -static VOID _wmMove(WINDATA *pWinData) -{ - SDL_DisplayMode *pSDLDisplayMode = _getDisplayModeForSDLWindow(pWinData->window); - POINTL pointl = { 0,0 }; - RECTL rectl; - - WinQueryWindowRect(pWinData->hwnd, &rectl); - WinMapWindowPoints(pWinData->hwnd, HWND_DESKTOP, (PPOINTL)&rectl, 2); - - WinMapWindowPoints(pWinData->hwnd, HWND_DESKTOP, &pointl, 1); - SDL_SendWindowEvent(pWinData->window, SDL_WINDOWEVENT_MOVED, rectl.xLeft, - pSDLDisplayMode->h - rectl.yTop); -} - -static MRESULT _wmDragOver(WINDATA *pWinData, PDRAGINFO pDragInfo) -{ - ULONG ulIdx; - PDRAGITEM pDragItem; - USHORT usDrag = DOR_NEVERDROP; - USHORT usDragOp = DO_UNKNOWN; - - if (!DrgAccessDraginfo(pDragInfo)) - return MRFROM2SHORT(DOR_NEVERDROP, DO_UNKNOWN); - - for (ulIdx = 0; ulIdx < pDragInfo->cditem; ulIdx++) { - pDragItem = DrgQueryDragitemPtr(pDragInfo, ulIdx); - - /* We accept WPS files only. */ - if (!DrgVerifyRMF(pDragItem, "DRM_OS2FILE", NULL)) { - usDrag = DOR_NEVERDROP; - usDragOp = DO_UNKNOWN; - break; - } - - if (pDragInfo->usOperation == DO_DEFAULT && - (pDragItem->fsSupportedOps & DO_COPYABLE) != 0) { - usDrag = DOR_DROP; - usDragOp = DO_COPY; - } else - if (pDragInfo->usOperation == DO_LINK && - (pDragItem->fsSupportedOps & DO_LINKABLE) != 0) { - usDrag = DOR_DROP; - usDragOp = DO_LINK; - } else { - usDrag = DOR_NODROPOP; - usDragOp = DO_UNKNOWN; - break; - } - } - - /* Update window (The DIVE surface spoiled while dragging) */ - WinInvalidateRect(pWinData->hwnd, NULL, FALSE); - WinUpdateWindow(pWinData->hwnd); - - DrgFreeDraginfo(pDragInfo); - return MPFROM2SHORT(usDrag, usDragOp); -} - -static MRESULT _wmDrop(WINDATA *pWinData, PDRAGINFO pDragInfo) -{ - ULONG ulIdx; - PDRAGITEM pDragItem; - CHAR acFName[CCHMAXPATH]; - PCHAR pcFName; - - if (!DrgAccessDraginfo(pDragInfo)) - return MRFROM2SHORT(DOR_NEVERDROP, 0); - - for (ulIdx = 0; ulIdx < pDragInfo->cditem; ulIdx++) { - pDragItem = DrgQueryDragitemPtr(pDragInfo, ulIdx); - - if (DrgVerifyRMF(pDragItem, "DRM_OS2FILE", NULL) && - pDragItem->hstrContainerName != NULLHANDLE && - pDragItem->hstrSourceName != NULLHANDLE) { - /* Get file name from the item. */ - DrgQueryStrName(pDragItem->hstrContainerName, sizeof(acFName), acFName); - pcFName = SDL_strchr(acFName, '\0'); - DrgQueryStrName(pDragItem->hstrSourceName, - sizeof(acFName) - (pcFName - acFName), pcFName); - - /* Send to SDL full file name converted to UTF-8. */ - pcFName = OS2_SysToUTF8(acFName); - SDL_SendDropFile(pWinData->window, pcFName); - SDL_free(pcFName); - - /* Notify a source that a drag operation is complete. */ - if (pDragItem->hwndItem) - DrgSendTransferMsg(pDragItem->hwndItem, DM_ENDCONVERSATION, - (MPARAM)pDragItem->ulItemID, - (MPARAM)DMFL_TARGETSUCCESSFUL); - } - } - - DrgDeleteDraginfoStrHandles(pDragInfo); - DrgFreeDraginfo(pDragInfo); - - SDL_SendDropComplete(pWinData->window); - - return (MRESULT)FALSE; -} - -static MRESULT EXPENTRY wndFrameProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2) -{ - HWND hwndClient = WinQueryWindow(hwnd, QW_BOTTOM); - WINDATA * pWinData = (WINDATA *)WinQueryWindowULong(hwndClient, 0); - - if (pWinData == NULL) - return WinDefWindowProc(hwnd, msg, mp1, mp2); - - /* Send a SDL_SYSWMEVENT if the application wants them */ - if (SDL_GetEventState(SDL_SYSWMEVENT) == SDL_ENABLE) { - SDL_SysWMmsg wmmsg; - - SDL_VERSION(&wmmsg.version); - wmmsg.subsystem = SDL_SYSWM_OS2; - wmmsg.msg.os2.fFrame = TRUE; - wmmsg.msg.os2.hwnd = hwnd; - wmmsg.msg.os2.msg = msg; - wmmsg.msg.os2.mp1 = mp1; - wmmsg.msg.os2.mp2 = mp2; - SDL_SendSysWMEvent(&wmmsg); - } - - switch (msg) { - case WM_MINMAXFRAME: - if ((((PSWP)mp1)->fl & SWP_RESTORE) != 0) { - pWinData->lSkipWMMove += 2; - SDL_SendWindowEvent(pWinData->window, SDL_WINDOWEVENT_RESTORED, 0, 0); - } - if ((((PSWP)mp1)->fl & SWP_MINIMIZE) != 0) { - pWinData->lSkipWMSize++; - pWinData->lSkipWMMove += 2; - SDL_SendWindowEvent(pWinData->window, SDL_WINDOWEVENT_MINIMIZED, 0, 0); - } - if ((((PSWP)mp1)->fl & SWP_MAXIMIZE) != 0) { - SDL_SendWindowEvent(pWinData->window, SDL_WINDOWEVENT_MAXIMIZED, 0, 0); - } - break; - - case WM_ADJUSTFRAMEPOS: - if (pWinData->lSkipWMAdjustFramePos > 0) { - pWinData->lSkipWMAdjustFramePos++; - break; - } - if ((pWinData->window->flags & SDL_WINDOW_FULLSCREEN) != 0 && - (((PSWP)mp1)->fl & SWP_RESTORE) != 0) { - /* Keep fullscreen window size on restore. */ - RECTL rectl; - - rectl.xLeft = 0; - rectl.yBottom = 0; - rectl.xRight = WinQuerySysValue(HWND_DESKTOP, SV_CXSCREEN); - rectl.yTop = WinQuerySysValue(HWND_DESKTOP, SV_CYSCREEN); - WinCalcFrameRect(hwnd, &rectl, FALSE); - ((PSWP)mp1)->x = rectl.xLeft; - ((PSWP)mp1)->y = rectl.yBottom; - ((PSWP)mp1)->cx = rectl.xRight - rectl.xLeft; - ((PSWP)mp1)->cy = rectl.yTop - rectl.yBottom; - } - if ((((PSWP)mp1)->fl & (SWP_SIZE | SWP_MINIMIZE)) == SWP_SIZE) { - if ((pWinData->window->flags & SDL_WINDOW_FULLSCREEN) != 0) { - /* SDL_WINDOW_FULLSCREEN_DESKTOP have flag SDL_WINDOW_FULLSCREEN... */ - if (SDL_IsShapedWindow(pWinData->window)) - OS2_ResizeWindowShape(pWinData->window); - break; - } - if ((SDL_GetWindowFlags(pWinData->window) & SDL_WINDOW_RESIZABLE) != 0) { - RECTL rectl; - int iMinW, iMinH, iMaxW, iMaxH; - int iWinW, iWinH; - - rectl.xLeft = 0; - rectl.yBottom = 0; - SDL_GetWindowSize(pWinData->window, - (int *)&rectl.xRight, (int *)&rectl.yTop); - iWinW = rectl.xRight; - iWinH = rectl.yTop; - - SDL_GetWindowMinimumSize(pWinData->window, &iMinW, &iMinH); - SDL_GetWindowMaximumSize(pWinData->window, &iMaxW, &iMaxH); - - if (iWinW < iMinW) - rectl.xRight = iMinW; - else if (iMaxW != 0 && iWinW > iMaxW) - rectl.xRight = iMaxW; - - if (iWinH < iMinH) - rectl.yTop = iMinW; - else if (iMaxH != 0 && iWinH > iMaxH) - rectl.yTop = iMaxH; - - if (rectl.xRight == iWinW && rectl.yTop == iWinH) { - if (SDL_IsShapedWindow(pWinData->window)) - OS2_ResizeWindowShape(pWinData->window); - break; - } - - WinCalcFrameRect(hwnd, &rectl, FALSE); - ((PSWP)mp1)->cx = rectl.xRight - rectl.xLeft; - ((PSWP)mp1)->cy = rectl.yTop - rectl.yBottom; - } - } - break; - } - - return pWinData->fnWndFrameProc(hwnd, msg, mp1, mp2); -} - -static MRESULT EXPENTRY wndProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2) -{ - WINDATA *pWinData = (WINDATA *)WinQueryWindowULong(hwnd, 0); - - if (pWinData == NULL) - return WinDefWindowProc(hwnd, msg, mp1, mp2); - - /* Send a SDL_SYSWMEVENT if the application wants them */ - if (SDL_GetEventState(SDL_SYSWMEVENT) == SDL_ENABLE) { - SDL_SysWMmsg wmmsg; - - SDL_VERSION(&wmmsg.version); - wmmsg.subsystem = SDL_SYSWM_OS2; - wmmsg.msg.os2.fFrame = FALSE; - wmmsg.msg.os2.hwnd = hwnd; - wmmsg.msg.os2.msg = msg; - wmmsg.msg.os2.mp1 = mp1; - wmmsg.msg.os2.mp2 = mp2; - SDL_SendSysWMEvent(&wmmsg); - } - - switch (msg) { - case WM_CLOSE: - case WM_QUIT: - SDL_SendWindowEvent(pWinData->window, SDL_WINDOWEVENT_CLOSE, 0, 0); - if (pWinData->fnUserWndProc == NULL) - return (MRESULT)FALSE; - break; - - case WM_PAINT: - _wmPaint(pWinData, hwnd); - break; - - case WM_SHOW: - SDL_SendWindowEvent(pWinData->window, (SHORT1FROMMP(mp1) == 0)? - SDL_WINDOWEVENT_HIDDEN : - SDL_WINDOWEVENT_SHOWN , - 0, 0); - break; - - case WM_UPDATEFRAME: - /* Return TRUE - no further action for the frame control window procedure */ - return (MRESULT)TRUE; - - case WM_ACTIVATE: - if ((BOOL)mp1) { - POINTL pointl; - - if (SDL_GetKeyboardFocus() != pWinData->window) - SDL_SetKeyboardFocus(pWinData->window); - - WinQueryPointerPos(HWND_DESKTOP, &pointl); - WinMapWindowPoints(HWND_DESKTOP, pWinData->hwnd, &pointl, 1); - SDL_SendMouseMotion(pWinData->window, 0, 0, - pointl.x, pWinData->window->h - pointl.y - 1); - } else { - if (SDL_GetKeyboardFocus() == pWinData->window) - SDL_SetKeyboardFocus(NULL); - - WinSetCapture(HWND_DESKTOP, NULLHANDLE); - } - break; - - case WM_MOUSEMOVE: - WinSetPointer(HWND_DESKTOP, hptrCursor); - - if (pWinData->lSkipWMMouseMove > 0) - pWinData->lSkipWMMouseMove--; - else { - _wmMouseMove(pWinData, SHORT1FROMMP(mp1), SHORT2FROMMP(mp1)); - } - return (MRESULT)FALSE; - - case WM_BUTTON1DOWN: - case WM_BUTTON1DBLCLK: - _wmMouseButton(pWinData, 0, TRUE); - break; - - case WM_BUTTON1UP: - _wmMouseButton(pWinData, 0, FALSE); - break; - - case WM_BUTTON2DOWN: - case WM_BUTTON2DBLCLK: - _wmMouseButton(pWinData, 1, TRUE); - break; - - case WM_BUTTON2UP: - _wmMouseButton(pWinData, 1, FALSE); - break; - - case WM_BUTTON3DOWN: - case WM_BUTTON3DBLCLK: - _wmMouseButton(pWinData, 2, TRUE); - break; - - case WM_BUTTON3UP: - _wmMouseButton(pWinData, 2, FALSE); - break; - - case WM_TRANSLATEACCEL: - /* ALT and acceleration keys not allowed (must be processed in WM_CHAR) */ - if (mp1 == NULL || ((PQMSG)mp1)->msg != WM_CHAR) - break; - return (MRESULT)FALSE; - - case WM_CHAR: - _wmChar(pWinData, mp1, mp2); - break; - - case WM_SIZE: - if (pWinData->lSkipWMSize > 0) - pWinData->lSkipWMSize--; - else { - if ((pWinData->window->flags & SDL_WINDOW_FULLSCREEN) == 0) { - SDL_SendWindowEvent(pWinData->window, SDL_WINDOWEVENT_RESIZED, - SHORT1FROMMP(mp2), SHORT2FROMMP(mp2)); - } else { - pWinData->lSkipWMVRNEnabled++; - } - } - break; - - case WM_MOVE: - if (pWinData->lSkipWMMove > 0) - pWinData->lSkipWMMove--; - else if ((pWinData->window->flags & SDL_WINDOW_FULLSCREEN) == 0) { - _wmMove(pWinData); - } - break; - - case WM_VRNENABLED: - if (pWinData->lSkipWMVRNEnabled > 0) - pWinData->lSkipWMVRNEnabled--; - else { - _setVisibleRegion(pWinData, TRUE); - } - return (MRESULT)TRUE; - - case WM_VRNDISABLED: - _setVisibleRegion(pWinData, FALSE); - return (MRESULT)TRUE; - - case DM_DRAGOVER: - return _wmDragOver(pWinData, (PDRAGINFO)PVOIDFROMMP(mp1)); - - case DM_DROP: - return _wmDrop(pWinData, (PDRAGINFO)PVOIDFROMMP(mp1)); - } - - return (pWinData->fnUserWndProc != NULL)? - pWinData->fnUserWndProc(hwnd, msg, mp1, mp2) : - WinDefWindowProc(hwnd, msg, mp1, mp2); -} - - -/* SDL routines. - * ------------ - */ - -static void OS2_PumpEvents(_THIS) -{ - SDL_VideoData *pVData = (SDL_VideoData *)_this->driverdata; - QMSG qmsg; - - if (WinPeekMsg(pVData->hab, &qmsg, NULLHANDLE, 0, 0, PM_REMOVE)) - WinDispatchMsg(pVData->hab, &qmsg); -} - -static WINDATA *_setupWindow(_THIS, SDL_Window *window, HWND hwndFrame, - HWND hwnd) -{ - SDL_VideoData *pVData = (SDL_VideoData *)_this->driverdata; - WINDATA *pWinData = SDL_calloc(1, sizeof(WINDATA)); - - if (pWinData == NULL) { - SDL_OutOfMemory(); - return NULL; - } - pWinData->hwnd = hwnd; - pWinData->hwndFrame = hwndFrame; - pWinData->window = window; - window->driverdata = pWinData; - - WinSetWindowULong(hwnd, 0, (ULONG)pWinData); - pWinData->fnWndFrameProc = WinSubclassWindow(hwndFrame, wndFrameProc); - - pWinData->pOutput = pVData->pOutput; - pWinData->pVOData = pVData->pOutput->Open(); - - WinSetVisibleRegionNotify(hwnd, TRUE); - - return pWinData; -} - -static int OS2_CreateWindow(_THIS, SDL_Window *window) -{ - RECTL rectl; - HWND hwndFrame, hwnd; - SDL_DisplayMode *pSDLDisplayMode = _getDisplayModeForSDLWindow(window); - ULONG ulFrameFlags = FCF_TASKLIST | FCF_TITLEBAR | FCF_SYSMENU | - FCF_MINBUTTON | FCF_SHELLPOSITION; - ULONG ulSWPFlags = SWP_SIZE | SWP_SHOW | SWP_ZORDER | SWP_ACTIVATE; - WINDATA *pWinData; - - if (pSDLDisplayMode == NULL) - return -1; - - /* Create a PM window */ - if ((window->flags & SDL_WINDOW_RESIZABLE) != 0) - ulFrameFlags |= FCF_SIZEBORDER | FCF_DLGBORDER | FCF_MAXBUTTON; - else if ((window->flags & SDL_WINDOW_BORDERLESS) == 0) - ulFrameFlags |= FCF_DLGBORDER; - - if ((window->flags & SDL_WINDOW_MAXIMIZED) != 0) - ulSWPFlags |= SWP_MAXIMIZE; - else if ((window->flags & SDL_WINDOW_MINIMIZED) != 0) - ulSWPFlags |= SWP_MINIMIZE; - - hwndFrame = WinCreateStdWindow(HWND_DESKTOP, 0, &ulFrameFlags, - WIN_CLIENT_CLASS, "SDL3", 0, 0, 0, &hwnd); - if (hwndFrame == NULLHANDLE) - return SDL_SetError("Couldn't create window"); - - /* Setup window data and frame window procedure */ - pWinData = _setupWindow(_this, window, hwndFrame, hwnd); - if (pWinData == NULL) { - WinDestroyWindow(hwndFrame); - return -1; - } - - /* Show window */ - rectl.xLeft = 0; - rectl.yBottom = 0; - rectl.xRight = window->w; - rectl.yTop = window->h; - WinCalcFrameRect(hwndFrame, &rectl, FALSE); - pWinData->lSkipWMSize++; - pWinData->lSkipWMMove++; - WinSetWindowPos(hwndFrame, HWND_TOP, rectl.xLeft, rectl.yBottom, - rectl.xRight - rectl.xLeft, rectl.yTop - rectl.yBottom, - ulSWPFlags); - - rectl.xLeft = 0; - rectl.yBottom = 0; - WinMapWindowPoints(hwnd, HWND_DESKTOP, (PPOINTL)&rectl, 1); - window->x = rectl.xLeft; - window->y = pSDLDisplayMode->h - (rectl.yBottom + window->h); - - window->flags |= SDL_WINDOW_SHOWN; - - return 0; -} - -static int OS2_CreateWindowFrom(_THIS, SDL_Window *window, const void *data) -{ - SDL_VideoData *pVData = (SDL_VideoData *)_this->driverdata; - CHAR acBuf[256]; - CLASSINFO stCI; - HWND hwndUser = (HWND)data; - HWND hwndFrame, hwnd; - ULONG cbText; - PSZ pszText; - WINDATA *pWinData; - SDL_DisplayMode *pSDLDisplayMode = _getDisplayModeForSDLWindow(window); - SWP swp; - POINTL pointl; - - debug_os2("Enter"); - if (pSDLDisplayMode == NULL) - return -1; - - /* User can accept client OR frame window handle. - * Get client and frame window handles. */ - WinQueryClassName(hwndUser, sizeof(acBuf), acBuf); - if (!WinQueryClassInfo(pVData->hab, acBuf, &stCI)) - return SDL_SetError("Cannot get user window class information"); - - if ((stCI.flClassStyle & CS_FRAME) == 0) { - /* Client window handle is specified */ - hwndFrame = WinQueryWindow(hwndUser, QW_PARENT); - if (hwndFrame == NULLHANDLE) - return SDL_SetError("Cannot get parent window handle"); - - if ((ULONG)WinSendMsg(hwndFrame, WM_QUERYFRAMEINFO, 0, 0) == 0) - return SDL_SetError("Parent window is not a frame window"); - - hwnd = hwndUser; - } else { - /* Frame window handle is specified */ - hwnd = WinWindowFromID(hwndUser, FID_CLIENT); - if (hwnd == NULLHANDLE) - return SDL_SetError("Cannot get client window handle"); - - hwndFrame = hwndUser; - - WinQueryClassName(hwnd, sizeof(acBuf), acBuf); - if (!WinQueryClassInfo(pVData->hab, acBuf, &stCI)) - return SDL_SetError("Cannot get client window class information"); - } - - /* Check window's reserved storage */ - if (stCI.cbWindowData < sizeof(ULONG)) - return SDL_SetError("Reserved storage of window must be at least %u bytes", sizeof(ULONG)); - - /* Set SDL-window title */ - cbText = WinQueryWindowTextLength(hwndFrame); - pszText = SDL_stack_alloc(CHAR, cbText + 1); - - if (pszText != NULL) - cbText = (pszText != NULL)? WinQueryWindowText(hwndFrame, cbText, pszText) : 0; - - if (cbText != 0) - window->title = OS2_SysToUTF8(pszText); - - if (pszText != NULL) { - SDL_stack_free(pszText); - } - - /* Set SDL-window flags */ - window->flags &= ~(SDL_WINDOW_SHOWN | SDL_WINDOW_BORDERLESS | - SDL_WINDOW_RESIZABLE | SDL_WINDOW_MAXIMIZED | - SDL_WINDOW_MINIMIZED | SDL_WINDOW_INPUT_FOCUS); - - if (WinIsWindowVisible(hwnd)) - window->flags |= SDL_WINDOW_SHOWN; - - WinSendMsg(hwndFrame, WM_QUERYBORDERSIZE, MPFROMP(&pointl), 0); - if (pointl.y == WinQuerySysValue(HWND_DESKTOP, SV_CYSIZEBORDER)) - window->flags |= SDL_WINDOW_RESIZABLE; - else if (pointl.y <= WinQuerySysValue(HWND_DESKTOP, SV_CYBORDER)) - window->flags |= SDL_WINDOW_BORDERLESS; - - WinQueryWindowPos(hwndFrame, &swp); - - if ((swp.fl & SWP_MAXIMIZE) != 0) - window->flags |= SDL_WINDOW_MAXIMIZED; - if ((swp.fl & SWP_MINIMIZE) != 0) - window->flags |= SDL_WINDOW_MINIMIZED; - - pointl.x = 0; - pointl.y = 0; - WinMapWindowPoints(hwnd, HWND_DESKTOP, &pointl, 1); - window->x = pointl.x; - window->y = pSDLDisplayMode->h - (pointl.y + swp.cy); - - WinQueryWindowPos(hwnd, &swp); - window->w = swp.cx; - window->h = swp.cy; - - /* Setup window data and frame window procedure */ - pWinData = _setupWindow(_this, window, hwndFrame, hwnd); - if (pWinData == NULL) { - SDL_free(window->title); - window->title = NULL; - return -1; - } - pWinData->fnUserWndProc = WinSubclassWindow(hwnd, wndProc); - - if (WinQueryActiveWindow(HWND_DESKTOP) == hwndFrame) - SDL_SetKeyboardFocus(window); - - return 0; -} - -static void OS2_DestroyWindow(_THIS, SDL_Window * window) -{ - SDL_VideoData *pVData = (SDL_VideoData *)_this->driverdata; - WINDATA *pWinData = (WINDATA *)window->driverdata; - - debug_os2("Enter"); - if (pWinData == NULL) - return; - - if (pWinData->hrgnShape != NULLHANDLE) { - HPS hps = WinGetPS(pWinData->hwnd); - GpiDestroyRegion(hps, pWinData->hrgnShape); - WinReleasePS(hps); - } - - if (window->shaper) { - SDL_free(window->shaper); - window->shaper = NULL; - } - - if (pWinData->fnUserWndProc == NULL) { - /* Window was created by SDL (OS2_CreateWindow()), - * not by user (OS2_CreateWindowFrom()) */ - WinDestroyWindow(pWinData->hwndFrame); - } else { - WinSetWindowULong(pWinData->hwnd, 0, 0); - } - - if ((pVData != NULL) && (pWinData->pVOData != NULL)) { - pVData->pOutput->Close(pWinData->pVOData); - pWinData->pVOData = NULL; - } - - if (pWinData->hptrIcon != NULLHANDLE) { - WinDestroyPointer(pWinData->hptrIcon); - pWinData->hptrIcon = NULLHANDLE; - } - - SDL_free(pWinData); - window->driverdata = NULL; -} - -static void OS2_SetWindowTitle(_THIS, SDL_Window *window) -{ - PSZ pszTitle = (window->title == NULL)? NULL : OS2_UTF8ToSys(window->title); - - WinSetWindowText(((WINDATA *)window->driverdata)->hwndFrame, pszTitle); - SDL_free(pszTitle); -} - -static void OS2_SetWindowIcon(_THIS, SDL_Window *window, SDL_Surface *icon) -{ - WINDATA *pWinData = (WINDATA *)window->driverdata; - HPOINTER hptr = utilCreatePointer(icon, 0, 0); - - if (hptr == NULLHANDLE) - return; - - /* Destroy old icon */ - if (pWinData->hptrIcon != NULLHANDLE) - WinDestroyPointer(pWinData->hptrIcon); - - /* Set new window icon */ - pWinData->hptrIcon = hptr; - if (!WinSendMsg(pWinData->hwndFrame, WM_SETICON, MPFROMLONG(hptr), 0)) { - debug_os2("Cannot set icon for the window"); - } -} - -static void OS2_SetWindowPosition(_THIS, SDL_Window *window) -{ - WINDATA *pWinData = (WINDATA *)window->driverdata; - RECTL rectl; - ULONG ulFlags; - SDL_DisplayMode *pSDLDisplayMode = _getDisplayModeForSDLWindow(window); - - debug_os2("Enter"); - if (pSDLDisplayMode == NULL) - return; - - rectl.xLeft = 0; - rectl.yBottom = 0; - rectl.xRight = window->w; - rectl.yTop = window->h; - WinCalcFrameRect(pWinData->hwndFrame, &rectl, FALSE); - - if (SDL_ShouldAllowTopmost() && - (window->flags & (SDL_WINDOW_FULLSCREEN|SDL_WINDOW_INPUT_FOCUS)) == - (SDL_WINDOW_FULLSCREEN|SDL_WINDOW_INPUT_FOCUS) ) - ulFlags = SWP_ZORDER | SWP_MOVE | SWP_SIZE; - else - ulFlags = SWP_MOVE | SWP_SIZE; - - pWinData->lSkipWMSize++; - pWinData->lSkipWMMove++; - WinSetWindowPos(pWinData->hwndFrame, HWND_TOP, - window->x + rectl.xLeft, - (pSDLDisplayMode->h - window->y) - window->h + rectl.yBottom, - rectl.xRight - rectl.xLeft, rectl.yTop - rectl.yBottom, - ulFlags); -} - -static void OS2_SetWindowSize(_THIS, SDL_Window *window) -{ - debug_os2("Enter"); - OS2_SetWindowPosition(_this, window); -} - -static void OS2_ShowWindow(_THIS, SDL_Window *window) -{ - WINDATA *pWinData = (WINDATA *)window->driverdata; - - debug_os2("Enter"); - WinShowWindow(pWinData->hwndFrame, TRUE); -} - -static void OS2_HideWindow(_THIS, SDL_Window *window) -{ - WINDATA *pWinData = (WINDATA *)window->driverdata; - - debug_os2("Enter"); - WinShowWindow(pWinData->hwndFrame, FALSE); -} - -static void OS2_RaiseWindow(_THIS, SDL_Window *window) -{ - debug_os2("Enter"); - OS2_SetWindowPosition(_this, window); -} - -static void OS2_MaximizeWindow(_THIS, SDL_Window *window) -{ - WINDATA *pWinData = (WINDATA *)window->driverdata; - - debug_os2("Enter"); - WinSetWindowPos(pWinData->hwndFrame, HWND_TOP, 0, 0, 0, 0, SWP_MAXIMIZE); -} - -static void OS2_MinimizeWindow(_THIS, SDL_Window *window) -{ - WINDATA *pWinData = (WINDATA *)window->driverdata; - - debug_os2("Enter"); - WinSetWindowPos(pWinData->hwndFrame, HWND_TOP, 0, 0, 0, 0, SWP_MINIMIZE | SWP_DEACTIVATE); -} - -static void OS2_RestoreWindow(_THIS, SDL_Window *window) -{ - WINDATA *pWinData = (WINDATA *)window->driverdata; - - debug_os2("Enter"); - WinSetWindowPos(pWinData->hwndFrame, HWND_TOP, 0, 0, 0, 0, SWP_RESTORE); -} - -static void OS2_SetWindowBordered(_THIS, SDL_Window * window, - SDL_bool bordered) -{ - WINDATA *pWinData = (WINDATA *)window->driverdata; - ULONG ulStyle = WinQueryWindowULong(pWinData->hwndFrame, QWL_STYLE); - RECTL rectl; - - debug_os2("Enter"); - - /* New frame sytle */ - if (bordered) - ulStyle |= ((window->flags & SDL_WINDOW_RESIZABLE) != 0) ? FS_SIZEBORDER : FS_DLGBORDER; - else - ulStyle &= ~(FS_SIZEBORDER | FS_BORDER | FS_DLGBORDER); - - /* Save client window position */ - WinQueryWindowRect(pWinData->hwnd, &rectl); - WinMapWindowPoints(pWinData->hwnd, HWND_DESKTOP, (PPOINTL)&rectl, 2); - - /* Change the frame */ - WinSetWindowULong(pWinData->hwndFrame, QWL_STYLE, ulStyle); - WinSendMsg(pWinData->hwndFrame, WM_UPDATEFRAME, MPFROMLONG(FCF_BORDER), 0); - - /* Restore client window position */ - WinCalcFrameRect(pWinData->hwndFrame, &rectl, FALSE); - pWinData->lSkipWMMove++; - WinSetWindowPos(pWinData->hwndFrame, HWND_TOP, rectl.xLeft, rectl.yBottom, - rectl.xRight - rectl.xLeft, - rectl.yTop - rectl.yBottom, - SWP_SIZE | SWP_MOVE | SWP_NOADJUST); -} - -static void OS2_SetWindowFullscreen(_THIS, SDL_Window *window, - SDL_VideoDisplay *display, - SDL_bool fullscreen) -{ - RECTL rectl; - ULONG ulFlags; - WINDATA *pWinData = (WINDATA *)window->driverdata; - SDL_DisplayMode *pSDLDisplayMode = &display->current_mode; - - debug_os2("Enter, fullscreen: %u", fullscreen); - - if (pSDLDisplayMode == NULL) - return; - - if (SDL_ShouldAllowTopmost() && - (window->flags & (SDL_WINDOW_FULLSCREEN|SDL_WINDOW_INPUT_FOCUS)) == (SDL_WINDOW_FULLSCREEN|SDL_WINDOW_INPUT_FOCUS)) - ulFlags = SWP_SIZE | SWP_MOVE | SWP_ZORDER | SWP_NOADJUST; - else - ulFlags = SWP_SIZE | SWP_MOVE | SWP_NOADJUST; - - if (fullscreen) { - rectl.xLeft = 0; - rectl.yBottom = 0; - rectl.xRight = pSDLDisplayMode->w; - rectl.yTop = pSDLDisplayMode->h; - /* We need send the restore command now to allow WinCalcFrameRect() */ - WinSetWindowPos(pWinData->hwndFrame, HWND_TOP, 0, 0, 0, 0, SWP_RESTORE); - } else { - pWinData->lSkipWMMove++; - rectl.xLeft = window->windowed.x; - rectl.yTop = pSDLDisplayMode->h - window->windowed.y; - rectl.xRight = rectl.xLeft + window->windowed.w; - rectl.yBottom = rectl.yTop - window->windowed.h; - } - - if (!WinCalcFrameRect(pWinData->hwndFrame, &rectl, FALSE)) { - debug_os2("WinCalcFrameRect() failed"); - } - else if (!WinSetWindowPos(pWinData->hwndFrame, HWND_TOP, - rectl.xLeft, rectl.yBottom, - rectl.xRight - rectl.xLeft, rectl.yTop - rectl.yBottom, - ulFlags)) { - debug_os2("WinSetWindowPos() failed"); - } -} - -static SDL_bool OS2_GetWindowWMInfo(_THIS, SDL_Window * window, - struct SDL_SysWMinfo *info) -{ - WINDATA *pWinData = (WINDATA *)window->driverdata; - - if (info->version.major <= SDL_MAJOR_VERSION) { - info->subsystem = SDL_SYSWM_OS2; - info->info.os2.hwnd = pWinData->hwnd; - info->info.os2.hwndFrame = pWinData->hwndFrame; - return SDL_TRUE; - } - - SDL_SetError("Application not compiled with SDL %u", - SDL_MAJOR_VERSION); - return SDL_FALSE; -} - -static void OS2_OnWindowEnter(_THIS, SDL_Window * window) -{ -} - -static int OS2_SetWindowHitTest(SDL_Window *window, SDL_bool enabled) -{ - debug_os2("Enter"); - return 0; -} - -static void OS2_SetWindowMouseGrab(_THIS, SDL_Window *window, SDL_bool grabbed) -{ - WINDATA *pWinData = (WINDATA *)window->driverdata; - - debug_os2("Enter, %u", grabbed); - _mouseCheck(pWinData); -} - - -/* Shaper - */ -typedef struct _SHAPERECTS { - PRECTL pRects; - ULONG cRects; - ULONG ulWinHeight; -} SHAPERECTS; - -static void _combineRectRegions(SDL_ShapeTree *node, void *closure) -{ - SHAPERECTS *pShapeRects = (SHAPERECTS *)closure; - PRECTL pRect; - - /* Expand rectangles list */ - if ((pShapeRects->cRects & 0x0F) == 0) { - pRect = SDL_realloc(pShapeRects->pRects, (pShapeRects->cRects + 0x10) * sizeof(RECTL)); - if (pRect == NULL) - return; - pShapeRects->pRects = pRect; - } - - /* Add a new rectangle */ - pRect = &pShapeRects->pRects[pShapeRects->cRects]; - pShapeRects->cRects++; - /* Fill rectangle data */ - pRect->xLeft = node->data.shape.x; - pRect->yTop = pShapeRects->ulWinHeight - node->data.shape.y; - pRect->xRight += node->data.shape.w; - pRect->yBottom = pRect->yTop - node->data.shape.h; -} - -static SDL_WindowShaper* OS2_CreateShaper(SDL_Window * window) -{ - SDL_WindowShaper* pSDLShaper = SDL_malloc(sizeof(SDL_WindowShaper)); - - debug_os2("Enter"); - pSDLShaper->window = window; - pSDLShaper->mode.mode = ShapeModeDefault; - pSDLShaper->mode.parameters.binarizationCutoff = 1; - pSDLShaper->userx = 0; - pSDLShaper->usery = 0; - pSDLShaper->driverdata = (SDL_ShapeTree *)NULL; - window->shaper = pSDLShaper; - - if (OS2_ResizeWindowShape(window) != 0) { - window->shaper = NULL; - SDL_free(pSDLShaper); - return NULL; - } - - return pSDLShaper; -} - -static int OS2_SetWindowShape(SDL_WindowShaper *shaper, SDL_Surface *shape, - SDL_WindowShapeMode *shape_mode) -{ - SDL_ShapeTree *pShapeTree; - WINDATA *pWinData; - SHAPERECTS stShapeRects; - HPS hps; - - debug_os2("Enter"); - if (shaper == NULL || shape == NULL || - (shape->format->Amask == 0 && shape_mode->mode != ShapeModeColorKey) || - shape->w != shaper->window->w || shape->h != shaper->window->h) { - return SDL_INVALID_SHAPE_ARGUMENT; - } - - if (shaper->driverdata != NULL) - SDL_FreeShapeTree((SDL_ShapeTree **)&shaper->driverdata); - - pShapeTree = SDL_CalculateShapeTree(*shape_mode, shape); - shaper->driverdata = pShapeTree; - - SDL_zero(stShapeRects); - stShapeRects.ulWinHeight = shaper->window->h; - SDL_TraverseShapeTree(pShapeTree, &_combineRectRegions, &stShapeRects); - - pWinData = (WINDATA *)shaper->window->driverdata; - hps = WinGetPS(pWinData->hwnd); - - if (pWinData->hrgnShape != NULLHANDLE) - GpiDestroyRegion(hps, pWinData->hrgnShape); - - pWinData->hrgnShape = (stShapeRects.pRects == NULL) ? NULLHANDLE : - GpiCreateRegion(hps, stShapeRects.cRects, stShapeRects.pRects); - - WinReleasePS(hps); - SDL_free(stShapeRects.pRects); - WinSendMsg(pWinData->hwnd, WM_VRNENABLED, 0, 0); - - return 0; -} - -static int OS2_ResizeWindowShape(SDL_Window *window) -{ - debug_os2("Enter"); - if (window == NULL) - return -1; - - if (window->x != -1000) { - if (window->shaper->driverdata != NULL) - SDL_FreeShapeTree((SDL_ShapeTree **)window->shaper->driverdata); - - if (window->shaper->hasshape == SDL_TRUE) { - window->shaper->userx = window->x; - window->shaper->usery = window->y; - SDL_SetWindowPosition(window, -1000, -1000); - } - } - - return 0; -} - - -/* Frame buffer - */ -static void OS2_DestroyWindowFramebuffer(_THIS, SDL_Window *window) -{ - WINDATA *pWinData = (WINDATA *)window->driverdata; - - debug_os2("Enter"); - if (pWinData != NULL && pWinData->pVOData != NULL) - pWinData->pOutput->VideoBufFree(pWinData->pVOData); -} - -static int OS2_CreateWindowFramebuffer(_THIS, SDL_Window *window, - Uint32 *format, void **pixels, - int *pitch) -{ - WINDATA *pWinData = (WINDATA *)window->driverdata; - SDL_VideoDisplay *pSDLDisplay = SDL_GetDisplayForWindow(window); - SDL_DisplayMode *pSDLDisplayMode; - MODEDATA *pModeData; - ULONG ulWidth, ulHeight; - - debug_os2("Enter"); - if (pSDLDisplay == NULL) { - debug_os2("No display for the window"); - return -1; - } - - pSDLDisplayMode = &pSDLDisplay->current_mode; - pModeData = (MODEDATA *)pSDLDisplayMode->driverdata; - if (pModeData == NULL) - return SDL_SetError("No mode data for the display"); - - SDL_GetWindowSize(window, (int *)&ulWidth, (int *)&ulHeight); - debug_os2("Window size: %u x %u", ulWidth, ulHeight); - - *pixels = pWinData->pOutput->VideoBufAlloc( - pWinData->pVOData, ulWidth, ulHeight, pModeData->ulDepth, - pModeData->fccColorEncoding, (PULONG)pitch); - if (*pixels == NULL) - return -1; - - *format = pSDLDisplayMode->format; - debug_os2("Pitch: %u, frame buffer: 0x%X.", *pitch, *pixels); - WinSendMsg(pWinData->hwnd, WM_VRNENABLED, 0, 0); - - return 0; -} - -static int OS2_UpdateWindowFramebuffer(_THIS, SDL_Window * window, - const SDL_Rect *rects, int numrects) -{ - WINDATA *pWinData = (WINDATA *)window->driverdata; - - return pWinData->pOutput->Update(pWinData->pVOData, pWinData->hwnd, - (SDL_Rect *)rects, (ULONG)numrects) - ? 0 : -1; -} - - -/* Clipboard - */ -static int OS2_SetClipboardText(_THIS, const char *text) -{ - SDL_VideoData *pVData = (SDL_VideoData *)_this->driverdata; - PSZ pszClipboard; - PSZ pszText = (text == NULL)? NULL : OS2_UTF8ToSys(text); - ULONG cbText; - ULONG ulRC; - BOOL fSuccess; - - debug_os2("Enter"); - if (pszText == NULL) - return -1; - cbText = SDL_strlen(pszText) + 1; - - ulRC = DosAllocSharedMem((PPVOID)&pszClipboard, 0, cbText, - PAG_COMMIT | PAG_READ | PAG_WRITE | - OBJ_GIVEABLE | OBJ_GETTABLE | OBJ_TILE); - if (ulRC != NO_ERROR) { - debug_os2("DosAllocSharedMem() failed, rc = %u", ulRC); - SDL_free(pszText); - return -1; - } - - SDL_memcpy(pszClipboard, pszText, cbText); - SDL_free(pszText); - - if (!WinOpenClipbrd(pVData->hab)) { - debug_os2("WinOpenClipbrd() failed"); - fSuccess = FALSE; - } else { - WinEmptyClipbrd(pVData->hab); - fSuccess = WinSetClipbrdData(pVData->hab, (ULONG)pszClipboard, CF_TEXT, CFI_POINTER); - if (!fSuccess) { - debug_os2("WinOpenClipbrd() failed"); - } - WinCloseClipbrd(pVData->hab); - } - - if (!fSuccess) { - DosFreeMem(pszClipboard); - return -1; - } - return 0; -} - -static char *OS2_GetClipboardText(_THIS) -{ - SDL_VideoData *pVData = (SDL_VideoData *)_this->driverdata; - PSZ pszClipboard = NULL; - - if (!WinOpenClipbrd(pVData->hab)) { - debug_os2("WinOpenClipbrd() failed"); - } else { - pszClipboard = (PSZ)WinQueryClipbrdData(pVData->hab, CF_TEXT); - if (pszClipboard != NULL) - pszClipboard = OS2_SysToUTF8(pszClipboard); - WinCloseClipbrd(pVData->hab); - } - - return (pszClipboard == NULL) ? SDL_strdup("") : pszClipboard; -} - -static SDL_bool OS2_HasClipboardText(_THIS) -{ - SDL_VideoData *pVData = (SDL_VideoData *)_this->driverdata; - PSZ pszClipboard; - SDL_bool result; - - if (!WinOpenClipbrd(pVData->hab)) { - debug_os2("WinOpenClipbrd() failed"); - return SDL_FALSE; - } - - pszClipboard = (PSZ)WinQueryClipbrdData(pVData->hab, CF_TEXT); - result = (pszClipboard && *pszClipboard) ? SDL_TRUE : SDL_FALSE; - WinCloseClipbrd(pVData->hab); - - return result; -} - - -static int OS2_VideoInit(_THIS) -{ - SDL_VideoData *pVData; - PTIB tib; - PPIB pib; - - /* Create SDL video driver private data */ - pVData = SDL_calloc(1, sizeof(SDL_VideoData)); - if (pVData == NULL) - return SDL_OutOfMemory(); - - /* Change process type code for use Win* API from VIO session */ - DosGetInfoBlocks(&tib, &pib); - if (pib->pib_ultype == 2 || pib->pib_ultype == 0) { - /* VIO windowable or fullscreen protect-mode session */ - pib->pib_ultype = 3; /* Presentation Manager protect-mode session */ - } - - /* PM initialization */ - pVData->hab = WinInitialize(0); - pVData->hmq = WinCreateMsgQueue(pVData->hab, 0); - if (pVData->hmq == NULLHANDLE) { - SDL_free(pVData); - return SDL_SetError("Message queue cannot be created."); - } - - if (!WinRegisterClass(pVData->hab, WIN_CLIENT_CLASS, wndProc, - CS_SIZEREDRAW | CS_MOVENOTIFY | CS_SYNCPAINT, - sizeof(SDL_VideoData*))) { - SDL_free(pVData); - return SDL_SetError("Window class not successfully registered."); - } - - if (SDL_strcasecmp(_this->name, OS2DRIVER_NAME_VMAN) == 0) - pVData->pOutput = &voVMan; - else - pVData->pOutput = &voDive; - - _this->driverdata = pVData; - - /* Add display */ - { - SDL_VideoDisplay stSDLDisplay; - SDL_DisplayMode stSDLDisplayMode; - DISPLAYDATA *pDisplayData; - MODEDATA *pModeData; - VIDEOOUTPUTINFO stVOInfo; - - if (!pVData->pOutput->QueryInfo(&stVOInfo)) { - SDL_free(pVData); - return SDL_SetError("Video mode query failed."); - } - - SDL_zero(stSDLDisplay); SDL_zero(stSDLDisplayMode); - - stSDLDisplayMode.format = _getSDLPixelFormat(stVOInfo.ulBPP, - stVOInfo.fccColorEncoding); - stSDLDisplayMode.w = stVOInfo.ulHorizResolution; - stSDLDisplayMode.h = stVOInfo.ulVertResolution; - stSDLDisplayMode.refresh_rate = 0; - stSDLDisplayMode.driverdata = NULL; - - pModeData = SDL_malloc(sizeof(MODEDATA)); - if (pModeData != NULL) { - pModeData->ulDepth = stVOInfo.ulBPP; - pModeData->fccColorEncoding = stVOInfo.fccColorEncoding; - pModeData->ulScanLineBytes = stVOInfo.ulScanLineSize; - stSDLDisplayMode.driverdata = pModeData; - } - - stSDLDisplay.name = "Primary"; - stSDLDisplay.desktop_mode = stSDLDisplayMode; - stSDLDisplay.current_mode = stSDLDisplayMode; - stSDLDisplay.driverdata = NULL; - stSDLDisplay.num_display_modes = 0; - - pDisplayData = SDL_malloc(sizeof(DISPLAYDATA)); - if (pDisplayData != NULL) { - HPS hps = WinGetPS(HWND_DESKTOP); - HDC hdc = GpiQueryDevice(hps); - - /* May be we can use CAPS_HORIZONTAL_RESOLUTION and - * CAPS_VERTICAL_RESOLUTION - pels per meter? */ - DevQueryCaps(hdc, CAPS_HORIZONTAL_FONT_RES, 1, - (PLONG)&pDisplayData->ulDPIHor); - DevQueryCaps(hdc, CAPS_VERTICAL_FONT_RES, 1, - (PLONG)&pDisplayData->ulDPIVer); - WinReleasePS(hps); - - pDisplayData->ulDPIDiag = SDL_ComputeDiagonalDPI( - stVOInfo.ulHorizResolution, stVOInfo.ulVertResolution, - (float)stVOInfo.ulHorizResolution / pDisplayData->ulDPIHor, - (float)stVOInfo.ulVertResolution / pDisplayData->ulDPIVer); - - stSDLDisplayMode.driverdata = pDisplayData; - } - - SDL_AddVideoDisplay(&stSDLDisplay, SDL_FALSE); - } - - OS2_InitMouse(_this, pVData->hab); - - return 0; -} - -static void OS2_VideoQuit(_THIS) -{ - SDL_VideoData *pVData = (SDL_VideoData *)_this->driverdata; - - OS2_QuitMouse(_this); - - WinDestroyMsgQueue(pVData->hmq); - WinTerminate(pVData->hab); - - /* our caller SDL_VideoQuit() already frees display_modes, driverdata, etc. */ -} - -static int OS2_GetDisplayBounds(_THIS, SDL_VideoDisplay *display, - SDL_Rect *rect) -{ - debug_os2("Enter"); - - rect->x = 0; - rect->y = 0; - rect->w = display->desktop_mode.w; - rect->h = display->desktop_mode.h; - - return 0; -} - -static int OS2_GetDisplayDPI(_THIS, SDL_VideoDisplay *display, float *ddpi, - float *hdpi, float *vdpi) -{ - DISPLAYDATA *pDisplayData = (DISPLAYDATA *)display->driverdata; - - debug_os2("Enter"); - if (pDisplayData == NULL) - return -1; - - if (ddpi != NULL) - *hdpi = pDisplayData->ulDPIDiag; - if (hdpi != NULL) - *hdpi = pDisplayData->ulDPIHor; - if (vdpi != NULL) - *vdpi = pDisplayData->ulDPIVer; - - return 0; -} - -static void OS2_GetDisplayModes(_THIS, SDL_VideoDisplay *display) -{ - SDL_DisplayMode mode; - - debug_os2("Enter"); - SDL_copyp(&mode, &display->current_mode); - mode.driverdata = (MODEDATA *) SDL_malloc(sizeof(MODEDATA)); - if (!mode.driverdata) return; /* yikes.. */ - SDL_memcpy(mode.driverdata, display->current_mode.driverdata, sizeof(MODEDATA)); - SDL_AddDisplayMode(display, &mode); -} - -static int OS2_SetDisplayMode(_THIS, SDL_VideoDisplay *display, - SDL_DisplayMode *mode) -{ - debug_os2("Enter"); - return -1; -} - - -static void OS2_DeleteDevice(SDL_VideoDevice *device) -{ - SDL_free(device); -} - -static SDL_VideoDevice *OS2_CreateDevice(void) -{ - SDL_VideoDevice *device; - - /* Initialize all variables that we clean on shutdown */ - device = (SDL_VideoDevice *)SDL_calloc(1, sizeof(SDL_VideoDevice)); - if (!device) { - SDL_OutOfMemory(); - return NULL; - } - - /* Set the function pointers */ - device->VideoInit = OS2_VideoInit; - device->VideoQuit = OS2_VideoQuit; - device->GetDisplayBounds = OS2_GetDisplayBounds; - device->GetDisplayDPI = OS2_GetDisplayDPI; - device->GetDisplayModes = OS2_GetDisplayModes; - device->SetDisplayMode = OS2_SetDisplayMode; - device->PumpEvents = OS2_PumpEvents; - device->CreateSDLWindow = OS2_CreateWindow; - device->CreateSDLWindowFrom = OS2_CreateWindowFrom; - device->DestroyWindow = OS2_DestroyWindow; - device->SetWindowTitle = OS2_SetWindowTitle; - device->SetWindowIcon = OS2_SetWindowIcon; - device->SetWindowPosition = OS2_SetWindowPosition; - device->SetWindowSize = OS2_SetWindowSize; - device->ShowWindow = OS2_ShowWindow; - device->HideWindow = OS2_HideWindow; - device->RaiseWindow = OS2_RaiseWindow; - device->MaximizeWindow = OS2_MaximizeWindow; - device->MinimizeWindow = OS2_MinimizeWindow; - device->RestoreWindow = OS2_RestoreWindow; - device->SetWindowBordered = OS2_SetWindowBordered; - device->SetWindowFullscreen = OS2_SetWindowFullscreen; - device->GetWindowWMInfo = OS2_GetWindowWMInfo; - device->OnWindowEnter = OS2_OnWindowEnter; - device->SetWindowHitTest = OS2_SetWindowHitTest; - device->SetWindowMouseGrab = OS2_SetWindowMouseGrab; - device->CreateWindowFramebuffer = OS2_CreateWindowFramebuffer; - device->UpdateWindowFramebuffer = OS2_UpdateWindowFramebuffer; - device->DestroyWindowFramebuffer = OS2_DestroyWindowFramebuffer; - - device->SetClipboardText = OS2_SetClipboardText; - device->GetClipboardText = OS2_GetClipboardText; - device->HasClipboardText = OS2_HasClipboardText; - - device->shape_driver.CreateShaper = OS2_CreateShaper; - device->shape_driver.SetWindowShape = OS2_SetWindowShape; - device->shape_driver.ResizeWindowShape = OS2_ResizeWindowShape; - - device->free = OS2_DeleteDevice; - - return device; -} - -static SDL_VideoDevice *OS2DIVE_CreateDevice(void) -{ - VIDEOOUTPUTINFO stVOInfo; - if (!voDive.QueryInfo(&stVOInfo)) { - return NULL; - } - return OS2_CreateDevice(); -} - -static SDL_VideoDevice *OS2VMAN_CreateDevice(void) -{ - VIDEOOUTPUTINFO stVOInfo; - if (!voVMan.QueryInfo(&stVOInfo)) { - return NULL; - } - return OS2_CreateDevice(); -} - - -/* DIVE and VMAN bootstraps both call the same OS2_CreateDevice() function. - * Video output system will be selected in OS2_VideoInit() by driver name. */ -VideoBootStrap OS2DIVE_bootstrap = -{ - OS2DRIVER_NAME_DIVE, "OS/2 video driver", - OS2DIVE_CreateDevice -}; -VideoBootStrap OS2VMAN_bootstrap = -{ - OS2DRIVER_NAME_VMAN, "OS/2 video driver", - OS2VMAN_CreateDevice -}; - -#endif /* SDL_VIDEO_DRIVER_OS2 */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/video/os2/SDL_os2video.h b/src/video/os2/SDL_os2video.h deleted file mode 100644 index 688410c68a..0000000000 --- a/src/video/os2/SDL_os2video.h +++ /dev/null @@ -1,82 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ -#include "../../SDL_internal.h" - -#ifndef SDL_os2video_h_ -#define SDL_os2video_h_ - -#include "../SDL_sysvideo.h" -#include "../../core/os2/SDL_os2.h" - -#define INCL_DOS -#define INCL_DOSERRORS -#define INCL_DOSPROCESS -#define INCL_WIN -#define INCL_GPI -#define INCL_OS2MM -#define INCL_DOSMEMMGR -#include - -#include "SDL_os2mouse.h" -#include "SDL_os2output.h" - -typedef struct SDL_VideoData { - HAB hab; - HMQ hmq; - OS2VIDEOOUTPUT *pOutput; /* Video output routines */ -} SDL_VideoData; - -typedef struct _WINDATA { - SDL_Window *window; - OS2VIDEOOUTPUT *pOutput; /* Video output routines */ - HWND hwndFrame; - HWND hwnd; - PFNWP fnUserWndProc; - PFNWP fnWndFrameProc; - - PVODATA pVOData; /* Video output data */ - - HRGN hrgnShape; - HPOINTER hptrIcon; - RECTL rectlBeforeFS; - - LONG lSkipWMSize; - LONG lSkipWMMove; - LONG lSkipWMMouseMove; - LONG lSkipWMVRNEnabled; - LONG lSkipWMAdjustFramePos; -} WINDATA; - -typedef struct _DISPLAYDATA { - ULONG ulDPIHor; - ULONG ulDPIVer; - ULONG ulDPIDiag; -} DISPLAYDATA; - -typedef struct _MODEDATA { - ULONG ulDepth; - ULONG fccColorEncoding; - ULONG ulScanLineBytes; -} MODEDATA; - -#endif /* SDL_os2video_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/video/os2/SDL_os2vman.c b/src/video/os2/SDL_os2vman.c deleted file mode 100644 index acb9200613..0000000000 --- a/src/video/os2/SDL_os2vman.c +++ /dev/null @@ -1,483 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ -#include "../../SDL_internal.h" -#include "../SDL_sysvideo.h" - -#define INCL_DOSERRORS -#define INCL_DOSPROCESS -#define INCL_DOSMODULEMGR -#define INCL_WIN -#define INCL_GPI -#define INCL_GPIBITMAPS /* GPI bit map functions */ -#include -#include "SDL_os2output.h" -#include "SDL_os2video.h" - -#include "SDL_gradd.h" - -typedef struct _VODATA { - PVOID pBuffer; - HRGN hrgnVisible; - ULONG ulBPP; - ULONG ulScanLineSize; - ULONG ulWidth; - ULONG ulHeight; - ULONG ulScreenHeight; - ULONG ulScreenBytesPerLine; - RECTL rectlWin; - - PRECTL pRectl; - ULONG cRectl; - PBLTRECT pBltRect; - ULONG cBltRect; -} VODATA; - -static BOOL voQueryInfo(VIDEOOUTPUTINFO *pInfo); -static PVODATA voOpen(); -static VOID voClose(PVODATA pVOData); -static BOOL voSetVisibleRegion(PVODATA pVOData, HWND hwnd, - SDL_DisplayMode *pSDLDisplayMode, - HRGN hrgnShape, BOOL fVisible); -static PVOID voVideoBufAlloc(PVODATA pVOData, ULONG ulWidth, ULONG ulHeight, - ULONG ulBPP, ULONG fccColorEncoding, - PULONG pulScanLineSize); -static VOID voVideoBufFree(PVODATA pVOData); -static BOOL voUpdate(PVODATA pVOData, HWND hwnd, SDL_Rect *pSDLRects, - ULONG cSDLRects); - -OS2VIDEOOUTPUT voVMan = { - voQueryInfo, - voOpen, - voClose, - voSetVisibleRegion, - voVideoBufAlloc, - voVideoBufFree, - voUpdate -}; - - -static HMODULE hmodVMan = NULLHANDLE; -static FNVMIENTRY *pfnVMIEntry = NULL; -static ULONG ulVRAMAddress = 0; - -static VOID APIENTRY ExitVMan(VOID) -{ - if (ulVRAMAddress != 0 && hmodVMan != NULLHANDLE) { - pfnVMIEntry(0, VMI_CMD_TERMPROC, NULL, NULL); - DosFreeModule(hmodVMan); - } - - DosExitList(EXLST_EXIT, (PFNEXITLIST)NULL); -} - -static BOOL _vmanInit(void) -{ - ULONG ulRC; - CHAR acBuf[256]; - INITPROCOUT stInitProcOut; - - if (hmodVMan != NULLHANDLE) /* already initialized */ - return TRUE; - - /* Load vman.dll */ - ulRC = DosLoadModule(acBuf, sizeof(acBuf), "VMAN", &hmodVMan); - if (ulRC != NO_ERROR) { - debug_os2("Could not load VMAN.DLL, rc = %u : %s", ulRC, acBuf); - hmodVMan = NULLHANDLE; - return FALSE; - } - - /* Get VMIEntry */ - ulRC = DosQueryProcAddr(hmodVMan, 0L, "VMIEntry", (PFN *)&pfnVMIEntry); - if (ulRC != NO_ERROR) { - debug_os2("Could not query address of VMIEntry from VMAN.DLL (Err: %lu)", ulRC); - DosFreeModule(hmodVMan); - hmodVMan = NULLHANDLE; - return FALSE; - } - - /* VMAN initialization */ - stInitProcOut.ulLength = sizeof(stInitProcOut); - ulRC = pfnVMIEntry(0, VMI_CMD_INITPROC, NULL, &stInitProcOut); - if (ulRC != RC_SUCCESS) { - debug_os2("Could not initialize VMAN for this process"); - pfnVMIEntry = NULL; - DosFreeModule(hmodVMan); - hmodVMan = NULLHANDLE; - return FALSE; - } - - /* Store video memory virtual address */ - ulVRAMAddress = stInitProcOut.ulVRAMVirt; - /* We use exit list for VMI_CMD_TERMPROC */ - if (DosExitList(EXLST_ADD | 0x00001000, (PFNEXITLIST)ExitVMan) != NO_ERROR) { - debug_os2("DosExitList() failed"); - } - - return TRUE; -} - -static PRECTL _getRectlArray(PVODATA pVOData, ULONG cRects) -{ - PRECTL pRectl; - - if (pVOData->cRectl >= cRects) - return pVOData->pRectl; - - pRectl = SDL_realloc(pVOData->pRectl, cRects * sizeof(RECTL)); - if (pRectl == NULL) - return NULL; - - pVOData->pRectl = pRectl; - pVOData->cRectl = cRects; - return pRectl; -} - -static PBLTRECT _getBltRectArray(PVODATA pVOData, ULONG cRects) -{ - PBLTRECT pBltRect; - - if (pVOData->cBltRect >= cRects) - return pVOData->pBltRect; - - pBltRect = SDL_realloc(pVOData->pBltRect, cRects * sizeof(BLTRECT)); - if (pBltRect == NULL) - return NULL; - - pVOData->pBltRect = pBltRect; - pVOData->cBltRect = cRects; - return pBltRect; -} - - -static BOOL voQueryInfo(VIDEOOUTPUTINFO *pInfo) -{ - ULONG ulRC; - GDDMODEINFO sCurModeInfo; - - if (!_vmanInit()) - return FALSE; - - /* Query current (desktop) mode */ - ulRC = pfnVMIEntry(0, VMI_CMD_QUERYCURRENTMODE, NULL, &sCurModeInfo); - if (ulRC != RC_SUCCESS) { - debug_os2("Could not query desktop video mode."); - return FALSE; - } - - pInfo->ulBPP = sCurModeInfo.ulBpp; - pInfo->ulHorizResolution = sCurModeInfo.ulHorizResolution; - pInfo->ulVertResolution = sCurModeInfo.ulVertResolution; - pInfo->ulScanLineSize = sCurModeInfo.ulScanLineSize; - pInfo->fccColorEncoding = sCurModeInfo.fccColorEncoding; - - return TRUE; -} - -static PVODATA voOpen(void) -{ - PVODATA pVOData; - - if (!_vmanInit()) - return NULL; - - pVOData = SDL_calloc(1, sizeof(VODATA)); - if (pVOData == NULL) { - SDL_OutOfMemory(); - return NULL; - } - - return pVOData; -} - -static VOID voClose(PVODATA pVOData) -{ - if (pVOData->pRectl != NULL) - SDL_free(pVOData->pRectl); - - if (pVOData->pBltRect != NULL) - SDL_free(pVOData->pBltRect); - - voVideoBufFree(pVOData); -} - -static BOOL voSetVisibleRegion(PVODATA pVOData, HWND hwnd, - SDL_DisplayMode *pSDLDisplayMode, - HRGN hrgnShape, BOOL fVisible) -{ - HPS hps; - BOOL fSuccess = FALSE; - - hps = WinGetPS(hwnd); - - if (pVOData->hrgnVisible != NULLHANDLE) { - GpiDestroyRegion(hps, pVOData->hrgnVisible); - pVOData->hrgnVisible = NULLHANDLE; - } - - if (fVisible) { - /* Query visible rectangles */ - pVOData->hrgnVisible = GpiCreateRegion(hps, 0, NULL); - if (pVOData->hrgnVisible == NULLHANDLE) { - SDL_SetError("GpiCreateRegion() failed"); - } else { - if (WinQueryVisibleRegion(hwnd, pVOData->hrgnVisible) == RGN_ERROR) { - GpiDestroyRegion(hps, pVOData->hrgnVisible); - pVOData->hrgnVisible = NULLHANDLE; - } else { - if (hrgnShape != NULLHANDLE) - GpiCombineRegion(hps, pVOData->hrgnVisible, pVOData->hrgnVisible, - hrgnShape, CRGN_AND); - fSuccess = TRUE; - } - } - - WinQueryWindowRect(hwnd, &pVOData->rectlWin); - WinMapWindowPoints(hwnd, HWND_DESKTOP, (PPOINTL)&pVOData->rectlWin, 2); - - if (pSDLDisplayMode != NULL) { - pVOData->ulScreenHeight = pSDLDisplayMode->h; - pVOData->ulScreenBytesPerLine = - ((MODEDATA *)pSDLDisplayMode->driverdata)->ulScanLineBytes; - } - } - - WinReleasePS(hps); - - return fSuccess; -} - -static PVOID voVideoBufAlloc(PVODATA pVOData, ULONG ulWidth, ULONG ulHeight, - ULONG ulBPP, ULONG fccColorEncoding, - PULONG pulScanLineSize) -{ - ULONG ulRC; - ULONG ulScanLineSize = ulWidth * (ulBPP >> 3); - - /* Destroy previous buffer */ - voVideoBufFree(pVOData); - - if (ulWidth == 0 || ulHeight == 0 || ulBPP == 0) - return NULL; - - /* Bytes per line */ - ulScanLineSize = (ulScanLineSize + 3) & ~3; /* 4-byte aligning */ - *pulScanLineSize = ulScanLineSize; - - ulRC = DosAllocMem(&pVOData->pBuffer, - (ulHeight * ulScanLineSize) + sizeof(ULONG), - PAG_COMMIT | PAG_EXECUTE | PAG_READ | PAG_WRITE); - if (ulRC != NO_ERROR) { - debug_os2("DosAllocMem(), rc = %u", ulRC); - return NULL; - } - - pVOData->ulBPP = ulBPP; - pVOData->ulScanLineSize = ulScanLineSize; - pVOData->ulWidth = ulWidth; - pVOData->ulHeight = ulHeight; - - return pVOData->pBuffer; -} - -static VOID voVideoBufFree(PVODATA pVOData) -{ - ULONG ulRC; - - if (pVOData->pBuffer == NULL) - return; - - ulRC = DosFreeMem(pVOData->pBuffer); - if (ulRC != NO_ERROR) { - debug_os2("DosFreeMem(), rc = %u", ulRC); - } else { - pVOData->pBuffer = NULL; - } -} - -static BOOL voUpdate(PVODATA pVOData, HWND hwnd, SDL_Rect *pSDLRects, - ULONG cSDLRects) -{ - PRECTL prectlDst, prectlScan; - HPS hps; - HRGN hrgnUpdate; - RGNRECT rgnCtl; - SDL_Rect stSDLRectDef; - BMAPINFO bmiSrc; - BMAPINFO bmiDst; - PPOINTL pptlSrcOrg; - PBLTRECT pbrDst; - HWREQIN sHWReqIn; - BITBLTINFO sBitbltInfo; - ULONG ulIdx; - - if (pVOData->pBuffer == NULL) - return FALSE; - - if (pVOData->hrgnVisible == NULLHANDLE) - return TRUE; - - bmiSrc.ulLength = sizeof(BMAPINFO); - bmiSrc.ulType = BMAP_MEMORY; - bmiSrc.ulWidth = pVOData->ulWidth; - bmiSrc.ulHeight = pVOData->ulHeight; - bmiSrc.ulBpp = pVOData->ulBPP; - bmiSrc.ulBytesPerLine = pVOData->ulScanLineSize; - bmiSrc.pBits = (PBYTE)pVOData->pBuffer; - - bmiDst.ulLength = sizeof(BMAPINFO); - bmiDst.ulType = BMAP_VRAM; - bmiDst.pBits = (PBYTE)ulVRAMAddress; - bmiDst.ulWidth = bmiSrc.ulWidth; - bmiDst.ulHeight = bmiSrc.ulHeight; - bmiDst.ulBpp = bmiSrc.ulBpp; - bmiDst.ulBytesPerLine = pVOData->ulScreenBytesPerLine; - - /* List of update rectangles. This is the intersection of requested - * rectangles and visible rectangles. */ - if (cSDLRects == 0) { - /* Full update requested */ - stSDLRectDef.x = 0; - stSDLRectDef.y = 0; - stSDLRectDef.w = bmiSrc.ulWidth; - stSDLRectDef.h = bmiSrc.ulHeight; - pSDLRects = &stSDLRectDef; - cSDLRects = 1; - } - - /* Make list of destination rectangles (prectlDst) list from the source - * list (prectl). */ - prectlDst = _getRectlArray(pVOData, cSDLRects); - if (prectlDst == NULL) { - debug_os2("Not enough memory"); - return FALSE; - } - prectlScan = prectlDst; - for (ulIdx = 0; ulIdx < cSDLRects; ulIdx++, pSDLRects++, prectlScan++) { - prectlScan->xLeft = pSDLRects->x; - prectlScan->yTop = pVOData->ulHeight - pSDLRects->y; - prectlScan->xRight = prectlScan->xLeft + pSDLRects->w; - prectlScan->yBottom = prectlScan->yTop - pSDLRects->h; - } - - hps = WinGetPS(hwnd); - if (hps == NULLHANDLE) - return FALSE; - - /* Make destination region to update */ - hrgnUpdate = GpiCreateRegion(hps, cSDLRects, prectlDst); - /* "AND" on visible and destination regions, result is region to update */ - GpiCombineRegion(hps, hrgnUpdate, hrgnUpdate, pVOData->hrgnVisible, CRGN_AND); - - /* Get rectangles of the region to update */ - rgnCtl.ircStart = 1; - rgnCtl.crc = 0; - rgnCtl.ulDirection = 1; - rgnCtl.crcReturned = 0; - GpiQueryRegionRects(hps, hrgnUpdate, NULL, &rgnCtl, NULL); - if (rgnCtl.crcReturned == 0) { - GpiDestroyRegion(hps, hrgnUpdate); - WinReleasePS(hps); - return TRUE; - } - /* We don't need prectlDst, use it again to store update regions */ - prectlDst = _getRectlArray(pVOData, rgnCtl.crcReturned); - if (prectlDst == NULL) { - debug_os2("Not enough memory"); - GpiDestroyRegion(hps, hrgnUpdate); - WinReleasePS(hps); - return FALSE; - } - rgnCtl.ircStart = 1; - rgnCtl.crc = rgnCtl.crcReturned; - rgnCtl.ulDirection = 1; - GpiQueryRegionRects(hps, hrgnUpdate, NULL, &rgnCtl, prectlDst); - GpiDestroyRegion(hps, hrgnUpdate); - WinReleasePS(hps); - cSDLRects = rgnCtl.crcReturned; - - /* Now cRect/prectlDst is a list of regions in window (update && visible) */ - - /* Make lists for blitting from update regions */ - pbrDst = _getBltRectArray(pVOData, cSDLRects); - if (pbrDst == NULL) { - debug_os2("Not enough memory"); - return FALSE; - } - - prectlScan = prectlDst; - pptlSrcOrg = (PPOINTL)prectlDst; /* Yes, this memory block will be used again */ - for (ulIdx = 0; ulIdx < cSDLRects; ulIdx++, prectlScan++, pptlSrcOrg++) { - pbrDst[ulIdx].ulXOrg = pVOData->rectlWin.xLeft + prectlScan->xLeft; - pbrDst[ulIdx].ulYOrg = pVOData->ulScreenHeight - - (pVOData->rectlWin.yBottom + prectlScan->yTop); - pbrDst[ulIdx].ulXExt = prectlScan->xRight - prectlScan->xLeft; - pbrDst[ulIdx].ulYExt = prectlScan->yTop - prectlScan->yBottom; - pptlSrcOrg->x = prectlScan->xLeft; - pptlSrcOrg->y = bmiSrc.ulHeight - prectlScan->yTop; - } - pptlSrcOrg = (PPOINTL)prectlDst; - - /* Request HW */ - sHWReqIn.ulLength = sizeof(HWREQIN); - sHWReqIn.ulFlags = REQUEST_HW; - sHWReqIn.cScrChangeRects = 1; - sHWReqIn.arectlScreen = &pVOData->rectlWin; - if (pfnVMIEntry(0, VMI_CMD_REQUESTHW, &sHWReqIn, NULL) != RC_SUCCESS) { - debug_os2("pfnVMIEntry(,VMI_CMD_REQUESTHW,,) failed"); - sHWReqIn.cScrChangeRects = 0; /* for fail signal only */ - } else { - RECTL rclSrcBounds; - - rclSrcBounds.xLeft = 0; - rclSrcBounds.yBottom = 0; - rclSrcBounds.xRight = bmiSrc.ulWidth; - rclSrcBounds.yTop = bmiSrc.ulHeight; - - SDL_zero(sBitbltInfo); - sBitbltInfo.ulLength = sizeof(BITBLTINFO); - sBitbltInfo.ulBltFlags = BF_DEFAULT_STATE | BF_ROP_INCL_SRC | BF_PAT_HOLLOW; - sBitbltInfo.cBlits = cSDLRects; - sBitbltInfo.ulROP = ROP_SRCCOPY; - sBitbltInfo.pSrcBmapInfo = &bmiSrc; - sBitbltInfo.pDstBmapInfo = &bmiDst; - sBitbltInfo.prclSrcBounds = &rclSrcBounds; - sBitbltInfo.prclDstBounds = &pVOData->rectlWin; - sBitbltInfo.aptlSrcOrg = pptlSrcOrg; - sBitbltInfo.abrDst = pbrDst; - - /* Screen update */ - if (pfnVMIEntry(0, VMI_CMD_BITBLT, &sBitbltInfo, NULL) != RC_SUCCESS) { - debug_os2("pfnVMIEntry(,VMI_CMD_BITBLT,,) failed"); - sHWReqIn.cScrChangeRects = 0; /* for fail signal only */ - } - - /* Release HW */ - sHWReqIn.ulFlags = 0; - if (pfnVMIEntry(0, VMI_CMD_REQUESTHW, &sHWReqIn, NULL) != RC_SUCCESS) { - debug_os2("pfnVMIEntry(,VMI_CMD_REQUESTHW,,) failed"); - } - } - - return sHWReqIn.cScrChangeRects != 0; -} - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/test/Makefile.in b/test/Makefile.in index 0927871e78..aae311280e 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -269,22 +269,14 @@ testnative$(EXE): $(srcdir)/testnative.c \ $(CC) -o $@ $^ $(CFLAGS) $(LIBS) @XLIB@ endif -ifeq (@ISOS2@,true) -testnative$(EXE): $(srcdir)/testnative.c \ - $(srcdir)/testnativeos2.c - $(CC) -o $@ $^ $(CFLAGS) $(LIBS) -endif - #there's probably a better way of doing this ifeq (@ISMACOSX@,false) ifeq (@ISWINDOWS@,false) ifeq (@ISUNIX@,false) -ifeq (@ISOS2@,false) testnative$(EXE): ; endif endif endif -endif testoverlay2$(EXE): $(srcdir)/testoverlay2.c $(srcdir)/testyuv_cvt.c $(srcdir)/testutils.c $(CC) -o $@ $^ $(CFLAGS) $(LIBS) diff --git a/test/Makefile.os2 b/test/Makefile.os2 deleted file mode 100644 index 3f6daf8594..0000000000 --- a/test/Makefile.os2 +++ /dev/null @@ -1,18 +0,0 @@ -# Open Watcom makefile to build SDL3 tests for OS/2 -# wmake -f Makefile.os2 -# -# To error out upon warnings: wmake -f Makefile.os2 ENABLE_WERROR=1 - -SYSTEM = os2v2 - -INCPATH = -I"$(%WATCOM)/h/os2" -I"$(%WATCOM)/h" - -CFLAGS = -bt=os2 -d0 -q -bm -5s -fp5 -fpi87 -sg -oteanbmier -ei -CFLAGS+= -wx -wcd=303 -!ifeq ENABLE_WERROR 1 -CFLAGS+= -we -!endif - -TNSRCS = testnative.c testnativeos2.c - -!include watcom.mif diff --git a/test/Makefile.w32 b/test/Makefile.w32 deleted file mode 100644 index 55ad493f4f..0000000000 --- a/test/Makefile.w32 +++ /dev/null @@ -1,21 +0,0 @@ -# Open Watcom makefile to build SDL3 tests for Win32 -# wmake -f Makefile.w32 -# -# To error out upon warnings: wmake -f Makefile.w32 ENABLE_WERROR=1 - -SYSTEM = nt - -INCPATH = -I"$(%WATCOM)/h/nt" -I"$(%WATCOM)/h" -I"../src/video/khronos" - -CFLAGS = -bt=nt -d0 -q -bm -5s -fp5 -fpi87 -sg -oteanbmier -ei -CFLAGS+= -wx -wcd=303 -!ifeq ENABLE_WERROR 1 -CFLAGS+= -we -!endif -CFLAGS+= -DSDL_MAIN_HANDLED -CFLAGS+= -DHAVE_OPENGL -GLLIBS = opengl32.lib - -TNSRCS = testnative.c testnativew32.c - -!include watcom.mif diff --git a/test/configure b/test/configure index f524bd4d37..c620cc661b 100755 --- a/test/configure +++ b/test/configure @@ -633,7 +633,6 @@ SDL_CFLAGS PKG_CONFIG_LIBDIR PKG_CONFIG_PATH PKG_CONFIG -ISOS2 ISUNIX ISWINDOWS ISMACOSX @@ -3557,7 +3556,6 @@ fi ISUNIX="false" ISWINDOWS="false" ISMACOSX="false" -ISOS2="false" case "$host" in *-*-cygwin* | *-*-mingw*) @@ -3658,12 +3656,6 @@ fi MATHLIB="" SYS_GL_LIBS="" ;; - *-*-os2*) - ISOS2="true" - EXE=".exe" - MATHLIB="" - SYS_GL_LIBS="" - ;; *) ISUNIX="true" EXE="" @@ -3718,7 +3710,6 @@ esac - SDL_VERSION=3.0.0 diff --git a/test/configure.ac b/test/configure.ac index 60b60ada13..b096d73301 100644 --- a/test/configure.ac +++ b/test/configure.ac @@ -18,7 +18,6 @@ dnl (Haiku, for example, sets none of these.) ISUNIX="false" ISWINDOWS="false" ISMACOSX="false" -ISOS2="false" dnl Figure out which math library to use case "$host" in @@ -76,12 +75,6 @@ case "$host" in MATHLIB="" SYS_GL_LIBS="" ;; - *-*-os2*) - ISOS2="true" - EXE=".exe" - MATHLIB="" - SYS_GL_LIBS="" - ;; *) dnl Oh well, call it Unix... ISUNIX="true" @@ -97,7 +90,6 @@ AC_SUBST(MATHLIB) AC_SUBST(ISMACOSX) AC_SUBST(ISWINDOWS) AC_SUBST(ISUNIX) -AC_SUBST(ISOS2) dnl Check for SDL SDL_VERSION=3.0.0 diff --git a/test/testnative.c b/test/testnative.c index e115089d5d..75ed9808c3 100644 --- a/test/testnative.c +++ b/test/testnative.c @@ -32,9 +32,6 @@ static NativeWindowFactory *factories[] = { #endif #ifdef TEST_NATIVE_COCOA &CocoaWindowFactory, -#endif -#ifdef TEST_NATIVE_OS2 - &OS2WindowFactory, #endif NULL }; diff --git a/test/testnative.h b/test/testnative.h index 694f46ec8d..528194927b 100644 --- a/test/testnative.h +++ b/test/testnative.h @@ -13,7 +13,6 @@ /* Definitions for platform dependent windowing functions to test SDL integration with native windows */ - #include "SDL.h" /* This header includes all the necessary system headers for native windows */ @@ -44,8 +43,3 @@ extern NativeWindowFactory X11WindowFactory; #define TEST_NATIVE_COCOA extern NativeWindowFactory CocoaWindowFactory; #endif - -#ifdef SDL_VIDEO_DRIVER_OS2 -#define TEST_NATIVE_OS2 -extern NativeWindowFactory OS2WindowFactory; -#endif diff --git a/test/testnativeos2.c b/test/testnativeos2.c deleted file mode 100644 index 6998fa614d..0000000000 --- a/test/testnativeos2.c +++ /dev/null @@ -1,57 +0,0 @@ -/* - Copyright (C) 1997-2022 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely. -*/ - -#include "testnative.h" - -#ifdef TEST_NATIVE_OS2 - -#define WIN_CLIENT_CLASS "SDL Test" - -static void *CreateWindowNative(int w, int h); -static void DestroyWindowNative(void *window); - -NativeWindowFactory OS2WindowFactory = { - "DIVE", - CreateWindowNative, - DestroyWindowNative -}; - -static void *CreateWindowNative(int w, int h) -{ - HWND hwnd, hwndFrame; - ULONG ulFrameFlags = FCF_TASKLIST | FCF_DLGBORDER | FCF_TITLEBAR | - FCF_SYSMENU | FCF_SHELLPOSITION | - FCF_SIZEBORDER | FCF_MINBUTTON | FCF_MAXBUTTON; - - WinRegisterClass(0, WIN_CLIENT_CLASS, WinDefWindowProc, - CS_SIZEREDRAW | CS_MOVENOTIFY, - sizeof(ULONG)); /* We should have minimum 4 bytes. */ - - hwndFrame = WinCreateStdWindow(HWND_DESKTOP, 0, &ulFrameFlags, - WIN_CLIENT_CLASS, "SDL Test", 0, 0, 1, &hwnd); - if (hwndFrame == NULLHANDLE) { - return NULL; - } - - WinSetWindowPos(hwndFrame, HWND_TOP, 0, 0, w, h, - SWP_ZORDER | SWP_ACTIVATE | SWP_SIZE | SWP_SHOW); - - return (void *)hwndFrame; /* We may return client or frame window - handle for SDL_CreateWindowFrom(). */ -} - -static void DestroyWindowNative(void *window) -{ - WinDestroyWindow((HWND) window); -} - -#endif /* TEST_NATIVE_OS2 */ diff --git a/test/watcom.mif b/test/watcom.mif deleted file mode 100644 index 6d0d9d405f..0000000000 --- a/test/watcom.mif +++ /dev/null @@ -1,122 +0,0 @@ -INCPATH+= -I"../include" -LIBPATH = .. -LIBS = SDL3.lib SDL3test.lib testutils.lib - -#CFLAGS+= -DHAVE_SDL_TTF -#TTFLIBS = SDL3ttf.lib - -CFLAGS+= $(INCPATH) - -TARGETS = testatomic.exe testdisplayinfo.exe testbounds.exe testdraw2.exe & - testdrawchessboard.exe testdropfile.exe testerror.exe testfile.exe & - testfilesystem.exe testgamecontroller.exe testgeometry.exe testgesture.exe & - testhittesting.exe testhotplug.exe testiconv.exe testime.exe testlocale.exe & - testintersections.exe testjoystick.exe testkeys.exe testloadso.exe & - testlock.exe testmessage.exe testoverlay2.exe testplatform.exe & - testpower.exe testsensor.exe testrelative.exe testrendercopyex.exe & - testrendertarget.exe testrumble.exe testscale.exe testsem.exe & - testshader.exe testshape.exe testsprite2.exe testspriteminimal.exe & - teststreaming.exe testthread.exe testtimer.exe testver.exe & - testviewport.exe testwm2.exe torturethread.exe checkkeys.exe & - checkkeysthreads.exe testmouse.exe testgles.exe testgles2.exe & - controllermap.exe testhaptic.exe testqsort.exe testresample.exe & - testaudioinfo.exe testaudiocapture.exe loopwave.exe loopwavequeue.exe & - testsurround.exe testyuv.exe testgl2.exe testvulkan.exe testnative.exe & - testautomation.exe testaudiohotplug.exe testcustomcursor.exe testmultiaudio.exe & - testoffscreen.exe testurl.exe - -noninteractive = & - testatomic.exe & - testerror.exe & - testfilesystem.exe & - testkeys.exe & - testlocale.exe & - testplatform.exe & - testpower.exe & - testqsort.exe & - testthread.exe & - testtimer.exe & - testver.exe - -needs_audio = & - testaudioinfo.exe & - testsurround.exe - -needs_display = & - testbounds.exe & - testdisplayinfo.exe - -TESTS = $(noninteractive) $(needs_audio) $(needs_display) - -# testautomation sources -TASRCS = testautomation.c & - testautomation_audio.c testautomation_clipboard.c & - testautomation_events.c testautomation_guid.c & - testautomation_hints.c testautomation_joystick.c & - testautomation_keyboard.c testautomation_main.c & - testautomation_math.c testautomation_mouse.c & - testautomation_pixels.c testautomation_platform.c & - testautomation_rect.c testautomation_render.c & - testautomation_rwops.c testautomation_sdltest.c & - testautomation_stdlib.c testautomation_surface.c & - testautomation_syswm.c testautomation_timer.c & - testautomation_video.c - -OBJS = $(TARGETS:.exe=.obj) -COBJS = $(CSRCS:.c=.obj) -TAOBJS = $(TASRCS:.c=.obj) -TNOBJS = $(TNSRCS:.c=.obj) - -all: testutils.lib $(TARGETS) - -.c: ../src/test - -.obj.exe: - wlink SYS $(SYSTEM) libpath $(LIBPATH) lib {$(LIBS)} op q op el file {$<} name $@ - -.c.obj: - wcc386 $(CFLAGS) -fo=$^@ $< - -# specials -testvulkan.obj: testvulkan.c - # new vulkan headers result in lots of W202 warnings - wcc386 $(CFLAGS) -wcd=202 -fo=$^@ $< - -testautomation.exe: $(TAOBJS) - wlink SYS $(SYSTEM) libpath $(LIBPATH) lib {$(LIBS)} op q op el file {$<} name $@ - -testnative.exe: $(TNOBJS) - wlink SYS $(SYSTEM) libpath $(LIBPATH) lib {$(LIBS)} op q op el file {$<} name $@ - -testoverlay2.exe: testoverlay2.obj testyuv_cvt.obj - wlink SYS $(SYSTEM) libpath $(LIBPATH) lib {$(LIBS)} op q op el file {$<} name $@ - -testyuv.exe: testyuv.obj testyuv_cvt.obj - wlink SYS $(SYSTEM) libpath $(LIBPATH) lib {$(LIBS)} op q op el file {$<} name $@ - -testshader.exe: testshader.obj - wlink SYS $(SYSTEM) libpath $(LIBPATH) lib {$(LIBS) $(GLLIBS)} op q op el file {$<} name $@ - -testime.exe: testime.obj - wlink SYS $(SYSTEM) libpath $(LIBPATH) lib {$(LIBS) $(TTFLIBS)} op q op el file {$<} name $@ - -testutils.lib: testutils.obj - wlib -q -b -n -c -pa -s -t -zld -ii -io $@ $< - -check: .SYMBOLIC $(TESTS) - @set SDL_AUDIODRIVER=dummy - @set SDL_VIDEODRIVER=dummy - @copy "../SDL3.dll" . - @for %exe in ($(TESTS)) do %exe - -check-quick: .SYMBOLIC $(TESTS) - @set SDL_TESTS_QUICK=1 - @set SDL_AUDIODRIVER=dummy - @set SDL_VIDEODRIVER=dummy - @copy "../SDL3.dll" . - @for %exe in ($(TESTS)) do %exe - -clean: .SYMBOLIC - rm -f *.obj *.err -distclean: .SYMBOLIC clean - rm -f *.exe *.lib From ed8637f437d5b52fd1d62669279f382fe2879683 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Tue, 22 Nov 2022 08:28:56 -0800 Subject: [PATCH 108/153] Fixed typo --- include/SDL_version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/SDL_version.h b/include/SDL_version.h index 6b6c59ba29..81b521cda7 100644 --- a/include/SDL_version.h +++ b/include/SDL_version.h @@ -102,7 +102,7 @@ typedef struct SDL_version * This macro will evaluate to true if compiled with SDL at least X.Y.Z. */ #define SDL_VERSION_ATLEAST(X, Y, Z) \ - (SDL_COMPILEDVERSION >= SDL_VERSIONUM(X, Y, Z)) + (SDL_COMPILEDVERSION >= SDL_VERSIONNUM(X, Y, Z)) /** * Get the version of SDL that is linked against your program. From 68b30d24e0d4581f7e61c0b1dc8bc6e8b0594d01 Mon Sep 17 00:00:00 2001 From: pionere Date: Tue, 22 Nov 2022 10:48:23 +0100 Subject: [PATCH 109/153] cmake: get rid of the duplicated _USE_MATH_DEFINES - define _USE_MATH_DEFINES in SDL_stdinc.h only - define _USE_MATH_DEFINES if not defined already --- CMakeLists.txt | 1 - include/SDL_stdinc.h | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 702d0c433f..c1bcefd3fb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -999,7 +999,6 @@ if(SDL_LIBC) endforeach() set(HAVE_ALLOCA 1) check_symbol_exists(M_PI math.h HAVE_M_PI) - target_compile_definitions(sdl-build-options INTERFACE "-D_USE_MATH_DEFINES") # needed for M_PI set(STDC_HEADERS 1) else() set(HAVE_LIBC TRUE) diff --git a/include/SDL_stdinc.h b/include/SDL_stdinc.h index 70dba7db69..4015152113 100644 --- a/include/SDL_stdinc.h +++ b/include/SDL_stdinc.h @@ -80,7 +80,7 @@ # include #endif #ifdef HAVE_MATH_H -# if defined(_MSC_VER) +# if defined(_MSC_VER) && !defined(_USE_MATH_DEFINES) /* Defining _USE_MATH_DEFINES is required to get M_PI to be defined on Visual Studio. See http://msdn.microsoft.com/en-us/library/4hwaceh6.aspx for more information. From 05e2c8f2ce020c9c891f21e245a6607360fe5c75 Mon Sep 17 00:00:00 2001 From: Cameron Cawley Date: Tue, 22 Nov 2022 12:12:17 +0000 Subject: [PATCH 110/153] Update README-riscos.md to reflect that atomic functions have been fixed --- docs/README-riscos.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/README-riscos.md b/docs/README-riscos.md index f7ddb2e202..4c31b5cf7c 100644 --- a/docs/README-riscos.md +++ b/docs/README-riscos.md @@ -16,16 +16,18 @@ Currently, SDL for RISC OS only supports compiling with GCCSDK under Linux. Both The following commands can be used to build SDL for RISC OS using autoconf: - ./configure --host=arm-unknown-riscos --prefix=$GCCSDK_INSTALL_ENV --disable-gcc-atomics + ./configure --host=arm-unknown-riscos --prefix=$GCCSDK_INSTALL_ENV make make install The following commands can be used to build SDL for RISC OS using CMake: - cmake -Bbuild-riscos -DCMAKE_TOOLCHAIN_FILE=$GCCSDK_INSTALL_ENV/toolchain-riscos.cmake -DRISCOS=ON -DCMAKE_INSTALL_PREFIX=$GCCSDK_INSTALL_ENV -DCMAKE_BUILD_TYPE=Release -DSDL_GCC_ATOMICS=OFF + cmake -Bbuild-riscos -DCMAKE_TOOLCHAIN_FILE=$GCCSDK_INSTALL_ENV/toolchain-riscos.cmake -DRISCOS=ON -DCMAKE_INSTALL_PREFIX=$GCCSDK_INSTALL_ENV -DCMAKE_BUILD_TYPE=Release cmake --build build-riscos cmake --build build-riscos --target install +When using GCCSDK 4.7.4 release 6 or earlier versions, the builtin atomic functions are broken, meaning it's currently necessary to compile with `--disable-gcc-atomics` using autotools or `-DSDL_GCC_ATOMICS=OFF` using CMake. Newer versions of GCCSDK don't have this problem. + Current level of implementation ------------------------------- @@ -36,6 +38,4 @@ The filesystem APIs return either Unix-style paths or RISC OS-style paths based The audio, loadso, thread and timer APIs are currently provided by UnixLib. -GCC atomics are currently broken on some platforms, meaning it's currently necessary to compile with `--disable-gcc-atomics` using autotools or `-DSDL_GCC_ATOMICS=OFF` using CMake. - The joystick, locale and power APIs are not yet implemented. From cdb54ad21e5eeaf271ad01c74a888c44841199e7 Mon Sep 17 00:00:00 2001 From: Ozkan Sezer Date: Tue, 22 Nov 2022 19:51:56 +0300 Subject: [PATCH 111/153] removed arts, esd, fusionsound, nas, paudio, sndio, sunaudio, winmm audio backends. --- .github/workflows/main.yml | 2 +- CMakeLists.txt | 37 +- acinclude/esd.m4 | 173 ----- cmake/sdlchecks.cmake | 180 ----- configure | 1074 --------------------------- configure.ac | 284 ------- include/SDL_config.h.cmake | 15 - include/SDL_config.h.in | 15 - src/audio/SDL_audio.c | 27 - src/audio/SDL_sysaudio.h | 8 - src/audio/arts/SDL_artsaudio.c | 357 --------- src/audio/arts/SDL_artsaudio.h | 53 -- src/audio/esd/SDL_esdaudio.c | 335 --------- src/audio/esd/SDL_esdaudio.h | 51 -- src/audio/fusionsound/SDL_fsaudio.c | 317 -------- src/audio/fusionsound/SDL_fsaudio.h | 50 -- src/audio/nas/SDL_nasaudio.c | 461 ------------ src/audio/nas/SDL_nasaudio.h | 56 -- src/audio/paudio/SDL_paudio.c | 494 ------------ src/audio/paudio/SDL_paudio.h | 48 -- src/audio/sndio/SDL_sndioaudio.c | 387 ---------- src/audio/sndio/SDL_sndioaudio.h | 49 -- src/audio/sun/SDL_sunaudio.c | 420 ----------- src/audio/sun/SDL_sunaudio.h | 47 -- src/audio/winmm/SDL_winmm.c | 459 ------------ src/audio/winmm/SDL_winmm.h | 45 -- 26 files changed, 2 insertions(+), 5442 deletions(-) delete mode 100644 acinclude/esd.m4 delete mode 100644 src/audio/arts/SDL_artsaudio.c delete mode 100644 src/audio/arts/SDL_artsaudio.h delete mode 100644 src/audio/esd/SDL_esdaudio.c delete mode 100644 src/audio/esd/SDL_esdaudio.h delete mode 100644 src/audio/fusionsound/SDL_fsaudio.c delete mode 100644 src/audio/fusionsound/SDL_fsaudio.h delete mode 100644 src/audio/nas/SDL_nasaudio.c delete mode 100644 src/audio/nas/SDL_nasaudio.h delete mode 100644 src/audio/paudio/SDL_paudio.c delete mode 100644 src/audio/paudio/SDL_paudio.h delete mode 100644 src/audio/sndio/SDL_sndioaudio.c delete mode 100644 src/audio/sndio/SDL_sndioaudio.h delete mode 100644 src/audio/sun/SDL_sunaudio.c delete mode 100644 src/audio/sun/SDL_sunaudio.h delete mode 100644 src/audio/winmm/SDL_winmm.c delete mode 100644 src/audio/winmm/SDL_winmm.h diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 250f8905ce..43309172a9 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -45,7 +45,7 @@ jobs: sudo apt-get update sudo apt-get install build-essential git make autoconf automake libtool \ pkg-config cmake ninja-build gnome-desktop-testing libasound2-dev libpulse-dev \ - libaudio-dev libjack-dev libsndio-dev libsamplerate0-dev libx11-dev libxext-dev \ + libsndio-dev libsamplerate0-dev libx11-dev libxext-dev \ libxrandr-dev libxcursor-dev libxfixes-dev libxi-dev libxss-dev libwayland-dev \ libxkbcommon-dev libdrm-dev libgbm-dev libgl1-mesa-dev libgles2-mesa-dev \ libegl1-mesa-dev libdbus-1-dev libibus-1.0-dev libudev-dev fcitx-libs-dev diff --git a/CMakeLists.txt b/CMakeLists.txt index c1bcefd3fb..260ab3aa7a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -460,22 +460,10 @@ dep_option(SDL_PTHREADS_SEM "Use pthread semaphores" ON "SDL_PTHREADS" OF dep_option(SDL_OSS "Support the OSS audio API" ON "UNIX_SYS OR RISCOS" OFF) set_option(SDL_ALSA "Support the ALSA audio API" ${UNIX_SYS}) dep_option(SDL_ALSA_SHARED "Dynamically load ALSA audio support" ON "SDL_ALSA" OFF) -set_option(SDL_JACK "Support the JACK audio API" ${UNIX_SYS}) -dep_option(SDL_JACK_SHARED "Dynamically load JACK audio support" ON "SDL_JACK" OFF) -set_option(SDL_ESD "Support the Enlightened Sound Daemon" ${UNIX_SYS}) -dep_option(SDL_ESD_SHARED "Dynamically load ESD audio support" ON "SDL_ESD" OFF) set_option(SDL_PIPEWIRE "Use Pipewire audio" ${UNIX_SYS}) dep_option(SDL_PIPEWIRE_SHARED "Dynamically load Pipewire support" ON "SDL_PIPEWIRE" OFF) set_option(SDL_PULSEAUDIO "Use PulseAudio" ${UNIX_SYS}) dep_option(SDL_PULSEAUDIO_SHARED "Dynamically load PulseAudio support" ON "SDL_PULSEAUDIO" OFF) -set_option(SDL_ARTS "Support the Analog Real Time Synthesizer" ${UNIX_SYS}) -dep_option(SDL_ARTS_SHARED "Dynamically load aRts audio support" ON "SDL_ARTS" OFF) -set_option(SDL_NAS "Support the NAS audio API" ${UNIX_SYS}) -dep_option(SDL_NAS_SHARED "Dynamically load NAS audio support" ON "SDL_NAS" OFF) -set_option(SDL_SNDIO "Support the sndio audio API" ${UNIX_SYS}) -dep_option(SDL_SNDIO_SHARED "Dynamically load the sndio audio API" ON "SDL_SNDIO" OFF) -set_option(SDL_FUSIONSOUND "Use FusionSound audio driver" OFF) -dep_option(SDL_FUSIONSOUND_SHARED "Dynamically load fusionsound audio support" ON "SDL_FUSIONSOUND" OFF) set_option(SDL_LIBSAMPLERATE "Use libsamplerate for audio rate conversion" ${UNIX_SYS}) dep_option(SDL_LIBSAMPLERATE_SHARED "Dynamically load libsamplerate" ON "SDL_LIBSAMPLERATE" OFF) set_option(SDL_RPATH "Use an rpath when linking SDL" ${UNIX_SYS}) @@ -1405,32 +1393,16 @@ elseif(EMSCRIPTEN) elseif(UNIX AND NOT APPLE AND NOT RISCOS AND NOT HAIKU) if(SDL_AUDIO) - if(SYSV5 OR SOLARIS OR HPUX) - set(SDL_AUDIO_DRIVER_SUNAUDIO 1) - file(GLOB SUN_AUDIO_SOURCES ${SDL3_SOURCE_DIR}/src/audio/sun/*.c) - list(APPEND SOURCE_FILES ${SUN_AUDIO_SOURCES}) - set(HAVE_SDL_AUDIO TRUE) - elseif(NETBSD) + if(NETBSD) set(SDL_AUDIO_DRIVER_NETBSD 1) file(GLOB NETBSD_AUDIO_SOURCES ${SDL3_SOURCE_DIR}/src/audio/netbsd/*.c) list(APPEND SOURCE_FILES ${NETBSD_AUDIO_SOURCES}) set(HAVE_SDL_AUDIO TRUE) - elseif(AIX) - set(SDL_AUDIO_DRIVER_PAUDIO 1) - file(GLOB AIX_AUDIO_SOURCES ${SDL3_SOURCE_DIR}/src/audio/paudio/*.c) - list(APPEND SOURCE_FILES ${AIX_AUDIO_SOURCES}) - set(HAVE_SDL_AUDIO TRUE) endif() CheckOSS() CheckALSA() - CheckJACK() CheckPipewire() CheckPulseAudio() - CheckESD() - CheckARTS() - CheckNAS() - CheckSNDIO() - CheckFusionSound() endif() if(SDL_VIDEO) @@ -1790,13 +1762,6 @@ elseif(WINDOWS) check_include_file(shellscalingapi.h HAVE_SHELLSCALINGAPI_H) if(SDL_AUDIO) - if(NOT WINDOWS_STORE) - set(SDL_AUDIO_DRIVER_WINMM 1) - file(GLOB WINMM_AUDIO_SOURCES ${SDL3_SOURCE_DIR}/src/audio/winmm/*.c) - list(APPEND SOURCE_FILES ${WINMM_AUDIO_SOURCES}) - set(HAVE_SDL_AUDIO TRUE) - endif() - if(HAVE_DSOUND_H AND NOT WINDOWS_STORE) set(SDL_AUDIO_DRIVER_DSOUND 1) file(GLOB DSOUND_AUDIO_SOURCES ${SDL3_SOURCE_DIR}/src/audio/directsound/*.c) diff --git a/acinclude/esd.m4 b/acinclude/esd.m4 deleted file mode 100644 index bd4b84849d..0000000000 --- a/acinclude/esd.m4 +++ /dev/null @@ -1,173 +0,0 @@ -# Configure paths for ESD -# Manish Singh 98-9-30 -# stolen back from Frank Belew -# stolen from Manish Singh -# Shamelessly stolen from Owen Taylor - -dnl AM_PATH_ESD([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) -dnl Test for ESD, and define ESD_CFLAGS and ESD_LIBS -dnl -AC_DEFUN([AM_PATH_ESD], -[dnl -dnl Get the cflags and libraries from the esd-config script -dnl -AC_ARG_WITH(esd-prefix,[ --with-esd-prefix=PFX Prefix where ESD is installed (optional)], - esd_prefix="$withval", esd_prefix="") -AC_ARG_WITH(esd-exec-prefix,[ --with-esd-exec-prefix=PFX Exec prefix where ESD is installed (optional)], - esd_exec_prefix="$withval", esd_exec_prefix="") -AC_ARG_ENABLE(esdtest, [ --disable-esdtest Do not try to compile and run a test ESD program], - , enable_esdtest=yes) - - if test x$esd_exec_prefix != x ; then - esd_args="$esd_args --exec-prefix=$esd_exec_prefix" - if test x${ESD_CONFIG+set} != xset ; then - ESD_CONFIG=$esd_exec_prefix/bin/esd-config - fi - fi - if test x$esd_prefix != x ; then - esd_args="$esd_args --prefix=$esd_prefix" - if test x${ESD_CONFIG+set} != xset ; then - ESD_CONFIG=$esd_prefix/bin/esd-config - fi - fi - - AC_PATH_PROG(ESD_CONFIG, esd-config, no) - min_esd_version=ifelse([$1], ,0.2.7,$1) - AC_MSG_CHECKING(for ESD - version >= $min_esd_version) - no_esd="" - if test "$ESD_CONFIG" = "no" ; then - no_esd=yes - else - ESD_CFLAGS=`$ESD_CONFIG $esdconf_args --cflags` - ESD_LIBS=`$ESD_CONFIG $esdconf_args --libs` - - esd_major_version=`$ESD_CONFIG $esd_args --version | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` - esd_minor_version=`$ESD_CONFIG $esd_args --version | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` - esd_micro_version=`$ESD_CONFIG $esd_config_args --version | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` - if test "x$enable_esdtest" = "xyes" ; then - AC_LANG_PUSH([C]) - ac_save_CFLAGS="$CFLAGS" - ac_save_LIBS="$LIBS" - CFLAGS="$CFLAGS $ESD_CFLAGS" - LIBS="$LIBS $ESD_LIBS" -dnl -dnl Now check if the installed ESD is sufficiently new. (Also sanity -dnl checks the results of esd-config to some extent -dnl - rm -f conf.esdtest - AC_RUN_IFELSE([AC_LANG_SOURCE([[ -#include -#include -#include - -int main (void) -{ - int major, minor, micro; - FILE *fp = fopen("conf.esdtest", "w"); - - if (fp) fclose(fp); - - if (sscanf("$min_esd_version", "%d.%d.%d", &major, &minor, µ) != 3) { - printf("%s, bad version string\n", "$min_esd_version"); - exit(1); - } - - if (($esd_major_version > major) || - (($esd_major_version == major) && ($esd_minor_version > minor)) || - (($esd_major_version == major) && ($esd_minor_version == minor) && ($esd_micro_version >= micro))) - { - return 0; - } - else - { - printf("\n*** 'esd-config --version' returned %d.%d.%d, but the minimum version\n", $esd_major_version, $esd_minor_version, $esd_micro_version); - printf("*** of ESD required is %d.%d.%d. If esd-config is correct, then it is\n", major, minor, micro); - printf("*** best to upgrade to the required version.\n"); - printf("*** If esd-config was wrong, set the environment variable ESD_CONFIG\n"); - printf("*** to point to the correct copy of esd-config, and remove the file\n"); - printf("*** config.cache before re-running configure\n"); - return 1; - } -} -]])], [], [no_esd=yes], [echo $ac_n "cross compiling; assumed OK... $ac_c"]) - CFLAGS="$ac_save_CFLAGS" - LIBS="$ac_save_LIBS" - AC_LANG_POP([C]) - fi - fi - if test "x$no_esd" = x ; then - AC_MSG_RESULT(yes) - ifelse([$2], , :, [$2]) - else - AC_MSG_RESULT(no) - if test "$ESD_CONFIG" = "no" ; then -dnl echo "*** The esd-config script installed by ESD could not be found" -dnl echo "*** If ESD was installed in PREFIX, make sure PREFIX/bin is in" -dnl echo "*** your path, or set the ESD_CONFIG environment variable to the" -dnl echo "*** full path to esd-config." - : - else - if test -f conf.esdtest ; then - : - else - echo "*** Could not run ESD test program, checking why..." - CFLAGS="$CFLAGS $ESD_CFLAGS" - LIBS="$LIBS $ESD_LIBS" - AC_LANG_PUSH([C]) - AC_LINK_IFELSE([AC_LANG_PROGRAM([[ -#include -#include -]], [[ return 0; ]])], - [ echo "*** The test program compiled, but did not run. This usually means" - echo "*** that the run-time linker is not finding ESD or finding the wrong" - echo "*** version of ESD. If it is not finding ESD, you'll need to set your" - echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" - echo "*** to the installed location Also, make sure you have run ldconfig if that" - echo "*** is required on your system" - echo "***" - echo "*** If you have an old version installed, it is best to remove it, although" - echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"], - [ echo "*** The test program failed to compile or link. See the file config.log for the" - echo "*** exact error that occured. This usually means ESD was incorrectly installed" - echo "*** or that you have moved ESD since it was installed. In the latter case, you" - echo "*** may want to edit the esd-config script: $ESD_CONFIG" ]) - CFLAGS="$ac_save_CFLAGS" - LIBS="$ac_save_LIBS" - AC_LANG_POP([C]) - fi - fi - ESD_CFLAGS="" - ESD_LIBS="" - ifelse([$3], , :, [$3]) - fi - AC_SUBST(ESD_CFLAGS) - AC_SUBST(ESD_LIBS) - rm -f conf.esdtest -]) - -dnl AM_ESD_SUPPORTS_MULTIPLE_RECORD([ACTION-IF-SUPPORTS [, ACTION-IF-NOT-SUPPORTS]]) -dnl Test, whether esd supports multiple recording clients (version >=0.2.21) -dnl -AC_DEFUN([AM_ESD_SUPPORTS_MULTIPLE_RECORD], -[dnl - AC_MSG_NOTICE([whether installed esd version supports multiple recording clients]) - ac_save_ESD_CFLAGS="$ESD_CFLAGS" - ac_save_ESD_LIBS="$ESD_LIBS" - AM_PATH_ESD(0.2.21, - ifelse([$1], , [ - AM_CONDITIONAL(ESD_SUPPORTS_MULTIPLE_RECORD, true) - AC_DEFINE(ESD_SUPPORTS_MULTIPLE_RECORD, 1, - [Define if you have esound with support of multiple recording clients.])], - [$1]), - ifelse([$2], , [AM_CONDITIONAL(ESD_SUPPORTS_MULTIPLE_RECORD, false)], [$2]) - if test "x$ac_save_ESD_CFLAGS" != x ; then - ESD_CFLAGS="$ac_save_ESD_CFLAGS" - fi - if test "x$ac_save_ESD_LIBS" != x ; then - ESD_LIBS="$ac_save_ESD_LIBS" - fi - ) -]) diff --git a/cmake/sdlchecks.cmake b/cmake/sdlchecks.cmake index b65d63aabc..553d670926 100644 --- a/cmake/sdlchecks.cmake +++ b/cmake/sdlchecks.cmake @@ -165,186 +165,6 @@ macro(CheckPulseAudio) endif() endmacro() -# Requires: -# - PkgCheckModules -# Optional: -# - SDL_JACK_SHARED opt -# - HAVE_SDL_LOADSO opt -macro(CheckJACK) - if(SDL_JACK) - pkg_check_modules(PKG_JACK jack) - if(PKG_JACK_FOUND) - set(HAVE_JACK TRUE) - file(GLOB JACK_SOURCES ${SDL3_SOURCE_DIR}/src/audio/jack/*.c) - list(APPEND SOURCE_FILES ${JACK_SOURCES}) - set(SDL_AUDIO_DRIVER_JACK 1) - list(APPEND EXTRA_CFLAGS ${PKG_JACK_CFLAGS}) - if(SDL_JACK_SHARED AND NOT HAVE_SDL_LOADSO) - message_warn("You must have SDL_LoadObject() support for dynamic JACK audio loading") - endif() - FindLibraryAndSONAME("jack" LIBDIRS ${PKG_JACK_LIBRARY_DIRS}) - if(SDL_JACK_SHARED AND JACK_LIB AND HAVE_SDL_LOADSO) - set(SDL_AUDIO_DRIVER_JACK_DYNAMIC "\"${JACK_LIB_SONAME}\"") - set(HAVE_JACK_SHARED TRUE) - else() - list(APPEND EXTRA_LDFLAGS ${PKG_JACK_LDFLAGS}) - endif() - set(HAVE_SDL_AUDIO TRUE) - endif() - endif() -endmacro() - -# Requires: -# - PkgCheckModules -# Optional: -# - SDL_ESD_SHARED opt -# - HAVE_SDL_LOADSO opt -macro(CheckESD) - if(SDL_ESD) - pkg_check_modules(PKG_ESD esound) - if(PKG_ESD_FOUND) - set(HAVE_ESD TRUE) - file(GLOB ESD_SOURCES ${SDL3_SOURCE_DIR}/src/audio/esd/*.c) - list(APPEND SOURCE_FILES ${ESD_SOURCES}) - set(SDL_AUDIO_DRIVER_ESD 1) - list(APPEND EXTRA_CFLAGS ${PKG_ESD_CFLAGS}) - if(SDL_ESD_SHARED AND NOT HAVE_SDL_LOADSO) - message_warn("You must have SDL_LoadObject() support for dynamic ESD loading") - endif() - FindLibraryAndSONAME(esd LIBDIRS ${PKG_ESD_LIBRARY_DIRS}) - if(SDL_ESD_SHARED AND ESD_LIB AND HAVE_SDL_LOADSO) - set(SDL_AUDIO_DRIVER_ESD_DYNAMIC "\"${ESD_LIB_SONAME}\"") - set(HAVE_ESD_SHARED TRUE) - else() - list(APPEND EXTRA_LDFLAGS ${PKG_ESD_LDFLAGS}) - endif() - set(HAVE_SDL_AUDIO TRUE) - endif() - endif() -endmacro() - -# Requires: -# - n/a -# Optional: -# - SDL_ARTS_SHARED opt -# - HAVE_SDL_LOADSO opt -macro(CheckARTS) - if(SDL_ARTS) - find_program(ARTS_CONFIG arts-config) - if(ARTS_CONFIG) - execute_process(CMD_ARTSCFLAGS ${ARTS_CONFIG} --cflags - OUTPUT_VARIABLE ARTS_CFLAGS OUTPUT_STRIP_TRAILING_WHITESPACE) - list(APPEND EXTRA_CFLAGS ${ARTS_CFLAGS}) - execute_process(CMD_ARTSLIBS ${ARTS_CONFIG} --libs - OUTPUT_VARIABLE ARTS_LIBS OUTPUT_STRIP_TRAILING_WHITESPACE) - file(GLOB ARTS_SOURCES ${SDL3_SOURCE_DIR}/src/audio/arts/*.c) - list(APPEND SOURCE_FILES ${ARTS_SOURCES}) - set(SDL_AUDIO_DRIVER_ARTS 1) - set(HAVE_ARTS TRUE) - if(SDL_ARTS_SHARED AND NOT HAVE_SDL_LOADSO) - message_warn("You must have SDL_LoadObject() support for dynamic ARTS loading") - endif() - FindLibraryAndSONAME(artsc) - if(SDL_ARTS_SHARED AND ARTSC_LIB AND HAVE_SDL_LOADSO) - # TODO - set(SDL_AUDIO_DRIVER_ARTS_DYNAMIC "\"${ARTSC_LIB_SONAME}\"") - set(HAVE_ARTS_SHARED TRUE) - else() - list(APPEND EXTRA_LDFLAGS ${ARTS_LIBS}) - endif() - set(HAVE_SDL_AUDIO TRUE) - endif() - endif() -endmacro() - -# Requires: -# - n/a -# Optional: -# - SDL_NAS_SHARED opt -# - HAVE_SDL_LOADSO opt -macro(CheckNAS) - if(SDL_NAS) - # TODO: set include paths properly, so the NAS headers are found - check_include_file(audio/audiolib.h HAVE_NAS_H) - find_library(D_NAS_LIB audio) - if(HAVE_NAS_H AND D_NAS_LIB) - set(HAVE_NAS TRUE) - file(GLOB NAS_SOURCES ${SDL3_SOURCE_DIR}/src/audio/nas/*.c) - list(APPEND SOURCE_FILES ${NAS_SOURCES}) - set(SDL_AUDIO_DRIVER_NAS 1) - if(SDL_NAS_SHARED AND NOT HAVE_SDL_LOADSO) - message_warn("You must have SDL_LoadObject() support for dynamic NAS loading") - endif() - FindLibraryAndSONAME("audio") - if(SDL_NAS_SHARED AND AUDIO_LIB AND HAVE_SDL_LOADSO) - set(SDL_AUDIO_DRIVER_NAS_DYNAMIC "\"${AUDIO_LIB_SONAME}\"") - set(HAVE_NAS_SHARED TRUE) - else() - list(APPEND EXTRA_LIBS ${D_NAS_LIB}) - endif() - set(HAVE_SDL_AUDIO TRUE) - endif() - endif() -endmacro() - -# Requires: -# - PkgCheckModules -# Optional: -# - SDL_SNDIO_SHARED opt -# - HAVE_SDL_LOADSO opt -macro(CheckSNDIO) - if(SDL_SNDIO) - pkg_check_modules(PKG_SNDIO sndio) - if(PKG_SNDIO_FOUND) - set(HAVE_SNDIO TRUE) - file(GLOB SNDIO_SOURCES ${SDL3_SOURCE_DIR}/src/audio/sndio/*.c) - list(APPEND SOURCE_FILES ${SNDIO_SOURCES}) - set(SDL_AUDIO_DRIVER_SNDIO 1) - list(APPEND EXTRA_CFLAGS ${PKG_SNDIO_CFLAGS}) - if(SDL_SNDIO_SHARED AND NOT HAVE_SDL_LOADSO) - message_warn("You must have SDL_LoadObject() support for dynamic sndio loading") - endif() - FindLibraryAndSONAME("sndio" LIBDIRS ${PKG_SNDIO_LIBRARY_DIRS}) - if(SDL_SNDIO_SHARED AND SNDIO_LIB AND HAVE_SDL_LOADSO) - set(SDL_AUDIO_DRIVER_SNDIO_DYNAMIC "\"${SNDIO_LIB_SONAME}\"") - set(HAVE_SNDIO_SHARED TRUE) - else() - list(APPEND EXTRA_LIBS ${PKG_SNDIO_LDFLAGS}) - endif() - set(HAVE_SDL_AUDIO TRUE) - endif() - endif() -endmacro() - -# Requires: -# - PkgCheckModules -# Optional: -# - FUSIONSOUND_SHARED opt -# - HAVE_SDL_LOADSO opt -macro(CheckFusionSound) - if(FUSIONSOUND) - pkg_check_modules(PKG_FUSIONSOUND fusionsound>=1.0.0) - if(PKG_FUSIONSOUND_FOUND) - set(HAVE_FUSIONSOUND TRUE) - file(GLOB FUSIONSOUND_SOURCES ${SDL3_SOURCE_DIR}/src/audio/fusionsound/*.c) - list(APPEND SOURCE_FILES ${FUSIONSOUND_SOURCES}) - set(SDL_AUDIO_DRIVER_FUSIONSOUND 1) - list(APPEND EXTRA_CFLAGS ${PKG_FUSIONSOUND_CFLAGS}) - if(FUSIONSOUND_SHARED AND NOT HAVE_SDL_LOADSO) - message_warn("You must have SDL_LoadObject() support for dynamic FusionSound loading") - endif() - FindLibraryAndSONAME("fusionsound" LIBDIRS ${PKG_FUSIONSOUND_LIBRARY_DIRS}) - if(FUSIONSOUND_SHARED AND FUSIONSOUND_LIB AND HAVE_SDL_LOADSO) - set(SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC "\"${FUSIONSOUND_LIB_SONAME}\"") - set(HAVE_FUSIONSOUND_SHARED TRUE) - else() - list(APPEND EXTRA_LDFLAGS ${PKG_FUSIONSOUND_LDFLAGS}) - endif() - set(HAVE_SDL_AUDIO TRUE) - endif() - endif() -endmacro() - # Requires: # - SDL_LIBSAMPLERATE # Optional: diff --git a/configure b/configure index 79763cbba2..a641003f75 100755 --- a/configure +++ b/configure @@ -706,20 +706,10 @@ RPI_LIBS RPI_CFLAGS DECOR_LIBS DECOR_CFLAGS -FUSIONSOUND_LIBS -FUSIONSOUND_CFLAGS -SNDIO_LIBS -SNDIO_CFLAGS -ARTSCONFIG PULSEAUDIO_LIBS PULSEAUDIO_CFLAGS PIPEWIRE_LIBS PIPEWIRE_CFLAGS -ESD_CONFIG -ESD_LIBS -ESD_CFLAGS -JACK_LIBS -JACK_CFLAGS ALSA_LIBS ALSA_CFLAGS ALLOCA @@ -878,25 +868,10 @@ with_alsa_prefix with_alsa_inc_prefix enable_alsatest enable_alsa_shared -enable_jack -enable_jack_shared -enable_esd -with_esd_prefix -with_esd_exec_prefix -enable_esdtest -enable_esd_shared enable_pipewire enable_pipewire_shared enable_pulseaudio enable_pulseaudio_shared -enable_arts -enable_arts_shared -enable_nas -enable_nas_shared -enable_sndio -enable_sndio_shared -enable_fusionsound -enable_fusionsound_shared enable_diskaudio enable_dummyaudio enable_libsamplerate @@ -974,18 +949,10 @@ PKG_CONFIG PKG_CONFIG_PATH PKG_CONFIG_LIBDIR CPP -JACK_CFLAGS -JACK_LIBS -ESD_CFLAGS -ESD_LIBS PIPEWIRE_CFLAGS PIPEWIRE_LIBS PULSEAUDIO_CFLAGS PULSEAUDIO_LIBS -SNDIO_CFLAGS -SNDIO_LIBS -FUSIONSOUND_CFLAGS -FUSIONSOUND_LIBS DECOR_CFLAGS DECOR_LIBS RPI_CFLAGS @@ -1676,28 +1643,12 @@ Optional Features: --enable-alsa support the ALSA audio API [default=yes] --disable-alsatest Do not try to compile and run a test Alsa program --enable-alsa-shared dynamically load ALSA audio support [default=yes] - --enable-jack use JACK audio [default=yes] - --enable-jack-shared dynamically load JACK audio support [default=yes] - --enable-esd support the Enlightened Sound Daemon [default=yes] - --disable-esdtest Do not try to compile and run a test ESD program - --enable-esd-shared dynamically load ESD audio support [default=yes] --enable-pipewire use Pipewire audio [default=yes] --enable-pipewire-shared dynamically load Pipewire support [default=yes] --enable-pulseaudio use PulseAudio [default=yes] --enable-pulseaudio-shared dynamically load PulseAudio support [default=yes] - --enable-arts support the Analog Real Time Synthesizer - [default=yes] - --enable-arts-shared dynamically load aRts audio support [default=yes] - --enable-nas support the NAS audio API [default=yes] - --enable-nas-shared dynamically load NAS audio support [default=yes] - --enable-sndio support the sndio audio API [default=yes] - --enable-sndio-shared dynamically load sndio audio support [default=yes] - --enable-fusionsound use FusionSound audio driver [default=no] - --enable-fusionsound-shared - dynamically load fusionsound audio support - [default=yes] --enable-diskaudio support the disk writer audio driver [default=yes] --enable-dummyaudio support the dummy audio driver [default=yes] --enable-libsamplerate use libsamplerate for audio rate conversion @@ -1799,8 +1750,6 @@ Optional Packages: compiler's sysroot if not specified). --with-alsa-prefix=PFX Prefix where Alsa library is installed(optional) --with-alsa-inc-prefix=PFX Prefix where include libraries are (optional) - --with-esd-prefix=PFX Prefix where ESD is installed (optional) - --with-esd-exec-prefix=PFX Exec prefix where ESD is installed (optional) --with-x use the X Window System Some influential environment variables: @@ -1822,10 +1771,6 @@ Some influential environment variables: PKG_CONFIG_LIBDIR path overriding pkg-config's built-in search path CPP C preprocessor - JACK_CFLAGS C compiler flags for JACK, overriding pkg-config - JACK_LIBS linker flags for JACK, overriding pkg-config - ESD_CFLAGS C compiler flags for ESD, overriding pkg-config - ESD_LIBS linker flags for ESD, overriding pkg-config PIPEWIRE_CFLAGS C compiler flags for PIPEWIRE, overriding pkg-config PIPEWIRE_LIBS @@ -1834,13 +1779,6 @@ Some influential environment variables: C compiler flags for PULSEAUDIO, overriding pkg-config PULSEAUDIO_LIBS linker flags for PULSEAUDIO, overriding pkg-config - SNDIO_CFLAGS - C compiler flags for SNDIO, overriding pkg-config - SNDIO_LIBS linker flags for SNDIO, overriding pkg-config - FUSIONSOUND_CFLAGS - C compiler flags for FUSIONSOUND, overriding pkg-config - FUSIONSOUND_LIBS - linker flags for FUSIONSOUND, overriding pkg-config DECOR_CFLAGS C compiler flags for DECOR, overriding pkg-config DECOR_LIBS linker flags for DECOR, overriding pkg-config @@ -21326,504 +21264,6 @@ printf "%s\n" "#define SDL_AUDIO_DRIVER_ALSA_DYNAMIC \"$alsa_lib\"" >>confdefs.h fi } -CheckJACK() -{ - # Check whether --enable-jack was given. -if test ${enable_jack+y} -then : - enableval=$enable_jack; -else $as_nop - enable_jack=yes -fi - - if test x$enable_audio = xyes -a x$enable_jack = xyes; then - -pkg_failed=no -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for jack >= 0.125" >&5 -printf %s "checking for jack >= 0.125... " >&6; } - -if test -n "$JACK_CFLAGS"; then - pkg_cv_JACK_CFLAGS="$JACK_CFLAGS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"jack >= 0.125\""; } >&5 - ($PKG_CONFIG --exists --print-errors "jack >= 0.125") 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_JACK_CFLAGS=`$PKG_CONFIG --cflags "jack >= 0.125" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes -else - pkg_failed=yes -fi - else - pkg_failed=untried -fi -if test -n "$JACK_LIBS"; then - pkg_cv_JACK_LIBS="$JACK_LIBS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"jack >= 0.125\""; } >&5 - ($PKG_CONFIG --exists --print-errors "jack >= 0.125") 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_JACK_LIBS=`$PKG_CONFIG --libs "jack >= 0.125" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes -else - pkg_failed=yes -fi - else - pkg_failed=untried -fi - - - -if test $pkg_failed = yes; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } - -if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then - _pkg_short_errors_supported=yes -else - _pkg_short_errors_supported=no -fi - if test $_pkg_short_errors_supported = yes; then - JACK_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "jack >= 0.125" 2>&1` - else - JACK_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "jack >= 0.125" 2>&1` - fi - # Put the nasty error message in config.log where it belongs - echo "$JACK_PKG_ERRORS" >&5 - - audio_jack=no -elif test $pkg_failed = untried; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } - audio_jack=no -else - JACK_CFLAGS=$pkg_cv_JACK_CFLAGS - JACK_LIBS=$pkg_cv_JACK_LIBS - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } - audio_jack=yes -fi - - if test x$audio_jack = xyes; then - # Check whether --enable-jack-shared was given. -if test ${enable_jack_shared+y} -then : - enableval=$enable_jack_shared; -else $as_nop - enable_jack_shared=yes -fi - - jack_lib=`find_lib "libjack.so.*" "$JACK_LIBS" | sed 's/.*\/\(.*\)/\1/; q'` - - -printf "%s\n" "#define SDL_AUDIO_DRIVER_JACK 1" >>confdefs.h - - SOURCES="$SOURCES $srcdir/src/audio/jack/*.c" - EXTRA_CFLAGS="$EXTRA_CFLAGS $JACK_CFLAGS" - if test x$have_loadso != xyes && \ - test x$enable_jack_shared = xyes; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: You must have SDL_LoadObject() support for dynamic JACK audio loading" >&5 -printf "%s\n" "$as_me: WARNING: You must have SDL_LoadObject() support for dynamic JACK audio loading" >&2;} - fi - if test x$have_loadso = xyes && \ - test x$enable_jack_shared = xyes && test x$jack_lib != x; then - echo "-- dynamic libjack -> $jack_lib" - -printf "%s\n" "#define SDL_AUDIO_DRIVER_JACK_DYNAMIC \"$jack_lib\"" >>confdefs.h - - SUMMARY_audio="${SUMMARY_audio} jack(dynamic)" - - case "$host" in - # On Solaris, jack must be linked deferred explicitly - # to prevent undefined symbol failures. - *-*-solaris*) - JACK_LIBS=`echo $JACK_LIBS | sed 's/\-l/-Wl,-l/g'` - EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-zdeferred $JACK_LIBS -Wl,-znodeferred" - esac - else - EXTRA_LDFLAGS="$EXTRA_LDFLAGS $JACK_LIBS" - SUMMARY_audio="${SUMMARY_audio} jack" - fi - have_audio=yes - fi - fi -} - -CheckESD() -{ - # Check whether --enable-esd was given. -if test ${enable_esd+y} -then : - enableval=$enable_esd; -else $as_nop - enable_esd=yes -fi - - if test x$enable_audio = xyes -a x$enable_esd = xyes; then - -pkg_failed=no -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for esound >= 0.2.8" >&5 -printf %s "checking for esound >= 0.2.8... " >&6; } - -if test -n "$ESD_CFLAGS"; then - pkg_cv_ESD_CFLAGS="$ESD_CFLAGS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"esound >= 0.2.8\""; } >&5 - ($PKG_CONFIG --exists --print-errors "esound >= 0.2.8") 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_ESD_CFLAGS=`$PKG_CONFIG --cflags "esound >= 0.2.8" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes -else - pkg_failed=yes -fi - else - pkg_failed=untried -fi -if test -n "$ESD_LIBS"; then - pkg_cv_ESD_LIBS="$ESD_LIBS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"esound >= 0.2.8\""; } >&5 - ($PKG_CONFIG --exists --print-errors "esound >= 0.2.8") 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_ESD_LIBS=`$PKG_CONFIG --libs "esound >= 0.2.8" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes -else - pkg_failed=yes -fi - else - pkg_failed=untried -fi - - - -if test $pkg_failed = yes; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } - -if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then - _pkg_short_errors_supported=yes -else - _pkg_short_errors_supported=no -fi - if test $_pkg_short_errors_supported = yes; then - ESD_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "esound >= 0.2.8" 2>&1` - else - ESD_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "esound >= 0.2.8" 2>&1` - fi - # Put the nasty error message in config.log where it belongs - echo "$ESD_PKG_ERRORS" >&5 - - have_esd=no -elif test $pkg_failed = untried; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } - have_esd=no -else - ESD_CFLAGS=$pkg_cv_ESD_CFLAGS - ESD_LIBS=$pkg_cv_ESD_LIBS - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } - have_esd=yes -fi - if test x$have_esd = xno; then - -# Check whether --with-esd-prefix was given. -if test ${with_esd_prefix+y} -then : - withval=$with_esd_prefix; esd_prefix="$withval" -else $as_nop - esd_prefix="" -fi - - -# Check whether --with-esd-exec-prefix was given. -if test ${with_esd_exec_prefix+y} -then : - withval=$with_esd_exec_prefix; esd_exec_prefix="$withval" -else $as_nop - esd_exec_prefix="" -fi - -# Check whether --enable-esdtest was given. -if test ${enable_esdtest+y} -then : - enableval=$enable_esdtest; -else $as_nop - enable_esdtest=yes -fi - - - if test x$esd_exec_prefix != x ; then - esd_args="$esd_args --exec-prefix=$esd_exec_prefix" - if test x${ESD_CONFIG+set} != xset ; then - ESD_CONFIG=$esd_exec_prefix/bin/esd-config - fi - fi - if test x$esd_prefix != x ; then - esd_args="$esd_args --prefix=$esd_prefix" - if test x${ESD_CONFIG+set} != xset ; then - ESD_CONFIG=$esd_prefix/bin/esd-config - fi - fi - - # Extract the first word of "esd-config", so it can be a program name with args. -set dummy esd-config; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_path_ESD_CONFIG+y} -then : - printf %s "(cached) " >&6 -else $as_nop - case $ESD_CONFIG in - [\\/]* | ?:[\\/]*) - ac_cv_path_ESD_CONFIG="$ESD_CONFIG" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_path_ESD_CONFIG="$as_dir$ac_word$ac_exec_ext" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - test -z "$ac_cv_path_ESD_CONFIG" && ac_cv_path_ESD_CONFIG="no" - ;; -esac -fi -ESD_CONFIG=$ac_cv_path_ESD_CONFIG -if test -n "$ESD_CONFIG"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ESD_CONFIG" >&5 -printf "%s\n" "$ESD_CONFIG" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - - min_esd_version=0.2.8 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ESD - version >= $min_esd_version" >&5 -printf %s "checking for ESD - version >= $min_esd_version... " >&6; } - no_esd="" - if test "$ESD_CONFIG" = "no" ; then - no_esd=yes - else - ESD_CFLAGS=`$ESD_CONFIG $esdconf_args --cflags` - ESD_LIBS=`$ESD_CONFIG $esdconf_args --libs` - - esd_major_version=`$ESD_CONFIG $esd_args --version | \ - sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'` - esd_minor_version=`$ESD_CONFIG $esd_args --version | \ - sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'` - esd_micro_version=`$ESD_CONFIG $esd_config_args --version | \ - sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'` - if test "x$enable_esdtest" = "xyes" ; then - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - ac_save_CFLAGS="$CFLAGS" - ac_save_LIBS="$LIBS" - CFLAGS="$CFLAGS $ESD_CFLAGS" - LIBS="$LIBS $ESD_LIBS" - rm -f conf.esdtest - if test "$cross_compiling" = yes -then : - echo $ac_n "cross compiling; assumed OK... $ac_c" -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include -#include -#include - -int main (void) -{ - int major, minor, micro; - FILE *fp = fopen("conf.esdtest", "w"); - - if (fp) fclose(fp); - - if (sscanf("$min_esd_version", "%d.%d.%d", &major, &minor, µ) != 3) { - printf("%s, bad version string\n", "$min_esd_version"); - exit(1); - } - - if (($esd_major_version > major) || - (($esd_major_version == major) && ($esd_minor_version > minor)) || - (($esd_major_version == major) && ($esd_minor_version == minor) && ($esd_micro_version >= micro))) - { - return 0; - } - else - { - printf("\n*** 'esd-config --version' returned %d.%d.%d, but the minimum version\n", $esd_major_version, $esd_minor_version, $esd_micro_version); - printf("*** of ESD required is %d.%d.%d. If esd-config is correct, then it is\n", major, minor, micro); - printf("*** best to upgrade to the required version.\n"); - printf("*** If esd-config was wrong, set the environment variable ESD_CONFIG\n"); - printf("*** to point to the correct copy of esd-config, and remove the file\n"); - printf("*** config.cache before re-running configure\n"); - return 1; - } -} - -_ACEOF -if ac_fn_c_try_run "$LINENO" -then : - -else $as_nop - no_esd=yes -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - - CFLAGS="$ac_save_CFLAGS" - LIBS="$ac_save_LIBS" - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - fi - fi - if test "x$no_esd" = x ; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } - have_esd=yes - else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } - if test "$ESD_CONFIG" = "no" ; then - : - else - if test -f conf.esdtest ; then - : - else - echo "*** Could not run ESD test program, checking why..." - CFLAGS="$CFLAGS $ESD_CFLAGS" - LIBS="$LIBS $ESD_LIBS" - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include -#include - -int -main (void) -{ - return 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - echo "*** The test program compiled, but did not run. This usually means" - echo "*** that the run-time linker is not finding ESD or finding the wrong" - echo "*** version of ESD. If it is not finding ESD, you'll need to set your" - echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" - echo "*** to the installed location Also, make sure you have run ldconfig if that" - echo "*** is required on your system" - echo "***" - echo "*** If you have an old version installed, it is best to remove it, although" - echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" -else $as_nop - echo "*** The test program failed to compile or link. See the file config.log for the" - echo "*** exact error that occured. This usually means ESD was incorrectly installed" - echo "*** or that you have moved ESD since it was installed. In the latter case, you" - echo "*** may want to edit the esd-config script: $ESD_CONFIG" -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext - CFLAGS="$ac_save_CFLAGS" - LIBS="$ac_save_LIBS" - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - fi - fi - ESD_CFLAGS="" - ESD_LIBS="" - have_esd=no - fi - - - rm -f conf.esdtest - - fi - if test x$have_esd = xyes; then - # Check whether --enable-esd-shared was given. -if test ${enable_esd_shared+y} -then : - enableval=$enable_esd_shared; -else $as_nop - enable_esd_shared=yes -fi - - esd_lib=`find_lib "libesd.so.*" "$ESD_LIBS" | sed 's/.*\/\(.*\)/\1/; q'` - - -printf "%s\n" "#define SDL_AUDIO_DRIVER_ESD 1" >>confdefs.h - - SOURCES="$SOURCES $srcdir/src/audio/esd/*.c" - EXTRA_CFLAGS="$EXTRA_CFLAGS $ESD_CFLAGS" - if test x$have_loadso != xyes && \ - test x$enable_esd_shared = xyes; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: You must have SDL_LoadObject() support for dynamic ESD loading" >&5 -printf "%s\n" "$as_me: WARNING: You must have SDL_LoadObject() support for dynamic ESD loading" >&2;} - fi - if test x$have_loadso = xyes && \ - test x$enable_esd_shared = xyes && test x$esd_lib != x; then - echo "-- dynamic libesd -> $esd_lib" - -printf "%s\n" "#define SDL_AUDIO_DRIVER_ESD_DYNAMIC \"$esd_lib\"" >>confdefs.h - - SUMMARY_audio="${SUMMARY_audio} esd(dynamic)" - else - EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ESD_LIBS" - SUMMARY_audio="${SUMMARY_audio} esd" - fi - have_audio=yes - fi - fi -} - CheckPipewire() { # Check whether --enable-pipewire was given. @@ -22072,493 +21512,6 @@ printf "%s\n" "#define SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC \"$pulseaudio_lib\"" fi } -CheckARTSC() -{ - # Check whether --enable-arts was given. -if test ${enable_arts+y} -then : - enableval=$enable_arts; -else $as_nop - enable_arts=yes -fi - - if test x$enable_audio = xyes -a x$enable_arts = xyes; then - # Extract the first word of "artsc-config", so it can be a program name with args. -set dummy artsc-config; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_path_ARTSCONFIG+y} -then : - printf %s "(cached) " >&6 -else $as_nop - case $ARTSCONFIG in - [\\/]* | ?:[\\/]*) - ac_cv_path_ARTSCONFIG="$ARTSCONFIG" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_path_ARTSCONFIG="$as_dir$ac_word$ac_exec_ext" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -ARTSCONFIG=$ac_cv_path_ARTSCONFIG -if test -n "$ARTSCONFIG"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ARTSCONFIG" >&5 -printf "%s\n" "$ARTSCONFIG" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - - if test x$ARTSCONFIG = x -o x$ARTSCONFIG = x'"$ARTSCONFIG"'; then - : # arts isn't installed - else - ARTS_CFLAGS=`$ARTSCONFIG --cflags` - ARTS_LIBS=`$ARTSCONFIG --libs` - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for aRts development environment" >&5 -printf %s "checking for aRts development environment... " >&6; } - audio_arts=no - save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $ARTS_CFLAGS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - #include - -int -main (void) -{ - - arts_stream_t stream; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - audio_arts=yes -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - CFLAGS="$save_CFLAGS" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $audio_arts" >&5 -printf "%s\n" "$audio_arts" >&6; } - if test x$audio_arts = xyes; then - # Check whether --enable-arts-shared was given. -if test ${enable_arts_shared+y} -then : - enableval=$enable_arts_shared; -else $as_nop - enable_arts_shared=yes -fi - - arts_lib=`find_lib "libartsc.so.*" "$ARTS_LIBS" | sed 's/.*\/\(.*\)/\1/; q'` - - -printf "%s\n" "#define SDL_AUDIO_DRIVER_ARTS 1" >>confdefs.h - - SOURCES="$SOURCES $srcdir/src/audio/arts/*.c" - EXTRA_CFLAGS="$EXTRA_CFLAGS $ARTS_CFLAGS" - if test x$have_loadso != xyes && \ - test x$enable_arts_shared = xyes; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: You must have SDL_LoadObject() support for dynamic ARTS loading" >&5 -printf "%s\n" "$as_me: WARNING: You must have SDL_LoadObject() support for dynamic ARTS loading" >&2;} - fi - if test x$have_loadso = xyes && \ - test x$enable_arts_shared = xyes && test x$arts_lib != x; then - echo "-- dynamic libartsc -> $arts_lib" - -printf "%s\n" "#define SDL_AUDIO_DRIVER_ARTS_DYNAMIC \"$arts_lib\"" >>confdefs.h - - SUMMARY_audio="${SUMMARY_audio} arts(dynamic)" - else - EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ARTS_LIBS" - SUMMARY_audio="${SUMMARY_audio} arts" - fi - have_audio=yes - fi - fi - fi -} - -CheckNAS() -{ - # Check whether --enable-nas was given. -if test ${enable_nas+y} -then : - enableval=$enable_nas; -else $as_nop - enable_nas=yes -fi - - if test x$enable_audio = xyes -a x$enable_nas = xyes; then - ac_fn_c_check_header_compile "$LINENO" "audio/audiolib.h" "ac_cv_header_audio_audiolib_h" "$ac_includes_default" -if test "x$ac_cv_header_audio_audiolib_h" = xyes -then : - have_nas_hdr=yes -fi - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for AuOpenServer in -laudio" >&5 -printf %s "checking for AuOpenServer in -laudio... " >&6; } -if test ${ac_cv_lib_audio_AuOpenServer+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS -LIBS="-laudio $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char AuOpenServer (); -int -main (void) -{ -return AuOpenServer (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_lib_audio_AuOpenServer=yes -else $as_nop - ac_cv_lib_audio_AuOpenServer=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_audio_AuOpenServer" >&5 -printf "%s\n" "$ac_cv_lib_audio_AuOpenServer" >&6; } -if test "x$ac_cv_lib_audio_AuOpenServer" = xyes -then : - have_nas_lib=yes -fi - - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for NAS audio support" >&5 -printf %s "checking for NAS audio support... " >&6; } - have_nas=no - - if test x$have_nas_hdr = xyes -a x$have_nas_lib = xyes; then - have_nas=yes - NAS_LIBS="-laudio" - - elif test -r /usr/X11R6/include/audio/audiolib.h; then - have_nas=yes - NAS_CFLAGS="-I/usr/X11R6/include/" - NAS_LIBS="-L/usr/X11R6/lib -laudio -lXt" - - fi - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $have_nas" >&5 -printf "%s\n" "$have_nas" >&6; } - - if test x$have_nas = xyes; then - # Check whether --enable-nas-shared was given. -if test ${enable_nas_shared+y} -then : - enableval=$enable_nas_shared; -else $as_nop - enable_nas_shared=yes -fi - - nas_lib=`find_lib "libaudio.so.*" "$NAS_LIBS" | sed 's/.*\/\(.*\)/\1/; q'` - - if test x$have_loadso != xyes && \ - test x$enable_nas_shared = xyes; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: You must have SDL_LoadObject() support for dynamic NAS loading" >&5 -printf "%s\n" "$as_me: WARNING: You must have SDL_LoadObject() support for dynamic NAS loading" >&2;} - fi - if test x$have_loadso = xyes && \ - test x$enable_nas_shared = xyes && test x$nas_lib != x; then - echo "-- dynamic libaudio -> $nas_lib" - -printf "%s\n" "#define SDL_AUDIO_DRIVER_NAS_DYNAMIC \"$nas_lib\"" >>confdefs.h - - SUMMARY_audio="${SUMMARY_audio} nas(dynamic)" - else - EXTRA_LDFLAGS="$EXTRA_LDFLAGS $NAS_LIBS" - SUMMARY_audio="${SUMMARY_audio} nas" - fi - - -printf "%s\n" "#define SDL_AUDIO_DRIVER_NAS 1" >>confdefs.h - - SOURCES="$SOURCES $srcdir/src/audio/nas/*.c" - EXTRA_CFLAGS="$EXTRA_CFLAGS $NAS_CFLAGS" - have_audio=yes - fi - fi -} - -CheckSNDIO() -{ - # Check whether --enable-sndio was given. -if test ${enable_sndio+y} -then : - enableval=$enable_sndio; -else $as_nop - enable_sndio=yes -fi - - if test x$enable_audio = xyes -a x$enable_sndio = xyes; then - -pkg_failed=no -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for sndio" >&5 -printf %s "checking for sndio... " >&6; } - -if test -n "$SNDIO_CFLAGS"; then - pkg_cv_SNDIO_CFLAGS="$SNDIO_CFLAGS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"sndio\""; } >&5 - ($PKG_CONFIG --exists --print-errors "sndio") 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_SNDIO_CFLAGS=`$PKG_CONFIG --cflags "sndio" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes -else - pkg_failed=yes -fi - else - pkg_failed=untried -fi -if test -n "$SNDIO_LIBS"; then - pkg_cv_SNDIO_LIBS="$SNDIO_LIBS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"sndio\""; } >&5 - ($PKG_CONFIG --exists --print-errors "sndio") 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_SNDIO_LIBS=`$PKG_CONFIG --libs "sndio" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes -else - pkg_failed=yes -fi - else - pkg_failed=untried -fi - - - -if test $pkg_failed = yes; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } - -if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then - _pkg_short_errors_supported=yes -else - _pkg_short_errors_supported=no -fi - if test $_pkg_short_errors_supported = yes; then - SNDIO_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "sndio" 2>&1` - else - SNDIO_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "sndio" 2>&1` - fi - # Put the nasty error message in config.log where it belongs - echo "$SNDIO_PKG_ERRORS" >&5 - - audio_sndio=no -elif test $pkg_failed = untried; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } - audio_sndio=no -else - SNDIO_CFLAGS=$pkg_cv_SNDIO_CFLAGS - SNDIO_LIBS=$pkg_cv_SNDIO_LIBS - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } - audio_sndio=yes -fi - - if test x$audio_sndio = xyes; then - # Check whether --enable-sndio-shared was given. -if test ${enable_sndio_shared+y} -then : - enableval=$enable_sndio_shared; -else $as_nop - enable_sndio_shared=yes -fi - - sndio_lib=`find_lib "libsndio.so.*" "$SNDIO_LIBS" | sed 's/.*\/\(.*\)/\1/; q'` - - if test x$have_loadso != xyes && \ - test x$enable_sndio_shared = xyes; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: You must have SDL_LoadObject() support for dynamic sndio loading" >&5 -printf "%s\n" "$as_me: WARNING: You must have SDL_LoadObject() support for dynamic sndio loading" >&2;} - fi - if test x$have_loadso = xyes && \ - test x$enable_sndio_shared = xyes && test x$sndio_lib != x; then - echo "-- dynamic libsndio -> $sndio_lib" - -printf "%s\n" "#define SDL_AUDIO_DRIVER_SNDIO_DYNAMIC \"$sndio_lib\"" >>confdefs.h - - SUMMARY_audio="${SUMMARY_audio} sndio(dynamic)" - else - EXTRA_LDFLAGS="$EXTRA_LDFLAGS $SNDIO_LIBS" - SUMMARY_audio="${SUMMARY_audio} sndio" - fi - - -printf "%s\n" "#define SDL_AUDIO_DRIVER_SNDIO 1" >>confdefs.h - - SOURCES="$SOURCES $srcdir/src/audio/sndio/*.c" - EXTRA_CFLAGS="$EXTRA_CFLAGS $SNDIO_CFLAGS" - have_audio=yes - fi - fi -} - -CheckFusionSound() -{ - # Check whether --enable-fusionsound was given. -if test ${enable_fusionsound+y} -then : - enableval=$enable_fusionsound; -else $as_nop - enable_fusionsound=no -fi - - if test x$enable_audio = xyes -a x$enable_fusionsound = xyes; then - -pkg_failed=no -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for fusionsound >= 1.1.1" >&5 -printf %s "checking for fusionsound >= 1.1.1... " >&6; } - -if test -n "$FUSIONSOUND_CFLAGS"; then - pkg_cv_FUSIONSOUND_CFLAGS="$FUSIONSOUND_CFLAGS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"fusionsound >= 1.1.1\""; } >&5 - ($PKG_CONFIG --exists --print-errors "fusionsound >= 1.1.1") 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_FUSIONSOUND_CFLAGS=`$PKG_CONFIG --cflags "fusionsound >= 1.1.1" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes -else - pkg_failed=yes -fi - else - pkg_failed=untried -fi -if test -n "$FUSIONSOUND_LIBS"; then - pkg_cv_FUSIONSOUND_LIBS="$FUSIONSOUND_LIBS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"fusionsound >= 1.1.1\""; } >&5 - ($PKG_CONFIG --exists --print-errors "fusionsound >= 1.1.1") 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_FUSIONSOUND_LIBS=`$PKG_CONFIG --libs "fusionsound >= 1.1.1" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes -else - pkg_failed=yes -fi - else - pkg_failed=untried -fi - - - -if test $pkg_failed = yes; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } - -if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then - _pkg_short_errors_supported=yes -else - _pkg_short_errors_supported=no -fi - if test $_pkg_short_errors_supported = yes; then - FUSIONSOUND_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "fusionsound >= 1.1.1" 2>&1` - else - FUSIONSOUND_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "fusionsound >= 1.1.1" 2>&1` - fi - # Put the nasty error message in config.log where it belongs - echo "$FUSIONSOUND_PKG_ERRORS" >&5 - - fusionsound=no -elif test $pkg_failed = untried; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } - fusionsound=no -else - FUSIONSOUND_CFLAGS=$pkg_cv_FUSIONSOUND_CFLAGS - FUSIONSOUND_LIBS=$pkg_cv_FUSIONSOUND_LIBS - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } - fusionsound=yes -fi - - if test x$fusionsound = xyes; then - -printf "%s\n" "#define SDL_AUDIO_DRIVER_FUSIONSOUND 1" >>confdefs.h - - SOURCES="$SOURCES $srcdir/src/audio/fusionsound/*.c" - EXTRA_CFLAGS="$EXTRA_CFLAGS $FUSIONSOUND_CFLAGS" - - # Check whether --enable-fusionsound-shared was given. -if test ${enable_fusionsound_shared+y} -then : - enableval=$enable_fusionsound_shared; -else $as_nop - enable_fusionsound_shared=yes -fi - - fusionsound_shared=no - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for FusionSound dynamic loading support" >&5 -printf %s "checking for FusionSound dynamic loading support... " >&6; } - if test x$have_loadso != xyes && \ - test x$enable_fusionsound_shared = xyes; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: You must have SDL_LoadObject() support for dynamic fusionsound loading" >&5 -printf "%s\n" "$as_me: WARNING: You must have SDL_LoadObject() support for dynamic fusionsound loading" >&2;} - fi - if test x$have_loadso = xyes && \ - test x$enable_fusionsound_shared = xyes; then - -printf "%s\n" "#define SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC \"libfusionsound.so\"" >>confdefs.h - - fusionsound_shared=yes - SUMMARY_audio="${SUMMARY_audio} fusionsound(dynamic)" - else - EXTRA_LDFLAGS="$EXTRA_LDFLAGS $FUSIONSOUND_LIBS" - SUMMARY_audio="${SUMMARY_audio} fusionsound" - fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $fusionsound_shared" >&5 -printf "%s\n" "$fusionsound_shared" >&6; } - - have_audio=yes - fi - fi -} - CheckDiskAudio() { # Check whether --enable-diskaudio was given. @@ -28356,12 +27309,6 @@ printf "%s\n" "#define SDL_VIDEO_DRIVER_ANDROID 1" >>confdefs.h CheckALSA CheckPipewire CheckPulseAudio - CheckJACK - CheckARTSC - CheckESD - CheckNAS - CheckSNDIO - CheckFusionSound CheckLibSampleRate # Need to check for Raspberry PI first and add platform specific compiler flags, otherwise the test for GLES fails! CheckRPI @@ -28414,14 +27361,6 @@ printf "%s\n" "#define SDL_VIDEO_DRIVER_ANDROID 1" >>confdefs.h # Set up files for the audio library if test x$enable_audio = xyes; then case $ARCH in - sysv5|solaris|hpux) - -printf "%s\n" "#define SDL_AUDIO_DRIVER_SUNAUDIO 1" >>confdefs.h - - SOURCES="$SOURCES $srcdir/src/audio/sun/*.c" - SUMMARY_audio="${SUMMARY_audio} sun" - have_audio=yes - ;; netbsd) # Don't use this on OpenBSD, it's busted. printf "%s\n" "#define SDL_AUDIO_DRIVER_NETBSD 1" >>confdefs.h @@ -28430,14 +27369,6 @@ printf "%s\n" "#define SDL_AUDIO_DRIVER_NETBSD 1" >>confdefs.h SUMMARY_audio="${SUMMARY_audio} netbsd" have_audio=yes ;; - aix) - -printf "%s\n" "#define SDL_AUDIO_DRIVER_PAUDIO 1" >>confdefs.h - - SOURCES="$SOURCES $srcdir/src/audio/paudio/*.c" - SUMMARY_audio="${SUMMARY_audio} paudio" - have_audio=yes - ;; android) printf "%s\n" "#define SDL_AUDIO_DRIVER_ANDROID 1" >>confdefs.h @@ -28673,11 +27604,6 @@ printf "%s\n" "#define SDL_VIDEO_RENDER_D3D12 1" >>confdefs.h fi # Set up files for the audio library if test x$enable_audio = xyes; then - -printf "%s\n" "#define SDL_AUDIO_DRIVER_WINMM 1" >>confdefs.h - - SUMMARY_audio="${SUMMARY_audio} winmm" - SOURCES="$SOURCES $srcdir/src/audio/winmm/*.c" if test x$have_dsound = xyes; then printf "%s\n" "#define SDL_AUDIO_DRIVER_DSOUND 1" >>confdefs.h diff --git a/configure.ac b/configure.ac index d0bcbf16f8..b92d0b8c9f 100644 --- a/configure.ac +++ b/configure.ac @@ -996,88 +996,6 @@ CheckALSA() fi } -dnl Find JACK Audio -CheckJACK() -{ - AC_ARG_ENABLE(jack, -[AS_HELP_STRING([--enable-jack], [use JACK audio [default=yes]])], - , enable_jack=yes) - if test x$enable_audio = xyes -a x$enable_jack = xyes; then - PKG_CHECK_MODULES([JACK], [jack >= 0.125], audio_jack=yes, audio_jack=no) - - if test x$audio_jack = xyes; then - AC_ARG_ENABLE(jack-shared, -[AS_HELP_STRING([--enable-jack-shared], [dynamically load JACK audio support [default=yes]])], - , enable_jack_shared=yes) - jack_lib=[`find_lib "libjack.so.*" "$JACK_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`] - - AC_DEFINE(SDL_AUDIO_DRIVER_JACK, 1, [ ]) - SOURCES="$SOURCES $srcdir/src/audio/jack/*.c" - EXTRA_CFLAGS="$EXTRA_CFLAGS $JACK_CFLAGS" - if test x$have_loadso != xyes && \ - test x$enable_jack_shared = xyes; then - AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic JACK audio loading]) - fi - if test x$have_loadso = xyes && \ - test x$enable_jack_shared = xyes && test x$jack_lib != x; then - echo "-- dynamic libjack -> $jack_lib" - AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_JACK_DYNAMIC, "$jack_lib", [ ]) - SUMMARY_audio="${SUMMARY_audio} jack(dynamic)" - - case "$host" in - # On Solaris, jack must be linked deferred explicitly - # to prevent undefined symbol failures. - *-*-solaris*) - JACK_LIBS=`echo $JACK_LIBS | sed 's/\-l/-Wl,-l/g'` - EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-zdeferred $JACK_LIBS -Wl,-znodeferred" - esac - else - EXTRA_LDFLAGS="$EXTRA_LDFLAGS $JACK_LIBS" - SUMMARY_audio="${SUMMARY_audio} jack" - fi - have_audio=yes - fi - fi -} - -dnl Find the ESD includes and libraries -CheckESD() -{ - AC_ARG_ENABLE(esd, -[AS_HELP_STRING([--enable-esd], [support the Enlightened Sound Daemon [default=yes]])], - , enable_esd=yes) - if test x$enable_audio = xyes -a x$enable_esd = xyes; then - PKG_CHECK_MODULES([ESD], [esound >= 0.2.8], have_esd=yes, have_esd=no) - if test x$have_esd = xno; then - AM_PATH_ESD(0.2.8, have_esd=yes, have_esd=no) - fi - if test x$have_esd = xyes; then - AC_ARG_ENABLE(esd-shared, -[AS_HELP_STRING([--enable-esd-shared], [dynamically load ESD audio support [default=yes]])], - , enable_esd_shared=yes) - esd_lib=[`find_lib "libesd.so.*" "$ESD_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`] - - AC_DEFINE(SDL_AUDIO_DRIVER_ESD, 1, [ ]) - SOURCES="$SOURCES $srcdir/src/audio/esd/*.c" - EXTRA_CFLAGS="$EXTRA_CFLAGS $ESD_CFLAGS" - if test x$have_loadso != xyes && \ - test x$enable_esd_shared = xyes; then - AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic ESD loading]) - fi - if test x$have_loadso = xyes && \ - test x$enable_esd_shared = xyes && test x$esd_lib != x; then - echo "-- dynamic libesd -> $esd_lib" - AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_ESD_DYNAMIC, "$esd_lib", [ ]) - SUMMARY_audio="${SUMMARY_audio} esd(dynamic)" - else - EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ESD_LIBS" - SUMMARY_audio="${SUMMARY_audio} esd" - fi - have_audio=yes - fi - fi -} - dnl Find Pipewire CheckPipewire() { @@ -1158,187 +1076,6 @@ CheckPulseAudio() fi } -CheckARTSC() -{ - AC_ARG_ENABLE(arts, -[AS_HELP_STRING([--enable-arts], [support the Analog Real Time Synthesizer [default=yes]])], - , enable_arts=yes) - if test x$enable_audio = xyes -a x$enable_arts = xyes; then - AC_PATH_PROG(ARTSCONFIG, artsc-config) - if test x$ARTSCONFIG = x -o x$ARTSCONFIG = x'"$ARTSCONFIG"'; then - : # arts isn't installed - else - ARTS_CFLAGS=`$ARTSCONFIG --cflags` - ARTS_LIBS=`$ARTSCONFIG --libs` - AC_MSG_CHECKING(for aRts development environment) - audio_arts=no - save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $ARTS_CFLAGS" - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ - #include - ]], [[ - arts_stream_t stream; - ]])], [audio_arts=yes],[]) - CFLAGS="$save_CFLAGS" - AC_MSG_RESULT($audio_arts) - if test x$audio_arts = xyes; then - AC_ARG_ENABLE(arts-shared, -[AS_HELP_STRING([--enable-arts-shared], [dynamically load aRts audio support [default=yes]])], - , enable_arts_shared=yes) - arts_lib=[`find_lib "libartsc.so.*" "$ARTS_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`] - - AC_DEFINE(SDL_AUDIO_DRIVER_ARTS, 1, [ ]) - SOURCES="$SOURCES $srcdir/src/audio/arts/*.c" - EXTRA_CFLAGS="$EXTRA_CFLAGS $ARTS_CFLAGS" - if test x$have_loadso != xyes && \ - test x$enable_arts_shared = xyes; then - AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic ARTS loading]) - fi - if test x$have_loadso = xyes && \ - test x$enable_arts_shared = xyes && test x$arts_lib != x; then - echo "-- dynamic libartsc -> $arts_lib" - AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_ARTS_DYNAMIC, "$arts_lib", [ ]) - SUMMARY_audio="${SUMMARY_audio} arts(dynamic)" - else - EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ARTS_LIBS" - SUMMARY_audio="${SUMMARY_audio} arts" - fi - have_audio=yes - fi - fi - fi -} - -dnl See if the NAS audio interface is supported -CheckNAS() -{ - AC_ARG_ENABLE(nas, -[AS_HELP_STRING([--enable-nas], [support the NAS audio API [default=yes]])], - , enable_nas=yes) - if test x$enable_audio = xyes -a x$enable_nas = xyes; then - AC_CHECK_HEADER(audio/audiolib.h, have_nas_hdr=yes) - AC_CHECK_LIB(audio, AuOpenServer, have_nas_lib=yes) - - AC_MSG_CHECKING(for NAS audio support) - have_nas=no - - if test x$have_nas_hdr = xyes -a x$have_nas_lib = xyes; then - have_nas=yes - NAS_LIBS="-laudio" - - elif test -r /usr/X11R6/include/audio/audiolib.h; then - have_nas=yes - NAS_CFLAGS="-I/usr/X11R6/include/" - NAS_LIBS="-L/usr/X11R6/lib -laudio -lXt" - - fi - - AC_MSG_RESULT($have_nas) - - if test x$have_nas = xyes; then - AC_ARG_ENABLE(nas-shared, -[AS_HELP_STRING([--enable-nas-shared], [dynamically load NAS audio support [default=yes]])], - , enable_nas_shared=yes) - nas_lib=[`find_lib "libaudio.so.*" "$NAS_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`] - - if test x$have_loadso != xyes && \ - test x$enable_nas_shared = xyes; then - AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic NAS loading]) - fi - if test x$have_loadso = xyes && \ - test x$enable_nas_shared = xyes && test x$nas_lib != x; then - echo "-- dynamic libaudio -> $nas_lib" - AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_NAS_DYNAMIC, "$nas_lib", [ ]) - SUMMARY_audio="${SUMMARY_audio} nas(dynamic)" - else - EXTRA_LDFLAGS="$EXTRA_LDFLAGS $NAS_LIBS" - SUMMARY_audio="${SUMMARY_audio} nas" - fi - - AC_DEFINE(SDL_AUDIO_DRIVER_NAS, 1, [ ]) - SOURCES="$SOURCES $srcdir/src/audio/nas/*.c" - EXTRA_CFLAGS="$EXTRA_CFLAGS $NAS_CFLAGS" - have_audio=yes - fi - fi -} - -dnl See if the sndio audio interface is supported -CheckSNDIO() -{ - AC_ARG_ENABLE(sndio, -[AS_HELP_STRING([--enable-sndio], [support the sndio audio API [default=yes]])], - , enable_sndio=yes) - if test x$enable_audio = xyes -a x$enable_sndio = xyes; then - PKG_CHECK_MODULES([SNDIO], [sndio], audio_sndio=yes, audio_sndio=no) - - if test x$audio_sndio = xyes; then - AC_ARG_ENABLE(sndio-shared, -[AS_HELP_STRING([--enable-sndio-shared], [dynamically load sndio audio support [default=yes]])], - , enable_sndio_shared=yes) - sndio_lib=[`find_lib "libsndio.so.*" "$SNDIO_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`] - - if test x$have_loadso != xyes && \ - test x$enable_sndio_shared = xyes; then - AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic sndio loading]) - fi - if test x$have_loadso = xyes && \ - test x$enable_sndio_shared = xyes && test x$sndio_lib != x; then - echo "-- dynamic libsndio -> $sndio_lib" - AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_SNDIO_DYNAMIC, "$sndio_lib", [ ]) - SUMMARY_audio="${SUMMARY_audio} sndio(dynamic)" - else - EXTRA_LDFLAGS="$EXTRA_LDFLAGS $SNDIO_LIBS" - SUMMARY_audio="${SUMMARY_audio} sndio" - fi - - AC_DEFINE(SDL_AUDIO_DRIVER_SNDIO, 1, [ ]) - SOURCES="$SOURCES $srcdir/src/audio/sndio/*.c" - EXTRA_CFLAGS="$EXTRA_CFLAGS $SNDIO_CFLAGS" - have_audio=yes - fi - fi -} - -dnl Find FusionSound -CheckFusionSound() -{ - AC_ARG_ENABLE(fusionsound, -[AS_HELP_STRING([--enable-fusionsound], [use FusionSound audio driver [default=no]])], - , enable_fusionsound=no) - if test x$enable_audio = xyes -a x$enable_fusionsound = xyes; then - PKG_CHECK_MODULES([FUSIONSOUND], [fusionsound >= 1.1.1], fusionsound=yes, fusionsound=no) - - if test x$fusionsound = xyes; then - AC_DEFINE(SDL_AUDIO_DRIVER_FUSIONSOUND, 1, [ ]) - SOURCES="$SOURCES $srcdir/src/audio/fusionsound/*.c" - EXTRA_CFLAGS="$EXTRA_CFLAGS $FUSIONSOUND_CFLAGS" - - AC_ARG_ENABLE(fusionsound-shared, -[AS_HELP_STRING([--enable-fusionsound-shared], [dynamically load fusionsound audio support [default=yes]])], - , enable_fusionsound_shared=yes) - fusionsound_shared=no - AC_MSG_CHECKING(for FusionSound dynamic loading support) - if test x$have_loadso != xyes && \ - test x$enable_fusionsound_shared = xyes; then - AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic fusionsound loading]) - fi - if test x$have_loadso = xyes && \ - test x$enable_fusionsound_shared = xyes; then - AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC, "libfusionsound.so", [ ]) - fusionsound_shared=yes - SUMMARY_audio="${SUMMARY_audio} fusionsound(dynamic)" - else - EXTRA_LDFLAGS="$EXTRA_LDFLAGS $FUSIONSOUND_LIBS" - SUMMARY_audio="${SUMMARY_audio} fusionsound" - fi - AC_MSG_RESULT($fusionsound_shared) - - have_audio=yes - fi - fi -} - dnl rcg07142001 See if the user wants the disk writer audio driver... CheckDiskAudio() { @@ -3779,12 +3516,6 @@ case "$host" in CheckALSA CheckPipewire CheckPulseAudio - CheckJACK - CheckARTSC - CheckESD - CheckNAS - CheckSNDIO - CheckFusionSound CheckLibSampleRate # Need to check for Raspberry PI first and add platform specific compiler flags, otherwise the test for GLES fails! CheckRPI @@ -3837,24 +3568,12 @@ case "$host" in # Set up files for the audio library if test x$enable_audio = xyes; then case $ARCH in - sysv5|solaris|hpux) - AC_DEFINE(SDL_AUDIO_DRIVER_SUNAUDIO, 1, [ ]) - SOURCES="$SOURCES $srcdir/src/audio/sun/*.c" - SUMMARY_audio="${SUMMARY_audio} sun" - have_audio=yes - ;; netbsd) # Don't use this on OpenBSD, it's busted. AC_DEFINE(SDL_AUDIO_DRIVER_NETBSD, 1, [ ]) SOURCES="$SOURCES $srcdir/src/audio/netbsd/*.c" SUMMARY_audio="${SUMMARY_audio} netbsd" have_audio=yes ;; - aix) - AC_DEFINE(SDL_AUDIO_DRIVER_PAUDIO, 1, [ ]) - SOURCES="$SOURCES $srcdir/src/audio/paudio/*.c" - SUMMARY_audio="${SUMMARY_audio} paudio" - have_audio=yes - ;; android) AC_DEFINE(SDL_AUDIO_DRIVER_ANDROID, 1, [ ]) SOURCES="$SOURCES $srcdir/src/audio/android/*.c" @@ -4049,9 +3768,6 @@ case "$host" in fi # Set up files for the audio library if test x$enable_audio = xyes; then - AC_DEFINE(SDL_AUDIO_DRIVER_WINMM, 1, [ ]) - SUMMARY_audio="${SUMMARY_audio} winmm" - SOURCES="$SOURCES $srcdir/src/audio/winmm/*.c" if test x$have_dsound = xyes; then AC_DEFINE(SDL_AUDIO_DRIVER_DSOUND, 1, [ ]) SUMMARY_audio="${SUMMARY_audio} directsound" diff --git a/include/SDL_config.h.cmake b/include/SDL_config.h.cmake index 41acf1c714..0176b8a8de 100644 --- a/include/SDL_config.h.cmake +++ b/include/SDL_config.h.cmake @@ -293,35 +293,20 @@ #cmakedefine SDL_AUDIO_DRIVER_ANDROID @SDL_AUDIO_DRIVER_ANDROID@ #cmakedefine SDL_AUDIO_DRIVER_OPENSLES @SDL_AUDIO_DRIVER_OPENSLES@ #cmakedefine SDL_AUDIO_DRIVER_AAUDIO @SDL_AUDIO_DRIVER_AAUDIO@ -#cmakedefine SDL_AUDIO_DRIVER_ARTS @SDL_AUDIO_DRIVER_ARTS@ -#cmakedefine SDL_AUDIO_DRIVER_ARTS_DYNAMIC @SDL_AUDIO_DRIVER_ARTS_DYNAMIC@ #cmakedefine SDL_AUDIO_DRIVER_COREAUDIO @SDL_AUDIO_DRIVER_COREAUDIO@ #cmakedefine SDL_AUDIO_DRIVER_DISK @SDL_AUDIO_DRIVER_DISK@ #cmakedefine SDL_AUDIO_DRIVER_DSOUND @SDL_AUDIO_DRIVER_DSOUND@ #cmakedefine SDL_AUDIO_DRIVER_DUMMY @SDL_AUDIO_DRIVER_DUMMY@ #cmakedefine SDL_AUDIO_DRIVER_EMSCRIPTEN @SDL_AUDIO_DRIVER_EMSCRIPTEN@ -#cmakedefine SDL_AUDIO_DRIVER_ESD @SDL_AUDIO_DRIVER_ESD@ -#cmakedefine SDL_AUDIO_DRIVER_ESD_DYNAMIC @SDL_AUDIO_DRIVER_ESD_DYNAMIC@ -#cmakedefine SDL_AUDIO_DRIVER_FUSIONSOUND @SDL_AUDIO_DRIVER_FUSIONSOUND@ -#cmakedefine SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC @SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC@ #cmakedefine SDL_AUDIO_DRIVER_HAIKU @SDL_AUDIO_DRIVER_HAIKU@ -#cmakedefine SDL_AUDIO_DRIVER_JACK @SDL_AUDIO_DRIVER_JACK@ -#cmakedefine SDL_AUDIO_DRIVER_JACK_DYNAMIC @SDL_AUDIO_DRIVER_JACK_DYNAMIC@ -#cmakedefine SDL_AUDIO_DRIVER_NAS @SDL_AUDIO_DRIVER_NAS@ -#cmakedefine SDL_AUDIO_DRIVER_NAS_DYNAMIC @SDL_AUDIO_DRIVER_NAS_DYNAMIC@ #cmakedefine SDL_AUDIO_DRIVER_NETBSD @SDL_AUDIO_DRIVER_NETBSD@ #cmakedefine SDL_AUDIO_DRIVER_OSS @SDL_AUDIO_DRIVER_OSS@ -#cmakedefine SDL_AUDIO_DRIVER_PAUDIO @SDL_AUDIO_DRIVER_PAUDIO@ #cmakedefine SDL_AUDIO_DRIVER_PIPEWIRE @SDL_AUDIO_DRIVER_PIPEWIRE@ #cmakedefine SDL_AUDIO_DRIVER_PIPEWIRE_DYNAMIC @SDL_AUDIO_DRIVER_PIPEWIRE_DYNAMIC@ #cmakedefine SDL_AUDIO_DRIVER_PULSEAUDIO @SDL_AUDIO_DRIVER_PULSEAUDIO@ #cmakedefine SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC @SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC@ #cmakedefine SDL_AUDIO_DRIVER_QSA @SDL_AUDIO_DRIVER_QSA@ -#cmakedefine SDL_AUDIO_DRIVER_SNDIO @SDL_AUDIO_DRIVER_SNDIO@ -#cmakedefine SDL_AUDIO_DRIVER_SNDIO_DYNAMIC @SDL_AUDIO_DRIVER_SNDIO_DYNAMIC@ -#cmakedefine SDL_AUDIO_DRIVER_SUNAUDIO @SDL_AUDIO_DRIVER_SUNAUDIO@ #cmakedefine SDL_AUDIO_DRIVER_WASAPI @SDL_AUDIO_DRIVER_WASAPI@ -#cmakedefine SDL_AUDIO_DRIVER_WINMM @SDL_AUDIO_DRIVER_WINMM@ #cmakedefine SDL_AUDIO_DRIVER_VITA @SDL_AUDIO_DRIVER_VITA@ #cmakedefine SDL_AUDIO_DRIVER_PSP @SDL_AUDIO_DRIVER_PSP@ #cmakedefine SDL_AUDIO_DRIVER_PS2 @SDL_AUDIO_DRIVER_PS2@ diff --git a/include/SDL_config.h.in b/include/SDL_config.h.in index a4756ee7b0..1c6fcbdcc5 100644 --- a/include/SDL_config.h.in +++ b/include/SDL_config.h.in @@ -279,37 +279,22 @@ #undef SDL_AUDIO_DRIVER_ALSA #undef SDL_AUDIO_DRIVER_ALSA_DYNAMIC #undef SDL_AUDIO_DRIVER_ANDROID -#undef SDL_AUDIO_DRIVER_ARTS -#undef SDL_AUDIO_DRIVER_ARTS_DYNAMIC #undef SDL_AUDIO_DRIVER_COREAUDIO #undef SDL_AUDIO_DRIVER_DISK #undef SDL_AUDIO_DRIVER_DSOUND #undef SDL_AUDIO_DRIVER_DUMMY #undef SDL_AUDIO_DRIVER_EMSCRIPTEN -#undef SDL_AUDIO_DRIVER_ESD -#undef SDL_AUDIO_DRIVER_ESD_DYNAMIC -#undef SDL_AUDIO_DRIVER_FUSIONSOUND -#undef SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC #undef SDL_AUDIO_DRIVER_HAIKU -#undef SDL_AUDIO_DRIVER_JACK -#undef SDL_AUDIO_DRIVER_JACK_DYNAMIC #undef SDL_AUDIO_DRIVER_NACL -#undef SDL_AUDIO_DRIVER_NAS -#undef SDL_AUDIO_DRIVER_NAS_DYNAMIC #undef SDL_AUDIO_DRIVER_NETBSD #undef SDL_AUDIO_DRIVER_OPENSLES #undef SDL_AUDIO_DRIVER_OSS -#undef SDL_AUDIO_DRIVER_PAUDIO #undef SDL_AUDIO_DRIVER_PIPEWIRE #undef SDL_AUDIO_DRIVER_PIPEWIRE_DYNAMIC #undef SDL_AUDIO_DRIVER_PULSEAUDIO #undef SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC #undef SDL_AUDIO_DRIVER_QSA -#undef SDL_AUDIO_DRIVER_SNDIO -#undef SDL_AUDIO_DRIVER_SNDIO_DYNAMIC -#undef SDL_AUDIO_DRIVER_SUNAUDIO #undef SDL_AUDIO_DRIVER_WASAPI -#undef SDL_AUDIO_DRIVER_WINMM /* Enable various input drivers */ #undef SDL_INPUT_LINUXEV diff --git a/src/audio/SDL_audio.c b/src/audio/SDL_audio.c index 76395f54ff..f40cdd2dcf 100644 --- a/src/audio/SDL_audio.c +++ b/src/audio/SDL_audio.c @@ -42,51 +42,27 @@ static const AudioBootStrap *const bootstrap[] = { #if SDL_AUDIO_DRIVER_ALSA &ALSA_bootstrap, #endif -#if SDL_AUDIO_DRIVER_SNDIO - &SNDIO_bootstrap, -#endif #if SDL_AUDIO_DRIVER_NETBSD &NETBSDAUDIO_bootstrap, #endif #if SDL_AUDIO_DRIVER_QSA &QSAAUDIO_bootstrap, #endif -#if SDL_AUDIO_DRIVER_SUNAUDIO - &SUNAUDIO_bootstrap, -#endif -#if SDL_AUDIO_DRIVER_ARTS - &ARTS_bootstrap, -#endif -#if SDL_AUDIO_DRIVER_ESD - &ESD_bootstrap, -#endif #if SDL_AUDIO_DRIVER_NACL &NACLAUDIO_bootstrap, #endif -#if SDL_AUDIO_DRIVER_NAS - &NAS_bootstrap, -#endif #if SDL_AUDIO_DRIVER_WASAPI &WASAPI_bootstrap, #endif #if SDL_AUDIO_DRIVER_DSOUND &DSOUND_bootstrap, #endif -#if SDL_AUDIO_DRIVER_WINMM - &WINMM_bootstrap, -#endif -#if SDL_AUDIO_DRIVER_PAUDIO - &PAUDIO_bootstrap, -#endif #if SDL_AUDIO_DRIVER_HAIKU &HAIKUAUDIO_bootstrap, #endif #if SDL_AUDIO_DRIVER_COREAUDIO &COREAUDIO_bootstrap, #endif -#if SDL_AUDIO_DRIVER_FUSIONSOUND - &FUSIONSOUND_bootstrap, -#endif #if SDL_AUDIO_DRIVER_AAUDIO &aaudio_bootstrap, #endif @@ -111,9 +87,6 @@ static const AudioBootStrap *const bootstrap[] = { #if SDL_AUDIO_DRIVER_EMSCRIPTEN &EMSCRIPTENAUDIO_bootstrap, #endif -#if SDL_AUDIO_DRIVER_JACK - &JACK_bootstrap, -#endif #if SDL_AUDIO_DRIVER_PIPEWIRE &PIPEWIRE_bootstrap, #endif diff --git a/src/audio/SDL_sysaudio.h b/src/audio/SDL_sysaudio.h index a76c5c21b9..e908986e77 100644 --- a/src/audio/SDL_sysaudio.h +++ b/src/audio/SDL_sysaudio.h @@ -184,25 +184,17 @@ typedef struct AudioBootStrap extern AudioBootStrap PIPEWIRE_bootstrap; extern AudioBootStrap PULSEAUDIO_bootstrap; extern AudioBootStrap ALSA_bootstrap; -extern AudioBootStrap JACK_bootstrap; -extern AudioBootStrap SNDIO_bootstrap; extern AudioBootStrap NETBSDAUDIO_bootstrap; extern AudioBootStrap DSP_bootstrap; extern AudioBootStrap QSAAUDIO_bootstrap; -extern AudioBootStrap SUNAUDIO_bootstrap; -extern AudioBootStrap ARTS_bootstrap; -extern AudioBootStrap ESD_bootstrap; extern AudioBootStrap NACLAUDIO_bootstrap; -extern AudioBootStrap NAS_bootstrap; extern AudioBootStrap WASAPI_bootstrap; extern AudioBootStrap DSOUND_bootstrap; extern AudioBootStrap WINMM_bootstrap; -extern AudioBootStrap PAUDIO_bootstrap; extern AudioBootStrap HAIKUAUDIO_bootstrap; extern AudioBootStrap COREAUDIO_bootstrap; extern AudioBootStrap DISKAUDIO_bootstrap; extern AudioBootStrap DUMMYAUDIO_bootstrap; -extern AudioBootStrap FUSIONSOUND_bootstrap; extern AudioBootStrap aaudio_bootstrap; extern AudioBootStrap openslES_bootstrap; extern AudioBootStrap ANDROIDAUDIO_bootstrap; diff --git a/src/audio/arts/SDL_artsaudio.c b/src/audio/arts/SDL_artsaudio.c deleted file mode 100644 index 82d84e320d..0000000000 --- a/src/audio/arts/SDL_artsaudio.c +++ /dev/null @@ -1,357 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ -#include "../../SDL_internal.h" - -#if SDL_AUDIO_DRIVER_ARTS - -/* Allow access to a raw mixing buffer */ - -#ifdef HAVE_SIGNAL_H -#include -#endif -#include -#include - -#include "SDL_timer.h" -#include "SDL_audio.h" -#include "../SDL_audio_c.h" -#include "SDL_artsaudio.h" - -#ifdef SDL_AUDIO_DRIVER_ARTS_DYNAMIC -#include "SDL_name.h" -#include "SDL_loadso.h" -#else -#define SDL_NAME(X) X -#endif - -#ifdef SDL_AUDIO_DRIVER_ARTS_DYNAMIC - -static const char *arts_library = SDL_AUDIO_DRIVER_ARTS_DYNAMIC; -static void *arts_handle = NULL; - -/* !!! FIXME: I hate this SDL_NAME clutter...it makes everything so messy! */ -static int (*SDL_NAME(arts_init)) (void); -static void (*SDL_NAME(arts_free)) (void); -static arts_stream_t(*SDL_NAME(arts_play_stream)) (int rate, int bits, - int channels, - const char *name); -static int (*SDL_NAME(arts_stream_set)) (arts_stream_t s, - arts_parameter_t param, int value); -static int (*SDL_NAME(arts_stream_get)) (arts_stream_t s, - arts_parameter_t param); -static int (*SDL_NAME(arts_write)) (arts_stream_t s, const void *buffer, - int count); -static void (*SDL_NAME(arts_close_stream)) (arts_stream_t s); -static int (*SDL_NAME(arts_suspend))(void); -static int (*SDL_NAME(arts_suspended)) (void); -static const char *(*SDL_NAME(arts_error_text)) (int errorcode); - -#define SDL_ARTS_SYM(x) { #x, (void **) (char *) &SDL_NAME(x) } -static struct -{ - const char *name; - void **func; -} arts_functions[] = { -/* *INDENT-OFF* */ - SDL_ARTS_SYM(arts_init), - SDL_ARTS_SYM(arts_free), - SDL_ARTS_SYM(arts_play_stream), - SDL_ARTS_SYM(arts_stream_set), - SDL_ARTS_SYM(arts_stream_get), - SDL_ARTS_SYM(arts_write), - SDL_ARTS_SYM(arts_close_stream), - SDL_ARTS_SYM(arts_suspend), - SDL_ARTS_SYM(arts_suspended), - SDL_ARTS_SYM(arts_error_text), -/* *INDENT-ON* */ -}; - -#undef SDL_ARTS_SYM - -static void -UnloadARTSLibrary() -{ - if (arts_handle != NULL) { - SDL_UnloadObject(arts_handle); - arts_handle = NULL; - } -} - -static int -LoadARTSLibrary(void) -{ - int i, retval = -1; - - if (arts_handle == NULL) { - arts_handle = SDL_LoadObject(arts_library); - if (arts_handle != NULL) { - retval = 0; - for (i = 0; i < SDL_arraysize(arts_functions); ++i) { - *arts_functions[i].func = - SDL_LoadFunction(arts_handle, arts_functions[i].name); - if (!*arts_functions[i].func) { - retval = -1; - UnloadARTSLibrary(); - break; - } - } - } - } - - return retval; -} - -#else - -static void -UnloadARTSLibrary() -{ - return; -} - -static int -LoadARTSLibrary(void) -{ - return 0; -} - -#endif /* SDL_AUDIO_DRIVER_ARTS_DYNAMIC */ - -/* This function waits until it is possible to write a full sound buffer */ -static void -ARTS_WaitDevice(_THIS) -{ - Sint32 ticks; - - /* Check to see if the thread-parent process is still alive */ - { - static int cnt = 0; - /* Note that this only works with thread implementations - that use a different process id for each thread. - */ - /* Check every 10 loops */ - if (this->hidden->parent && (((++cnt) % 10) == 0)) { - if (kill(this->hidden->parent, 0) < 0 && errno == ESRCH) { - SDL_OpenedAudioDeviceDisconnected(this); - } - } - } - - /* Use timer for general audio synchronization */ - ticks = - ((Sint32) (this->hidden->next_frame - SDL_GetTicks())) - FUDGE_TICKS; - if (ticks > 0) { - SDL_Delay(ticks); - } -} - -static void -ARTS_PlayDevice(_THIS) -{ - /* Write the audio data */ - int written = SDL_NAME(arts_write) (this->hidden->stream, - this->hidden->mixbuf, - this->hidden->mixlen); - - /* If timer synchronization is enabled, set the next write frame */ - if (this->hidden->frame_ticks) { - this->hidden->next_frame += this->hidden->frame_ticks; - } - - /* If we couldn't write, assume fatal error for now */ - if (written < 0) { - SDL_OpenedAudioDeviceDisconnected(this); - } -#ifdef DEBUG_AUDIO - fprintf(stderr, "Wrote %d bytes of audio data\n", written); -#endif -} - -static Uint8 * -ARTS_GetDeviceBuf(_THIS) -{ - return (this->hidden->mixbuf); -} - - -static void -ARTS_CloseDevice(_THIS) -{ - if (this->hidden->stream) { - SDL_NAME(arts_close_stream) (this->hidden->stream); - } - SDL_NAME(arts_free) (); - SDL_free(this->hidden->mixbuf); - SDL_free(this->hidden); -} - -static int -ARTS_Suspend(void) -{ - const Uint32 abortms = SDL_GetTicks() + 3000; /* give up after 3 secs */ - while ( (!SDL_NAME(arts_suspended)()) && !SDL_TICKS_PASSED(SDL_GetTicks(), abortms) ) { - if ( SDL_NAME(arts_suspend)() ) { - break; - } - } - return SDL_NAME(arts_suspended)(); -} - -static int -ARTS_OpenDevice(_THIS, const char *devname) -{ - int rc = 0; - int bits, frag_spec = 0; - SDL_AudioFormat test_format = 0; - - /* Initialize all variables that we clean on shutdown */ - this->hidden = (struct SDL_PrivateAudioData *) - SDL_malloc((sizeof *this->hidden)); - if (this->hidden == NULL) { - return SDL_OutOfMemory(); - } - SDL_zerop(this->hidden); - - /* Try for a closest match on audio format */ - for (test_format = SDL_FirstAudioFormat(this->spec.format); test_format; test_format = SDL_NextAudioFormat()) { -#ifdef DEBUG_AUDIO - fprintf(stderr, "Trying format 0x%4.4x\n", test_format); -#endif - switch (test_format) { - case AUDIO_U8: - case AUDIO_S16LSB: - break; - default: - continue; - } - break; - } - if (!test_format) { - return SDL_SetError("%s: Unsupported audio format", "arts"); - } - this->spec.format = test_format; - bits = SDL_AUDIO_BITSIZE(test_format); - - if ((rc = SDL_NAME(arts_init) ()) != 0) { - return SDL_SetError("Unable to initialize ARTS: %s", - SDL_NAME(arts_error_text) (rc)); - } - - if (!ARTS_Suspend()) { - return SDL_SetError("ARTS can not open audio device"); - } - - this->hidden->stream = SDL_NAME(arts_play_stream) (this->spec.freq, - bits, - this->spec.channels, - "SDL"); - - /* Play nothing so we have at least one write (server bug workaround). */ - SDL_NAME(arts_write) (this->hidden->stream, "", 0); - - /* Calculate the final parameters for this audio specification */ - SDL_CalculateAudioSpec(&this->spec); - - /* Determine the power of two of the fragment size */ - for (frag_spec = 0; (0x01 << frag_spec) < this->spec.size; ++frag_spec); - if ((0x01 << frag_spec) != this->spec.size) { - return SDL_SetError("Fragment size must be a power of two"); - } - frag_spec |= 0x00020000; /* two fragments, for low latency */ - -#ifdef ARTS_P_PACKET_SETTINGS - SDL_NAME(arts_stream_set) (this->hidden->stream, - ARTS_P_PACKET_SETTINGS, frag_spec); -#else - SDL_NAME(arts_stream_set) (this->hidden->stream, ARTS_P_PACKET_SIZE, - frag_spec & 0xffff); - SDL_NAME(arts_stream_set) (this->hidden->stream, ARTS_P_PACKET_COUNT, - frag_spec >> 16); -#endif - this->spec.size = SDL_NAME(arts_stream_get) (this->hidden->stream, - ARTS_P_PACKET_SIZE); - - /* Allocate mixing buffer */ - this->hidden->mixlen = this->spec.size; - this->hidden->mixbuf = (Uint8 *) SDL_malloc(this->hidden->mixlen); - if (this->hidden->mixbuf == NULL) { - return SDL_OutOfMemory(); - } - SDL_memset(this->hidden->mixbuf, this->spec.silence, this->spec.size); - - /* Get the parent process id (we're the parent of the audio thread) */ - this->hidden->parent = getpid(); - - /* We're ready to rock and roll. :-) */ - return 0; -} - - -static void -ARTS_Deinitialize(void) -{ - UnloadARTSLibrary(); -} - - -static SDL_bool -ARTS_Init(SDL_AudioDriverImpl * impl) -{ - if (LoadARTSLibrary() < 0) { - return SDL_FALSE; - } else { - if (SDL_NAME(arts_init) () != NULL) { - UnloadARTSLibrary(); - SDL_SetError("ARTS: arts_init failed (no audio server?)"); - return SDL_FALSE; - } - - /* Play a stream so aRts doesn't crash */ - if (ARTS_Suspend()) { - arts_stream_t stream; - stream = SDL_NAME(arts_play_stream) (44100, 16, 2, "SDL"); - SDL_NAME(arts_write) (stream, "", 0); - SDL_NAME(arts_close_stream) (stream); - } - - SDL_NAME(arts_free) (); - } - - /* Set the function pointers */ - impl->OpenDevice = ARTS_OpenDevice; - impl->PlayDevice = ARTS_PlayDevice; - impl->WaitDevice = ARTS_WaitDevice; - impl->GetDeviceBuf = ARTS_GetDeviceBuf; - impl->CloseDevice = ARTS_CloseDevice; - impl->Deinitialize = ARTS_Deinitialize; - impl->OnlyHasDefaultOutputDevice = SDL_TRUE; - - return SDL_TRUE; /* this audio target is available. */ -} - - -AudioBootStrap ARTS_bootstrap = { - "arts", "Analog RealTime Synthesizer", ARTS_Init, SDL_FALSE -}; - -#endif /* SDL_AUDIO_DRIVER_ARTS */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/audio/arts/SDL_artsaudio.h b/src/audio/arts/SDL_artsaudio.h deleted file mode 100644 index 0f6e1693c0..0000000000 --- a/src/audio/arts/SDL_artsaudio.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ -#include "../../SDL_internal.h" - -#ifndef SDL_artsaudio_h_ -#define SDL_artsaudio_h_ - -#include - -#include "../SDL_sysaudio.h" - -/* Hidden "this" pointer for the audio functions */ -#define _THIS SDL_AudioDevice *this - -struct SDL_PrivateAudioData -{ - /* The stream descriptor for the audio device */ - arts_stream_t stream; - - /* The parent process id, to detect when application quits */ - pid_t parent; - - /* Raw mixing buffer */ - Uint8 *mixbuf; - int mixlen; - - /* Support for audio timing using a timer, in addition to SDL_IOReady() */ - float frame_ticks; - float next_frame; -}; -#define FUDGE_TICKS 10 /* The scheduler overhead ticks per frame */ - -#endif /* SDL_artsaudio_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/audio/esd/SDL_esdaudio.c b/src/audio/esd/SDL_esdaudio.c deleted file mode 100644 index ccf07916c7..0000000000 --- a/src/audio/esd/SDL_esdaudio.c +++ /dev/null @@ -1,335 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ -#include "../../SDL_internal.h" - -#if SDL_AUDIO_DRIVER_ESD - -/* Allow access to an ESD network stream mixing buffer */ - -#include -#include -#include -#include -#include - -#include "SDL_timer.h" -#include "SDL_audio.h" -#include "../SDL_audio_c.h" -#include "SDL_esdaudio.h" - -#ifdef SDL_AUDIO_DRIVER_ESD_DYNAMIC -#include "SDL_name.h" -#include "SDL_loadso.h" -#else -#define SDL_NAME(X) X -#endif - -#ifdef SDL_AUDIO_DRIVER_ESD_DYNAMIC - -static const char *esd_library = SDL_AUDIO_DRIVER_ESD_DYNAMIC; -static void *esd_handle = NULL; - -static int (*SDL_NAME(esd_open_sound)) (const char *host); -static int (*SDL_NAME(esd_close)) (int esd); -static int (*SDL_NAME(esd_play_stream)) (esd_format_t format, int rate, - const char *host, const char *name); - -#define SDL_ESD_SYM(x) { #x, (void **) (char *) &SDL_NAME(x) } -static struct -{ - const char *name; - void **func; -} const esd_functions[] = { - SDL_ESD_SYM(esd_open_sound), - SDL_ESD_SYM(esd_close), SDL_ESD_SYM(esd_play_stream), -}; - -#undef SDL_ESD_SYM - -static void -UnloadESDLibrary() -{ - if (esd_handle != NULL) { - SDL_UnloadObject(esd_handle); - esd_handle = NULL; - } -} - -static int -LoadESDLibrary(void) -{ - int i, retval = -1; - - if (esd_handle == NULL) { - esd_handle = SDL_LoadObject(esd_library); - if (esd_handle) { - retval = 0; - for (i = 0; i < SDL_arraysize(esd_functions); ++i) { - *esd_functions[i].func = - SDL_LoadFunction(esd_handle, esd_functions[i].name); - if (!*esd_functions[i].func) { - retval = -1; - UnloadESDLibrary(); - break; - } - } - } - } - return retval; -} - -#else - -static void -UnloadESDLibrary() -{ - return; -} - -static int -LoadESDLibrary(void) -{ - return 0; -} - -#endif /* SDL_AUDIO_DRIVER_ESD_DYNAMIC */ - - -/* This function waits until it is possible to write a full sound buffer */ -static void -ESD_WaitDevice(_THIS) -{ - Sint32 ticks; - - /* Check to see if the thread-parent process is still alive */ - { - static int cnt = 0; - /* Note that this only works with thread implementations - that use a different process id for each thread. - */ - /* Check every 10 loops */ - if (this->hidden->parent && (((++cnt) % 10) == 0)) { - if (kill(this->hidden->parent, 0) < 0 && errno == ESRCH) { - SDL_OpenedAudioDeviceDisconnected(this); - } - } - } - - /* Use timer for general audio synchronization */ - ticks = ((Sint32) (this->hidden->next_frame - SDL_GetTicks())) - FUDGE_TICKS; - if (ticks > 0) { - SDL_Delay(ticks); - } -} - -static void -ESD_PlayDevice(_THIS) -{ - int written = 0; - - /* Write the audio data, checking for EAGAIN on broken audio drivers */ - do { - written = write(this->hidden->audio_fd, - this->hidden->mixbuf, this->hidden->mixlen); - if ((written < 0) && ((errno == 0) || (errno == EAGAIN))) { - SDL_Delay(1); /* Let a little CPU time go by */ - } - } while ((written < 0) && - ((errno == 0) || (errno == EAGAIN) || (errno == EINTR))); - - /* Set the next write frame */ - this->hidden->next_frame += this->hidden->frame_ticks; - - /* If we couldn't write, assume fatal error for now */ - if (written < 0) { - SDL_OpenedAudioDeviceDisconnected(this); - } -} - -static Uint8 * -ESD_GetDeviceBuf(_THIS) -{ - return (this->hidden->mixbuf); -} - -static void -ESD_CloseDevice(_THIS) -{ - if (this->hidden->audio_fd >= 0) { - SDL_NAME(esd_close) (this->hidden->audio_fd); - } - SDL_free(this->hidden->mixbuf); - SDL_free(this->hidden); -} - -/* Try to get the name of the program */ -static char * -get_progname(void) -{ - char *progname = NULL; -#ifdef __LINUX__ - FILE *fp; - static char temp[BUFSIZ]; - - SDL_snprintf(temp, SDL_arraysize(temp), "/proc/%d/cmdline", getpid()); - fp = fopen(temp, "r"); - if (fp != NULL) { - if (fgets(temp, sizeof(temp) - 1, fp)) { - progname = SDL_strrchr(temp, '/'); - if (progname == NULL) { - progname = temp; - } else { - progname = progname + 1; - } - } - fclose(fp); - } -#endif - return (progname); -} - - -static int -ESD_OpenDevice(_THIS, const char *devname) -{ - esd_format_t format = (ESD_STREAM | ESD_PLAY); - SDL_AudioFormat test_format = 0; - int found = 0; - - /* Initialize all variables that we clean on shutdown */ - this->hidden = (struct SDL_PrivateAudioData *) - SDL_malloc((sizeof *this->hidden)); - if (this->hidden == NULL) { - return SDL_OutOfMemory(); - } - SDL_zerop(this->hidden); - this->hidden->audio_fd = -1; - - /* Convert audio spec to the ESD audio format */ - /* Try for a closest match on audio format */ - for (test_format = SDL_FirstAudioFormat(this->spec.format); - !found && test_format; test_format = SDL_NextAudioFormat()) { -#ifdef DEBUG_AUDIO - fprintf(stderr, "Trying format 0x%4.4x\n", test_format); -#endif - found = 1; - switch (test_format) { - case AUDIO_U8: - format |= ESD_BITS8; - break; - case AUDIO_S16SYS: - format |= ESD_BITS16; - break; - default: - found = 0; - break; - } - } - - if (!found) { - return SDL_SetError("Couldn't find any hardware audio formats"); - } - - if (this->spec.channels == 1) { - format |= ESD_MONO; - } else { - format |= ESD_STEREO; - } -#if 0 - this->spec.samples = ESD_BUF_SIZE; /* Darn, no way to change this yet */ -#endif - - /* Open a connection to the ESD audio server */ - this->hidden->audio_fd = - SDL_NAME(esd_play_stream) (format, this->spec.freq, NULL, - get_progname()); - - if (this->hidden->audio_fd < 0) { - return SDL_SetError("Couldn't open ESD connection"); - } - - /* Calculate the final parameters for this audio specification */ - SDL_CalculateAudioSpec(&this->spec); - this->hidden->frame_ticks = - (float) (this->spec.samples * 1000) / this->spec.freq; - this->hidden->next_frame = SDL_GetTicks() + this->hidden->frame_ticks; - - /* Allocate mixing buffer */ - this->hidden->mixlen = this->spec.size; - this->hidden->mixbuf = (Uint8 *) SDL_malloc(this->hidden->mixlen); - if (this->hidden->mixbuf == NULL) { - return SDL_OutOfMemory(); - } - SDL_memset(this->hidden->mixbuf, this->spec.silence, this->spec.size); - - /* Get the parent process id (we're the parent of the audio thread) */ - this->hidden->parent = getpid(); - - /* We're ready to rock and roll. :-) */ - return 0; -} - -static void -ESD_Deinitialize(void) -{ - UnloadESDLibrary(); -} - -static SDL_bool -ESD_Init(SDL_AudioDriverImpl * impl) -{ - if (LoadESDLibrary() < 0) { - return SDL_FALSE; - } else { - int connection = 0; - - /* Don't start ESD if it's not running */ - SDL_setenv("ESD_NO_SPAWN", "1", 0); - - connection = SDL_NAME(esd_open_sound) (NULL); - if (connection < 0) { - UnloadESDLibrary(); - SDL_SetError("ESD: esd_open_sound failed (no audio server?)"); - return SDL_FALSE; - } - SDL_NAME(esd_close) (connection); - } - - /* Set the function pointers */ - impl->OpenDevice = ESD_OpenDevice; - impl->PlayDevice = ESD_PlayDevice; - impl->WaitDevice = ESD_WaitDevice; - impl->GetDeviceBuf = ESD_GetDeviceBuf; - impl->CloseDevice = ESD_CloseDevice; - impl->Deinitialize = ESD_Deinitialize; - impl->OnlyHasDefaultOutputDevice = SDL_TRUE; - - return SDL_TRUE; /* this audio target is available. */ -} - - -AudioBootStrap ESD_bootstrap = { - "esd", "Enlightened Sound Daemon", ESD_Init, SDL_FALSE -}; - -#endif /* SDL_AUDIO_DRIVER_ESD */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/audio/esd/SDL_esdaudio.h b/src/audio/esd/SDL_esdaudio.h deleted file mode 100644 index 90b780059d..0000000000 --- a/src/audio/esd/SDL_esdaudio.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ -#include "../../SDL_internal.h" - -#ifndef SDL_esdaudio_h_ -#define SDL_esdaudio_h_ - -#include "../SDL_sysaudio.h" - -/* Hidden "this" pointer for the audio functions */ -#define _THIS SDL_AudioDevice *this - -struct SDL_PrivateAudioData -{ - /* The file descriptor for the audio device */ - int audio_fd; - - /* The parent process id, to detect when application quits */ - pid_t parent; - - /* Raw mixing buffer */ - Uint8 *mixbuf; - int mixlen; - - /* Support for audio timing using a timer */ - float frame_ticks; - float next_frame; -}; -#define FUDGE_TICKS 10 /* The scheduler overhead ticks per frame */ - -#endif /* SDL_esdaudio_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/audio/fusionsound/SDL_fsaudio.c b/src/audio/fusionsound/SDL_fsaudio.c deleted file mode 100644 index fbe684de85..0000000000 --- a/src/audio/fusionsound/SDL_fsaudio.c +++ /dev/null @@ -1,317 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ -#include "../../SDL_internal.h" - -#if SDL_AUDIO_DRIVER_FUSIONSOUND - -/* !!! FIXME: why is this is SDL_FS_* instead of FUSIONSOUND_*? */ - -/* Allow access to a raw mixing buffer */ - -#ifdef HAVE_SIGNAL_H -#include -#endif -#include - -#include "SDL_timer.h" -#include "SDL_audio.h" -#include "../SDL_audio_c.h" -#include "SDL_fsaudio.h" - -#include - -/* #define SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC "libfusionsound.so" */ - -#ifdef SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC -#include "SDL_name.h" -#include "SDL_loadso.h" -#else -#define SDL_NAME(X) X -#endif - -#if (FUSIONSOUND_MAJOR_VERSION == 1) && (FUSIONSOUND_MINOR_VERSION < 1) -typedef DFBResult DirectResult; -#endif - -/* Buffers to use - more than 2 gives a lot of latency */ -#define FUSION_BUFFERS (2) - -#ifdef SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC - -static const char *fs_library = SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC; -static void *fs_handle = NULL; - -static DirectResult (*SDL_NAME(FusionSoundInit)) (int *argc, char *(*argv[])); -static DirectResult (*SDL_NAME(FusionSoundCreate)) (IFusionSound ** - ret_interface); - -#define SDL_FS_SYM(x) { #x, (void **) (char *) &SDL_NAME(x) } -static struct -{ - const char *name; - void **func; -} fs_functions[] = { -/* *INDENT-OFF* */ - SDL_FS_SYM(FusionSoundInit), - SDL_FS_SYM(FusionSoundCreate), -/* *INDENT-ON* */ -}; - -#undef SDL_FS_SYM - -static void -UnloadFusionSoundLibrary() -{ - if (fs_handle != NULL) { - SDL_UnloadObject(fs_handle); - fs_handle = NULL; - } -} - -static int -LoadFusionSoundLibrary(void) -{ - int i, retval = -1; - - if (fs_handle == NULL) { - fs_handle = SDL_LoadObject(fs_library); - if (fs_handle != NULL) { - retval = 0; - for (i = 0; i < SDL_arraysize(fs_functions); ++i) { - *fs_functions[i].func = - SDL_LoadFunction(fs_handle, fs_functions[i].name); - if (!*fs_functions[i].func) { - retval = -1; - UnloadFusionSoundLibrary(); - break; - } - } - } - } - - return retval; -} - -#else - -static void -UnloadFusionSoundLibrary() -{ - return; -} - -static int -LoadFusionSoundLibrary(void) -{ - return 0; -} - -#endif /* SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC */ - -/* This function waits until it is possible to write a full sound buffer */ -static void -SDL_FS_WaitDevice(_THIS) -{ - this->hidden->stream->Wait(this->hidden->stream, - this->hidden->mixsamples); -} - -static void -SDL_FS_PlayDevice(_THIS) -{ - DirectResult ret; - - ret = this->hidden->stream->Write(this->hidden->stream, - this->hidden->mixbuf, - this->hidden->mixsamples); - /* If we couldn't write, assume fatal error for now */ - if (ret) { - SDL_OpenedAudioDeviceDisconnected(this); - } -#ifdef DEBUG_AUDIO - fprintf(stderr, "Wrote %d bytes of audio data\n", this->hidden->mixlen); -#endif -} - - -static Uint8 * -SDL_FS_GetDeviceBuf(_THIS) -{ - return (this->hidden->mixbuf); -} - - -static void -SDL_FS_CloseDevice(_THIS) -{ - if (this->hidden->stream) { - this->hidden->stream->Release(this->hidden->stream); - } - if (this->hidden->fs) { - this->hidden->fs->Release(this->hidden->fs); - } - SDL_free(this->hidden->mixbuf); - SDL_free(this->hidden); -} - - -static int -SDL_FS_OpenDevice(_THIS, const char *devname) -{ - int bytes; - SDL_AudioFormat test_format; - FSSampleFormat fs_format; - FSStreamDescription desc; - DirectResult ret; - - /* Initialize all variables that we clean on shutdown */ - this->hidden = (struct SDL_PrivateAudioData *) - SDL_malloc((sizeof *this->hidden)); - if (this->hidden == NULL) { - return SDL_OutOfMemory(); - } - SDL_zerop(this->hidden); - - /* Try for a closest match on audio format */ - for (test_format = SDL_FirstAudioFormat(this->spec.format); test_format; test_format = SDL_NextAudioFormat()) { -#ifdef DEBUG_AUDIO - fprintf(stderr, "Trying format 0x%4.4x\n", test_format); -#endif - switch (test_format) { - case AUDIO_U8: - fs_format = FSSF_U8; - break; - case AUDIO_S16SYS: - fs_format = FSSF_S16; - break; - case AUDIO_S32SYS: - fs_format = FSSF_S32; - break; - case AUDIO_F32SYS: - fs_format = FSSF_FLOAT; - break; - default: - continue; - } - break; - } - - if (!test_format) { - return SDL_SetError("%s: Unsupported audio format", "fusionsound"); - } - this->spec.format = test_format; - bytes = SDL_AUDIO_BITSIZE(test_format) / 8; - - /* Retrieve the main sound interface. */ - ret = SDL_NAME(FusionSoundCreate) (&this->hidden->fs); - if (ret) { - return SDL_SetError("Unable to initialize FusionSound: %d", ret); - } - - this->hidden->mixsamples = this->spec.size / bytes / this->spec.channels; - - /* Fill stream description. */ - desc.flags = FSSDF_SAMPLERATE | FSSDF_BUFFERSIZE | - FSSDF_CHANNELS | FSSDF_SAMPLEFORMAT | FSSDF_PREBUFFER; - desc.samplerate = this->spec.freq; - desc.buffersize = this->spec.size * FUSION_BUFFERS; - desc.channels = this->spec.channels; - desc.prebuffer = 10; - desc.sampleformat = fs_format; - - ret = - this->hidden->fs->CreateStream(this->hidden->fs, &desc, - &this->hidden->stream); - if (ret) { - return SDL_SetError("Unable to create FusionSoundStream: %d", ret); - } - - /* See what we got */ - desc.flags = FSSDF_SAMPLERATE | FSSDF_BUFFERSIZE | - FSSDF_CHANNELS | FSSDF_SAMPLEFORMAT; - ret = this->hidden->stream->GetDescription(this->hidden->stream, &desc); - - this->spec.freq = desc.samplerate; - this->spec.size = - desc.buffersize / FUSION_BUFFERS * bytes * desc.channels; - this->spec.channels = desc.channels; - - /* Calculate the final parameters for this audio specification */ - SDL_CalculateAudioSpec(&this->spec); - - /* Allocate mixing buffer */ - this->hidden->mixlen = this->spec.size; - this->hidden->mixbuf = (Uint8 *) SDL_malloc(this->hidden->mixlen); - if (this->hidden->mixbuf == NULL) { - return SDL_OutOfMemory(); - } - SDL_memset(this->hidden->mixbuf, this->spec.silence, this->spec.size); - - /* We're ready to rock and roll. :-) */ - return 0; -} - - -static void -SDL_FS_Deinitialize(void) -{ - UnloadFusionSoundLibrary(); -} - - -static SDL_bool -SDL_FS_Init(SDL_AudioDriverImpl * impl) -{ - if (LoadFusionSoundLibrary() < 0) { - return SDL_FALSE; - } else { - DirectResult ret; - - ret = SDL_NAME(FusionSoundInit) (NULL, NULL); - if (ret) { - UnloadFusionSoundLibrary(); - SDL_SetError - ("FusionSound: SDL_FS_init failed (FusionSoundInit: %d)", - ret); - return SDL_FALSE; - } - } - - /* Set the function pointers */ - impl->OpenDevice = SDL_FS_OpenDevice; - impl->PlayDevice = SDL_FS_PlayDevice; - impl->WaitDevice = SDL_FS_WaitDevice; - impl->GetDeviceBuf = SDL_FS_GetDeviceBuf; - impl->CloseDevice = SDL_FS_CloseDevice; - impl->Deinitialize = SDL_FS_Deinitialize; - impl->OnlyHasDefaultOutputDevice = SDL_TRUE; - - return SDL_TRUE; /* this audio target is available. */ -} - - -AudioBootStrap FUSIONSOUND_bootstrap = { - "fusionsound", "FusionSound", SDL_FS_Init, SDL_FALSE -}; - -#endif /* SDL_AUDIO_DRIVER_FUSIONSOUND */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/audio/fusionsound/SDL_fsaudio.h b/src/audio/fusionsound/SDL_fsaudio.h deleted file mode 100644 index 2e7a59bcff..0000000000 --- a/src/audio/fusionsound/SDL_fsaudio.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ -#include "../../SDL_internal.h" - -#ifndef SDL_fsaudio_h_ -#define SDL_fsaudio_h_ - -#include - -#include "../SDL_sysaudio.h" - -/* Hidden "this" pointer for the audio functions */ -#define _THIS SDL_AudioDevice *this - -struct SDL_PrivateAudioData -{ - /* Interface */ - IFusionSound *fs; - - /* The stream interface for the audio device */ - IFusionSoundStream *stream; - - /* Raw mixing buffer */ - Uint8 *mixbuf; - int mixlen; - int mixsamples; - -}; - -#endif /* SDL_fsaudio_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/audio/nas/SDL_nasaudio.c b/src/audio/nas/SDL_nasaudio.c deleted file mode 100644 index d6d8632329..0000000000 --- a/src/audio/nas/SDL_nasaudio.c +++ /dev/null @@ -1,461 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ -#include "../../SDL_internal.h" - -#if SDL_AUDIO_DRIVER_NAS - -/* Allow access to a raw mixing buffer */ - -#include -#include - -#include "SDL_timer.h" -#include "SDL_audio.h" -#include "SDL_loadso.h" -#include "../SDL_audio_c.h" -#include "SDL_nasaudio.h" - -static void (*NAS_AuCloseServer) (AuServer *); -static void (*NAS_AuNextEvent) (AuServer *, AuBool, AuEvent *); -static AuBool(*NAS_AuDispatchEvent) (AuServer *, AuEvent *); -static void (*NAS_AuHandleEvents) (AuServer *); -static AuFlowID(*NAS_AuCreateFlow) (AuServer *, AuStatus *); -static void (*NAS_AuStartFlow) (AuServer *, AuFlowID, AuStatus *); -static void (*NAS_AuSetElements) - (AuServer *, AuFlowID, AuBool, int, AuElement *, AuStatus *); -static void (*NAS_AuWriteElement) - (AuServer *, AuFlowID, int, AuUint32, AuPointer, AuBool, AuStatus *); -static AuUint32 (*NAS_AuReadElement) - (AuServer *, AuFlowID, int, AuUint32, AuPointer, AuStatus *); -static AuServer *(*NAS_AuOpenServer) - (_AuConst char *, int, _AuConst char *, int, _AuConst char *, char **); -static AuEventHandlerRec *(*NAS_AuRegisterEventHandler) - (AuServer *, AuMask, int, AuID, AuEventHandlerCallback, AuPointer); - - -#ifdef SDL_AUDIO_DRIVER_NAS_DYNAMIC - -static const char *nas_library = SDL_AUDIO_DRIVER_NAS_DYNAMIC; -static void *nas_handle = NULL; - -static int -load_nas_sym(const char *fn, void **addr) -{ - *addr = SDL_LoadFunction(nas_handle, fn); - if (*addr == NULL) { - return 0; - } - return 1; -} - -/* cast funcs to char* first, to please GCC's strict aliasing rules. */ -#define SDL_NAS_SYM(x) \ - if (!load_nas_sym(#x, (void **) (char *) &NAS_##x)) return -1 -#else -#define SDL_NAS_SYM(x) NAS_##x = x -#endif - -static int -load_nas_syms(void) -{ - SDL_NAS_SYM(AuCloseServer); - SDL_NAS_SYM(AuNextEvent); - SDL_NAS_SYM(AuDispatchEvent); - SDL_NAS_SYM(AuHandleEvents); - SDL_NAS_SYM(AuCreateFlow); - SDL_NAS_SYM(AuStartFlow); - SDL_NAS_SYM(AuSetElements); - SDL_NAS_SYM(AuWriteElement); - SDL_NAS_SYM(AuReadElement); - SDL_NAS_SYM(AuOpenServer); - SDL_NAS_SYM(AuRegisterEventHandler); - return 0; -} - -#undef SDL_NAS_SYM - -#ifdef SDL_AUDIO_DRIVER_NAS_DYNAMIC - -static void -UnloadNASLibrary(void) -{ - if (nas_handle != NULL) { - SDL_UnloadObject(nas_handle); - nas_handle = NULL; - } -} - -static int -LoadNASLibrary(void) -{ - int retval = 0; - if (nas_handle == NULL) { - nas_handle = SDL_LoadObject(nas_library); - if (nas_handle == NULL) { - /* Copy error string so we can use it in a new SDL_SetError(). */ - const char *origerr = SDL_GetError(); - const size_t len = SDL_strlen(origerr) + 1; - char *err = SDL_stack_alloc(char, len); - SDL_strlcpy(err, origerr, len); - SDL_SetError("NAS: SDL_LoadObject('%s') failed: %s", nas_library, err); - SDL_stack_free(err); - retval = -1; - } else { - retval = load_nas_syms(); - if (retval < 0) { - UnloadNASLibrary(); - } - } - } - return retval; -} - -#else - -static void -UnloadNASLibrary(void) -{ -} - -static int -LoadNASLibrary(void) -{ - load_nas_syms(); - return 0; -} - -#endif /* SDL_AUDIO_DRIVER_NAS_DYNAMIC */ - -/* This function waits until it is possible to write a full sound buffer */ -static void -NAS_WaitDevice(_THIS) -{ - while (this->hidden->buf_free < this->hidden->mixlen) { - AuEvent ev; - NAS_AuNextEvent(this->hidden->aud, AuTrue, &ev); - NAS_AuDispatchEvent(this->hidden->aud, &ev); - } -} - -static void -NAS_PlayDevice(_THIS) -{ - while (this->hidden->mixlen > this->hidden->buf_free) { - /* - * We think the buffer is full? Yikes! Ask the server for events, - * in the hope that some of them is LowWater events telling us more - * of the buffer is free now than what we think. - */ - AuEvent ev; - NAS_AuNextEvent(this->hidden->aud, AuTrue, &ev); - NAS_AuDispatchEvent(this->hidden->aud, &ev); - } - this->hidden->buf_free -= this->hidden->mixlen; - - /* Write the audio data */ - NAS_AuWriteElement(this->hidden->aud, this->hidden->flow, 0, - this->hidden->mixlen, this->hidden->mixbuf, AuFalse, - NULL); - - this->hidden->written += this->hidden->mixlen; - -#ifdef DEBUG_AUDIO - fprintf(stderr, "Wrote %d bytes of audio data\n", this->hidden->mixlen); -#endif -} - -static Uint8 * -NAS_GetDeviceBuf(_THIS) -{ - return (this->hidden->mixbuf); -} - -static int -NAS_CaptureFromDevice(_THIS, void *buffer, int buflen) -{ - struct SDL_PrivateAudioData *h = this->hidden; - int retval; - - while (SDL_TRUE) { - /* just keep the event queue moving and the server chattering. */ - NAS_AuHandleEvents(h->aud); - - retval = (int) NAS_AuReadElement(h->aud, h->flow, 1, buflen, buffer, NULL); - /*printf("read %d capture bytes\n", (int) retval);*/ - if (retval == 0) { - SDL_Delay(10); /* don't burn the CPU if we're waiting for data. */ - } else { - break; - } - } - - return retval; -} - -static void -NAS_FlushCapture(_THIS) -{ - struct SDL_PrivateAudioData *h = this->hidden; - AuUint32 total = 0; - AuUint32 br; - Uint8 buf[512]; - - do { - /* just keep the event queue moving and the server chattering. */ - NAS_AuHandleEvents(h->aud); - br = NAS_AuReadElement(h->aud, h->flow, 1, sizeof (buf), buf, NULL); - /*printf("flushed %d capture bytes\n", (int) br);*/ - total += br; - } while ((br == sizeof (buf)) && (total < this->spec.size)); -} - -static void -NAS_CloseDevice(_THIS) -{ - if (this->hidden->aud) { - NAS_AuCloseServer(this->hidden->aud); - } - SDL_free(this->hidden->mixbuf); - SDL_free(this->hidden); -} - -static AuBool -event_handler(AuServer * aud, AuEvent * ev, AuEventHandlerRec * hnd) -{ - SDL_AudioDevice *this = (SDL_AudioDevice *) hnd->data; - struct SDL_PrivateAudioData *h = this->hidden; - if (this->iscapture) { - return AuTrue; /* we don't (currently) care about any of this for capture devices */ - } - - switch (ev->type) { - case AuEventTypeElementNotify: - { - AuElementNotifyEvent *event = (AuElementNotifyEvent *) ev; - - switch (event->kind) { - case AuElementNotifyKindLowWater: - if (h->buf_free >= 0) { - h->really += event->num_bytes; - gettimeofday(&h->last_tv, 0); - h->buf_free += event->num_bytes; - } else { - h->buf_free = event->num_bytes; - } - break; - case AuElementNotifyKindState: - switch (event->cur_state) { - case AuStatePause: - if (event->reason != AuReasonUser) { - if (h->buf_free >= 0) { - h->really += event->num_bytes; - gettimeofday(&h->last_tv, 0); - h->buf_free += event->num_bytes; - } else { - h->buf_free = event->num_bytes; - } - } - break; - } - } - } - } - return AuTrue; -} - -static AuDeviceID -find_device(_THIS) -{ - /* These "Au" things are all macros, not functions... */ - struct SDL_PrivateAudioData *h = this->hidden; - const unsigned int devicekind = this->iscapture ? AuComponentKindPhysicalInput : AuComponentKindPhysicalOutput; - const int numdevs = AuServerNumDevices(h->aud); - const int nch = this->spec.channels; - int i; - - /* Try to find exact match on channels first... */ - for (i = 0; i < numdevs; i++) { - const AuDeviceAttributes *dev = AuServerDevice(h->aud, i); - if ((AuDeviceKind(dev) == devicekind) && (AuDeviceNumTracks(dev) == nch)) { - return AuDeviceIdentifier(dev); - } - } - - /* Take anything, then... */ - for (i = 0; i < numdevs; i++) { - const AuDeviceAttributes *dev = AuServerDevice(h->aud, i); - if (AuDeviceKind(dev) == devicekind) { - this->spec.channels = AuDeviceNumTracks(dev); - return AuDeviceIdentifier(dev); - } - } - return AuNone; -} - -static int -NAS_OpenDevice(_THIS, const char *devname) -{ - AuElement elms[3]; - int buffer_size; - SDL_bool iscapture = this->iscapture; - SDL_AudioFormat test_format, format = 0; - - /* Initialize all variables that we clean on shutdown */ - this->hidden = (struct SDL_PrivateAudioData *) - SDL_malloc((sizeof *this->hidden)); - if (this->hidden == NULL) { - return SDL_OutOfMemory(); - } - SDL_zerop(this->hidden); - - /* Try for a closest match on audio format */ - for (test_format = SDL_FirstAudioFormat(this->spec.format); test_format; test_format = SDL_NextAudioFormat()) { - switch (test_format) { - case AUDIO_U8: - format = AuFormatLinearUnsigned8; - break; - case AUDIO_S8: - format = AuFormatLinearSigned8; - break; - case AUDIO_U16LSB: - format = AuFormatLinearUnsigned16LSB; - break; - case AUDIO_U16MSB: - format = AuFormatLinearUnsigned16MSB; - break; - case AUDIO_S16LSB: - format = AuFormatLinearSigned16LSB; - break; - case AUDIO_S16MSB: - format = AuFormatLinearSigned16MSB; - break; - default: - continue; - } - break; - } - if (!test_format) { - return SDL_SetError("%s: Unsupported audio format", "nas"); - } - this->spec.format = test_format; - - this->hidden->aud = NAS_AuOpenServer("", 0, NULL, 0, NULL, NULL); - if (this->hidden->aud == 0) { - return SDL_SetError("NAS: Couldn't open connection to NAS server"); - } - - this->hidden->dev = find_device(this); - if ((this->hidden->dev == AuNone) - || (!(this->hidden->flow = NAS_AuCreateFlow(this->hidden->aud, 0)))) { - return SDL_SetError("NAS: Couldn't find a fitting device on NAS server"); - } - - buffer_size = this->spec.freq; - if (buffer_size < 4096) - buffer_size = 4096; - - if (buffer_size > 32768) - buffer_size = 32768; /* So that the buffer won't get unmanageably big. */ - - /* Calculate the final parameters for this audio specification */ - SDL_CalculateAudioSpec(&this->spec); - - if (iscapture) { - AuMakeElementImportDevice(elms, this->spec.freq, this->hidden->dev, - AuUnlimitedSamples, 0, NULL); - AuMakeElementExportClient(elms + 1, 0, this->spec.freq, format, - this->spec.channels, AuTrue, buffer_size, - buffer_size, 0, NULL); - } else { - AuMakeElementImportClient(elms, this->spec.freq, format, - this->spec.channels, AuTrue, buffer_size, - buffer_size / 4, 0, NULL); - AuMakeElementExportDevice(elms + 1, 0, this->hidden->dev, this->spec.freq, - AuUnlimitedSamples, 0, NULL); - } - - NAS_AuSetElements(this->hidden->aud, this->hidden->flow, AuTrue, - 2, elms, NULL); - - NAS_AuRegisterEventHandler(this->hidden->aud, AuEventHandlerIDMask, 0, - this->hidden->flow, event_handler, - (AuPointer) this); - - NAS_AuStartFlow(this->hidden->aud, this->hidden->flow, NULL); - - /* Allocate mixing buffer */ - if (!iscapture) { - this->hidden->mixlen = this->spec.size; - this->hidden->mixbuf = (Uint8 *) SDL_malloc(this->hidden->mixlen); - if (this->hidden->mixbuf == NULL) { - return SDL_OutOfMemory(); - } - SDL_memset(this->hidden->mixbuf, this->spec.silence, this->spec.size); - } - - /* We're ready to rock and roll. :-) */ - return 0; -} - -static void -NAS_Deinitialize(void) -{ - UnloadNASLibrary(); -} - -static SDL_bool -NAS_Init(SDL_AudioDriverImpl * impl) -{ - if (LoadNASLibrary() < 0) { - return SDL_FALSE; - } else { - AuServer *aud = NAS_AuOpenServer("", 0, NULL, 0, NULL, NULL); - if (aud == NULL) { - SDL_SetError("NAS: AuOpenServer() failed (no audio server?)"); - return SDL_FALSE; - } - NAS_AuCloseServer(aud); - } - - /* Set the function pointers */ - impl->OpenDevice = NAS_OpenDevice; - impl->PlayDevice = NAS_PlayDevice; - impl->WaitDevice = NAS_WaitDevice; - impl->GetDeviceBuf = NAS_GetDeviceBuf; - impl->CaptureFromDevice = NAS_CaptureFromDevice; - impl->FlushCapture = NAS_FlushCapture; - impl->CloseDevice = NAS_CloseDevice; - impl->Deinitialize = NAS_Deinitialize; - - impl->OnlyHasDefaultOutputDevice = SDL_TRUE; - impl->OnlyHasDefaultCaptureDevice = SDL_TRUE; - impl->HasCaptureSupport = SDL_TRUE; - - return SDL_TRUE; /* this audio target is available. */ -} - -AudioBootStrap NAS_bootstrap = { - "nas", "Network Audio System", NAS_Init, SDL_FALSE -}; - -#endif /* SDL_AUDIO_DRIVER_NAS */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/audio/nas/SDL_nasaudio.h b/src/audio/nas/SDL_nasaudio.h deleted file mode 100644 index 7c9506d917..0000000000 --- a/src/audio/nas/SDL_nasaudio.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ -#include "../../SDL_internal.h" - -#ifndef SDL_nasaudio_h_ -#define SDL_nasaudio_h_ - -#ifdef __sgi -#include -#else -#include