diff --git a/libs/windows/include/SDL.h b/libs/windows/include/SDL.h index e2656caf..02203f29 100644 --- a/libs/windows/include/SDL.h +++ b/libs/windows/include/SDL.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2020 Sam Lantinga + Copyright (C) 1997-2021 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 diff --git a/libs/windows/include/SDL_assert.h b/libs/windows/include/SDL_assert.h index f8a368ec..05823713 100644 --- a/libs/windows/include/SDL_assert.h +++ b/libs/windows/include/SDL_assert.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2020 Sam Lantinga + Copyright (C) 1997-2021 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 diff --git a/libs/windows/include/SDL_atomic.h b/libs/windows/include/SDL_atomic.h index e99f1bcc..5f62bd73 100644 --- a/libs/windows/include/SDL_atomic.h +++ b/libs/windows/include/SDL_atomic.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2020 Sam Lantinga + Copyright (C) 1997-2021 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 diff --git a/libs/windows/include/SDL_audio.h b/libs/windows/include/SDL_audio.h index 4ba34914..46f03164 100644 --- a/libs/windows/include/SDL_audio.h +++ b/libs/windows/include/SDL_audio.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2020 Sam Lantinga + Copyright (C) 1997-2021 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 diff --git a/libs/windows/include/SDL_bits.h b/libs/windows/include/SDL_bits.h index db150ed0..08b59eae 100644 --- a/libs/windows/include/SDL_bits.h +++ b/libs/windows/include/SDL_bits.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2020 Sam Lantinga + Copyright (C) 1997-2021 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 @@ -48,10 +48,9 @@ extern "C" { * \return Index of the most significant bit, or -1 if the value is 0. */ #if defined(__WATCOMC__) && defined(__386__) -extern _inline int _SDL_clz_watcom (Uint32); -#pragma aux _SDL_clz_watcom = \ +extern _inline int _SDL_bsr_watcom (Uint32); +#pragma aux _SDL_bsr_watcom = \ "bsr eax, eax" \ - "xor eax, 31" \ parm [eax] nomemory \ value [eax] \ modify exact [eax] nomemory; @@ -72,7 +71,13 @@ SDL_MostSignificantBitIndex32(Uint32 x) if (x == 0) { return -1; } - return 31 - _SDL_clz_watcom(x); + return _SDL_bsr_watcom(x); +#elif defined(_MSC_VER) + unsigned long index; + if (_BitScanReverse(&index, x)) { + return index; + } + return -1; #else /* Based off of Bit Twiddling Hacks by Sean Eron Anderson * , released in the public domain. diff --git a/libs/windows/include/SDL_blendmode.h b/libs/windows/include/SDL_blendmode.h index 5e21a79e..4c45cad6 100644 --- a/libs/windows/include/SDL_blendmode.h +++ b/libs/windows/include/SDL_blendmode.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2020 Sam Lantinga + Copyright (C) 1997-2021 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 diff --git a/libs/windows/include/SDL_clipboard.h b/libs/windows/include/SDL_clipboard.h index dbf69fce..1455348f 100644 --- a/libs/windows/include/SDL_clipboard.h +++ b/libs/windows/include/SDL_clipboard.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2020 Sam Lantinga + Copyright (C) 1997-2021 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 diff --git a/libs/windows/include/SDL_config.h b/libs/windows/include/SDL_config.h index 3937dbc3..6cdeab83 100644 --- a/libs/windows/include/SDL_config.h +++ b/libs/windows/include/SDL_config.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2020 Sam Lantinga + Copyright (C) 1997-2021 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 @@ -22,34 +22,498 @@ #ifndef SDL_config_h_ #define SDL_config_h_ -#include "SDL_platform.h" - /** - * \file SDL_config.h + * \file SDL_config.h.in + * + * This is a set of defines to configure the SDL features */ -/* Add any platform that doesn't build using the configure system. */ -#if defined(__WIN32__) -#include "SDL_config_windows.h" -#elif defined(__WINRT__) -#include "SDL_config_winrt.h" -#elif defined(__MACOSX__) -#include "SDL_config_macosx.h" -#elif defined(__IPHONEOS__) -#include "SDL_config_iphoneos.h" -#elif defined(__ANDROID__) -#include "SDL_config_android.h" -#elif defined(__PSP__) -#include "SDL_config_psp.h" -#elif defined(__OS2__) -#include "SDL_config_os2.h" -#else -/* This is a minimal configuration just to get SDL running on new platforms. */ -#include "SDL_config_minimal.h" -#endif /* platform config */ +/* General platform specific identifiers */ +#include "SDL_platform.h" -#ifdef USING_GENERATED_CONFIG_H -#error Wrong SDL_config.h, check your include path? +/* C language features */ +/* #undef const */ +/* #undef inline */ +/* #undef volatile */ + +/* C datatypes */ +/* Define SIZEOF_VOIDP for 64/32 architectures */ +#if defined(__LP64__) || defined(_LP64) || defined(_WIN64) +#define SIZEOF_VOIDP 8 +#else +#define SIZEOF_VOIDP 4 #endif +/* #undef HAVE_GCC_ATOMICS */ +/* #undef HAVE_GCC_SYNC_LOCK_TEST_AND_SET */ + +/* Comment this if you want to build without any C library requirements */ +#define HAVE_LIBC 1 +#if HAVE_LIBC + +/* Useful headers */ +#define STDC_HEADERS 1 +/* #undef HAVE_ALLOCA_H */ +#define HAVE_CTYPE_H 1 +/* #undef HAVE_FLOAT_H */ +/* #undef HAVE_ICONV_H */ +/* #undef HAVE_INTTYPES_H */ +#define HAVE_LIMITS_H 1 +/* #undef HAVE_MALLOC_H */ +#define HAVE_MATH_H 1 +/* #undef HAVE_MEMORY_H */ +#define HAVE_SIGNAL_H 1 +/* #undef HAVE_STDARG_H */ +/* #undef HAVE_STDINT_H */ +#define HAVE_STDIO_H 1 +/* #undef HAVE_STDLIB_H */ +/* #undef HAVE_STRINGS_H */ +#define HAVE_STRING_H 1 +/* #undef HAVE_SYS_TYPES_H */ +#define HAVE_WCHAR_H 1 +/* #undef HAVE_PTHREAD_NP_H */ +/* #undef HAVE_LIBUNWIND_H */ + +/* C library functions */ +#define HAVE_MALLOC 1 +#define HAVE_CALLOC 1 +#define HAVE_REALLOC 1 +#define HAVE_FREE 1 +#define HAVE_ALLOCA 1 +#ifndef __WIN32__ /* Don't use C runtime versions of these on Windows */ +/* #undef HAVE_GETENV */ +/* #undef HAVE_SETENV */ +/* #undef HAVE_PUTENV */ +/* #undef HAVE_UNSETENV */ +#endif +#define HAVE_QSORT 1 +#define HAVE_ABS 1 +/* #undef HAVE_BCOPY */ +#define HAVE_MEMSET 1 +#define HAVE_MEMCPY 1 +#define HAVE_MEMMOVE 1 +#define HAVE_MEMCMP 1 +#define HAVE_WCSLEN 1 +/* #undef HAVE_WCSLCPY */ +/* #undef HAVE_WCSLCAT */ +#define HAVE_WCSDUP 1 +#define HAVE_WCSSTR 1 +#define HAVE_WCSCMP 1 +#define HAVE_WCSNCMP 1 +/* #undef HAVE_WCSCASECMP */ +#define HAVE__WCSICMP 1 +/* #undef HAVE_WCSNCASECMP */ +#define HAVE__WCSNICMP 1 +#define HAVE_STRLEN 1 +/* #undef HAVE_STRLCPY */ +/* #undef HAVE_STRLCAT */ +#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 +/* #undef HAVE__UITOA */ +#define HAVE__ULTOA 1 +#define HAVE_STRTOL 1 +#define HAVE_STRTOUL 1 +/* #undef HAVE__I64TOA */ +/* #undef HAVE__UI64TOA */ +#define HAVE_STRTOLL 1 +/* #undef HAVE_STRTOULL */ +#define HAVE_STRTOD 1 +#define HAVE_ATOI 1 +#define HAVE_ATOF 1 +#define HAVE_STRCMP 1 +#define HAVE_STRNCMP 1 +#define HAVE__STRICMP 1 +/* #undef HAVE_STRCASECMP */ +#define HAVE__STRNICMP 1 +/* #undef HAVE_STRNCASECMP */ +#define HAVE_SSCANF 1 +/* #undef HAVE_VSSCANF */ +/* #undef HAVE_VSNPRINTF */ +#define HAVE_M_PI 1 +#define HAVE_ACOS 1 +#define HAVE_ACOSF 1 +#define HAVE_ASIN 1 +#define HAVE_ASINF 1 +#define HAVE_ATAN 1 +#define HAVE_ATANF 1 +#define HAVE_ATAN2 1 +#define HAVE_ATAN2F 1 +#define HAVE_CEIL 1 +#define HAVE_CEILF 1 +#define HAVE_COPYSIGN 1 +#define HAVE_COPYSIGNF 1 +#define HAVE_COS 1 +#define HAVE_COSF 1 +#define HAVE_EXP 1 +#define HAVE_EXPF 1 +#define HAVE_FABS 1 +#define HAVE_FABSF 1 +#define HAVE_FLOOR 1 +#define HAVE_FLOORF 1 +#define HAVE_FMOD 1 +#define HAVE_FMODF 1 +#define HAVE_LOG 1 +#define HAVE_LOGF 1 +#define HAVE_LOG10 1 +#define HAVE_LOG10F 1 +#define HAVE_LROUND 1 +#define HAVE_LROUNDF 1 +#define HAVE_POW 1 +#define HAVE_POWF 1 +#define HAVE_ROUND 1 +#define HAVE_ROUNDF 1 +#define HAVE_SCALBN 1 +#define HAVE_SCALBNF 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 +/* #undef HAVE_FOPEN64 */ +/* #undef HAVE_FSEEKO */ +/* #undef HAVE_FSEEKO64 */ +/* #undef HAVE_SIGACTION */ +/* #undef HAVE_SA_SIGACTION */ +/* #undef HAVE_SETJMP */ +/* #undef HAVE_NANOSLEEP */ +/* #undef HAVE_SYSCONF */ +/* #undef HAVE_SYSCTLBYNAME */ +/* #undef HAVE_CLOCK_GETTIME */ +/* #undef HAVE_GETPAGESIZE */ +/* #undef HAVE_MPROTECT */ +/* #undef HAVE_ICONV */ +/* #undef HAVE_PTHREAD_SETNAME_NP */ +/* #undef HAVE_PTHREAD_SET_NAME_NP */ +/* #undef HAVE_SEM_TIMEDWAIT */ +/* #undef HAVE_GETAUXVAL */ +/* #undef HAVE_ELF_AUX_INFO */ +/* #undef HAVE_POLL */ +/* #undef HAVE__EXIT */ + +#elif __WIN32__ +/* #undef HAVE_STDARG_H */ +/* #undef HAVE_STDDEF_H */ +/* #undef HAVE_FLOAT_H */ + +#else +/* We may need some replacement for stdarg.h here */ +#include +#endif /* HAVE_LIBC */ + +/* #undef HAVE_ALTIVEC_H */ +/* #undef HAVE_DBUS_DBUS_H */ +/* #undef HAVE_FCITX */ +/* #undef HAVE_IBUS_IBUS_H */ +/* #undef HAVE_SYS_INOTIFY_H */ +/* #undef HAVE_INOTIFY_INIT */ +/* #undef HAVE_INOTIFY_INIT1 */ +/* #undef HAVE_INOTIFY */ +/* #undef HAVE_IMMINTRIN_H */ +/* #undef HAVE_LIBUDEV_H */ +/* #undef HAVE_LIBSAMPLERATE_H */ + +#define HAVE_D3D_H 1 +#define HAVE_D3D11_H 1 +#define HAVE_DDRAW_H 1 +#define HAVE_DSOUND_H 1 +#define HAVE_DINPUT_H 1 +#define HAVE_XINPUT_H 1 +#define HAVE_DXGI_H 1 + +#define HAVE_MMDEVICEAPI_H 1 +#define HAVE_AUDIOCLIENT_H 1 +#define HAVE_SENSORSAPI_H 1 + +/* #undef HAVE_XINPUT_GAMEPAD_EX */ +/* #undef HAVE_XINPUT_STATE_EX */ + +/* SDL internal assertion support */ +/* #undef SDL_DEFAULT_ASSERT_LEVEL */ + +/* Allow disabling of core subsystems */ +/* #undef SDL_ATOMIC_DISABLED */ +/* #undef SDL_AUDIO_DISABLED */ +/* #undef SDL_CPUINFO_DISABLED */ +/* #undef SDL_EVENTS_DISABLED */ +/* #undef SDL_FILE_DISABLED */ +/* #undef SDL_JOYSTICK_DISABLED */ +/* #undef SDL_HAPTIC_DISABLED */ +/* #undef SDL_SENSOR_DISABLED */ +/* #undef SDL_LOADSO_DISABLED */ +/* #undef SDL_RENDER_DISABLED */ +/* #undef SDL_THREADS_DISABLED */ +/* #undef SDL_TIMERS_DISABLED */ +/* #undef SDL_VIDEO_DISABLED */ +/* #undef SDL_POWER_DISABLED */ +/* #undef SDL_FILESYSTEM_DISABLED */ + +/* Enable various audio drivers */ +/* #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 */ +#define SDL_AUDIO_DRIVER_DISK 1 +#define SDL_AUDIO_DRIVER_DSOUND 1 +#define SDL_AUDIO_DRIVER_DUMMY 1 +/* #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_NAS */ +/* #undef SDL_AUDIO_DRIVER_NAS_DYNAMIC */ +/* #undef SDL_AUDIO_DRIVER_NETBSD */ +/* #undef SDL_AUDIO_DRIVER_OSS */ +/* #undef SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H */ +/* #undef SDL_AUDIO_DRIVER_PAUDIO */ +/* #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 */ +#define SDL_AUDIO_DRIVER_WASAPI 1 +#define SDL_AUDIO_DRIVER_WINMM 1 +/* #undef SDL_AUDIO_DRIVER_OS2 */ + +/* Enable various input drivers */ +/* #undef SDL_INPUT_LINUXEV */ +/* #undef SDL_INPUT_LINUXKD */ +/* #undef SDL_JOYSTICK_ANDROID */ +/* #undef SDL_JOYSTICK_HAIKU */ +#define SDL_JOYSTICK_DINPUT 1 +#define SDL_JOYSTICK_XINPUT 1 +/* #undef SDL_JOYSTICK_DUMMY */ +/* #undef SDL_JOYSTICK_IOKIT */ +/* #undef SDL_JOYSTICK_MFI */ +/* #undef SDL_JOYSTICK_LINUX */ +/* #undef SDL_JOYSTICK_WINMM */ +/* #undef SDL_JOYSTICK_USBHID */ +/* #undef SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H */ +#define SDL_JOYSTICK_HIDAPI 1 +/* #undef SDL_JOYSTICK_EMSCRIPTEN */ +#define SDL_JOYSTICK_VIRTUAL 1 +/* #undef SDL_HAPTIC_DUMMY */ +/* #undef SDL_HAPTIC_LINUX */ +/* #undef SDL_HAPTIC_IOKIT */ +#define SDL_HAPTIC_DINPUT 1 +#define SDL_HAPTIC_XINPUT 1 +/* #undef SDL_HAPTIC_ANDROID */ +/* #undef SDL_LIBUSB_DYNAMIC */ + +/* Enable various sensor drivers */ +/* #undef SDL_SENSOR_ANDROID */ +/* #undef SDL_SENSOR_COREMOTION */ +#define SDL_SENSOR_WINDOWS 1 +/* #undef SDL_SENSOR_DUMMY */ + +/* Enable various shared object loading systems */ +/* #undef SDL_LOADSO_DLOPEN */ +/* #undef SDL_LOADSO_DUMMY */ +/* #undef SDL_LOADSO_LDG */ +#define SDL_LOADSO_WINDOWS 1 +/* #undef SDL_LOADSO_OS2 */ + +/* Enable various threading systems */ +#define SDL_THREAD_GENERIC_COND_SUFFIX 1 +/* #undef SDL_THREAD_PTHREAD */ +/* #undef SDL_THREAD_PTHREAD_RECURSIVE_MUTEX */ +/* #undef SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP */ +#define SDL_THREAD_WINDOWS 1 +/* #undef SDL_THREAD_OS2 */ + +/* Enable various timer systems */ +/* #undef SDL_TIMER_HAIKU */ +/* #undef SDL_TIMER_DUMMY */ +/* #undef SDL_TIMER_UNIX */ +#define SDL_TIMER_WINDOWS 1 +/* #undef SDL_TIMER_OS2 */ + +/* Enable various video drivers */ +/* #undef SDL_VIDEO_DRIVER_ANDROID */ +/* #undef SDL_VIDEO_DRIVER_EMSCRIPTEN */ +/* #undef SDL_VIDEO_DRIVER_HAIKU */ +/* #undef SDL_VIDEO_DRIVER_COCOA */ +/* #undef SDL_VIDEO_DRIVER_UIKIT */ +/* #undef SDL_VIDEO_DRIVER_DIRECTFB */ +/* #undef SDL_VIDEO_DRIVER_DIRECTFB_DYNAMIC */ +#define SDL_VIDEO_DRIVER_DUMMY 1 +/* #undef SDL_VIDEO_DRIVER_OFFSCREEN */ +#define SDL_VIDEO_DRIVER_WINDOWS 1 +/* #undef SDL_VIDEO_DRIVER_WINRT */ +/* #undef SDL_VIDEO_DRIVER_WAYLAND */ +/* #undef SDL_VIDEO_DRIVER_RPI */ +/* #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_KMSDRM */ +/* #undef SDL_VIDEO_DRIVER_KMSDRM_DYNAMIC */ +/* #undef SDL_VIDEO_DRIVER_KMSDRM_DYNAMIC_GBM */ + +/* #undef SDL_VIDEO_DRIVER_WAYLAND_QT_TOUCH */ +/* #undef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC */ +/* #undef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_EGL */ +/* #undef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_CURSOR */ +/* #undef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_XKBCOMMON */ + +/* #undef SDL_VIDEO_DRIVER_X11 */ +/* #undef SDL_VIDEO_DRIVER_X11_DYNAMIC */ +/* #undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT */ +/* #undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XCURSOR */ +/* #undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XINERAMA */ +/* #undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT2 */ +/* #undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR */ +/* #undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS */ +/* #undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XVIDMODE */ +/* #undef SDL_VIDEO_DRIVER_X11_XCURSOR */ +/* #undef SDL_VIDEO_DRIVER_X11_XDBE */ +/* #undef SDL_VIDEO_DRIVER_X11_XINERAMA */ +/* #undef SDL_VIDEO_DRIVER_X11_XINPUT2 */ +/* #undef SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH */ +/* #undef SDL_VIDEO_DRIVER_X11_XRANDR */ +/* #undef SDL_VIDEO_DRIVER_X11_XSCRNSAVER */ +/* #undef SDL_VIDEO_DRIVER_X11_XSHAPE */ +/* #undef SDL_VIDEO_DRIVER_X11_XVIDMODE */ +/* #undef SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS */ +/* #undef SDL_VIDEO_DRIVER_X11_CONST_PARAM_XEXTADDDISPLAY */ +/* #undef SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM */ + +#define SDL_VIDEO_RENDER_D3D 1 +#define SDL_VIDEO_RENDER_D3D11 1 +#define SDL_VIDEO_RENDER_OGL 1 +/* #undef SDL_VIDEO_RENDER_OGL_ES */ +#define SDL_VIDEO_RENDER_OGL_ES2 1 +/* #undef SDL_VIDEO_RENDER_DIRECTFB */ +/* #undef SDL_VIDEO_RENDER_METAL */ + +/* Enable OpenGL support */ +#define SDL_VIDEO_OPENGL 1 +/* #undef SDL_VIDEO_OPENGL_ES */ +#define SDL_VIDEO_OPENGL_ES2 1 +/* #undef SDL_VIDEO_OPENGL_BGL */ +/* #undef SDL_VIDEO_OPENGL_CGL */ +/* #undef SDL_VIDEO_OPENGL_GLX */ +#define SDL_VIDEO_OPENGL_WGL 1 +#define SDL_VIDEO_OPENGL_EGL 1 +/* #undef SDL_VIDEO_OPENGL_OSMESA */ +/* #undef SDL_VIDEO_OPENGL_OSMESA_DYNAMIC */ + +/* Enable Vulkan support */ +#define SDL_VIDEO_VULKAN 1 + +/* Enable Metal support */ +/* #undef SDL_VIDEO_METAL */ + +/* Enable system power support */ +/* #undef SDL_POWER_ANDROID */ +/* #undef SDL_POWER_LINUX */ +#define SDL_POWER_WINDOWS 1 +/* #undef SDL_POWER_WINRT */ +/* #undef SDL_POWER_MACOSX */ +/* #undef SDL_POWER_UIKIT */ +/* #undef SDL_POWER_HAIKU */ +/* #undef SDL_POWER_EMSCRIPTEN */ +/* #undef SDL_POWER_HARDWIRED */ + +/* Enable system filesystem support */ +/* #undef SDL_FILESYSTEM_ANDROID */ +/* #undef SDL_FILESYSTEM_HAIKU */ +/* #undef SDL_FILESYSTEM_COCOA */ +/* #undef SDL_FILESYSTEM_DUMMY */ +/* #undef SDL_FILESYSTEM_UNIX */ +#define SDL_FILESYSTEM_WINDOWS 1 +/* #undef SDL_FILESYSTEM_EMSCRIPTEN */ +/* #undef SDL_FILESYSTEM_OS2 */ + +/* Enable assembly routines */ +#define SDL_ASSEMBLY_ROUTINES 1 +/* #undef SDL_ALTIVEC_BLITTERS */ +/* #undef SDL_ARM_SIMD_BLITTERS */ +/* #undef SDL_ARM_NEON_BLITTERS */ + +/* Enable dynamic libsamplerate support */ +/* #undef SDL_LIBSAMPLERATE_DYNAMIC */ + +/* Platform specific definitions */ +/* #undef SDL_IPHONE_KEYBOARD */ +/* #undef SDL_IPHONE_LAUNCHSCREEN */ + +#if !defined(__WIN32__) && !defined(__WINRT__) +# if !defined(_STDINT_H_) && !defined(_STDINT_H) && !defined(HAVE_STDINT_H) && !defined(_HAVE_STDINT_H) +typedef unsigned int size_t; +typedef signed char int8_t; +typedef unsigned char uint8_t; +typedef signed short int16_t; +typedef unsigned short uint16_t; +typedef signed int int32_t; +typedef unsigned int uint32_t; +typedef signed long long int64_t; +typedef unsigned long long uint64_t; +typedef unsigned long uintptr_t; +# endif /* if (stdint.h isn't available) */ +#else /* __WIN32__ */ +# if !defined(_STDINT_H_) && !defined(HAVE_STDINT_H) && !defined(_HAVE_STDINT_H) +# if defined(__GNUC__) || defined(__DMC__) || defined(__WATCOMC__) +#define HAVE_STDINT_H 1 +# elif defined(_MSC_VER) +typedef signed __int8 int8_t; +typedef unsigned __int8 uint8_t; +typedef signed __int16 int16_t; +typedef unsigned __int16 uint16_t; +typedef signed __int32 int32_t; +typedef unsigned __int32 uint32_t; +typedef signed __int64 int64_t; +typedef unsigned __int64 uint64_t; +# ifndef _UINTPTR_T_DEFINED +# ifdef _WIN64 +typedef unsigned __int64 uintptr_t; +# else +typedef unsigned int uintptr_t; +# endif +#define _UINTPTR_T_DEFINED +# endif +/* Older Visual C++ headers don't have the Win64-compatible typedefs... */ +# if ((_MSC_VER <= 1200) && (!defined(DWORD_PTR))) +#define DWORD_PTR DWORD +# endif +# if ((_MSC_VER <= 1200) && (!defined(LONG_PTR))) +#define LONG_PTR LONG +# endif +# else /* !__GNUC__ && !_MSC_VER */ +typedef signed char int8_t; +typedef unsigned char uint8_t; +typedef signed short int16_t; +typedef unsigned short uint16_t; +typedef signed int int32_t; +typedef unsigned int uint32_t; +typedef signed long long int64_t; +typedef unsigned long long uint64_t; +# ifndef _SIZE_T_DEFINED_ +#define _SIZE_T_DEFINED_ +typedef unsigned int size_t; +# endif +typedef unsigned int uintptr_t; +# endif /* __GNUC__ || _MSC_VER */ +# endif /* !_STDINT_H_ && !HAVE_STDINT_H */ +#endif /* __WIN32__ */ + #endif /* SDL_config_h_ */ diff --git a/libs/windows/include/SDL_config_android.h b/libs/windows/include/SDL_config_android.h index d1148cf2..65d7e20d 100644 --- a/libs/windows/include/SDL_config_android.h +++ b/libs/windows/include/SDL_config_android.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2020 Sam Lantinga + Copyright (C) 1997-2021 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 @@ -111,8 +111,12 @@ #define HAVE_LOGF 1 #define HAVE_LOG10 1 #define HAVE_LOG10F 1 +#define HAVE_LROUND 1 +#define HAVE_LROUNDF 1 #define HAVE_POW 1 #define HAVE_POWF 1 +#define HAVE_ROUND 1 +#define HAVE_ROUNDF 1 #define HAVE_SCALBN 1 #define HAVE_SCALBNF 1 #define HAVE_SIN 1 @@ -129,7 +133,11 @@ #define HAVE_SYSCONF 1 #define HAVE_CLOCK_GETTIME 1 +#ifdef __LP64__ +#define SIZEOF_VOIDP 8 +#else #define SIZEOF_VOIDP 4 +#endif /* Enable various audio drivers */ #define SDL_AUDIO_DRIVER_ANDROID 1 diff --git a/libs/windows/include/SDL_config_iphoneos.h b/libs/windows/include/SDL_config_iphoneos.h index f06ad335..9a748beb 100644 --- a/libs/windows/include/SDL_config_iphoneos.h +++ b/libs/windows/include/SDL_config_iphoneos.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2020 Sam Lantinga + Copyright (C) 1997-2021 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 @@ -112,8 +112,12 @@ #define HAVE_LOGF 1 #define HAVE_LOG10 1 #define HAVE_LOG10F 1 +#define HAVE_LROUND 1 +#define HAVE_LROUNDF 1 #define HAVE_POW 1 #define HAVE_POWF 1 +#define HAVE_ROUND 1 +#define HAVE_ROUNDF 1 #define HAVE_SCALBN 1 #define HAVE_SCALBNF 1 #define HAVE_SIN 1 @@ -166,10 +170,12 @@ #define SDL_VIDEO_DRIVER_DUMMY 1 /* Enable OpenGL ES */ +#if !TARGET_OS_MACCATALYST #define SDL_VIDEO_OPENGL_ES2 1 #define SDL_VIDEO_OPENGL_ES 1 #define SDL_VIDEO_RENDER_OGL_ES 1 #define SDL_VIDEO_RENDER_OGL_ES2 1 +#endif /* Metal supported on 64-bit devices running iOS 8.0 and tvOS 9.0 and newer Also supported in simulator from iOS 13.0 and tvOS 13.0 diff --git a/libs/windows/include/SDL_config_macosx.h b/libs/windows/include/SDL_config_macosx.h index 4b45f165..9a8f720f 100644 --- a/libs/windows/include/SDL_config_macosx.h +++ b/libs/windows/include/SDL_config_macosx.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2020 Sam Lantinga + Copyright (C) 1997-2021 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 @@ -115,8 +115,12 @@ #define HAVE_LOGF 1 #define HAVE_LOG10 1 #define HAVE_LOG10F 1 +#define HAVE_LROUND 1 +#define HAVE_LROUNDF 1 #define HAVE_POW 1 #define HAVE_POWF 1 +#define HAVE_ROUND 1 +#define HAVE_ROUNDF 1 #define HAVE_SCALBN 1 #define HAVE_SCALBNF 1 #define HAVE_SIN 1 diff --git a/libs/windows/include/SDL_config_minimal.h b/libs/windows/include/SDL_config_minimal.h index b9c39584..fe0ced86 100644 --- a/libs/windows/include/SDL_config_minimal.h +++ b/libs/windows/include/SDL_config_minimal.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2020 Sam Lantinga + Copyright (C) 1997-2021 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 diff --git a/libs/windows/include/SDL_config_os2.h b/libs/windows/include/SDL_config_os2.h index 1922217d..ba6c3f3f 100644 --- a/libs/windows/include/SDL_config_os2.h +++ b/libs/windows/include/SDL_config_os2.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2020 Sam Lantinga + Copyright (C) 1997-2021 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 @@ -25,6 +25,8 @@ #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 @@ -132,7 +134,8 @@ #define HAVE_WCSLEN 1 #define HAVE_WCSLCPY 1 #define HAVE_WCSLCAT 1 -/* #define HAVE_WCSDUP 1 */ +/* #undef HAVE_WCSDUP */ +#define HAVE__WCSDUP 1 /* #define wcsdup _wcsdup */ #define HAVE_WCSSTR 1 #define HAVE_WCSCMP 1 @@ -172,8 +175,12 @@ /* #undef HAVE_LOGF */ #define HAVE_LOG10 1 /* #undef HAVE_LOG10F */ +/* #undef HAVE_LROUND */ +/* #undef HAVE_LROUNDF */ #define HAVE_POW 1 /* #undef HAVE_POWF */ +/* #undef HAVE_ROUND */ +/* #undef HAVE_ROUNDF */ #define HAVE_SIN 1 /* #undef HAVE_SINF */ /* #undef HAVE_SCALBN */ @@ -184,5 +191,9 @@ /* #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/libs/windows/include/SDL_config_pandora.h b/libs/windows/include/SDL_config_pandora.h index 8728a638..d57a79f2 100644 --- a/libs/windows/include/SDL_config_pandora.h +++ b/libs/windows/include/SDL_config_pandora.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2020 Sam Lantinga + Copyright (C) 1997-2021 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 @@ -95,6 +95,10 @@ #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 diff --git a/libs/windows/include/SDL_config_psp.h b/libs/windows/include/SDL_config_psp.h index 235fe08e..53d4ca69 100644 --- a/libs/windows/include/SDL_config_psp.h +++ b/libs/windows/include/SDL_config_psp.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2020 Sam Lantinga + Copyright (C) 1997-2021 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 diff --git a/libs/windows/include/SDL_config_windows.h b/libs/windows/include/SDL_config_windows.h index 85ad68ee..0d8171f3 100644 --- a/libs/windows/include/SDL_config_windows.h +++ b/libs/windows/include/SDL_config_windows.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2020 Sam Lantinga + Copyright (C) 1997-2021 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 @@ -119,9 +119,6 @@ typedef unsigned int uintptr_t; #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 */ @@ -172,7 +169,12 @@ typedef unsigned int uintptr_t; /* These functions were added with the VC++ 2013 C runtime library */ #if _MSC_VER >= 1800 #define HAVE_STRTOLL 1 +#define HAVE_STRTOULL 1 #define HAVE_VSSCANF 1 +#define HAVE_LROUND 1 +#define HAVE_LROUNDF 1 +#define HAVE_ROUND 1 +#define HAVE_ROUNDF 1 #define HAVE_SCALBN 1 #define HAVE_SCALBNF 1 #define HAVE_TRUNC 1 @@ -215,7 +217,13 @@ typedef unsigned int uintptr_t; /* Enable various input drivers */ #define SDL_JOYSTICK_DINPUT 1 #define SDL_JOYSTICK_HIDAPI 1 +#ifndef __WINRT__ +#define SDL_JOYSTICK_RAWINPUT 1 +#endif #define SDL_JOYSTICK_VIRTUAL 1 +#ifdef SDL_WINDOWS10_SDK +#define SDL_JOYSTICK_WGI 1 +#endif #define SDL_JOYSTICK_XINPUT 1 #define SDL_HAPTIC_DINPUT 1 #define SDL_HAPTIC_XINPUT 1 @@ -227,6 +235,7 @@ typedef unsigned int uintptr_t; #define SDL_LOADSO_WINDOWS 1 /* Enable various threading systems */ +#define SDL_THREAD_GENERIC_COND_SUFFIX 1 #define SDL_THREAD_WINDOWS 1 /* Enable various timer systems */ diff --git a/libs/windows/include/SDL_config_winrt.h b/libs/windows/include/SDL_config_winrt.h index 02079f53..c6d5c135 100644 --- a/libs/windows/include/SDL_config_winrt.h +++ b/libs/windows/include/SDL_config_winrt.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2020 Sam Lantinga + Copyright (C) 1997-2021 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 @@ -126,17 +126,13 @@ typedef unsigned int uintptr_t; #define HAVE_STRLEN 1 #define HAVE__STRREV 1 #define HAVE__STRUPR 1 -//#define HAVE__STRLWR 1 // TODO, WinRT: consider using _strlwr_s instead #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 #define HAVE_STRTOL 1 #define HAVE_STRTOUL 1 -//#define HAVE_STRTOLL 1 +/* #undef HAVE_STRTOLL */ +/* #undef HAVE_STRTOULL */ #define HAVE_STRTOD 1 #define HAVE_ATOI 1 #define HAVE_ATOF 1 @@ -145,7 +141,12 @@ typedef unsigned int uintptr_t; #define HAVE__STRICMP 1 #define HAVE__STRNICMP 1 #define HAVE_VSNPRINTF 1 -//#define HAVE_SSCANF 1 // TODO, WinRT: consider using sscanf_s instead +/* TODO, WinRT: consider using ??_s versions of the following */ +/* #undef HAVE__STRLWR */ +/* #undef HAVE_ITOA */ +/* #undef HAVE__LTOA */ +/* #undef HAVE__ULTOA */ +/* #undef HAVE_SSCANF */ #define HAVE_M_PI 1 #define HAVE_ACOS 1 #define HAVE_ACOSF 1 @@ -172,8 +173,12 @@ typedef unsigned int uintptr_t; #define HAVE_LOGF 1 #define HAVE_LOG10 1 #define HAVE_LOG10F 1 +#define HAVE_LROUND 1 +#define HAVE_LROUNDF 1 #define HAVE_POW 1 #define HAVE_POWF 1 +#define HAVE_ROUND 1 +#define HAVE_ROUNDF 1 #define HAVE__SCALB 1 #define HAVE_SIN 1 #define HAVE_SINF 1 @@ -208,6 +213,7 @@ typedef unsigned int uintptr_t; /* Enable various threading systems */ #if (NTDDI_VERSION >= NTDDI_WINBLUE) +#define SDL_THREAD_GENERIC_COND_SUFFIX 1 #define SDL_THREAD_WINDOWS 1 #else /* WinRT on Windows 8.0 and Windows Phone 8.0 don't support CreateThread() */ diff --git a/libs/windows/include/SDL_config_wiz.h b/libs/windows/include/SDL_config_wiz.h index f65af8eb..7c552f25 100644 --- a/libs/windows/include/SDL_config_wiz.h +++ b/libs/windows/include/SDL_config_wiz.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2020 Sam Lantinga + Copyright (C) 1997-2021 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 @@ -107,8 +107,12 @@ #define HAVE_LOGF 1 #define HAVE_LOG10 1 #define HAVE_LOG10F 1 +#define HAVE_LROUND 1 +#define HAVE_LROUNDF 1 #define HAVE_POW 1 #define HAVE_POWF 1 +#define HAVE_ROUND 1 +#define HAVE_ROUNDF 1 #define HAVE_SCALBN 1 #define HAVE_SCALBNF 1 #define HAVE_SIN 1 diff --git a/libs/windows/include/SDL_copying.h b/libs/windows/include/SDL_copying.h index 4f8a2bcd..15223e98 100644 --- a/libs/windows/include/SDL_copying.h +++ b/libs/windows/include/SDL_copying.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2020 Sam Lantinga + Copyright (C) 1997-2021 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 diff --git a/libs/windows/include/SDL_cpuinfo.h b/libs/windows/include/SDL_cpuinfo.h index df3123c0..c51f713b 100644 --- a/libs/windows/include/SDL_cpuinfo.h +++ b/libs/windows/include/SDL_cpuinfo.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2020 Sam Lantinga + Copyright (C) 1997-2021 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 diff --git a/libs/windows/include/SDL_egl.h b/libs/windows/include/SDL_egl.h index 531441e6..223357e5 100644 --- a/libs/windows/include/SDL_egl.h +++ b/libs/windows/include/SDL_egl.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2020 Sam Lantinga + Copyright (C) 1997-2021 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 diff --git a/libs/windows/include/SDL_endian.h b/libs/windows/include/SDL_endian.h index 171c008a..4534cad4 100644 --- a/libs/windows/include/SDL_endian.h +++ b/libs/windows/include/SDL_endian.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2020 Sam Lantinga + Copyright (C) 1997-2021 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 @@ -30,6 +30,10 @@ #include "SDL_stdinc.h" +#ifdef _MSC_VER +#include +#endif + /** * \name The two types of endianness */ @@ -45,6 +49,9 @@ #elif defined(__OpenBSD__) #include #define SDL_BYTEORDER BYTE_ORDER +#elif defined(__FreeBSD__) +#include +#define SDL_BYTEORDER BYTE_ORDER #else #if defined(__hppa__) || \ defined(__m68k__) || defined(mc68000) || defined(_M_M68K) || \ @@ -68,8 +75,11 @@ extern "C" { /** * \file SDL_endian.h */ -#if defined(__GNUC__) && defined(__i386__) && \ - !(__GNUC__ == 2 && __GNUC_MINOR__ == 95 /* broken gcc version */) +#if (defined(__clang__) && (__clang_major__ > 3 || (__clang_major__ == 3 && __clang_minor__ >= 2))) || \ + (defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8))) +#define SDL_Swap16(x) __builtin_bswap16(x) +#elif defined(__GNUC__) && defined(__i386__) && \ + !(__GNUC__ == 2 && __GNUC_MINOR__ <= 95 /* broken gcc version */) SDL_FORCE_INLINE Uint16 SDL_Swap16(Uint16 x) { @@ -92,13 +102,23 @@ SDL_Swap16(Uint16 x) __asm__("rlwimi %0,%2,8,16,23": "=&r"(result):"0"(x >> 8), "r"(x)); return (Uint16)result; } -#elif defined(__GNUC__) && (defined(__M68000__) || defined(__M68020__)) && !defined(__mcoldfire__) +#elif defined(__GNUC__) && defined(__aarch64__) +SDL_FORCE_INLINE Uint16 +SDL_Swap16(Uint16 x) +{ + __asm__("rev16 %w1, %w0" : "=r"(x) : "r"(x)); + return x; +} +#elif defined(__GNUC__) && (defined(__m68k__) && !defined(__mcoldfire__)) SDL_FORCE_INLINE Uint16 SDL_Swap16(Uint16 x) { __asm__("rorw #8,%0": "=d"(x): "0"(x):"cc"); return x; } +#elif defined(_MSC_VER) +#pragma intrinsic(_byteswap_ushort) +#define SDL_Swap16(x) _byteswap_ushort(x) #elif defined(__WATCOMC__) && defined(__386__) extern _inline Uint16 SDL_Swap16(Uint16); #pragma aux SDL_Swap16 = \ @@ -113,7 +133,11 @@ SDL_Swap16(Uint16 x) } #endif -#if defined(__GNUC__) && defined(__i386__) +#if (defined(__clang__) && (__clang_major__ > 2 || (__clang_major__ == 2 && __clang_minor__ >= 6))) || \ + (defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))) +#define SDL_Swap32(x) __builtin_bswap32(x) +#elif defined(__GNUC__) && defined(__i386__) && \ + !(__GNUC__ == 2 && __GNUC_MINOR__ <= 95 /* broken gcc version */) SDL_FORCE_INLINE Uint32 SDL_Swap32(Uint32 x) { @@ -138,7 +162,14 @@ SDL_Swap32(Uint32 x) __asm__("rlwimi %0,%2,24,0,7": "=&r"(result):"0"(result), "r"(x)); return result; } -#elif defined(__GNUC__) && (defined(__M68000__) || defined(__M68020__)) && !defined(__mcoldfire__) +#elif defined(__GNUC__) && defined(__aarch64__) +SDL_FORCE_INLINE Uint32 +SDL_Swap32(Uint32 x) +{ + __asm__("rev %w1, %w0": "=r"(x):"r"(x)); + return x; +} +#elif defined(__GNUC__) && (defined(__m68k__) && !defined(__mcoldfire__)) SDL_FORCE_INLINE Uint32 SDL_Swap32(Uint32 x) { @@ -160,6 +191,9 @@ extern _inline Uint32 SDL_Swap32(Uint32); parm [eax] \ modify [eax]; #endif +#elif defined(_MSC_VER) +#pragma intrinsic(_byteswap_ulong) +#define SDL_Swap32(x) _byteswap_ulong(x) #else SDL_FORCE_INLINE Uint32 SDL_Swap32(Uint32 x) @@ -169,7 +203,11 @@ SDL_Swap32(Uint32 x) } #endif -#if defined(__GNUC__) && defined(__i386__) +#if (defined(__clang__) && (__clang_major__ > 2 || (__clang_major__ == 2 && __clang_minor__ >= 6))) || \ + (defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))) +#define SDL_Swap64(x) __builtin_bswap64(x) +#elif defined(__GNUC__) && defined(__i386__) && \ + !(__GNUC__ == 2 && __GNUC_MINOR__ <= 95 /* broken gcc version */) SDL_FORCE_INLINE Uint64 SDL_Swap64(Uint64 x) { @@ -194,6 +232,9 @@ SDL_Swap64(Uint64 x) __asm__("bswapq %0": "=r"(x):"0"(x)); return x; } +#elif defined(_MSC_VER) +#pragma intrinsic(_byteswap_uint64) +#define SDL_Swap64(x) _byteswap_uint64(x) #else SDL_FORCE_INLINE Uint64 SDL_Swap64(Uint64 x) diff --git a/libs/windows/include/SDL_error.h b/libs/windows/include/SDL_error.h index 962d62f6..144a1707 100644 --- a/libs/windows/include/SDL_error.h +++ b/libs/windows/include/SDL_error.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2020 Sam Lantinga + Copyright (C) 1997-2021 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 diff --git a/libs/windows/include/SDL_events.h b/libs/windows/include/SDL_events.h index ae560c08..c775b104 100644 --- a/libs/windows/include/SDL_events.h +++ b/libs/windows/include/SDL_events.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2020 Sam Lantinga + Copyright (C) 1997-2021 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 diff --git a/libs/windows/include/SDL_filesystem.h b/libs/windows/include/SDL_filesystem.h index 68042b60..c3b6602b 100644 --- a/libs/windows/include/SDL_filesystem.h +++ b/libs/windows/include/SDL_filesystem.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2020 Sam Lantinga + Copyright (C) 1997-2021 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 diff --git a/libs/windows/include/SDL_gamecontroller.h b/libs/windows/include/SDL_gamecontroller.h index e42433c9..aa4b4798 100644 --- a/libs/windows/include/SDL_gamecontroller.h +++ b/libs/windows/include/SDL_gamecontroller.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2020 Sam Lantinga + Copyright (C) 1997-2021 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 diff --git a/libs/windows/include/SDL_gesture.h b/libs/windows/include/SDL_gesture.h index 81ed4317..a7382bc6 100644 --- a/libs/windows/include/SDL_gesture.h +++ b/libs/windows/include/SDL_gesture.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2020 Sam Lantinga + Copyright (C) 1997-2021 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 diff --git a/libs/windows/include/SDL_haptic.h b/libs/windows/include/SDL_haptic.h index c27da118..29f45066 100644 --- a/libs/windows/include/SDL_haptic.h +++ b/libs/windows/include/SDL_haptic.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2020 Sam Lantinga + Copyright (C) 1997-2021 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 diff --git a/libs/windows/include/SDL_hints.h b/libs/windows/include/SDL_hints.h index 50a5a089..2d5e04ca 100644 --- a/libs/windows/include/SDL_hints.h +++ b/libs/windows/include/SDL_hints.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2020 Sam Lantinga + Copyright (C) 1997-2021 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 @@ -604,17 +604,6 @@ extern "C" { */ #define SDL_HINT_JOYSTICK_HIDAPI_PS4 "SDL_JOYSTICK_HIDAPI_PS4" -/** - * \brief A variable controlling whether the HIDAPI driver for PS5 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_PS5 "SDL_JOYSTICK_HIDAPI_PS5" - /** * \brief A variable controlling whether extended input reports should be used for PS4 controllers when using the HIDAPI driver. * @@ -630,6 +619,41 @@ extern "C" { */ #define SDL_HINT_JOYSTICK_HIDAPI_PS4_RUMBLE "SDL_JOYSTICK_HIDAPI_PS4_RUMBLE" +/** + * \brief A variable controlling whether the HIDAPI driver for PS5 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_PS5 "SDL_JOYSTICK_HIDAPI_PS5" + +/** + * \brief A variable controlling whether extended input reports should be used for PS5 controllers when using the HIDAPI driver. + * + * This variable can be set to the following values: + * "0" - extended reports are not enabled (the default) + * "1" - extended reports + * + * Extended input reports allow rumble on Bluetooth PS5 controllers, but + * break DirectInput handling for applications that don't use SDL. + * + * Once extended reports are enabled, they can not be disabled without + * power cycling the controller. + */ +#define SDL_HINT_JOYSTICK_HIDAPI_PS5_RUMBLE "SDL_JOYSTICK_HIDAPI_PS5_RUMBLE" + +/** + * \brief A variable controlling whether the player LEDs should be lit to indicate which player is associated with a PS5 controller. + * + * This variable can be set to the following values: + * "0" - player LEDs are not enabled + * "1" - player LEDs are enabled (the default) + */ +#define SDL_HINT_JOYSTICK_HIDAPI_PS5_PLAYER_LED "SDL_JOYSTICK_HIDAPI_PS5_PLAYER_LED" + /** * \brief A variable controlling whether the HIDAPI driver for Steam Controllers should be used. * @@ -1181,6 +1205,59 @@ extern "C" { */ #define SDL_HINT_WINDOWS_DISABLE_THREAD_NAMING "SDL_WINDOWS_DISABLE_THREAD_NAMING" +/** + * \brief Force SDL to use Critical Sections for mutexes on Windows. + * On Windows 7 and newer, Slim Reader/Writer Locks are available. + * They offer better performance, allocate no kernel ressources and + * use less memory. SDL will fall back to Critical Sections on older + * OS versions or if forced to by this hint. + * This also affects Condition Variables. When SRW mutexes are used, + * SDL will use Windows Condition Variables as well. Else, a generic + * SDL_cond implementation will be used that works with all mutexes. + * + * This variable can be set to the following values: + * "0" - Use SRW Locks when available. If not, fall back to Critical Sections. (default) + * "1" - Force the use of Critical Sections in all cases. + * + */ +#define SDL_HINT_WINDOWS_FORCE_MUTEX_CRITICAL_SECTIONS "SDL_WINDOWS_FORCE_MUTEX_CRITICAL_SECTIONS" + +/** + * \brief Force SDL to use Kernel Semaphores on Windows. + * Kernel Semaphores are inter-process and require a context + * switch on every interaction. On Windows 8 and newer, the + * WaitOnAddress API is available. Using that and atomics to + * implement semaphores increases performance. + * SDL will fall back to Kernel Objects on older OS versions + * or if forced to by this hint. + * + * This variable can be set to the following values: + * "0" - Use Atomics and WaitOnAddress API when available. If not, fall back to Kernel Objects. (default) + * "1" - Force the use of Kernel Objects in all cases. + * + */ +#define SDL_HINT_WINDOWS_FORCE_SEMAPHORE_KERNEL "SDL_WINDOWS_FORCE_SEMAPHORE_KERNEL" + +/** + * \brief Use the D3D9Ex API introduced in Windows Vista, instead of normal D3D9. + * Direct3D 9Ex contains changes to state management that can eliminate device + * loss errors during scenarios like Alt+Tab or UAC prompts. D3D9Ex may require + * some changes to your application to cope with the new behavior, so this + * is disabled by default. + * + * This hint must be set before initializing the video subsystem. + * + * For more information on Direct3D 9Ex, see: + * - https://docs.microsoft.com/en-us/windows/win32/direct3darticles/graphics-apis-in-windows-vista#direct3d-9ex + * - https://docs.microsoft.com/en-us/windows/win32/direct3darticles/direct3d-9ex-improvements + * + * This variable can be set to the following values: + * "0" - Use the original Direct3D 9 API (default) + * "1" - Use the Direct3D 9Ex API on Vista and later (and fall back if D3D9Ex is unavailable) + * + */ +#define SDL_HINT_WINDOWS_USE_D3D9EX "SDL_WINDOWS_USE_D3D9EX" + /** * \brief Tell SDL which Dispmanx layer to use on a Raspberry PI * diff --git a/libs/windows/include/SDL_joystick.h b/libs/windows/include/SDL_joystick.h index 0bbeafe0..25920400 100644 --- a/libs/windows/include/SDL_joystick.h +++ b/libs/windows/include/SDL_joystick.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2020 Sam Lantinga + Copyright (C) 1997-2021 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 diff --git a/libs/windows/include/SDL_keyboard.h b/libs/windows/include/SDL_keyboard.h index f6853c64..9eaeb283 100644 --- a/libs/windows/include/SDL_keyboard.h +++ b/libs/windows/include/SDL_keyboard.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2020 Sam Lantinga + Copyright (C) 1997-2021 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 diff --git a/libs/windows/include/SDL_keycode.h b/libs/windows/include/SDL_keycode.h index 6f6b65cb..7c385897 100644 --- a/libs/windows/include/SDL_keycode.h +++ b/libs/windows/include/SDL_keycode.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2020 Sam Lantinga + Copyright (C) 1997-2021 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 diff --git a/libs/windows/include/SDL_loadso.h b/libs/windows/include/SDL_loadso.h index 89578a9f..80379bcc 100644 --- a/libs/windows/include/SDL_loadso.h +++ b/libs/windows/include/SDL_loadso.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2020 Sam Lantinga + Copyright (C) 1997-2021 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 diff --git a/libs/windows/include/SDL_locale.h b/libs/windows/include/SDL_locale.h index 1f4b0c46..8137414f 100644 --- a/libs/windows/include/SDL_locale.h +++ b/libs/windows/include/SDL_locale.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2020 Sam Lantinga + Copyright (C) 1997-2021 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 diff --git a/libs/windows/include/SDL_log.h b/libs/windows/include/SDL_log.h index c1751fd7..f038e20c 100644 --- a/libs/windows/include/SDL_log.h +++ b/libs/windows/include/SDL_log.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2020 Sam Lantinga + Copyright (C) 1997-2021 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 diff --git a/libs/windows/include/SDL_main.h b/libs/windows/include/SDL_main.h index fcb5c17d..2d7c9073 100644 --- a/libs/windows/include/SDL_main.h +++ b/libs/windows/include/SDL_main.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2020 Sam Lantinga + Copyright (C) 1997-2021 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 diff --git a/libs/windows/include/SDL_messagebox.h b/libs/windows/include/SDL_messagebox.h index 03639ce4..8caecc5b 100644 --- a/libs/windows/include/SDL_messagebox.h +++ b/libs/windows/include/SDL_messagebox.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2020 Sam Lantinga + Copyright (C) 1997-2021 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 diff --git a/libs/windows/include/SDL_metal.h b/libs/windows/include/SDL_metal.h index f9673577..283ab8de 100644 --- a/libs/windows/include/SDL_metal.h +++ b/libs/windows/include/SDL_metal.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2020 Sam Lantinga + Copyright (C) 1997-2021 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 diff --git a/libs/windows/include/SDL_misc.h b/libs/windows/include/SDL_misc.h index a04f19ba..5eac321b 100644 --- a/libs/windows/include/SDL_misc.h +++ b/libs/windows/include/SDL_misc.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2020 Sam Lantinga + Copyright (C) 1997-2021 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 diff --git a/libs/windows/include/SDL_mouse.h b/libs/windows/include/SDL_mouse.h index 99b658e9..32303076 100644 --- a/libs/windows/include/SDL_mouse.h +++ b/libs/windows/include/SDL_mouse.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2020 Sam Lantinga + Copyright (C) 1997-2021 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 diff --git a/libs/windows/include/SDL_mutex.h b/libs/windows/include/SDL_mutex.h index 3c5b9557..f49b6477 100644 --- a/libs/windows/include/SDL_mutex.h +++ b/libs/windows/include/SDL_mutex.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2020 Sam Lantinga + Copyright (C) 1997-2021 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 diff --git a/libs/windows/include/SDL_name.h b/libs/windows/include/SDL_name.h index a49c4887..21e1b798 100644 --- a/libs/windows/include/SDL_name.h +++ b/libs/windows/include/SDL_name.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2020 Sam Lantinga + Copyright (C) 1997-2021 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 diff --git a/libs/windows/include/SDL_opengl.h b/libs/windows/include/SDL_opengl.h index 5cd302cd..95b51ae4 100644 --- a/libs/windows/include/SDL_opengl.h +++ b/libs/windows/include/SDL_opengl.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2020 Sam Lantinga + Copyright (C) 1997-2021 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 diff --git a/libs/windows/include/SDL_opengles.h b/libs/windows/include/SDL_opengles.h index 5c2a3e63..7ebf4cc6 100644 --- a/libs/windows/include/SDL_opengles.h +++ b/libs/windows/include/SDL_opengles.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2020 Sam Lantinga + Copyright (C) 1997-2021 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 diff --git a/libs/windows/include/SDL_opengles2.h b/libs/windows/include/SDL_opengles2.h index 00bc180c..ce114ae1 100644 --- a/libs/windows/include/SDL_opengles2.h +++ b/libs/windows/include/SDL_opengles2.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2020 Sam Lantinga + Copyright (C) 1997-2021 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 diff --git a/libs/windows/include/SDL_pixels.h b/libs/windows/include/SDL_pixels.h index aa90cbc2..e1aedf2a 100644 --- a/libs/windows/include/SDL_pixels.h +++ b/libs/windows/include/SDL_pixels.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2020 Sam Lantinga + Copyright (C) 1997-2021 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 diff --git a/libs/windows/include/SDL_platform.h b/libs/windows/include/SDL_platform.h index 71665579..a0789fe4 100644 --- a/libs/windows/include/SDL_platform.h +++ b/libs/windows/include/SDL_platform.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2020 Sam Lantinga + Copyright (C) 1997-2021 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 diff --git a/libs/windows/include/SDL_power.h b/libs/windows/include/SDL_power.h index 39884cc2..cc6160ed 100644 --- a/libs/windows/include/SDL_power.h +++ b/libs/windows/include/SDL_power.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2020 Sam Lantinga + Copyright (C) 1997-2021 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 diff --git a/libs/windows/include/SDL_quit.h b/libs/windows/include/SDL_quit.h index b2bd5da5..28250500 100644 --- a/libs/windows/include/SDL_quit.h +++ b/libs/windows/include/SDL_quit.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2020 Sam Lantinga + Copyright (C) 1997-2021 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 diff --git a/libs/windows/include/SDL_rect.h b/libs/windows/include/SDL_rect.h index 47f0d207..b1897e52 100644 --- a/libs/windows/include/SDL_rect.h +++ b/libs/windows/include/SDL_rect.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2020 Sam Lantinga + Copyright (C) 1997-2021 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 diff --git a/libs/windows/include/SDL_render.h b/libs/windows/include/SDL_render.h index f26fb7e5..980109af 100644 --- a/libs/windows/include/SDL_render.h +++ b/libs/windows/include/SDL_render.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2020 Sam Lantinga + Copyright (C) 1997-2021 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 @@ -450,6 +450,28 @@ extern DECLSPEC int SDLCALL SDL_UpdateYUVTexture(SDL_Texture * texture, const Uint8 *Uplane, int Upitch, const Uint8 *Vplane, int Vpitch); +/** + * \brief Update a rectangle within a planar NV12 or NV21 texture with new pixel data. + * + * \param texture The texture to update + * \param rect A pointer to the rectangle of pixels to update, or NULL to + * update the entire texture. + * \param Yplane The raw pixel data for the Y plane. + * \param Ypitch The number of bytes between rows of pixel data for the Y plane. + * \param UVplane The raw pixel data for the UV plane. + * \param UVpitch The number of bytes between rows of pixel data for the UV plane. + * + * \return 0 on success, or -1 if the texture is not valid. + * + * \note You can use SDL_UpdateTexture() as long as your pixel data is + * a contiguous block of NV12/21 planes in the proper order, but + * this function is available if your pixel data is not contiguous. + */ +extern DECLSPEC int SDLCALL SDL_UpdateNVTexture(SDL_Texture * texture, + const SDL_Rect * rect, + const Uint8 *Yplane, int Ypitch, + const Uint8 *UVplane, int UVpitch); + /** * \brief Lock a portion of the texture for write-only pixel access. * diff --git a/libs/windows/include/SDL_revision.h b/libs/windows/include/SDL_revision.h index e0bcf431..d70fd694 100644 --- a/libs/windows/include/SDL_revision.h +++ b/libs/windows/include/SDL_revision.h @@ -1,2 +1,2 @@ -#define SDL_REVISION "hg-14525:e52d96ea04fc" -#define SDL_REVISION_NUMBER 14525 +#define SDL_REVISION "hg-0:aaaaaaaaaaah" +#define SDL_REVISION_NUMBER 0 diff --git a/libs/windows/include/SDL_rwops.h b/libs/windows/include/SDL_rwops.h index 2e6225fc..923a836c 100644 --- a/libs/windows/include/SDL_rwops.h +++ b/libs/windows/include/SDL_rwops.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2020 Sam Lantinga + Copyright (C) 1997-2021 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 diff --git a/libs/windows/include/SDL_scancode.h b/libs/windows/include/SDL_scancode.h index b19197d2..e54c1e00 100644 --- a/libs/windows/include/SDL_scancode.h +++ b/libs/windows/include/SDL_scancode.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2020 Sam Lantinga + Copyright (C) 1997-2021 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 diff --git a/libs/windows/include/SDL_sensor.h b/libs/windows/include/SDL_sensor.h index e6236341..b89e6876 100644 --- a/libs/windows/include/SDL_sensor.h +++ b/libs/windows/include/SDL_sensor.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2020 Sam Lantinga + Copyright (C) 1997-2021 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 diff --git a/libs/windows/include/SDL_shape.h b/libs/windows/include/SDL_shape.h index cbd9debd..b8c05dbe 100644 --- a/libs/windows/include/SDL_shape.h +++ b/libs/windows/include/SDL_shape.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2020 Sam Lantinga + Copyright (C) 1997-2021 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 diff --git a/libs/windows/include/SDL_stdinc.h b/libs/windows/include/SDL_stdinc.h index 91ccaa45..5ca04e01 100644 --- a/libs/windows/include/SDL_stdinc.h +++ b/libs/windows/include/SDL_stdinc.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2020 Sam Lantinga + Copyright (C) 1997-2021 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 @@ -549,6 +549,10 @@ extern DECLSPEC double SDLCALL SDL_log10(double x); extern DECLSPEC float SDLCALL SDL_log10f(float x); extern DECLSPEC double SDLCALL SDL_pow(double x, double y); extern DECLSPEC float SDLCALL SDL_powf(float x, float y); +extern DECLSPEC double SDLCALL SDL_round(double x); +extern DECLSPEC float SDLCALL SDL_roundf(float x); +extern DECLSPEC long SDLCALL SDL_lround(double x); +extern DECLSPEC long SDLCALL SDL_lroundf(float x); extern DECLSPEC double SDLCALL SDL_scalbn(double x, int n); extern DECLSPEC float SDLCALL SDL_scalbnf(float x, int n); extern DECLSPEC double SDLCALL SDL_sin(double x); diff --git a/libs/windows/include/SDL_surface.h b/libs/windows/include/SDL_surface.h index d3f8c814..d9b11958 100644 --- a/libs/windows/include/SDL_surface.h +++ b/libs/windows/include/SDL_surface.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2020 Sam Lantinga + Copyright (C) 1997-2021 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 @@ -519,6 +519,17 @@ extern DECLSPEC int SDLCALL SDL_SoftStretch(SDL_Surface * src, SDL_Surface * dst, const SDL_Rect * dstrect); +/** + * \brief Perform a bilinear scaling between two surfaces of the + * same pixel format, 32BPP. + * + */ +extern DECLSPEC int SDLCALL SDL_SoftStretchLinear(SDL_Surface * src, + const SDL_Rect * srcrect, + SDL_Surface * dst, + const SDL_Rect * dstrect); + + #define SDL_BlitScaled SDL_UpperBlitScaled /** diff --git a/libs/windows/include/SDL_system.h b/libs/windows/include/SDL_system.h index d296ab1f..06ac41cd 100644 --- a/libs/windows/include/SDL_system.h +++ b/libs/windows/include/SDL_system.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2020 Sam Lantinga + Copyright (C) 1997-2021 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 @@ -59,12 +59,20 @@ extern DECLSPEC int SDLCALL SDL_Direct3D9GetAdapterIndex( int displayIndex ); typedef struct IDirect3DDevice9 IDirect3DDevice9; /** - \brief Returns the D3D device associated with a renderer, or NULL if it's not a D3D renderer. + \brief Returns the D3D9 device associated with a renderer, or NULL if it's not a D3D9 renderer. Once you are done using the device, you should release it to avoid a resource leak. */ extern DECLSPEC IDirect3DDevice9* SDLCALL SDL_RenderGetD3D9Device(SDL_Renderer * renderer); +typedef struct ID3D11Device ID3D11Device; +/** + \brief Returns the D3D11 device associated with a renderer, or NULL if it's not a D3D11 renderer. + + Once you are done using the device, you should release it to avoid a resource leak. + */ +extern DECLSPEC ID3D11Device* SDLCALL SDL_RenderGetD3D11Device(SDL_Renderer * renderer); + /** \brief Returns the DXGI Adapter and Output indices for the specified display index. diff --git a/libs/windows/include/SDL_syswm.h b/libs/windows/include/SDL_syswm.h index f0e9675d..6dae3778 100644 --- a/libs/windows/include/SDL_syswm.h +++ b/libs/windows/include/SDL_syswm.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2020 Sam Lantinga + Copyright (C) 1997-2021 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 diff --git a/libs/windows/include/SDL_test.h b/libs/windows/include/SDL_test.h index 7095427a..66fde839 100644 --- a/libs/windows/include/SDL_test.h +++ b/libs/windows/include/SDL_test.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2020 Sam Lantinga + Copyright (C) 1997-2021 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 diff --git a/libs/windows/include/SDL_test_assert.h b/libs/windows/include/SDL_test_assert.h index 19b90950..55e32a41 100644 --- a/libs/windows/include/SDL_test_assert.h +++ b/libs/windows/include/SDL_test_assert.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2020 Sam Lantinga + Copyright (C) 1997-2021 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 diff --git a/libs/windows/include/SDL_test_common.h b/libs/windows/include/SDL_test_common.h index 3ad20305..6e4344fd 100644 --- a/libs/windows/include/SDL_test_common.h +++ b/libs/windows/include/SDL_test_common.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2020 Sam Lantinga + Copyright (C) 1997-2021 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 diff --git a/libs/windows/include/SDL_test_compare.h b/libs/windows/include/SDL_test_compare.h index 38b22bb3..ee42c9d3 100644 --- a/libs/windows/include/SDL_test_compare.h +++ b/libs/windows/include/SDL_test_compare.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2020 Sam Lantinga + Copyright (C) 1997-2021 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 diff --git a/libs/windows/include/SDL_test_crc32.h b/libs/windows/include/SDL_test_crc32.h index 611066ab..f41e24e2 100644 --- a/libs/windows/include/SDL_test_crc32.h +++ b/libs/windows/include/SDL_test_crc32.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2020 Sam Lantinga + Copyright (C) 1997-2021 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 diff --git a/libs/windows/include/SDL_test_font.h b/libs/windows/include/SDL_test_font.h index dc4ce6dd..f4912890 100644 --- a/libs/windows/include/SDL_test_font.h +++ b/libs/windows/include/SDL_test_font.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2020 Sam Lantinga + Copyright (C) 1997-2021 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 diff --git a/libs/windows/include/SDL_test_fuzzer.h b/libs/windows/include/SDL_test_fuzzer.h index cb5a17a1..aa0b9a6f 100644 --- a/libs/windows/include/SDL_test_fuzzer.h +++ b/libs/windows/include/SDL_test_fuzzer.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2020 Sam Lantinga + Copyright (C) 1997-2021 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 diff --git a/libs/windows/include/SDL_test_harness.h b/libs/windows/include/SDL_test_harness.h index 97d98128..84212a68 100644 --- a/libs/windows/include/SDL_test_harness.h +++ b/libs/windows/include/SDL_test_harness.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2020 Sam Lantinga + Copyright (C) 1997-2021 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 diff --git a/libs/windows/include/SDL_test_images.h b/libs/windows/include/SDL_test_images.h index 1cc3ee26..a379cf1c 100644 --- a/libs/windows/include/SDL_test_images.h +++ b/libs/windows/include/SDL_test_images.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2020 Sam Lantinga + Copyright (C) 1997-2021 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 diff --git a/libs/windows/include/SDL_test_log.h b/libs/windows/include/SDL_test_log.h index 6066f904..0caddca8 100644 --- a/libs/windows/include/SDL_test_log.h +++ b/libs/windows/include/SDL_test_log.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2020 Sam Lantinga + Copyright (C) 1997-2021 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 diff --git a/libs/windows/include/SDL_test_md5.h b/libs/windows/include/SDL_test_md5.h index b1c51d92..ca29757c 100644 --- a/libs/windows/include/SDL_test_md5.h +++ b/libs/windows/include/SDL_test_md5.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2020 Sam Lantinga + Copyright (C) 1997-2021 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 diff --git a/libs/windows/include/SDL_test_memory.h b/libs/windows/include/SDL_test_memory.h index df69f93e..4a19c1d8 100644 --- a/libs/windows/include/SDL_test_memory.h +++ b/libs/windows/include/SDL_test_memory.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2020 Sam Lantinga + Copyright (C) 1997-2021 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 diff --git a/libs/windows/include/SDL_test_random.h b/libs/windows/include/SDL_test_random.h index 9404e9dc..2dfbfef5 100644 --- a/libs/windows/include/SDL_test_random.h +++ b/libs/windows/include/SDL_test_random.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2020 Sam Lantinga + Copyright (C) 1997-2021 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 diff --git a/libs/windows/include/SDL_thread.h b/libs/windows/include/SDL_thread.h index 4016358a..4b71083f 100644 --- a/libs/windows/include/SDL_thread.h +++ b/libs/windows/include/SDL_thread.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2020 Sam Lantinga + Copyright (C) 1997-2021 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 diff --git a/libs/windows/include/SDL_timer.h b/libs/windows/include/SDL_timer.h index aada7178..66ab2d9e 100644 --- a/libs/windows/include/SDL_timer.h +++ b/libs/windows/include/SDL_timer.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2020 Sam Lantinga + Copyright (C) 1997-2021 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 diff --git a/libs/windows/include/SDL_touch.h b/libs/windows/include/SDL_touch.h index fa5a37ce..323cd225 100644 --- a/libs/windows/include/SDL_touch.h +++ b/libs/windows/include/SDL_touch.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2020 Sam Lantinga + Copyright (C) 1997-2021 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 diff --git a/libs/windows/include/SDL_types.h b/libs/windows/include/SDL_types.h index b6bb5711..4267f366 100644 --- a/libs/windows/include/SDL_types.h +++ b/libs/windows/include/SDL_types.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2020 Sam Lantinga + Copyright (C) 1997-2021 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 diff --git a/libs/windows/include/SDL_version.h b/libs/windows/include/SDL_version.h index 23b65f43..a2b63e12 100644 --- a/libs/windows/include/SDL_version.h +++ b/libs/windows/include/SDL_version.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2020 Sam Lantinga + Copyright (C) 1997-2021 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 @@ -59,7 +59,7 @@ typedef struct SDL_version */ #define SDL_MAJOR_VERSION 2 #define SDL_MINOR_VERSION 0 -#define SDL_PATCHLEVEL 14 +#define SDL_PATCHLEVEL 15 /** * \brief Macro to determine SDL version program was compiled against. diff --git a/libs/windows/include/SDL_video.h b/libs/windows/include/SDL_video.h index 54cbe0f0..2f684bea 100644 --- a/libs/windows/include/SDL_video.h +++ b/libs/windows/include/SDL_video.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2020 Sam Lantinga + Copyright (C) 1997-2021 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 diff --git a/libs/windows/include/begin_code.h b/libs/windows/include/begin_code.h index 1ca40ccd..37bf9750 100644 --- a/libs/windows/include/begin_code.h +++ b/libs/windows/include/begin_code.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2020 Sam Lantinga + Copyright (C) 1997-2021 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 diff --git a/libs/windows/include/close_code.h b/libs/windows/include/close_code.h index 6aa411b0..c65a2162 100644 --- a/libs/windows/include/close_code.h +++ b/libs/windows/include/close_code.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2020 Sam Lantinga + Copyright (C) 1997-2021 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 diff --git a/libs/windows/lib/arm64/SDL2.dll b/libs/windows/lib/arm64/SDL2.dll index 2190ac7c..1964fe33 100644 Binary files a/libs/windows/lib/arm64/SDL2.dll and b/libs/windows/lib/arm64/SDL2.dll differ diff --git a/libs/windows/lib/arm64/SDL2.lib b/libs/windows/lib/arm64/SDL2.lib index 87abe978..723071f8 100644 Binary files a/libs/windows/lib/arm64/SDL2.lib and b/libs/windows/lib/arm64/SDL2.lib differ diff --git a/libs/windows/lib/arm64/SDL2.pdb b/libs/windows/lib/arm64/SDL2.pdb index ad15e3b6..e295e5a9 100644 Binary files a/libs/windows/lib/arm64/SDL2.pdb and b/libs/windows/lib/arm64/SDL2.pdb differ diff --git a/libs/windows/lib/x64/SDL2.dll b/libs/windows/lib/x64/SDL2.dll index 1000f045..1fa5a555 100644 Binary files a/libs/windows/lib/x64/SDL2.dll and b/libs/windows/lib/x64/SDL2.dll differ diff --git a/libs/windows/lib/x64/SDL2.lib b/libs/windows/lib/x64/SDL2.lib index 5e3b5e75..29e0df24 100644 Binary files a/libs/windows/lib/x64/SDL2.lib and b/libs/windows/lib/x64/SDL2.lib differ diff --git a/libs/windows/lib/x64/SDL2.pdb b/libs/windows/lib/x64/SDL2.pdb index 151b30f4..cadf11e1 100644 Binary files a/libs/windows/lib/x64/SDL2.pdb and b/libs/windows/lib/x64/SDL2.pdb differ diff --git a/libs/windows/lib/x86/SDL2.dll b/libs/windows/lib/x86/SDL2.dll index d78e7400..291b2f29 100644 Binary files a/libs/windows/lib/x86/SDL2.dll and b/libs/windows/lib/x86/SDL2.dll differ diff --git a/libs/windows/lib/x86/SDL2.lib b/libs/windows/lib/x86/SDL2.lib index cae3b454..dd18efca 100644 Binary files a/libs/windows/lib/x86/SDL2.lib and b/libs/windows/lib/x86/SDL2.lib differ diff --git a/libs/windows/lib/x86/SDL2.pdb b/libs/windows/lib/x86/SDL2.pdb index 2b8c0a34..f921de18 100644 Binary files a/libs/windows/lib/x86/SDL2.pdb and b/libs/windows/lib/x86/SDL2.pdb differ