Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fccm/8b1d656881960c4e04752cc05320f2a1 to your computer and use it in GitHub Desktop.
Save fccm/8b1d656881960c4e04752cc05320f2a1 to your computer and use it in GitHub Desktop.
diff -Naur SDL2-2.0.10/include/ SDL2-2.0.12/include/
diff -Naur SDL2-2.0.10/include/begin_code.h SDL2-2.0.12/include/begin_code.h
--- SDL2-2.0.10/include/begin_code.h 2019-07-25 06:32:36.000000000 +0200
+++ SDL2-2.0.12/include/begin_code.h 2020-03-11 02:36:18.000000000 +0100
@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
- Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
+ Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
diff -Naur SDL2-2.0.10/include/close_code.h SDL2-2.0.12/include/close_code.h
--- SDL2-2.0.10/include/close_code.h 2019-07-25 06:32:36.000000000 +0200
+++ SDL2-2.0.12/include/close_code.h 2020-03-11 02:36:18.000000000 +0100
@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
- Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
+ Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
diff -Naur SDL2-2.0.10/include/SDL_assert.h SDL2-2.0.12/include/SDL_assert.h
--- SDL2-2.0.10/include/SDL_assert.h 2019-07-25 06:32:36.000000000 +0200
+++ SDL2-2.0.12/include/SDL_assert.h 2020-03-11 02:36:18.000000000 +0100
@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
- Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
+ Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
diff -Naur SDL2-2.0.10/include/SDL_atomic.h SDL2-2.0.12/include/SDL_atomic.h
--- SDL2-2.0.10/include/SDL_atomic.h 2019-07-25 06:32:36.000000000 +0200
+++ SDL2-2.0.12/include/SDL_atomic.h 2020-03-11 02:36:18.000000000 +0100
@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
- Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
+ Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
diff -Naur SDL2-2.0.10/include/SDL_audio.h SDL2-2.0.12/include/SDL_audio.h
--- SDL2-2.0.10/include/SDL_audio.h 2019-07-25 06:32:36.000000000 +0200
+++ SDL2-2.0.12/include/SDL_audio.h 2020-03-11 02:36:18.000000000 +0100
@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
- Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
+ Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
diff -Naur SDL2-2.0.10/include/SDL_bits.h SDL2-2.0.12/include/SDL_bits.h
--- SDL2-2.0.10/include/SDL_bits.h 2019-07-25 06:32:36.000000000 +0200
+++ SDL2-2.0.12/include/SDL_bits.h 2020-03-11 02:36:18.000000000 +0100
@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
- Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
+ Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
diff -Naur SDL2-2.0.10/include/SDL_blendmode.h SDL2-2.0.12/include/SDL_blendmode.h
--- SDL2-2.0.10/include/SDL_blendmode.h 2019-07-25 06:32:36.000000000 +0200
+++ SDL2-2.0.12/include/SDL_blendmode.h 2020-03-11 02:36:18.000000000 +0100
@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
- Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
+ Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@@ -50,6 +50,9 @@
SDL_BLENDMODE_MOD = 0x00000004, /**< color modulate
dstRGB = srcRGB * dstRGB
dstA = dstA */
+ SDL_BLENDMODE_MUL = 0x00000008, /**< color multiply
+ dstRGB = (srcRGB * dstRGB) + (dstRGB * (1-srcA))
+ dstA = (srcA * dstA) + (dstA * (1-srcA)) */
SDL_BLENDMODE_INVALID = 0x7FFFFFFF
/* Additional custom blend modes can be returned by SDL_ComposeCustomBlendMode() */
diff -Naur SDL2-2.0.10/include/SDL_clipboard.h SDL2-2.0.12/include/SDL_clipboard.h
--- SDL2-2.0.10/include/SDL_clipboard.h 2019-07-25 06:32:36.000000000 +0200
+++ SDL2-2.0.12/include/SDL_clipboard.h 2020-03-11 02:36:18.000000000 +0100
@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
- Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
+ Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
diff -Naur SDL2-2.0.10/include/SDL_config_android.h SDL2-2.0.12/include/SDL_config_android.h
--- SDL2-2.0.10/include/SDL_config_android.h 2019-07-25 06:32:36.000000000 +0200
+++ SDL2-2.0.12/include/SDL_config_android.h 2020-03-11 02:36:18.000000000 +0100
@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
- Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
+ Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@@ -71,6 +71,7 @@
#define HAVE_STRCHR 1
#define HAVE_STRRCHR 1
#define HAVE_STRSTR 1
+#define HAVE_STRTOK_R 1
#define HAVE_STRTOL 1
#define HAVE_STRTOUL 1
#define HAVE_STRTOLL 1
diff -Naur SDL2-2.0.10/include/SDL_config.h SDL2-2.0.12/include/SDL_config.h
--- SDL2-2.0.10/include/SDL_config.h 2019-07-25 06:32:36.000000000 +0200
+++ SDL2-2.0.12/include/SDL_config.h 2020-03-11 02:36:18.000000000 +0100
@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
- Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
+ Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
diff -Naur SDL2-2.0.10/include/SDL_config.h.cmake SDL2-2.0.12/include/SDL_config.h.cmake
--- SDL2-2.0.10/include/SDL_config.h.cmake 2019-07-25 06:32:36.000000000 +0200
+++ SDL2-2.0.12/include/SDL_config.h.cmake 2020-03-11 02:36:18.000000000 +0100
@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
- Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
+ Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@@ -96,7 +96,10 @@
#cmakedefine HAVE_WCSLEN 1
#cmakedefine HAVE_WCSLCPY 1
#cmakedefine HAVE_WCSLCAT 1
+#cmakedefine HAVE_WCSDUP 1
+#cmakedefine HAVE_WCSSTR 1
#cmakedefine HAVE_WCSCMP 1
+#cmakedefine HAVE_WCSNCMP 1
#cmakedefine HAVE_STRLEN 1
#cmakedefine HAVE_STRLCPY 1
#cmakedefine HAVE_STRLCAT 1
@@ -108,6 +111,8 @@
#cmakedefine HAVE_STRCHR 1
#cmakedefine HAVE_STRRCHR 1
#cmakedefine HAVE_STRSTR 1
+#cmakedefine HAVE_STRTOK_R 1
+#cmakedefine HAVE_STRTOK_S 1
#cmakedefine HAVE_ITOA 1
#cmakedefine HAVE__LTOA 1
#cmakedefine HAVE__UITOA 1
@@ -127,6 +132,7 @@
#cmakedefine HAVE_STRCASECMP 1
#cmakedefine HAVE__STRNICMP 1
#cmakedefine HAVE_STRNCASECMP 1
+#cmakedefine HAVE_SSCANF 1
#cmakedefine HAVE_VSSCANF 1
#cmakedefine HAVE_VSNPRINTF 1
#cmakedefine HAVE_M_PI 1
@@ -211,7 +217,6 @@
#cmakedefine HAVE_XINPUT_H @HAVE_XINPUT_H@
#cmakedefine HAVE_DXGI_H @HAVE_DXGI_H@
-#cmakedefine HAVE_ENDPOINTVOLUME_H @HAVE_ENDPOINTVOLUME_H@
#cmakedefine HAVE_MMDEVICEAPI_H @HAVE_MMDEVICEAPI_H@
#cmakedefine HAVE_AUDIOCLIENT_H @HAVE_AUDIOCLIENT_H@
@@ -294,9 +299,11 @@
#cmakedefine SDL_HAPTIC_DINPUT @SDL_HAPTIC_DINPUT@
#cmakedefine SDL_HAPTIC_XINPUT @SDL_HAPTIC_XINPUT@
#cmakedefine SDL_HAPTIC_ANDROID @SDL_HAPTIC_ANDROID@
+#cmakedefine SDL_LIBUSB_DYNAMIC @SDL_LIBUSB_DYNAMIC@
/* Enable various sensor drivers */
#cmakedefine SDL_SENSOR_ANDROID @SDL_SENSOR_ANDROID@
+#cmakedefine SDL_SENSOR_COREMOTION @SDL_SENSOR_COREMOTION@
#cmakedefine SDL_SENSOR_DUMMY @SDL_SENSOR_DUMMY@
/* Enable various shared object loading systems */
@@ -322,9 +329,11 @@
#cmakedefine SDL_VIDEO_DRIVER_ANDROID @SDL_VIDEO_DRIVER_ANDROID@
#cmakedefine SDL_VIDEO_DRIVER_HAIKU @SDL_VIDEO_DRIVER_HAIKU@
#cmakedefine SDL_VIDEO_DRIVER_COCOA @SDL_VIDEO_DRIVER_COCOA@
+#cmakedefine SDL_VIDEO_DRIVER_UIKIT @SDL_VIDEO_DRIVER_UIKIT@
#cmakedefine SDL_VIDEO_DRIVER_DIRECTFB @SDL_VIDEO_DRIVER_DIRECTFB@
#cmakedefine SDL_VIDEO_DRIVER_DIRECTFB_DYNAMIC @SDL_VIDEO_DRIVER_DIRECTFB_DYNAMIC@
#cmakedefine SDL_VIDEO_DRIVER_DUMMY @SDL_VIDEO_DRIVER_DUMMY@
+#cmakedefine SDL_VIDEO_DRIVER_OFFSCREEN @SDL_VIDEO_DRIVER_OFFSCREEN@
#cmakedefine SDL_VIDEO_DRIVER_WINDOWS @SDL_VIDEO_DRIVER_WINDOWS@
#cmakedefine SDL_VIDEO_DRIVER_WAYLAND @SDL_VIDEO_DRIVER_WAYLAND@
#cmakedefine SDL_VIDEO_DRIVER_RPI @SDL_VIDEO_DRIVER_RPI@
@@ -387,11 +396,15 @@
/* Enable Vulkan support */
#cmakedefine SDL_VIDEO_VULKAN @SDL_VIDEO_VULKAN@
+/* Enable Metal support */
+#cmakedefine SDL_VIDEO_METAL @SDL_VIDEO_METAL@
+
/* Enable system power support */
#cmakedefine SDL_POWER_ANDROID @SDL_POWER_ANDROID@
#cmakedefine SDL_POWER_LINUX @SDL_POWER_LINUX@
#cmakedefine SDL_POWER_WINDOWS @SDL_POWER_WINDOWS@
#cmakedefine SDL_POWER_MACOSX @SDL_POWER_MACOSX@
+#cmakedefine SDL_POWER_UIKIT @SDL_POWER_UIKIT@
#cmakedefine SDL_POWER_HAIKU @SDL_POWER_HAIKU@
#cmakedefine SDL_POWER_EMSCRIPTEN @SDL_POWER_EMSCRIPTEN@
#cmakedefine SDL_POWER_HARDWIRED @SDL_POWER_HARDWIRED@
@@ -408,11 +421,16 @@
/* Enable assembly routines */
#cmakedefine SDL_ASSEMBLY_ROUTINES @SDL_ASSEMBLY_ROUTINES@
#cmakedefine SDL_ALTIVEC_BLITTERS @SDL_ALTIVEC_BLITTERS@
+#cmakedefine SDL_ARM_SIMD_BLITTERS @SDL_ARM_SIMD_BLITTERS@
+#cmakedefine SDL_ARM_NEON_BLITTERS @SDL_ARM_NEON_BLITTERS@
/* Enable dynamic libsamplerate support */
#cmakedefine SDL_LIBSAMPLERATE_DYNAMIC @SDL_LIBSAMPLERATE_DYNAMIC@
/* Platform specific definitions */
+#cmakedefine SDL_IPHONE_KEYBOARD @SDL_IPHONE_KEYBOARD@
+#cmakedefine SDL_IPHONE_LAUNCHSCREEN @SDL_IPHONE_LAUNCHSCREEN@
+
#if !defined(__WIN32__)
# if !defined(_STDINT_H_) && !defined(_STDINT_H) && !defined(HAVE_STDINT_H) && !defined(_HAVE_STDINT_H)
typedef unsigned int size_t;
diff -Naur SDL2-2.0.10/include/SDL_config.h.in SDL2-2.0.12/include/SDL_config.h.in
--- SDL2-2.0.10/include/SDL_config.h.in 2019-07-25 06:32:36.000000000 +0200
+++ SDL2-2.0.12/include/SDL_config.h.in 2020-03-11 02:36:18.000000000 +0100
@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
- Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
+ Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@@ -33,7 +33,7 @@
/* Make sure that this isn't included by Visual C++ */
#ifdef _MSC_VER
-#error You should run hg revert SDL_config.h
+#error You should run hg revert SDL_config.h
#endif
/* C language features */
@@ -99,7 +99,10 @@
#undef HAVE_WCSLEN
#undef HAVE_WCSLCPY
#undef HAVE_WCSLCAT
+#undef HAVE_WCSDUP
+#undef HAVE_WCSSTR
#undef HAVE_WCSCMP
+#undef HAVE_WCSNCMP
#undef HAVE_STRLEN
#undef HAVE_STRLCPY
#undef HAVE_STRLCAT
@@ -111,6 +114,8 @@
#undef HAVE_STRCHR
#undef HAVE_STRRCHR
#undef HAVE_STRSTR
+#undef HAVE_STRTOK_R
+#undef HAVE_STRTOK_S
#undef HAVE_ITOA
#undef HAVE__LTOA
#undef HAVE__UITOA
@@ -192,9 +197,9 @@
#undef HAVE__EXIT
#else
-#define HAVE_STDARG_H 1
-#define HAVE_STDDEF_H 1
-#define HAVE_STDINT_H 1
+#define HAVE_STDARG_H 1
+#define HAVE_STDDEF_H 1
+#define HAVE_STDINT_H 1
#endif /* HAVE_LIBC */
#undef HAVE_ALTIVEC_H
@@ -210,7 +215,6 @@
#undef HAVE_DSOUND_H
#undef HAVE_DXGI_H
#undef HAVE_XINPUT_H
-#undef HAVE_ENDPOINTVOLUME_H
#undef HAVE_MMDEVICEAPI_H
#undef HAVE_AUDIOCLIENT_H
#undef HAVE_XINPUT_GAMEPAD_EX
@@ -383,6 +387,9 @@
/* Enable Vulkan support */
#undef SDL_VIDEO_VULKAN
+/* Enable Metal support */
+#undef SDL_VIDEO_METAL
+
/* Enable system power support */
#undef SDL_POWER_LINUX
#undef SDL_POWER_WINDOWS
@@ -405,6 +412,8 @@
/* Enable assembly routines */
#undef SDL_ASSEMBLY_ROUTINES
#undef SDL_ALTIVEC_BLITTERS
+#undef SDL_ARM_SIMD_BLITTERS
+#undef SDL_ARM_NEON_BLITTERS
/* Enable ime support */
#undef SDL_USE_IME
@@ -412,6 +421,9 @@
/* Enable dynamic udev support */
#undef SDL_UDEV_DYNAMIC
+/* Enable dynamic libusb support */
+#undef SDL_LIBUSB_DYNAMIC
+
/* Enable dynamic libsamplerate support */
#undef SDL_LIBSAMPLERATE_DYNAMIC
diff -Naur SDL2-2.0.10/include/SDL_config_iphoneos.h SDL2-2.0.12/include/SDL_config_iphoneos.h
--- SDL2-2.0.10/include/SDL_config_iphoneos.h 2019-07-25 06:32:36.000000000 +0200
+++ SDL2-2.0.12/include/SDL_config_iphoneos.h 2020-03-11 02:36:18.000000000 +0100
@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
- Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
+ Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@@ -71,6 +71,7 @@
#define HAVE_STRCHR 1
#define HAVE_STRRCHR 1
#define HAVE_STRSTR 1
+#define HAVE_STRTOK_R 1
#define HAVE_STRTOL 1
#define HAVE_STRTOUL 1
#define HAVE_STRTOLL 1
@@ -137,7 +138,7 @@
/* Enable MFi joystick support */
#define SDL_JOYSTICK_MFI 1
-/*#define SDL_JOYSTICK_HIDAPI 1*/
+#define SDL_JOYSTICK_HIDAPI 1
#ifdef __TVOS__
#define SDL_SENSOR_DUMMY 1
@@ -181,6 +182,10 @@
#define SDL_VIDEO_VULKAN 1
#endif
+#if SDL_PLATFORM_SUPPORTS_METAL
+#define SDL_VIDEO_METAL 1
+#endif
+
/* Enable system power support */
#define SDL_POWER_UIKIT 1
diff -Naur SDL2-2.0.10/include/SDL_config_macosx.h SDL2-2.0.12/include/SDL_config_macosx.h
--- SDL2-2.0.10/include/SDL_config_macosx.h 2019-07-25 06:32:36.000000000 +0200
+++ SDL2-2.0.12/include/SDL_config_macosx.h 2020-03-11 02:36:18.000000000 +0100
@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
- Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
+ Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@@ -74,6 +74,7 @@
#define HAVE_STRCHR 1
#define HAVE_STRRCHR 1
#define HAVE_STRSTR 1
+#define HAVE_STRTOK_R 1
#define HAVE_STRTOL 1
#define HAVE_STRTOUL 1
#define HAVE_STRTOLL 1
@@ -130,6 +131,8 @@
#define HAVE_SYSCONF 1
#define HAVE_SYSCTLBYNAME 1
+#define HAVE_GCC_ATOMICS 1
+
/* Enable various audio drivers */
#define SDL_AUDIO_DRIVER_COREAUDIO 1
#define SDL_AUDIO_DRIVER_DISK 1
@@ -157,13 +160,13 @@
#define SDL_VIDEO_DRIVER_COCOA 1
#define SDL_VIDEO_DRIVER_DUMMY 1
#undef SDL_VIDEO_DRIVER_X11
-#define SDL_VIDEO_DRIVER_X11_DYNAMIC "/usr/X11R6/lib/libX11.6.dylib"
-#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT "/usr/X11R6/lib/libXext.6.dylib"
-#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XINERAMA "/usr/X11R6/lib/libXinerama.1.dylib"
-#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT2 "/usr/X11R6/lib/libXi.6.dylib"
-#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR "/usr/X11R6/lib/libXrandr.2.dylib"
-#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS "/usr/X11R6/lib/libXss.1.dylib"
-#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XVIDMODE "/usr/X11R6/lib/libXxf86vm.1.dylib"
+#define SDL_VIDEO_DRIVER_X11_DYNAMIC "/opt/X11/lib/libX11.6.dylib"
+#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT "/opt/X11/lib/libXext.6.dylib"
+#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XINERAMA "/opt/X11/lib/libXinerama.1.dylib"
+#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT2 "/opt/X11/lib/libXi.6.dylib"
+#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR "/opt/X11/lib/libXrandr.2.dylib"
+#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS "/opt/X11/lib/libXss.1.dylib"
+#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XVIDMODE "/opt/X11/lib/libXxf86vm.1.dylib"
#define SDL_VIDEO_DRIVER_X11_XDBE 1
#define SDL_VIDEO_DRIVER_X11_XINERAMA 1
#define SDL_VIDEO_DRIVER_X11_XRANDR 1
@@ -191,9 +194,15 @@
#define SDL_VIDEO_RENDER_OGL_ES2 1
#endif
-#ifndef SDL_VIDEO_RENDER_METAL
/* Metal only supported on 64-bit architectures with 10.11+ */
#if TARGET_CPU_X86_64 && (MAC_OS_X_VERSION_MAX_ALLOWED >= 101100)
+#define SDL_PLATFORM_SUPPORTS_METAL 1
+#else
+#define SDL_PLATFORM_SUPPORTS_METAL 0
+#endif
+
+#ifndef SDL_VIDEO_RENDER_METAL
+#if SDL_PLATFORM_SUPPORTS_METAL
#define SDL_VIDEO_RENDER_METAL 1
#else
#define SDL_VIDEO_RENDER_METAL 0
@@ -217,13 +226,22 @@
#define SDL_VIDEO_OPENGL_GLX 1
#endif
-/* Enable Vulkan support */
-/* Metal/Vulkan Portability only supported on 64-bit architectures with 10.11+ */
-#if TARGET_CPU_X86_64 && (MAC_OS_X_VERSION_MAX_ALLOWED >= 101100)
+/* Enable Vulkan and Metal support */
+#ifndef SDL_VIDEO_VULKAN
+#if SDL_PLATFORM_SUPPORTS_METAL
#define SDL_VIDEO_VULKAN 1
#else
#define SDL_VIDEO_VULKAN 0
#endif
+#endif
+
+#ifndef SDL_VIDEO_METAL
+#if SDL_PLATFORM_SUPPORTS_METAL
+#define SDL_VIDEO_METAL 1
+#else
+#define SDL_VIDEO_METAL 0
+#endif
+#endif
/* Enable system power support */
#define SDL_POWER_MACOSX 1
diff -Naur SDL2-2.0.10/include/SDL_config_minimal.h SDL2-2.0.12/include/SDL_config_minimal.h
--- SDL2-2.0.10/include/SDL_config_minimal.h 2019-07-25 06:32:36.000000000 +0200
+++ SDL2-2.0.12/include/SDL_config_minimal.h 2020-03-11 02:36:18.000000000 +0100
@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
- Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
+ Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
diff -Naur SDL2-2.0.10/include/SDL_config_os2.h SDL2-2.0.12/include/SDL_config_os2.h
--- SDL2-2.0.10/include/SDL_config_os2.h 2019-07-25 06:32:36.000000000 +0200
+++ SDL2-2.0.12/include/SDL_config_os2.h 2020-03-11 02:36:18.000000000 +0100
@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
- Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
+ Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@@ -110,6 +110,7 @@
#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
@@ -122,12 +123,21 @@
#define HAVE_STRTOD 1
#define HAVE_ATOI 1
#define HAVE_ATOF 1
+#define HAVE_WCSLEN 1
+#define HAVE_WCSLCPY 1
+#define HAVE_WCSLCAT 1
+/* #define HAVE_WCSDUP 1 */
+/* #define wcsdup _wcsdup */
+#define HAVE_WCSSTR 1
+#define HAVE_WCSCMP 1
+#define HAVE_WCSNCMP 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_SSCANF 1
+#define HAVE_VSSCANF 1
#define HAVE_SNPRINTF 1
#define HAVE_VSNPRINTF 1
#define HAVE_SETJMP 1
diff -Naur SDL2-2.0.10/include/SDL_config_pandora.h SDL2-2.0.12/include/SDL_config_pandora.h
--- SDL2-2.0.10/include/SDL_config_pandora.h 2019-07-25 06:32:36.000000000 +0200
+++ SDL2-2.0.12/include/SDL_config_pandora.h 2020-03-11 02:36:18.000000000 +0100
@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
- Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
+ Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
diff -Naur SDL2-2.0.10/include/SDL_config_psp.h SDL2-2.0.12/include/SDL_config_psp.h
--- SDL2-2.0.10/include/SDL_config_psp.h 2019-07-25 06:32:36.000000000 +0200
+++ SDL2-2.0.12/include/SDL_config_psp.h 2020-03-11 02:36:18.000000000 +0100
@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
- Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
+ Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
diff -Naur SDL2-2.0.10/include/SDL_config_windows.h SDL2-2.0.12/include/SDL_config_windows.h
--- SDL2-2.0.10/include/SDL_config_windows.h 2019-07-25 06:32:36.000000000 +0200
+++ SDL2-2.0.12/include/SDL_config_windows.h 2020-03-11 02:36:18.000000000 +0100
@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
- Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
+ Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@@ -84,7 +84,6 @@
#define HAVE_XINPUT_H 1
#define HAVE_MMDEVICEAPI_H 1
#define HAVE_AUDIOCLIENT_H 1
-#define HAVE_ENDPOINTVOLUME_H 1
/* This is disabled by default to avoid C runtime dependencies and manifest requirements */
#ifdef HAVE_LIBC
@@ -118,6 +117,10 @@
#define HAVE_STRCHR 1
#define HAVE_STRRCHR 1
#define HAVE_STRSTR 1
+/* #undef HAVE_STRTOK_R */
+#if defined(_MSC_VER)
+#define HAVE_STRTOK_S 1
+#endif
/* These functions have security warnings, so we won't use them */
/* #undef HAVE__LTOA */
/* #undef HAVE__ULTOA */
@@ -139,7 +142,7 @@
#define HAVE_ATAN2 1
#define HAVE_ATAN2F 1
#define HAVE_CEILF 1
-#define HAVE__COPYSIGN 1
+#define HAVE__COPYSIGN 1
#define HAVE_COS 1
#define HAVE_COSF 1
#define HAVE_EXP 1
@@ -168,7 +171,7 @@
#define HAVE_STRTOLL 1
#define HAVE_VSSCANF 1
#define HAVE_SCALBN 1
-#define HAVE_SCALBNF 1
+#define HAVE_SCALBNF 1
#endif
/* This function is available with at least the VC++ 2008 C runtime library */
#if _MSC_VER >= 1400
diff -Naur SDL2-2.0.10/include/SDL_config_winrt.h SDL2-2.0.12/include/SDL_config_winrt.h
--- SDL2-2.0.10/include/SDL_config_winrt.h 2019-07-25 06:32:36.000000000 +0200
+++ SDL2-2.0.12/include/SDL_config_winrt.h 2020-03-11 02:36:18.000000000 +0100
@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
- Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
+ Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@@ -100,7 +100,6 @@
#define HAVE_MMDEVICEAPI_H 1
#define HAVE_AUDIOCLIENT_H 1
-#define HAVE_ENDPOINTVOLUME_H 1
#define HAVE_LIBC 1
#define STDC_HEADERS 1
@@ -131,6 +130,7 @@
#define HAVE_STRCHR 1
#define HAVE_STRRCHR 1
#define HAVE_STRSTR 1
+#define HAVE_STRTOK_S 1
//#define HAVE_ITOA 1 // TODO, WinRT: consider using _itoa_s instead
//#define HAVE__LTOA 1 // TODO, WinRT: consider using _ltoa_s instead
//#define HAVE__ULTOA 1 // TODO, WinRT: consider using _ultoa_s instead
diff -Naur SDL2-2.0.10/include/SDL_config_wiz.h SDL2-2.0.12/include/SDL_config_wiz.h
--- SDL2-2.0.10/include/SDL_config_wiz.h 2019-07-25 06:32:36.000000000 +0200
+++ SDL2-2.0.12/include/SDL_config_wiz.h 2020-03-11 02:36:18.000000000 +0100
@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
- Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
+ Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@@ -67,6 +67,7 @@
#define HAVE_STRCHR 1
#define HAVE_STRRCHR 1
#define HAVE_STRSTR 1
+#define HAVE_STRTOK_R 1
#define HAVE_STRTOL 1
#define HAVE_STRTOUL 1
#define HAVE_STRTOLL 1
diff -Naur SDL2-2.0.10/include/SDL_copying.h SDL2-2.0.12/include/SDL_copying.h
--- SDL2-2.0.10/include/SDL_copying.h 2019-07-25 06:32:36.000000000 +0200
+++ SDL2-2.0.12/include/SDL_copying.h 2020-03-11 02:36:18.000000000 +0100
@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
- Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
+ Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
diff -Naur SDL2-2.0.10/include/SDL_cpuinfo.h SDL2-2.0.12/include/SDL_cpuinfo.h
--- SDL2-2.0.10/include/SDL_cpuinfo.h 2019-07-25 06:32:36.000000000 +0200
+++ SDL2-2.0.12/include/SDL_cpuinfo.h 2020-03-11 02:36:18.000000000 +0100
@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
- Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
+ Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@@ -73,8 +73,8 @@
# define __ARM_NEON 1 /* Set __ARM_NEON so that it can be used elsewhere, at compile time */
# endif
# if defined (_M_ARM64)
-# include <armintr.h>
-# include <arm_neon.h>
+# include <arm64intr.h>
+# include <arm64_neon.h>
# define __ARM_NEON 1 /* Set __ARM_NEON so that it can be used elsewhere, at compile time */
# endif
# endif
@@ -187,6 +187,11 @@
extern DECLSPEC SDL_bool SDLCALL SDL_HasAVX512F(void);
/**
+ * This function returns true if the CPU has ARM SIMD (ARMv6) features.
+ */
+extern DECLSPEC SDL_bool SDLCALL SDL_HasARMSIMD(void);
+
+/**
* This function returns true if the CPU has NEON (ARM SIMD) features.
*/
extern DECLSPEC SDL_bool SDLCALL SDL_HasNEON(void);
diff -Naur SDL2-2.0.10/include/SDL_egl.h SDL2-2.0.12/include/SDL_egl.h
--- SDL2-2.0.10/include/SDL_egl.h 2019-07-25 06:32:36.000000000 +0200
+++ SDL2-2.0.12/include/SDL_egl.h 2020-03-11 02:36:18.000000000 +0100
@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
- Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
+ Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@@ -390,6 +390,9 @@
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN 1
#endif
+#ifndef NOMINMAX /* don't define min() and max(). */
+#define NOMINMAX
+#endif
#include <windows.h>
#if __WINRT__
diff -Naur SDL2-2.0.10/include/SDL_endian.h SDL2-2.0.12/include/SDL_endian.h
--- SDL2-2.0.10/include/SDL_endian.h 2019-07-25 06:32:36.000000000 +0200
+++ SDL2-2.0.12/include/SDL_endian.h 2020-03-11 02:36:18.000000000 +0100
@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
- Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
+ Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@@ -42,10 +42,13 @@
#ifdef __linux__
#include <endian.h>
#define SDL_BYTEORDER __BYTE_ORDER
-#else /* __linux__ */
+#elif defined(__OpenBSD__)
+#include <endian.h>
+#define SDL_BYTEORDER BYTE_ORDER
+#else
#if defined(__hppa__) || \
defined(__m68k__) || defined(mc68000) || defined(_M_M68K) || \
- (defined(__MIPS__) && defined(__MISPEB__)) || \
+ (defined(__MIPS__) && defined(__MIPSEB__)) || \
defined(__ppc__) || defined(__POWERPC__) || defined(_M_PPC) || \
defined(__sparc__)
#define SDL_BYTEORDER SDL_BIG_ENDIAN
diff -Naur SDL2-2.0.10/include/SDL_error.h SDL2-2.0.12/include/SDL_error.h
--- SDL2-2.0.10/include/SDL_error.h 2019-07-25 06:32:36.000000000 +0200
+++ SDL2-2.0.12/include/SDL_error.h 2020-03-11 02:36:18.000000000 +0100
@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
- Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
+ Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
diff -Naur SDL2-2.0.10/include/SDL_events.h SDL2-2.0.12/include/SDL_events.h
--- SDL2-2.0.10/include/SDL_events.h 2019-07-25 06:32:36.000000000 +0200
+++ SDL2-2.0.12/include/SDL_events.h 2020-03-11 02:36:18.000000000 +0100
@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
- Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
+ Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@@ -442,6 +442,7 @@
float dx; /**< Normalized in the range -1...1 */
float dy; /**< Normalized in the range -1...1 */
float pressure; /**< Normalized in the range 0...1 */
+ Uint32 windowID; /**< The window underneath the finger, if any */
} SDL_TouchFingerEvent;
@@ -558,7 +559,7 @@
{
Uint32 type; /**< Event type, shared with all events */
SDL_CommonEvent common; /**< Common event data */
- SDL_DisplayEvent display; /**< Window event data */
+ SDL_DisplayEvent display; /**< Display event data */
SDL_WindowEvent window; /**< Window event data */
SDL_KeyboardEvent key; /**< Keyboard event data */
SDL_TextEditingEvent edit; /**< Text editing event data */
diff -Naur SDL2-2.0.10/include/SDL_filesystem.h SDL2-2.0.12/include/SDL_filesystem.h
--- SDL2-2.0.10/include/SDL_filesystem.h 2019-07-25 06:32:36.000000000 +0200
+++ SDL2-2.0.12/include/SDL_filesystem.h 2020-03-11 02:36:18.000000000 +0100
@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
- Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
+ Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
diff -Naur SDL2-2.0.10/include/SDL_gamecontroller.h SDL2-2.0.12/include/SDL_gamecontroller.h
--- SDL2-2.0.10/include/SDL_gamecontroller.h 2019-07-25 06:32:36.000000000 +0200
+++ SDL2-2.0.12/include/SDL_gamecontroller.h 2020-03-11 02:36:18.000000000 +0100
@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
- Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
+ Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@@ -57,6 +57,15 @@
struct _SDL_GameController;
typedef struct _SDL_GameController SDL_GameController;
+typedef enum
+{
+ SDL_CONTROLLER_TYPE_UNKNOWN = 0,
+ SDL_CONTROLLER_TYPE_XBOX360,
+ SDL_CONTROLLER_TYPE_XBOXONE,
+ SDL_CONTROLLER_TYPE_PS3,
+ SDL_CONTROLLER_TYPE_PS4,
+ SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_PRO
+} SDL_GameControllerType;
typedef enum
{
@@ -176,6 +185,12 @@
extern DECLSPEC const char *SDLCALL SDL_GameControllerNameForIndex(int joystick_index);
/**
+ * Get the type of a game controller.
+ * This can be called before any controllers are opened.
+ */
+extern DECLSPEC SDL_GameControllerType SDLCALL SDL_GameControllerTypeForIndex(int joystick_index);
+
+/**
* Get the mapping of a game controller.
* This can be called before any controllers are opened.
*
@@ -200,11 +215,21 @@
extern DECLSPEC SDL_GameController *SDLCALL SDL_GameControllerFromInstanceID(SDL_JoystickID joyid);
/**
+ * Return the SDL_GameController associated with a player index.
+ */
+extern DECLSPEC SDL_GameController *SDLCALL SDL_GameControllerFromPlayerIndex(int player_index);
+
+/**
* Return the name for this currently opened controller
*/
extern DECLSPEC const char *SDLCALL SDL_GameControllerName(SDL_GameController *gamecontroller);
/**
+ * Return the type of this currently opened controller
+ */
+extern DECLSPEC SDL_GameControllerType SDLCALL SDL_GameControllerGetType(SDL_GameController *gamecontroller);
+
+/**
* Get the player index of an opened game controller, or -1 if it's not available
*
* For XInput controllers this returns the XInput user index.
@@ -212,6 +237,11 @@
extern DECLSPEC int SDLCALL SDL_GameControllerGetPlayerIndex(SDL_GameController *gamecontroller);
/**
+ * Set the player index of an opened game controller
+ */
+extern DECLSPEC void SDLCALL SDL_GameControllerSetPlayerIndex(SDL_GameController *gamecontroller, int player_index);
+
+/**
* Get the USB vendor ID of an opened controller, if available.
* If the vendor ID isn't available this function returns 0.
*/
diff -Naur SDL2-2.0.10/include/SDL_gesture.h SDL2-2.0.12/include/SDL_gesture.h
--- SDL2-2.0.10/include/SDL_gesture.h 2019-07-25 06:32:36.000000000 +0200
+++ SDL2-2.0.12/include/SDL_gesture.h 2020-03-11 02:36:18.000000000 +0100
@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
- Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
+ Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
diff -Naur SDL2-2.0.10/include/SDL.h SDL2-2.0.12/include/SDL.h
--- SDL2-2.0.10/include/SDL.h 2019-07-25 06:32:36.000000000 +0200
+++ SDL2-2.0.12/include/SDL.h 2020-03-11 02:36:18.000000000 +0100
@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
- Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
+ Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@@ -47,6 +47,7 @@
#include "SDL_loadso.h"
#include "SDL_log.h"
#include "SDL_messagebox.h"
+#include "SDL_metal.h"
#include "SDL_mutex.h"
#include "SDL_power.h"
#include "SDL_render.h"
diff -Naur SDL2-2.0.10/include/SDL_haptic.h SDL2-2.0.12/include/SDL_haptic.h
--- SDL2-2.0.10/include/SDL_haptic.h 2019-07-25 06:32:36.000000000 +0200
+++ SDL2-2.0.12/include/SDL_haptic.h 2020-03-11 02:36:18.000000000 +0100
@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
- Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
+ Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
diff -Naur SDL2-2.0.10/include/SDL_hints.h SDL2-2.0.12/include/SDL_hints.h
--- SDL2-2.0.10/include/SDL_hints.h 2019-07-25 06:32:36.000000000 +0200
+++ SDL2-2.0.12/include/SDL_hints.h 2020-03-11 02:36:18.000000000 +0100
@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
- Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
+ Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@@ -165,6 +165,21 @@
#define SDL_HINT_VIDEO_ALLOW_SCREENSAVER "SDL_VIDEO_ALLOW_SCREENSAVER"
/**
+ * \brief A variable controlling whether the graphics context is externally managed.
+ *
+ * This variable can be set to the following values:
+ * "0" - SDL will manage graphics contexts that are attached to windows.
+ * "1" - Disable graphics context management on windows.
+ *
+ * By default SDL will manage OpenGL contexts in certain situations. For example, on Android the
+ * context will be automatically saved and restored when pausing the application. Additionally, some
+ * platforms will assume usage of OpenGL if Vulkan isn't used. Setting this to "1" will prevent this
+ * behavior, which is desireable when the application manages the graphics context, such as
+ * an externally managed OpenGL context or attaching a Vulkan surface to the window.
+ */
+#define SDL_HINT_VIDEO_EXTERNAL_CONTEXT "SDL_VIDEO_EXTERNAL_CONTEXT"
+
+/**
* \brief A variable controlling whether the X11 VidMode extension should be used.
*
* This variable can be set to the following values:
@@ -198,6 +213,12 @@
#define SDL_HINT_VIDEO_X11_XRANDR "SDL_VIDEO_X11_XRANDR"
/**
+ * \brief A variable forcing the visual ID chosen for new X11 windows
+ *
+ */
+#define SDL_HINT_VIDEO_X11_WINDOW_VISUALID "SDL_VIDEO_X11_WINDOW_VISUALID"
+
+/**
* \brief A variable controlling whether the X11 _NET_WM_PING protocol should be supported.
*
* This variable can be set to the following values:
@@ -224,6 +245,17 @@
#define SDL_HINT_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR "SDL_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR"
/**
+ * \brief A variable controlling whether X11 should use GLX or EGL by default
+ *
+ * This variable can be set to the following values:
+ * "0" - Use GLX
+ * "1" - Use EGL
+ *
+ * By default SDL will use GLX when both are present.
+ */
+#define SDL_HINT_VIDEO_X11_FORCE_EGL "SDL_VIDEO_X11_FORCE_EGL"
+
+/**
* \brief A variable controlling whether the window frame and title bar are interactive when the cursor is hidden
*
* This variable can be set to the following values:
@@ -437,6 +469,24 @@
#define SDL_HINT_XINPUT_USE_OLD_JOYSTICK_MAPPING "SDL_XINPUT_USE_OLD_JOYSTICK_MAPPING"
/**
+ * \brief A variable that overrides the automatic controller type detection
+ *
+ * The variable should be comma separated entries, in the form: VID/PID=type
+ *
+ * The VID and PID should be hexadecimal with exactly 4 digits, e.g. 0x00fd
+ *
+ * The type should be one of:
+ * Xbox360
+ * XboxOne
+ * PS3
+ * PS4
+ * SwitchPro
+ *
+ * This hint affects what driver is used, and must be set before calling SDL_Init(SDL_INIT_GAMECONTROLLER)
+ */
+#define SDL_HINT_GAMECONTROLLERTYPE "SDL_GAMECONTROLLERTYPE"
+
+/**
* \brief A variable that lets you manually hint extra gamecontroller db entries.
*
* The variable should be newline delimited rows of gamecontroller config data, see SDL_gamecontroller.h
@@ -483,6 +533,29 @@
#define SDL_HINT_GAMECONTROLLER_IGNORE_DEVICES_EXCEPT "SDL_GAMECONTROLLER_IGNORE_DEVICES_EXCEPT"
/**
+ * \brief If set, game controller face buttons report their values according to their labels instead of their positional layout.
+ *
+ * For example, on Nintendo Switch controllers, normally you'd get:
+ *
+ * (Y)
+ * (X) (B)
+ * (A)
+ *
+ * but if this hint is set, you'll get:
+ *
+ * (X)
+ * (Y) (A)
+ * (B)
+ *
+ * The variable can be set to the following values:
+ * "0" - Report the face buttons by position, as though they were on an Xbox controller.
+ * "1" - Report the face buttons by label instead of position
+ *
+ * The default value is "1". This hint may be set at any time.
+ */
+#define SDL_HINT_GAMECONTROLLER_USE_BUTTON_LABELS "SDL_GAMECONTROLLER_USE_BUTTON_LABELS"
+
+/**
* \brief A variable that lets you enable joystick (and gamecontroller) events even when your app is in the background.
*
* The variable can be set to the following values:
@@ -566,6 +639,17 @@
#define SDL_HINT_JOYSTICK_HIDAPI_XBOX "SDL_JOYSTICK_HIDAPI_XBOX"
/**
+ * \brief A variable controlling whether the HIDAPI driver for Nintendo GameCube controllers should be used.
+ *
+ * This variable can be set to the following values:
+ * "0" - HIDAPI driver is not used
+ * "1" - HIDAPI driver is used
+ *
+ * The default is the value of SDL_HINT_JOYSTICK_HIDAPI
+ */
+#define SDL_HINT_JOYSTICK_HIDAPI_GAMECUBE "SDL_JOYSTICK_HIDAPI_GAMECUBE"
+
+/**
* \brief A variable that controls whether Steam Controllers should be exposed using the SDL joystick and game controller APIs
*
* The variable can be set to the following values:
@@ -1174,6 +1258,20 @@
*/
#define SDL_HINT_WAVE_FACT_CHUNK "SDL_WAVE_FACT_CHUNK"
+/*
+ * \brief Override for SDL_GetDisplayUsableBounds()
+ *
+ * If set, this hint will override the expected results for
+ * SDL_GetDisplayUsableBounds() for display index 0. Generally you don't want
+ * to do this, but this allows an embedded system to request that some of the
+ * screen be reserved for other uses when paired with a well-behaved
+ * application.
+ *
+ * The contents of this hint must be 4 comma-separated integers, the first
+ * is the bounds x, then y, width and height, in that order.
+ */
+#define SDL_HINT_DISPLAY_USABLE_BOUNDS "SDL_DISPLAY_USABLE_BOUNDS"
+
/**
* \brief An enumeration of hint priorities
*/
diff -Naur SDL2-2.0.10/include/SDL_joystick.h SDL2-2.0.12/include/SDL_joystick.h
--- SDL2-2.0.10/include/SDL_joystick.h 2019-07-25 06:32:36.000000000 +0200
+++ SDL2-2.0.12/include/SDL_joystick.h 2020-03-11 02:36:18.000000000 +0100
@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
- Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
+ Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@@ -192,7 +192,12 @@
/**
* Return the SDL_Joystick associated with an instance id.
*/
-extern DECLSPEC SDL_Joystick *SDLCALL SDL_JoystickFromInstanceID(SDL_JoystickID joyid);
+extern DECLSPEC SDL_Joystick *SDLCALL SDL_JoystickFromInstanceID(SDL_JoystickID instance_id);
+
+/**
+ * Return the SDL_Joystick associated with a player index.
+ */
+extern DECLSPEC SDL_Joystick *SDLCALL SDL_JoystickFromPlayerIndex(int player_index);
/**
* Return the name for this currently opened joystick.
@@ -208,6 +213,11 @@
extern DECLSPEC int SDLCALL SDL_JoystickGetPlayerIndex(SDL_Joystick * joystick);
/**
+ * Set the player index of an opened joystick
+ */
+extern DECLSPEC void SDLCALL SDL_JoystickSetPlayerIndex(SDL_Joystick * joystick, int player_index);
+
+/**
* Return the GUID for this opened joystick
*/
extern DECLSPEC SDL_JoystickGUID SDLCALL SDL_JoystickGetGUID(SDL_Joystick * joystick);
diff -Naur SDL2-2.0.10/include/SDL_keyboard.h SDL2-2.0.12/include/SDL_keyboard.h
--- SDL2-2.0.10/include/SDL_keyboard.h 2019-07-25 06:32:36.000000000 +0200
+++ SDL2-2.0.12/include/SDL_keyboard.h 2020-03-11 02:36:18.000000000 +0100
@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
- Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
+ Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
diff -Naur SDL2-2.0.10/include/SDL_keycode.h SDL2-2.0.12/include/SDL_keycode.h
--- SDL2-2.0.10/include/SDL_keycode.h 2019-07-25 06:32:36.000000000 +0200
+++ SDL2-2.0.12/include/SDL_keycode.h 2020-03-11 02:36:18.000000000 +0100
@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
- Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
+ Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@@ -47,7 +47,7 @@
#define SDLK_SCANCODE_MASK (1<<30)
#define SDL_SCANCODE_TO_KEYCODE(X) (X | SDLK_SCANCODE_MASK)
-enum
+typedef enum
{
SDLK_UNKNOWN = 0,
@@ -317,7 +317,7 @@
SDLK_AUDIOREWIND = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOREWIND),
SDLK_AUDIOFASTFORWARD = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOFASTFORWARD)
-};
+} SDL_KeyCode;
/**
* \brief Enumeration of valid key mods (possibly OR'd together).
diff -Naur SDL2-2.0.10/include/SDL_loadso.h SDL2-2.0.12/include/SDL_loadso.h
--- SDL2-2.0.10/include/SDL_loadso.h 2019-07-25 06:32:36.000000000 +0200
+++ SDL2-2.0.12/include/SDL_loadso.h 2020-03-11 02:36:18.000000000 +0100
@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
- Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
+ Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
diff -Naur SDL2-2.0.10/include/SDL_log.h SDL2-2.0.12/include/SDL_log.h
--- SDL2-2.0.10/include/SDL_log.h 2019-07-25 06:32:36.000000000 +0200
+++ SDL2-2.0.12/include/SDL_log.h 2020-03-11 02:36:18.000000000 +0100
@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
- Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
+ Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@@ -61,7 +61,7 @@
* at the VERBOSE level and all other categories are enabled at the
* CRITICAL level.
*/
-enum
+typedef enum
{
SDL_LOG_CATEGORY_APPLICATION,
SDL_LOG_CATEGORY_ERROR,
@@ -94,7 +94,7 @@
};
*/
SDL_LOG_CATEGORY_CUSTOM
-};
+} SDL_LogCategory;
/**
* \brief The predefined log priorities
diff -Naur SDL2-2.0.10/include/SDL_main.h SDL2-2.0.12/include/SDL_main.h
--- SDL2-2.0.10/include/SDL_main.h 2019-07-25 06:32:36.000000000 +0200
+++ SDL2-2.0.12/include/SDL_main.h 2020-03-11 02:36:18.000000000 +0100
@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
- Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
+ Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
diff -Naur SDL2-2.0.10/include/SDL_messagebox.h SDL2-2.0.12/include/SDL_messagebox.h
--- SDL2-2.0.10/include/SDL_messagebox.h 2019-07-25 06:32:36.000000000 +0200
+++ SDL2-2.0.12/include/SDL_messagebox.h 2020-03-11 02:36:18.000000000 +0100
@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
- Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
+ Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@@ -36,9 +36,11 @@
*/
typedef enum
{
- SDL_MESSAGEBOX_ERROR = 0x00000010, /**< error dialog */
- SDL_MESSAGEBOX_WARNING = 0x00000020, /**< warning dialog */
- SDL_MESSAGEBOX_INFORMATION = 0x00000040 /**< informational dialog */
+ SDL_MESSAGEBOX_ERROR = 0x00000010, /**< error dialog */
+ SDL_MESSAGEBOX_WARNING = 0x00000020, /**< warning dialog */
+ SDL_MESSAGEBOX_INFORMATION = 0x00000040, /**< informational dialog */
+ SDL_MESSAGEBOX_BUTTONS_LEFT_TO_RIGHT = 0x00000080, /**< buttons placed left to right */
+ SDL_MESSAGEBOX_BUTTONS_RIGHT_TO_LEFT = 0x00000100 /**< buttons placed right to left */
} SDL_MessageBoxFlags;
/**
diff -Naur SDL2-2.0.10/include/SDL_metal.h SDL2-2.0.12/include/SDL_metal.h
--- SDL2-2.0.10/include/SDL_metal.h 1970-01-01 01:00:00.000000000 +0100
+++ SDL2-2.0.12/include/SDL_metal.h 2020-03-11 02:36:18.000000000 +0100
@@ -0,0 +1,91 @@
+/*
+ Simple DirectMedia Layer
+ Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
+
+ 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.
+*/
+
+/**
+ * \file SDL_metal.h
+ *
+ * Header file for functions to creating Metal layers and views on SDL windows.
+ */
+
+#ifndef SDL_metal_h_
+#define SDL_metal_h_
+
+#include "SDL_video.h"
+
+#include "begin_code.h"
+/* Set up for C function definitions, even when using C++ */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * \brief A handle to a CAMetalLayer-backed NSView (macOS) or UIView (iOS/tvOS).
+ *
+ * \note This can be cast directly to an NSView or UIView.
+ */
+typedef void *SDL_MetalView;
+
+/**
+ * \name Metal support functions
+ */
+/* @{ */
+
+/**
+ * \brief Create a CAMetalLayer-backed NSView/UIView and attach it to the
+ * specified window.
+ *
+ * On macOS, this does *not* associate a MTLDevice with the CAMetalLayer on its
+ * own. It is up to user code to do that.
+ *
+ * The returned handle can be casted directly to a NSView or UIView, and the
+ * CAMetalLayer can be accessed from the view's 'layer' property.
+ *
+ * \code
+ * SDL_MetalView metalview = SDL_Metal_CreateView(window);
+ * UIView *uiview = (__bridge UIView *)metalview;
+ * CAMetalLayer *metallayer = (CAMetalLayer *)uiview.layer;
+ * // [...]
+ * SDL_Metal_DestroyView(metalview);
+ * \endcode
+ *
+ * \sa SDL_Metal_DestroyView
+ */
+extern DECLSPEC SDL_MetalView SDLCALL SDL_Metal_CreateView(SDL_Window * window);
+
+/**
+ * \brief Destroy an existing SDL_MetalView object.
+ *
+ * This should be called before SDL_DestroyWindow, if SDL_Metal_CreateView was
+ * called after SDL_CreateWindow.
+ *
+ * \sa SDL_Metal_CreateView
+ */
+extern DECLSPEC void SDLCALL SDL_Metal_DestroyView(SDL_MetalView view);
+
+/* @} *//* Metal support functions */
+
+/* Ends C function definitions when using C++ */
+#ifdef __cplusplus
+}
+#endif
+#include "close_code.h"
+
+#endif /* SDL_metal_h_ */
diff -Naur SDL2-2.0.10/include/SDL_mouse.h SDL2-2.0.12/include/SDL_mouse.h
--- SDL2-2.0.10/include/SDL_mouse.h 2019-07-25 06:32:36.000000000 +0200
+++ SDL2-2.0.12/include/SDL_mouse.h 2020-03-11 02:36:18.000000000 +0100
@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
- Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
+ Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
diff -Naur SDL2-2.0.10/include/SDL_mutex.h SDL2-2.0.12/include/SDL_mutex.h
--- SDL2-2.0.10/include/SDL_mutex.h 2019-07-25 06:32:36.000000000 +0200
+++ SDL2-2.0.12/include/SDL_mutex.h 2020-03-11 02:36:18.000000000 +0100
@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
- Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
+ Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
diff -Naur SDL2-2.0.10/include/SDL_name.h SDL2-2.0.12/include/SDL_name.h
--- SDL2-2.0.10/include/SDL_name.h 2019-07-25 06:32:36.000000000 +0200
+++ SDL2-2.0.12/include/SDL_name.h 2020-03-11 02:36:18.000000000 +0100
@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
- Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
+ Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
diff -Naur SDL2-2.0.10/include/SDL_opengles2.h SDL2-2.0.12/include/SDL_opengles2.h
--- SDL2-2.0.10/include/SDL_opengles2.h 2019-07-25 06:32:36.000000000 +0200
+++ SDL2-2.0.12/include/SDL_opengles2.h 2020-03-11 02:36:18.000000000 +0100
@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
- Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
+ Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
diff -Naur SDL2-2.0.10/include/SDL_opengles.h SDL2-2.0.12/include/SDL_opengles.h
--- SDL2-2.0.10/include/SDL_opengles.h 2019-07-25 06:32:36.000000000 +0200
+++ SDL2-2.0.12/include/SDL_opengles.h 2020-03-11 02:36:18.000000000 +0100
@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
- Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
+ Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
diff -Naur SDL2-2.0.10/include/SDL_opengl_glext.h SDL2-2.0.12/include/SDL_opengl_glext.h
--- SDL2-2.0.10/include/SDL_opengl_glext.h 2019-07-25 06:32:36.000000000 +0200
+++ SDL2-2.0.12/include/SDL_opengl_glext.h 2020-03-11 02:36:18.000000000 +0100
@@ -40,6 +40,9 @@
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN 1
#endif
+#ifndef NOMINMAX /* don't define min() and max(). */
+#define NOMINMAX
+#endif
#include <windows.h>
#endif
diff -Naur SDL2-2.0.10/include/SDL_opengl.h SDL2-2.0.12/include/SDL_opengl.h
--- SDL2-2.0.10/include/SDL_opengl.h 2019-07-25 06:32:36.000000000 +0200
+++ SDL2-2.0.12/include/SDL_opengl.h 2020-03-11 02:36:18.000000000 +0100
@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
- Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
+ Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
diff -Naur SDL2-2.0.10/include/SDL_pixels.h SDL2-2.0.12/include/SDL_pixels.h
--- SDL2-2.0.10/include/SDL_pixels.h 2019-07-25 06:32:36.000000000 +0200
+++ SDL2-2.0.12/include/SDL_pixels.h 2020-03-11 02:36:18.000000000 +0100
@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
- Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
+ Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@@ -48,7 +48,7 @@
/* @} */
/** Pixel type. */
-enum
+typedef enum
{
SDL_PIXELTYPE_UNKNOWN,
SDL_PIXELTYPE_INDEX1,
@@ -62,18 +62,18 @@
SDL_PIXELTYPE_ARRAYU32,
SDL_PIXELTYPE_ARRAYF16,
SDL_PIXELTYPE_ARRAYF32
-};
+} SDL_PixelType;
/** Bitmap pixel order, high bit -> low bit. */
-enum
+typedef enum
{
SDL_BITMAPORDER_NONE,
SDL_BITMAPORDER_4321,
SDL_BITMAPORDER_1234
-};
+} SDL_BitmapOrder;
/** Packed component order, high bit -> low bit. */
-enum
+typedef enum
{
SDL_PACKEDORDER_NONE,
SDL_PACKEDORDER_XRGB,
@@ -84,12 +84,12 @@
SDL_PACKEDORDER_BGRX,
SDL_PACKEDORDER_ABGR,
SDL_PACKEDORDER_BGRA
-};
+} SDL_PackedOrder;
/** Array component order, low byte -> high byte. */
/* !!! FIXME: in 2.1, make these not overlap differently with
!!! FIXME: SDL_PACKEDORDER_*, so we can simplify SDL_ISPIXELFORMAT_ALPHA */
-enum
+typedef enum
{
SDL_ARRAYORDER_NONE,
SDL_ARRAYORDER_RGB,
@@ -98,10 +98,10 @@
SDL_ARRAYORDER_BGR,
SDL_ARRAYORDER_BGRA,
SDL_ARRAYORDER_ABGR
-};
+} SDL_ArrayOrder;
/** Packed component layout. */
-enum
+typedef enum
{
SDL_PACKEDLAYOUT_NONE,
SDL_PACKEDLAYOUT_332,
@@ -112,7 +112,7 @@
SDL_PACKEDLAYOUT_8888,
SDL_PACKEDLAYOUT_2101010,
SDL_PACKEDLAYOUT_1010102
-};
+} SDL_PackedLayout;
#define SDL_DEFINE_PIXELFOURCC(A, B, C, D) SDL_FOURCC(A, B, C, D)
@@ -191,6 +191,9 @@
SDL_PIXELFORMAT_RGB444 =
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XRGB,
SDL_PACKEDLAYOUT_4444, 12, 2),
+ SDL_PIXELFORMAT_BGR444 =
+ SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XBGR,
+ SDL_PACKEDLAYOUT_4444, 12, 2),
SDL_PIXELFORMAT_RGB555 =
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XRGB,
SDL_PACKEDLAYOUT_1555, 15, 2),
diff -Naur SDL2-2.0.10/include/SDL_platform.h SDL2-2.0.12/include/SDL_platform.h
--- SDL2-2.0.10/include/SDL_platform.h 2019-07-25 06:32:36.000000000 +0200
+++ SDL2-2.0.12/include/SDL_platform.h 2020-03-11 02:36:18.000000000 +0100
@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
- Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
+ Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
diff -Naur SDL2-2.0.10/include/SDL_power.h SDL2-2.0.12/include/SDL_power.h
--- SDL2-2.0.10/include/SDL_power.h 2019-07-25 06:32:36.000000000 +0200
+++ SDL2-2.0.12/include/SDL_power.h 2020-03-11 02:36:18.000000000 +0100
@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
- Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
+ Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
diff -Naur SDL2-2.0.10/include/SDL_quit.h SDL2-2.0.12/include/SDL_quit.h
--- SDL2-2.0.10/include/SDL_quit.h 2019-07-25 06:32:36.000000000 +0200
+++ SDL2-2.0.12/include/SDL_quit.h 2020-03-11 02:36:18.000000000 +0100
@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
- Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
+ Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
diff -Naur SDL2-2.0.10/include/SDL_rect.h SDL2-2.0.12/include/SDL_rect.h
--- SDL2-2.0.10/include/SDL_rect.h 2019-07-25 06:32:36.000000000 +0200
+++ SDL2-2.0.12/include/SDL_rect.h 2020-03-11 02:36:18.000000000 +0100
@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
- Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
+ Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
diff -Naur SDL2-2.0.10/include/SDL_render.h SDL2-2.0.12/include/SDL_render.h
--- SDL2-2.0.10/include/SDL_render.h 2019-07-25 06:32:36.000000000 +0200
+++ SDL2-2.0.12/include/SDL_render.h 2020-03-11 02:36:18.000000000 +0100
@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
- Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
+ Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@@ -86,6 +86,16 @@
} SDL_RendererInfo;
/**
+ * \brief The scaling mode for a texture.
+ */
+typedef enum
+{
+ SDL_ScaleModeNearest, /**< nearest pixel sampling */
+ SDL_ScaleModeLinear, /**< linear filtering */
+ SDL_ScaleModeBest /**< anisotropic filtering */
+} SDL_ScaleMode;
+
+/**
* \brief The access pattern allowed for a texture.
*/
typedef enum
@@ -367,6 +377,35 @@
SDL_BlendMode *blendMode);
/**
+ * \brief Set the scale mode used for texture scale operations.
+ *
+ * \param texture The texture to update.
+ * \param scaleMode ::SDL_ScaleMode to use for texture scaling.
+ *
+ * \return 0 on success, or -1 if the texture is not valid.
+ *
+ * \note If the scale mode is not supported, the closest supported mode is
+ * chosen.
+ *
+ * \sa SDL_GetTextureScaleMode()
+ */
+extern DECLSPEC int SDLCALL SDL_SetTextureScaleMode(SDL_Texture * texture,
+ SDL_ScaleMode scaleMode);
+
+/**
+ * \brief Get the scale mode used for texture scale operations.
+ *
+ * \param texture The texture to query.
+ * \param scaleMode A pointer filled in with the current scale mode.
+ *
+ * \return 0 on success, or -1 if the texture is not valid.
+ *
+ * \sa SDL_SetTextureScaleMode()
+ */
+extern DECLSPEC int SDLCALL SDL_GetTextureScaleMode(SDL_Texture * texture,
+ SDL_ScaleMode *scaleMode);
+
+/**
* \brief Update the given texture rectangle with new pixel data.
*
* \param texture The texture to update
@@ -431,9 +470,30 @@
void **pixels, int *pitch);
/**
+ * \brief Lock a portion of the texture for write-only pixel access.
+ * Expose it as a SDL surface.
+ *
+ * \param texture The texture to lock for access, which was created with
+ * ::SDL_TEXTUREACCESS_STREAMING.
+ * \param rect A pointer to the rectangle to lock for access. If the rect
+ * is NULL, the entire texture will be locked.
+ * \param surface This is filled in with a SDL surface representing the locked area
+ * Surface is freed internally after calling SDL_UnlockTexture or SDL_DestroyTexture.
+ *
+ * \return 0 on success, or -1 if the texture is not valid or was not created with ::SDL_TEXTUREACCESS_STREAMING.
+ *
+ * \sa SDL_UnlockTexture()
+ */
+extern DECLSPEC int SDLCALL SDL_LockTextureToSurface(SDL_Texture *texture,
+ const SDL_Rect *rect,
+ SDL_Surface **surface);
+
+/**
* \brief Unlock a texture, uploading the changes to video memory, if needed.
+ * If SDL_LockTextureToSurface() was called for locking, the SDL surface is freed.
*
* \sa SDL_LockTexture()
+ * \sa SDL_LockTextureToSurface()
*/
extern DECLSPEC void SDLCALL SDL_UnlockTexture(SDL_Texture * texture);
@@ -558,8 +618,8 @@
* \brief Set the clip rectangle for the current target.
*
* \param renderer The renderer for which clip rectangle should be set.
- * \param rect A pointer to the rectangle to set as the clip rectangle, or
- * NULL to disable clipping.
+ * \param rect A pointer to the rectangle to set as the clip rectangle,
+ * relative to the viewport, or NULL to disable clipping.
*
* \return 0 on success, or -1 on error
*
diff -Naur SDL2-2.0.10/include/SDL_revision.h SDL2-2.0.12/include/SDL_revision.h
--- SDL2-2.0.10/include/SDL_revision.h 2019-07-25 06:33:05.000000000 +0200
+++ SDL2-2.0.12/include/SDL_revision.h 2020-03-11 02:36:42.000000000 +0100
@@ -1,2 +1,2 @@
-#define SDL_REVISION "hg-12952:bc90ce38f1e2"
-#define SDL_REVISION_NUMBER 12952
+#define SDL_REVISION "hg-13609:34cc7d3b69d3"
+#define SDL_REVISION_NUMBER 13609
diff -Naur SDL2-2.0.10/include/SDL_rwops.h SDL2-2.0.12/include/SDL_rwops.h
--- SDL2-2.0.10/include/SDL_rwops.h 2019-07-25 06:32:36.000000000 +0200
+++ SDL2-2.0.12/include/SDL_rwops.h 2020-03-11 02:36:18.000000000 +0100
@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
- Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
+ Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
diff -Naur SDL2-2.0.10/include/SDL_scancode.h SDL2-2.0.12/include/SDL_scancode.h
--- SDL2-2.0.10/include/SDL_scancode.h 2019-07-25 06:32:36.000000000 +0200
+++ SDL2-2.0.12/include/SDL_scancode.h 2020-03-11 02:36:18.000000000 +0100
@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
- Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
+ Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
diff -Naur SDL2-2.0.10/include/SDL_sensor.h SDL2-2.0.12/include/SDL_sensor.h
--- SDL2-2.0.10/include/SDL_sensor.h 2019-07-25 06:32:36.000000000 +0200
+++ SDL2-2.0.12/include/SDL_sensor.h 2020-03-11 02:36:18.000000000 +0100
@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
- Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
+ Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
diff -Naur SDL2-2.0.10/include/SDL_shape.h SDL2-2.0.12/include/SDL_shape.h
--- SDL2-2.0.10/include/SDL_shape.h 2019-07-25 06:32:36.000000000 +0200
+++ SDL2-2.0.12/include/SDL_shape.h 2020-03-11 02:36:18.000000000 +0100
@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
- Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
+ Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
diff -Naur SDL2-2.0.10/include/SDL_stdinc.h SDL2-2.0.12/include/SDL_stdinc.h
--- SDL2-2.0.10/include/SDL_stdinc.h 2019-07-25 06:32:36.000000000 +0200
+++ SDL2-2.0.12/include/SDL_stdinc.h 2020-03-11 02:36:18.000000000 +0100
@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
- Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
+ Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@@ -408,6 +408,8 @@
extern DECLSPEC int SDLCALL SDL_isdigit(int x);
extern DECLSPEC int SDLCALL SDL_isspace(int x);
+extern DECLSPEC int SDLCALL SDL_isupper(int x);
+extern DECLSPEC int SDLCALL SDL_islower(int x);
extern DECLSPEC int SDLCALL SDL_toupper(int x);
extern DECLSPEC int SDLCALL SDL_tolower(int x);
@@ -415,11 +417,14 @@
#define SDL_zero(x) SDL_memset(&(x), 0, sizeof((x)))
#define SDL_zerop(x) SDL_memset((x), 0, sizeof(*(x)))
+#define SDL_zeroa(x) SDL_memset((x), 0, sizeof((x)))
/* Note that memset() is a byte assignment and this is a 32-bit assignment, so they're not directly equivalent. */
SDL_FORCE_INLINE void SDL_memset4(void *dst, Uint32 val, size_t dwords)
{
-#if defined(__GNUC__) && defined(i386)
+#ifdef __APPLE__
+ memset_pattern4(dst, &val, dwords * 4);
+#elif defined(__GNUC__) && defined(i386)
int u0, u1, u2;
__asm__ __volatile__ (
"cld \n\t"
@@ -450,11 +455,14 @@
extern DECLSPEC void *SDLCALL SDL_memmove(SDL_OUT_BYTECAP(len) void *dst, SDL_IN_BYTECAP(len) const void *src, size_t len);
extern DECLSPEC int SDLCALL SDL_memcmp(const void *s1, const void *s2, size_t len);
-extern DECLSPEC wchar_t *SDLCALL SDL_wcsdup(const wchar_t *wstr);
extern DECLSPEC size_t SDLCALL SDL_wcslen(const wchar_t *wstr);
extern DECLSPEC size_t SDLCALL SDL_wcslcpy(SDL_OUT_Z_CAP(maxlen) wchar_t *dst, const wchar_t *src, size_t maxlen);
extern DECLSPEC size_t SDLCALL SDL_wcslcat(SDL_INOUT_Z_CAP(maxlen) wchar_t *dst, const wchar_t *src, size_t maxlen);
+extern DECLSPEC wchar_t *SDLCALL SDL_wcsdup(const wchar_t *wstr);
+extern DECLSPEC wchar_t *SDLCALL SDL_wcsstr(const wchar_t *haystack, const wchar_t *needle);
+
extern DECLSPEC int SDLCALL SDL_wcscmp(const wchar_t *str1, const wchar_t *str2);
+extern DECLSPEC int SDLCALL SDL_wcsncmp(const wchar_t *str1, const wchar_t *str2, size_t maxlen);
extern DECLSPEC size_t SDLCALL SDL_strlen(const char *str);
extern DECLSPEC size_t SDLCALL SDL_strlcpy(SDL_OUT_Z_CAP(maxlen) char *dst, const char *src, size_t maxlen);
@@ -467,6 +475,7 @@
extern DECLSPEC char *SDLCALL SDL_strchr(const char *str, int c);
extern DECLSPEC char *SDLCALL SDL_strrchr(const char *str, int c);
extern DECLSPEC char *SDLCALL SDL_strstr(const char *haystack, const char *needle);
+extern DECLSPEC char *SDLCALL SDL_strtokr(char *s1, const char *s2, char **saveptr);
extern DECLSPEC size_t SDLCALL SDL_utf8strlen(const char *str);
extern DECLSPEC char *SDLCALL SDL_itoa(int value, char *str, int radix);
@@ -581,6 +590,7 @@
#define SDL_strchr strchr
#define SDL_strrchr strrchr
#define SDL_strstr strstr
+#define SDL_strtokr strtok_r
#define SDL_strcmp strcmp
#define SDL_strncmp strncmp
#define SDL_strcasecmp strcasecmp
diff -Naur SDL2-2.0.10/include/SDL_surface.h SDL2-2.0.12/include/SDL_surface.h
--- SDL2-2.0.10/include/SDL_surface.h 2019-07-25 06:32:36.000000000 +0200
+++ SDL2-2.0.12/include/SDL_surface.h 2020-03-11 02:36:18.000000000 +0100
@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
- Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
+ Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
diff -Naur SDL2-2.0.10/include/SDL_system.h SDL2-2.0.12/include/SDL_system.h
--- SDL2-2.0.10/include/SDL_system.h 2019-07-25 06:32:36.000000000 +0200
+++ SDL2-2.0.12/include/SDL_system.h 2020-03-11 02:36:18.000000000 +0100
@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
- Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
+ Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@@ -89,7 +89,7 @@
#endif /* __LINUX__ */
/* Platform specific functions for iOS */
-#if defined(__IPHONEOS__) && __IPHONEOS__
+#ifdef __IPHONEOS__
#define SDL_iOSSetAnimationCallback(window, interval, callback, callbackParam) SDL_iPhoneSetAnimationCallback(window, interval, callback, callbackParam)
extern DECLSPEC int SDLCALL SDL_iPhoneSetAnimationCallback(SDL_Window * window, int interval, void (*callback)(void*), void *callbackParam);
@@ -101,7 +101,7 @@
/* Platform specific functions for Android */
-#if defined(__ANDROID__) && __ANDROID__
+#ifdef __ANDROID__
/**
\brief Get the JNI environment for the current thread
@@ -121,6 +121,32 @@
extern DECLSPEC void * SDLCALL SDL_AndroidGetActivity(void);
/**
+ \brief Return API level of the current device
+
+ API level 29: Android 10
+ API level 28: Android 9
+ API level 27: Android 8.1
+ API level 26: Android 8.0
+ API level 25: Android 7.1
+ API level 24: Android 7.0
+ API level 23: Android 6.0
+ API level 22: Android 5.1
+ API level 21: Android 5.0
+ API level 20: Android 4.4W
+ API level 19: Android 4.4
+ API level 18: Android 4.3
+ API level 17: Android 4.2
+ API level 16: Android 4.1
+ API level 15: Android 4.0.3
+ API level 14: Android 4.0
+ API level 13: Android 3.2
+ API level 12: Android 3.1
+ API level 11: Android 3.0
+ API level 10: Android 2.3.3
+ */
+extern DECLSPEC int SDLCALL SDL_GetAndroidSDKVersion(void);
+
+/**
\brief Return true if the application is running on Android TV
*/
extern DECLSPEC SDL_bool SDLCALL SDL_IsAndroidTV(void);
@@ -175,7 +201,7 @@
#endif /* __ANDROID__ */
/* Platform specific functions for WinRT */
-#if defined(__WINRT__) && __WINRT__
+#ifdef __WINRT__
/**
* \brief WinRT / Windows Phone path types
@@ -268,6 +294,17 @@
*/
extern DECLSPEC SDL_bool SDLCALL SDL_IsTablet(void);
+/* Functions used by iOS application delegates to notify SDL about state changes */
+extern DECLSPEC void SDLCALL SDL_OnApplicationWillTerminate(void);
+extern DECLSPEC void SDLCALL SDL_OnApplicationDidReceiveMemoryWarning(void);
+extern DECLSPEC void SDLCALL SDL_OnApplicationWillResignActive(void);
+extern DECLSPEC void SDLCALL SDL_OnApplicationDidEnterBackground(void);
+extern DECLSPEC void SDLCALL SDL_OnApplicationWillEnterForeground(void);
+extern DECLSPEC void SDLCALL SDL_OnApplicationDidBecomeActive(void);
+#ifdef __IPHONEOS__
+extern DECLSPEC void SDLCALL SDL_OnApplicationDidChangeStatusBarOrientation(void);
+#endif
+
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
}
diff -Naur SDL2-2.0.10/include/SDL_syswm.h SDL2-2.0.12/include/SDL_syswm.h
--- SDL2-2.0.10/include/SDL_syswm.h 2019-07-25 06:32:36.000000000 +0200
+++ SDL2-2.0.12/include/SDL_syswm.h 2020-03-11 02:36:18.000000000 +0100
@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
- Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
+ Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@@ -49,6 +49,9 @@
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
+#ifndef NOMINMAX /* don't define min() and max(). */
+#define NOMINMAX
+#endif
#include <windows.h>
#endif
@@ -129,7 +132,8 @@
SDL_SYSWM_WINRT,
SDL_SYSWM_ANDROID,
SDL_SYSWM_VIVANTE,
- SDL_SYSWM_OS2
+ SDL_SYSWM_OS2,
+ SDL_SYSWM_HAIKU
} SDL_SYSWM_TYPE;
/**
diff -Naur SDL2-2.0.10/include/SDL_test_assert.h SDL2-2.0.12/include/SDL_test_assert.h
--- SDL2-2.0.10/include/SDL_test_assert.h 2019-07-25 06:32:36.000000000 +0200
+++ SDL2-2.0.12/include/SDL_test_assert.h 2020-03-11 02:36:18.000000000 +0100
@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
- Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
+ Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
diff -Naur SDL2-2.0.10/include/SDL_test_common.h SDL2-2.0.12/include/SDL_test_common.h
--- SDL2-2.0.10/include/SDL_test_common.h 2019-07-25 06:32:36.000000000 +0200
+++ SDL2-2.0.12/include/SDL_test_common.h 2020-03-11 02:36:18.000000000 +0100
@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
- Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
+ Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@@ -156,6 +156,19 @@
void SDLTest_CommonLogUsage(SDLTest_CommonState * state, const char *argv0, const char **options);
/**
+ * \brief Returns common usage information
+ *
+ * You should (probably) be using SDLTest_CommonLogUsage() instead, but this
+ * function remains for binary compatibility. Strings returned from this
+ * function are valid until SDLTest_CommonQuit() is called, in which case
+ * those strings' memory is freed and can no longer be used.
+ *
+ * \param state The common state describing the test window to create.
+ * \returns String with usage information
+ */
+const char *SDLTest_CommonUsage(SDLTest_CommonState * state);
+
+/**
* \brief Open test window.
*
* \param state The common state describing the test window to create.
diff -Naur SDL2-2.0.10/include/SDL_test_compare.h SDL2-2.0.12/include/SDL_test_compare.h
--- SDL2-2.0.10/include/SDL_test_compare.h 2019-07-25 06:32:36.000000000 +0200
+++ SDL2-2.0.12/include/SDL_test_compare.h 2020-03-11 02:36:18.000000000 +0100
@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
- Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
+ Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
diff -Naur SDL2-2.0.10/include/SDL_test_crc32.h SDL2-2.0.12/include/SDL_test_crc32.h
--- SDL2-2.0.10/include/SDL_test_crc32.h 2019-07-25 06:32:36.000000000 +0200
+++ SDL2-2.0.12/include/SDL_test_crc32.h 2020-03-11 02:36:18.000000000 +0100
@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
- Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
+ Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
diff -Naur SDL2-2.0.10/include/SDL_test_font.h SDL2-2.0.12/include/SDL_test_font.h
--- SDL2-2.0.10/include/SDL_test_font.h 2019-07-25 06:32:36.000000000 +0200
+++ SDL2-2.0.12/include/SDL_test_font.h 2020-03-11 02:36:18.000000000 +0100
@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
- Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
+ Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
diff -Naur SDL2-2.0.10/include/SDL_test_fuzzer.h SDL2-2.0.12/include/SDL_test_fuzzer.h
--- SDL2-2.0.10/include/SDL_test_fuzzer.h 2019-07-25 06:32:36.000000000 +0200
+++ SDL2-2.0.12/include/SDL_test_fuzzer.h 2020-03-11 02:36:18.000000000 +0100
@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
- Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
+ Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
diff -Naur SDL2-2.0.10/include/SDL_test.h SDL2-2.0.12/include/SDL_test.h
--- SDL2-2.0.10/include/SDL_test.h 2019-07-25 06:32:36.000000000 +0200
+++ SDL2-2.0.12/include/SDL_test.h 2020-03-11 02:36:18.000000000 +0100
@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
- Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
+ Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
diff -Naur SDL2-2.0.10/include/SDL_test_harness.h SDL2-2.0.12/include/SDL_test_harness.h
--- SDL2-2.0.10/include/SDL_test_harness.h 2019-07-25 06:32:36.000000000 +0200
+++ SDL2-2.0.12/include/SDL_test_harness.h 2020-03-11 02:36:18.000000000 +0100
@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
- Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
+ Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
diff -Naur SDL2-2.0.10/include/SDL_test_images.h SDL2-2.0.12/include/SDL_test_images.h
--- SDL2-2.0.10/include/SDL_test_images.h 2019-07-25 06:32:36.000000000 +0200
+++ SDL2-2.0.12/include/SDL_test_images.h 2020-03-11 02:36:18.000000000 +0100
@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
- Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
+ Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
diff -Naur SDL2-2.0.10/include/SDL_test_log.h SDL2-2.0.12/include/SDL_test_log.h
--- SDL2-2.0.10/include/SDL_test_log.h 2019-07-25 06:32:36.000000000 +0200
+++ SDL2-2.0.12/include/SDL_test_log.h 2020-03-11 02:36:18.000000000 +0100
@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
- Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
+ Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
diff -Naur SDL2-2.0.10/include/SDL_test_md5.h SDL2-2.0.12/include/SDL_test_md5.h
--- SDL2-2.0.10/include/SDL_test_md5.h 2019-07-25 06:32:36.000000000 +0200
+++ SDL2-2.0.12/include/SDL_test_md5.h 2020-03-11 02:36:18.000000000 +0100
@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
- Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
+ Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
diff -Naur SDL2-2.0.10/include/SDL_test_memory.h SDL2-2.0.12/include/SDL_test_memory.h
--- SDL2-2.0.10/include/SDL_test_memory.h 2019-07-25 06:32:36.000000000 +0200
+++ SDL2-2.0.12/include/SDL_test_memory.h 2020-03-11 02:36:18.000000000 +0100
@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
- Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
+ Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
diff -Naur SDL2-2.0.10/include/SDL_test_random.h SDL2-2.0.12/include/SDL_test_random.h
--- SDL2-2.0.10/include/SDL_test_random.h 2019-07-25 06:32:36.000000000 +0200
+++ SDL2-2.0.12/include/SDL_test_random.h 2020-03-11 02:36:18.000000000 +0100
@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
- Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
+ Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
diff -Naur SDL2-2.0.10/include/SDL_thread.h SDL2-2.0.12/include/SDL_thread.h
--- SDL2-2.0.10/include/SDL_thread.h 2019-07-25 06:32:36.000000000 +0200
+++ SDL2-2.0.12/include/SDL_thread.h 2020-03-11 02:36:18.000000000 +0100
@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
- Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
+ Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@@ -69,7 +69,7 @@
*/
typedef int (SDLCALL * SDL_ThreadFunction) (void *data);
-#if defined(__WIN32__) && !defined(HAVE_LIBC)
+#if defined(__WIN32__)
/**
* \file SDL_thread.h
*
@@ -93,11 +93,18 @@
#define SDL_PASSED_BEGINTHREAD_ENDTHREAD
#include <process.h> /* _beginthreadex() and _endthreadex() */
-typedef uintptr_t(__cdecl * pfnSDL_CurrentBeginThread)
+typedef uintptr_t (__cdecl * pfnSDL_CurrentBeginThread)
(void *, unsigned, unsigned (__stdcall *func)(void *),
void * /*arg*/, unsigned, unsigned * /* threadID */);
typedef void (__cdecl * pfnSDL_CurrentEndThread) (unsigned code);
+#ifndef SDL_beginthread
+#define SDL_beginthread _beginthreadex
+#endif
+#ifndef SDL_endthread
+#define SDL_endthread _endthreadex
+#endif
+
/**
* Create a thread.
*/
@@ -118,12 +125,12 @@
*/
#if defined(SDL_CreateThread) && SDL_DYNAMIC_API
#undef SDL_CreateThread
-#define SDL_CreateThread(fn, name, data) SDL_CreateThread_REAL(fn, name, data, (pfnSDL_CurrentBeginThread)_beginthreadex, (pfnSDL_CurrentEndThread)_endthreadex)
+#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, stacksize, data, (pfnSDL_CurrentBeginThread)_beginthreadex, (pfnSDL_CurrentEndThread)_endthreadex)
+#define SDL_CreateThreadWithStackSize(fn, name, stacksize, data) SDL_CreateThreadWithStackSize_REAL(fn, name, stacksize, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread)
#else
-#define SDL_CreateThread(fn, name, data) SDL_CreateThread(fn, name, data, (pfnSDL_CurrentBeginThread)_beginthreadex, (pfnSDL_CurrentEndThread)_endthreadex)
-#define SDL_CreateThreadWithStackSize(fn, name, stacksize, data) SDL_CreateThreadWithStackSize(fn, name, data, (pfnSDL_CurrentBeginThread)_beginthreadex, (pfnSDL_CurrentEndThread)_endthreadex)
+#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, data, (pfnSDL_CurrentBeginThread)_beginthreadex, (pfnSDL_CurrentEndThread)SDL_endthread)
#endif
#elif defined(__OS2__)
@@ -132,13 +139,23 @@
* into a dll with Watcom's runtime statically linked.
*/
#define SDL_PASSED_BEGINTHREAD_ENDTHREAD
+
#ifndef __EMX__
#include <process.h>
#else
#include <stdlib.h>
#endif
+
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,
@@ -147,14 +164,15 @@
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)_beginthread, (pfnSDL_CurrentEndThread)_endthread)
+#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)_beginthread, (pfnSDL_CurrentEndThread)_endthread)
+#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)_beginthread, (pfnSDL_CurrentEndThread)_endthread)
-#define SDL_CreateThreadWithStackSize(fn, name, stacksize, data) SDL_CreateThreadWithStackSize(fn, name, stacksize, data, (pfnSDL_CurrentBeginThread)_beginthread, (pfnSDL_CurrentEndThread)_endthread)
+#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 -Naur SDL2-2.0.10/include/SDL_timer.h SDL2-2.0.12/include/SDL_timer.h
--- SDL2-2.0.10/include/SDL_timer.h 2019-07-25 06:32:36.000000000 +0200
+++ SDL2-2.0.12/include/SDL_timer.h 2020-03-11 02:36:18.000000000 +0100
@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
- Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
+ Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
diff -Naur SDL2-2.0.10/include/SDL_touch.h SDL2-2.0.12/include/SDL_touch.h
--- SDL2-2.0.10/include/SDL_touch.h 2019-07-25 06:32:36.000000000 +0200
+++ SDL2-2.0.12/include/SDL_touch.h 2020-03-11 02:36:18.000000000 +0100
@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
- Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
+ Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
diff -Naur SDL2-2.0.10/include/SDL_types.h SDL2-2.0.12/include/SDL_types.h
--- SDL2-2.0.10/include/SDL_types.h 2019-07-25 06:32:36.000000000 +0200
+++ SDL2-2.0.12/include/SDL_types.h 2020-03-11 02:36:18.000000000 +0100
@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
- Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
+ Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
diff -Naur SDL2-2.0.10/include/SDL_version.h SDL2-2.0.12/include/SDL_version.h
--- SDL2-2.0.10/include/SDL_version.h 2019-07-25 06:32:36.000000000 +0200
+++ SDL2-2.0.12/include/SDL_version.h 2020-03-11 02:36:18.000000000 +0100
@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
- Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
+ Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@@ -59,7 +59,7 @@
*/
#define SDL_MAJOR_VERSION 2
#define SDL_MINOR_VERSION 0
-#define SDL_PATCHLEVEL 10
+#define SDL_PATCHLEVEL 12
/**
* \brief Macro to determine SDL version program was compiled against.
diff -Naur SDL2-2.0.10/include/SDL_video.h SDL2-2.0.12/include/SDL_video.h
--- SDL2-2.0.10/include/SDL_video.h 2019-07-25 06:32:36.000000000 +0200
+++ SDL2-2.0.12/include/SDL_video.h 2020-03-11 02:36:18.000000000 +0100
@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
- Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
+ Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@@ -96,7 +96,6 @@
*/
typedef enum
{
- /* !!! FIXME: change this to name = (1<<x). */
SDL_WINDOW_FULLSCREEN = 0x00000001, /**< fullscreen window */
SDL_WINDOW_OPENGL = 0x00000002, /**< window usable with OpenGL context */
SDL_WINDOW_SHOWN = 0x00000004, /**< window is visible */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment