diff --git a/code/SDL2/include/SDL.h b/code/SDL2/include/SDL.h index 222a8bd9..e2656caf 100644 --- a/code/SDL2/include/SDL.h +++ b/code/SDL2/include/SDL.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2021 Sam Lantinga + Copyright (C) 1997-2020 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 @@ -93,120 +93,37 @@ extern "C" { /* @} */ /** - * Initialize the SDL library. - * - * SDL_Init() simply forwards to calling SDL_InitSubSystem(). Therefore, the - * two may be used interchangeably. Though for readability of your code - * SDL_InitSubSystem() might be preferred. - * - * The file I/O (for example: SDL_RWFromFile) and threading (SDL_CreateThread) - * subsystems are initialized by default. Message boxes - * (SDL_ShowSimpleMessageBox) also attempt to work without initializing the - * video subsystem, in hopes of being useful in showing an error dialog when - * SDL_Init fails. You must specifically initialize other subsystems if you - * use them in your application. - * - * Logging (such as SDL_Log) works without initialization, too. - * - * `flags` may be any of the following OR'd together: - * - * - `SDL_INIT_TIMER`: timer subsystem - * - `SDL_INIT_AUDIO`: audio subsystem - * - `SDL_INIT_VIDEO`: video subsystem; automatically initializes the events - * subsystem - * - `SDL_INIT_JOYSTICK`: joystick subsystem; automatically initializes the - * events subsystem - * - `SDL_INIT_HAPTIC`: haptic (force feedback) subsystem - * - `SDL_INIT_GAMECONTROLLER`: controller subsystem; automatically - * initializes the joystick subsystem - * - `SDL_INIT_EVENTS`: events subsystem - * - `SDL_INIT_EVERYTHING`: all of the above subsystems - * - `SDL_INIT_NOPARACHUTE`: compatibility; this flag is ignored - * - * Subsystem initialization is ref-counted, you must call SDL_QuitSubSystem() - * for each SDL_InitSubSystem() to correctly shutdown a subsystem manually (or - * call SDL_Quit() to force shutdown). If a subsystem is already loaded then - * this call will increase the ref-count and return. - * - * \param flags subsystem initialization flags - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \sa SDL_InitSubSystem - * \sa SDL_Quit - * \sa SDL_SetMainReady - * \sa SDL_WasInit + * This function initializes the subsystems specified by \c flags */ extern DECLSPEC int SDLCALL SDL_Init(Uint32 flags); /** - * Compatibility function to initialize the SDL library. + * This function initializes specific SDL subsystems * - * In SDL2, this function and SDL_Init() are interchangeable. - * - * \param flags any of the flags used by SDL_Init(); see SDL_Init for details. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \sa SDL_Init - * \sa SDL_Quit - * \sa SDL_QuitSubSystem + * Subsystem initialization is ref-counted, you must call + * SDL_QuitSubSystem() for each SDL_InitSubSystem() to correctly + * shutdown a subsystem manually (or call SDL_Quit() to force shutdown). + * If a subsystem is already loaded then this call will + * increase the ref-count and return. */ extern DECLSPEC int SDLCALL SDL_InitSubSystem(Uint32 flags); /** - * Shut down specific SDL subsystems. - * - * If you start a subsystem using a call to that subsystem's init function - * (for example SDL_VideoInit()) instead of SDL_Init() or SDL_InitSubSystem(), - * SDL_QuitSubSystem() and SDL_WasInit() will not work. You will need to use - * that subsystem's quit function (SDL_VideoQuit()) directly instead. But - * generally, you should not be using those functions directly anyhow; use - * SDL_Init() instead. - * - * You still need to call SDL_Quit() even if you close all open subsystems - * with SDL_QuitSubSystem(). - * - * \param flags any of the flags used by SDL_Init(); see SDL_Init for details. - * - * \sa SDL_InitSubSystem - * \sa SDL_Quit + * This function cleans up specific SDL subsystems */ extern DECLSPEC void SDLCALL SDL_QuitSubSystem(Uint32 flags); /** - * Get a mask of the specified subsystems which are currently initialized. + * This function returns a mask of the specified subsystems which have + * previously been initialized. * - * \param flags any of the flags used by SDL_Init(); see SDL_Init for details. - * \returns a mask of all initialized subsystems if `flags` is 0, otherwise it - * returns the initialization status of the specified subsystems. - * - * The return value does not include SDL_INIT_NOPARACHUTE. - * - * \sa SDL_Init - * \sa SDL_InitSubSystem + * If \c flags is 0, it returns a mask of all initialized subsystems. */ extern DECLSPEC Uint32 SDLCALL SDL_WasInit(Uint32 flags); /** - * Clean up all initialized subsystems. - * - * You should call this function even if you have already shutdown each - * initialized subsystem with SDL_QuitSubSystem(). It is safe to call this - * function even in the case of errors in initialization. - * - * If you start a subsystem using a call to that subsystem's init function - * (for example SDL_VideoInit()) instead of SDL_Init() or SDL_InitSubSystem(), - * then you must use that subsystem's quit function (SDL_VideoQuit()) to shut - * it down before calling SDL_Quit(). But generally, you should not be using - * those functions directly anyhow; use SDL_Init() instead. - * - * You can use this function with atexit() to ensure that it is run when your - * application is shutdown, but it is not wise to do this from a library or - * other dynamically loaded code. - * - * \sa SDL_Init - * \sa SDL_QuitSubSystem + * This function cleans up all initialized subsystems. You should + * call it upon all exit conditions. */ extern DECLSPEC void SDLCALL SDL_Quit(void); diff --git a/code/SDL2/include/SDL_atomic.h b/code/SDL2/include/SDL_atomic.h index 5e1eae77..e99f1bcc 100644 --- a/code/SDL2/include/SDL_atomic.h +++ b/code/SDL2/include/SDL_atomic.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2021 Sam Lantinga + Copyright (C) 1997-2020 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 @@ -89,47 +89,25 @@ extern "C" { typedef int SDL_SpinLock; /** - * Try to lock a spin lock by setting it to a non-zero value. + * \brief Try to lock a spin lock by setting it to a non-zero value. * - * ***Please note that spinlocks are dangerous if you don't know what you're - * doing. Please be careful using any sort of spinlock!*** + * \param lock Points to the lock. * - * \param lock a pointer to a lock variable - * \returns SDL_TRUE if the lock succeeded, SDL_FALSE if the lock is already - * held. - * - * \sa SDL_AtomicLock - * \sa SDL_AtomicUnlock + * \return SDL_TRUE if the lock succeeded, SDL_FALSE if the lock is already held. */ extern DECLSPEC SDL_bool SDLCALL SDL_AtomicTryLock(SDL_SpinLock *lock); /** - * Lock a spin lock by setting it to a non-zero value. + * \brief Lock a spin lock by setting it to a non-zero value. * - * ***Please note that spinlocks are dangerous if you don't know what you're - * doing. Please be careful using any sort of spinlock!*** - * - * \param lock a pointer to a lock variable - * - * \sa SDL_AtomicTryLock - * \sa SDL_AtomicUnlock + * \param lock Points to the lock. */ extern DECLSPEC void SDLCALL SDL_AtomicLock(SDL_SpinLock *lock); /** - * Unlock a spin lock by setting it to 0. + * \brief Unlock a spin lock by setting it to 0. Always returns immediately * - * Always returns immediately. - * - * ***Please note that spinlocks are dangerous if you don't know what you're - * doing. Please be careful using any sort of spinlock!*** - * - * \param lock a pointer to a lock variable - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_AtomicLock - * \sa SDL_AtomicTryLock + * \param lock Points to the lock. */ extern DECLSPEC void SDLCALL SDL_AtomicUnlock(SDL_SpinLock *lock); @@ -159,17 +137,17 @@ extern _inline void SDL_CompilerBarrier (void); * Memory barriers are designed to prevent reads and writes from being * reordered by the compiler and being seen out of order on multi-core CPUs. * - * A typical pattern would be for thread A to write some data and a flag, and - * for thread B to read the flag and get the data. In this case you would - * insert a release barrier between writing the data and the flag, + * A typical pattern would be for thread A to write some data and a flag, + * and for thread B to read the flag and get the data. In this case you + * would insert a release barrier between writing the data and the flag, * guaranteeing that the data write completes no later than the flag is - * written, and you would insert an acquire barrier between reading the flag - * and reading the data, to ensure that all the reads associated with the flag - * have completed. + * written, and you would insert an acquire barrier between reading the + * flag and reading the data, to ensure that all the reads associated + * with the flag have completed. * - * In this pattern you should always see a release barrier paired with an - * acquire barrier and you should gate the data reads/writes with a single - * flag variable. + * In this pattern you should always see a release barrier paired with + * an acquire barrier and you should gate the data reads/writes with a + * single flag variable. * * For more information on these semantics, take a look at the blog post: * http://preshing.com/20120913/acquire-and-release-semantics @@ -238,67 +216,32 @@ typedef void (*SDL_KernelMemoryBarrierFunc)(); typedef struct { int value; } SDL_atomic_t; /** - * Set an atomic variable to a new value if it is currently an old value. + * \brief Set an atomic variable to a new value if it is currently an old value. * - * ***Note: If you don't know what this function is for, you shouldn't use - * it!*** + * \return SDL_TRUE if the atomic variable was set, SDL_FALSE otherwise. * - * \param a a pointer to an SDL_atomic_t variable to be modified - * \param oldval the old value - * \param newval the new value - * \returns SDL_TRUE if the atomic variable was set, SDL_FALSE otherwise. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_AtomicCASPtr - * \sa SDL_AtomicGet - * \sa SDL_AtomicSet - */ + * \note If you don't know what this function is for, you shouldn't use it! +*/ extern DECLSPEC SDL_bool SDLCALL SDL_AtomicCAS(SDL_atomic_t *a, int oldval, int newval); /** - * Set an atomic variable to a value. + * \brief Set an atomic variable to a value. * - * This function also acts as a full memory barrier. - * - * ***Note: If you don't know what this function is for, you shouldn't use - * it!*** - * - * \param a a pointer to an SDL_atomic_t variable to be modified - * \param v the desired value - * \returns the previous value of the atomic variable. - * - * \sa SDL_AtomicGet + * \return The previous value of the atomic variable. */ extern DECLSPEC int SDLCALL SDL_AtomicSet(SDL_atomic_t *a, int v); /** - * Get the value of an atomic variable. - * - * ***Note: If you don't know what this function is for, you shouldn't use - * it!*** - * - * \param a a pointer to an SDL_atomic_t variable - * \returns the current value of an atomic variable. - * - * \sa SDL_AtomicSet + * \brief Get the value of an atomic variable */ extern DECLSPEC int SDLCALL SDL_AtomicGet(SDL_atomic_t *a); /** - * Add to an atomic variable. + * \brief Add to an atomic variable. * - * This function also acts as a full memory barrier. + * \return The previous value of the atomic variable. * - * ***Note: If you don't know what this function is for, you shouldn't use - * it!*** - * - * \param a a pointer to an SDL_atomic_t variable to be modified - * \param v the desired value to add - * \returns the previous value of the atomic variable. - * - * \sa SDL_AtomicDecRef - * \sa SDL_AtomicIncRef + * \note This same style can be used for any number operation */ extern DECLSPEC int SDLCALL SDL_AtomicAdd(SDL_atomic_t *a, int v); @@ -320,50 +263,23 @@ extern DECLSPEC int SDLCALL SDL_AtomicAdd(SDL_atomic_t *a, int v); #endif /** - * Set a pointer to a new value if it is currently an old value. + * \brief Set a pointer to a new value if it is currently an old value. * - * ***Note: If you don't know what this function is for, you shouldn't use - * it!*** + * \return SDL_TRUE if the pointer was set, SDL_FALSE otherwise. * - * \param a a pointer to a pointer - * \param oldval the old pointer value - * \param newval the new pointer value - * \returns SDL_TRUE if the pointer was set, SDL_FALSE otherwise. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_AtomicCAS - * \sa SDL_AtomicGetPtr - * \sa SDL_AtomicSetPtr - */ + * \note If you don't know what this function is for, you shouldn't use it! +*/ extern DECLSPEC SDL_bool SDLCALL SDL_AtomicCASPtr(void **a, void *oldval, void *newval); /** - * Set a pointer to a value atomically. + * \brief Set a pointer to a value atomically. * - * ***Note: If you don't know what this function is for, you shouldn't use - * it!*** - * - * \param a a pointer to a pointer - * \param v the desired pointer value - * \returns the previous value of the pointer. - * - * \sa SDL_AtomicCASPtr - * \sa SDL_AtomicGetPtr + * \return The previous value of the pointer. */ extern DECLSPEC void* SDLCALL SDL_AtomicSetPtr(void **a, void* v); /** - * Get the value of a pointer atomically. - * - * ***Note: If you don't know what this function is for, you shouldn't use - * it!*** - * - * \param a a pointer to a pointer - * \returns the current value of a pointer. - * - * \sa SDL_AtomicCASPtr - * \sa SDL_AtomicSetPtr + * \brief Get the value of a pointer atomically. */ extern DECLSPEC void* SDLCALL SDL_AtomicGetPtr(void **a); diff --git a/code/SDL2/include/SDL_blendmode.h b/code/SDL2/include/SDL_blendmode.h index 374f225a..5e21a79e 100644 --- a/code/SDL2/include/SDL_blendmode.h +++ b/code/SDL2/include/SDL_blendmode.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2021 Sam Lantinga + Copyright (C) 1997-2020 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 @@ -91,96 +91,19 @@ typedef enum } SDL_BlendFactor; /** - * Compose a custom blend mode for renderers. + * \brief Create a custom blend mode, which may or may not be supported by a given renderer * - * The functions SDL_SetRenderDrawBlendMode and SDL_SetTextureBlendMode accept - * the SDL_BlendMode returned by this function if the renderer supports it. + * \param srcColorFactor source color factor + * \param dstColorFactor destination color factor + * \param colorOperation color operation + * \param srcAlphaFactor source alpha factor + * \param dstAlphaFactor destination alpha factor + * \param alphaOperation alpha operation * - * A blend mode controls how the pixels from a drawing operation (source) get - * combined with the pixels from the render target (destination). First, the - * components of the source and destination pixels get multiplied with their - * blend factors. Then, the blend operation takes the two products and - * calculates the result that will get stored in the render target. - * - * Expressed in pseudocode, it would look like this: - * - * ```c - * dstRGB = colorOperation(srcRGB * srcColorFactor, dstRGB * dstColorFactor); - * dstA = alphaOperation(srcA * srcAlphaFactor, dstA * dstAlphaFactor); - * ``` - * - * Where the functions `colorOperation(src, dst)` and `alphaOperation(src, - * dst)` can return one of the following: - * - * - `src + dst` - * - `src - dst` - * - `dst - src` - * - `min(src, dst)` - * - `max(src, dst)` - * - * The red, green, and blue components are always multiplied with the first, - * second, and third components of the SDL_BlendFactor, respectively. The - * fourth component is not used. - * - * The alpha component is always multiplied with the fourth component of the - * SDL_BlendFactor. The other components are not used in the alpha - * calculation. - * - * Support for these blend modes varies for each renderer. To check if a - * specific SDL_BlendMode is supported, create a renderer and pass it to - * either SDL_SetRenderDrawBlendMode or SDL_SetTextureBlendMode. They will - * return with an error if the blend mode is not supported. - * - * This list describes the support of custom blend modes for each renderer in - * SDL 2.0.6. All renderers support the four blend modes listed in the - * SDL_BlendMode enumeration. - * - * - **direct3d**: Supports `SDL_BLENDOPERATION_ADD` with all factors. - * - **direct3d11**: Supports all operations with all factors. However, some - * factors produce unexpected results with `SDL_BLENDOPERATION_MINIMUM` and - * `SDL_BLENDOPERATION_MAXIMUM`. - * - **opengl**: Supports the `SDL_BLENDOPERATION_ADD` operation with all - * factors. OpenGL versions 1.1, 1.2, and 1.3 do not work correctly with SDL - * 2.0.6. - * - **opengles**: Supports the `SDL_BLENDOPERATION_ADD` operation with all - * factors. Color and alpha factors need to be the same. OpenGL ES 1 - * implementation specific: May also support `SDL_BLENDOPERATION_SUBTRACT` - * and `SDL_BLENDOPERATION_REV_SUBTRACT`. May support color and alpha - * operations being different from each other. May support color and alpha - * factors being different from each other. - * - **opengles2**: Supports the `SDL_BLENDOPERATION_ADD`, - * `SDL_BLENDOPERATION_SUBTRACT`, `SDL_BLENDOPERATION_REV_SUBTRACT` - * operations with all factors. - * - **psp**: No custom blend mode support. - * - **software**: No custom blend mode support. - * - * Some renderers do not provide an alpha component for the default render - * target. The `SDL_BLENDFACTOR_DST_ALPHA` and - * `SDL_BLENDFACTOR_ONE_MINUS_DST_ALPHA` factors do not have an effect in this - * case. - * - * \param srcColorFactor the SDL_BlendFactor applied to the red, green, and - * blue components of the source pixels - * \param dstColorFactor the SDL_BlendFactor applied to the red, green, and - * blue components of the destination pixels - * \param colorOperation the SDL_BlendOperation used to combine the red, - * green, and blue components of the source and - * destination pixels - * \param srcAlphaFactor the SDL_BlendFactor applied to the alpha component of - * the source pixels - * \param dstAlphaFactor the SDL_BlendFactor applied to the alpha component of - * the destination pixels - * \param alphaOperation the SDL_BlendOperation used to combine the alpha - * component of the source and destination pixels - * \returns an SDL_BlendMode that represents the chosen factors and - * operations. - * - * \since This function is available in SDL 2.0.6. - * - * \sa SDL_SetRenderDrawBlendMode - * \sa SDL_GetRenderDrawBlendMode - * \sa SDL_SetTextureBlendMode - * \sa SDL_GetTextureBlendMode + * The result of the blend mode operation will be: + * dstRGB = dstRGB * dstColorFactor colorOperation srcRGB * srcColorFactor + * and + * dstA = dstA * dstAlphaFactor alphaOperation srcA * srcAlphaFactor */ extern DECLSPEC SDL_BlendMode SDLCALL SDL_ComposeCustomBlendMode(SDL_BlendFactor srcColorFactor, SDL_BlendFactor dstColorFactor, diff --git a/code/SDL2/include/SDL_clipboard.h b/code/SDL2/include/SDL_clipboard.h index 79e4dcc3..f28751eb 100644 --- a/code/SDL2/include/SDL_clipboard.h +++ b/code/SDL2/include/SDL_clipboard.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2021 Sam Lantinga + Copyright (C) 1997-2018 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 @@ -39,41 +39,23 @@ extern "C" { /* Function prototypes */ /** - * Put UTF-8 text into the clipboard. + * \brief Put UTF-8 text into the clipboard * - * \param text the text to store in the clipboard - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \sa SDL_GetClipboardText - * \sa SDL_HasClipboardText + * \sa SDL_GetClipboardText() */ extern DECLSPEC int SDLCALL SDL_SetClipboardText(const char *text); /** - * Get UTF-8 text from the clipboard, which must be freed with SDL_free(). + * \brief Get UTF-8 text from the clipboard, which must be freed with SDL_free() * - * This functions returns NULL if there was not enough memory left for a copy - * of the clipboard's content. - * - * \returns the clipboard text on success or NULL on failure; call - * SDL_GetError() for more information. Caller must call SDL_free() - * on the returned pointer when done with it. - * - * \sa SDL_HasClipboardText - * \sa SDL_SetClipboardText + * \sa SDL_SetClipboardText() */ extern DECLSPEC char * SDLCALL SDL_GetClipboardText(void); /** - * Query whether the clipboard exists and contains a non-empty text string. + * \brief Returns a flag indicating whether the clipboard exists and contains a text string that is non-empty * - * \returns SDL_TRUE if the clipboard has text, or SDL_FALSE if it does not. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GetClipboardText - * \sa SDL_SetClipboardText + * \sa SDL_GetClipboardText() */ extern DECLSPEC SDL_bool SDLCALL SDL_HasClipboardText(void); diff --git a/code/SDL2/include/SDL_config.h b/code/SDL2/include/SDL_config.h index 33436c41..3937dbc3 100644 --- a/code/SDL2/include/SDL_config.h +++ b/code/SDL2/include/SDL_config.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2021 Sam Lantinga + Copyright (C) 1997-2020 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 @@ -19,281 +19,37 @@ 3. This notice may not be removed or altered from any source distribution. */ -#ifndef SDL_config_windows_h_ -#define SDL_config_windows_h_ +#ifndef SDL_config_h_ #define SDL_config_h_ #include "SDL_platform.h" -/* This is a set of defines to configure the SDL features */ +/** + * \file SDL_config.h + */ -#if !defined(_STDINT_H_) && (!defined(HAVE_STDINT_H) || !_HAVE_STDINT_H) -#if defined(__GNUC__) || defined(__DMC__) || defined(__WATCOMC__) || defined(__clang__) -#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; +/* 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 -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 */ +/* This is a minimal configuration just to get SDL running on new platforms. */ +#include "SDL_config_minimal.h" +#endif /* platform config */ -#ifdef _WIN64 -# define SIZEOF_VOIDP 8 -#else -# define SIZEOF_VOIDP 4 +#ifdef USING_GENERATED_CONFIG_H +#error Wrong SDL_config.h, check your include path? #endif -#define HAVE_DDRAW_H 1 -#define HAVE_DINPUT_H 1 -#define HAVE_DSOUND_H 1 -#define HAVE_DXGI_H 1 -#define HAVE_XINPUT_H 1 -#define HAVE_MMDEVICEAPI_H 1 -#define HAVE_AUDIOCLIENT_H 1 -#define HAVE_SENSORSAPI_H 1 -#if (defined(_M_IX86) || defined(_M_X64) || defined(_M_AMD64)) && (defined(_MSC_VER) && _MSC_VER >= 1600) -#define HAVE_IMMINTRIN_H 1 -#elif defined(__has_include) && (defined(__i386__) || defined(__x86_64)) -# if __has_include() -# define HAVE_IMMINTRIN_H 1 -# endif -#endif - -/* This is disabled by default to avoid C runtime dependencies and manifest requirements */ -#ifdef HAVE_LIBC -/* Useful headers */ -#define STDC_HEADERS 1 -#define HAVE_CTYPE_H 1 -#define HAVE_FLOAT_H 1 -#define HAVE_LIMITS_H 1 -#define HAVE_MATH_H 1 -#define HAVE_SIGNAL_H 1 -#define HAVE_STDIO_H 1 -#define HAVE_STRING_H 1 - -/* C library functions */ -#define HAVE_MALLOC 1 -#define HAVE_CALLOC 1 -#define HAVE_REALLOC 1 -#define HAVE_FREE 1 -#define HAVE_ALLOCA 1 -#define HAVE_QSORT 1 -#define HAVE_ABS 1 -#define HAVE_MEMSET 1 -#define HAVE_MEMCPY 1 -#define HAVE_MEMMOVE 1 -#define HAVE_MEMCMP 1 -#define HAVE_STRLEN 1 -#define HAVE__STRREV 1 -/* These functions have security warnings, so we won't use them */ -/* #undef HAVE__STRUPR */ -/* #undef HAVE__STRLWR */ -#define HAVE_STRCHR 1 -#define HAVE_STRRCHR 1 -#define HAVE_STRSTR 1 -/* #undef HAVE_STRTOK_R */ -/* These functions have security warnings, so we won't use them */ -/* #undef HAVE__LTOA */ -/* #undef HAVE__ULTOA */ -#define HAVE_STRTOL 1 -#define HAVE_STRTOUL 1 -#define HAVE_STRTOD 1 -#define HAVE_ATOI 1 -#define HAVE_ATOF 1 -#define HAVE_STRCMP 1 -#define HAVE_STRNCMP 1 -#define HAVE__STRICMP 1 -#define HAVE__STRNICMP 1 -#define HAVE__WCSICMP 1 -#define HAVE__WCSNICMP 1 -#define HAVE__WCSDUP 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_CEILF 1 -#define HAVE__COPYSIGN 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_POW 1 -#define HAVE_POWF 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 -#if defined(_MSC_VER) -/* 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 -#define HAVE_TRUNCF 1 -#endif -/* This function is available with at least the VC++ 2008 C runtime library */ -#if _MSC_VER >= 1400 -#define HAVE__FSEEKI64 1 -#endif -#endif -#if !defined(_MSC_VER) || defined(_USE_MATH_DEFINES) -#define HAVE_M_PI 1 -#endif -#else -#define HAVE_STDARG_H 1 -#define HAVE_STDDEF_H 1 -#endif - -/* Check to see if we have Windows 10 build environment */ -#if defined(_MSC_VER) && (_MSC_VER >= 1911) /* Visual Studio 15.3 */ -#include -#if _WIN32_WINNT >= 0x0601 /* Windows 7 */ -#define SDL_WINDOWS7_SDK -#endif -#if _WIN32_WINNT >= 0x0602 /* Windows 8 */ -#define SDL_WINDOWS8_SDK -#endif -#if _WIN32_WINNT >= 0x0A00 /* Windows 10 */ -#define SDL_WINDOWS10_SDK -#endif -#endif /* _MSC_VER >= 1911 */ - -/* Enable various audio drivers */ -#define SDL_AUDIO_DRIVER_WASAPI 1 -#define SDL_AUDIO_DRIVER_DSOUND 1 -#define SDL_AUDIO_DRIVER_WINMM 1 -#define SDL_AUDIO_DRIVER_DISK 1 -#define SDL_AUDIO_DRIVER_DUMMY 1 - -/* 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 - -/* Enable the sensor driver */ -#define SDL_SENSOR_WINDOWS 1 - -/* Enable various shared object loading systems */ -#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 */ -#define SDL_TIMER_WINDOWS 1 - -/* Enable various video drivers */ -#define SDL_VIDEO_DRIVER_DUMMY 1 -#define SDL_VIDEO_DRIVER_WINDOWS 1 - -#ifndef SDL_VIDEO_RENDER_D3D -#define SDL_VIDEO_RENDER_D3D 1 -#endif -#ifdef SDL_WINDOWS7_SDK -#define SDL_VIDEO_RENDER_D3D11 1 -#endif - -/* Enable OpenGL support */ -#ifndef SDL_VIDEO_OPENGL -#define SDL_VIDEO_OPENGL 1 -#endif -#ifndef SDL_VIDEO_OPENGL_WGL -#define SDL_VIDEO_OPENGL_WGL 1 -#endif -#ifndef SDL_VIDEO_RENDER_OGL -#define SDL_VIDEO_RENDER_OGL 1 -#endif -#ifndef SDL_VIDEO_RENDER_OGL_ES2 -#define SDL_VIDEO_RENDER_OGL_ES2 1 -#endif -#ifndef SDL_VIDEO_OPENGL_ES2 -#define SDL_VIDEO_OPENGL_ES2 1 -#endif -#ifndef SDL_VIDEO_OPENGL_EGL -#define SDL_VIDEO_OPENGL_EGL 1 -#endif - -/* Enable Vulkan support */ -#define SDL_VIDEO_VULKAN 1 - -/* Enable system power support */ -#define SDL_POWER_WINDOWS 1 - -/* Enable filesystem support */ -#define SDL_FILESYSTEM_WINDOWS 1 - -/* Enable assembly routines (Win64 doesn't have inline asm) */ -#ifndef _WIN64 -#define SDL_ASSEMBLY_ROUTINES 1 -#endif - -#endif /* SDL_config_windows_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ +#endif /* SDL_config_h_ */ diff --git a/code/SDL2/include/SDL_config.h.cmake b/code/SDL2/include/SDL_config.h.cmake index c57266c4..511ffc0d 100644 --- a/code/SDL2/include/SDL_config.h.cmake +++ b/code/SDL2/include/SDL_config.h.cmake @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2017 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 @@ -38,7 +38,7 @@ /* C datatypes */ /* Define SIZEOF_VOIDP for 64/32 architectures */ -#ifdef __LP64__ +#if defined(__LP64__) || defined(_LP64) || defined(_WIN64) #define SIZEOF_VOIDP 8 #else #define SIZEOF_VOIDP 4 @@ -47,46 +47,32 @@ #cmakedefine HAVE_GCC_ATOMICS @HAVE_GCC_ATOMICS@ #cmakedefine HAVE_GCC_SYNC_LOCK_TEST_AND_SET @HAVE_GCC_SYNC_LOCK_TEST_AND_SET@ -#cmakedefine HAVE_D3D_H @HAVE_D3D_H@ -#cmakedefine HAVE_D3D11_H @HAVE_D3D11_H@ -#cmakedefine HAVE_DDRAW_H @HAVE_DDRAW_H@ -#cmakedefine HAVE_DSOUND_H @HAVE_DSOUND_H@ -#cmakedefine HAVE_DINPUT_H @HAVE_DINPUT_H@ -#cmakedefine HAVE_XAUDIO2_H @HAVE_XAUDIO2_H@ -#cmakedefine HAVE_XINPUT_H @HAVE_XINPUT_H@ -#cmakedefine HAVE_DXGI_H @HAVE_DXGI_H@ -#cmakedefine HAVE_XINPUT_GAMEPAD_EX @HAVE_XINPUT_GAMEPAD_EX@ -#cmakedefine HAVE_XINPUT_STATE_EX @HAVE_XINPUT_STATE_EX@ - /* Comment this if you want to build without any C library requirements */ #cmakedefine HAVE_LIBC 1 #if HAVE_LIBC /* Useful headers */ -#cmakedefine HAVE_ALLOCA_H 1 -#cmakedefine HAVE_SYS_TYPES_H 1 -#cmakedefine HAVE_STDIO_H 1 #cmakedefine STDC_HEADERS 1 -#cmakedefine HAVE_STDLIB_H 1 -#cmakedefine HAVE_STDARG_H 1 -#cmakedefine HAVE_MALLOC_H 1 -#cmakedefine HAVE_MEMORY_H 1 -#cmakedefine HAVE_STRING_H 1 -#cmakedefine HAVE_STRINGS_H 1 -#cmakedefine HAVE_WCHAR_H 1 -#cmakedefine HAVE_INTTYPES_H 1 -#cmakedefine HAVE_STDINT_H 1 +#cmakedefine HAVE_ALLOCA_H 1 #cmakedefine HAVE_CTYPE_H 1 -#cmakedefine HAVE_MATH_H 1 +#cmakedefine HAVE_FLOAT_H 1 #cmakedefine HAVE_ICONV_H 1 +#cmakedefine HAVE_INTTYPES_H 1 +#cmakedefine HAVE_LIMITS_H 1 +#cmakedefine HAVE_MALLOC_H 1 +#cmakedefine HAVE_MATH_H 1 +#cmakedefine HAVE_MEMORY_H 1 #cmakedefine HAVE_SIGNAL_H 1 -#cmakedefine HAVE_ALTIVEC_H 1 +#cmakedefine HAVE_STDARG_H 1 +#cmakedefine HAVE_STDINT_H 1 +#cmakedefine HAVE_STDIO_H 1 +#cmakedefine HAVE_STDLIB_H 1 +#cmakedefine HAVE_STRINGS_H 1 +#cmakedefine HAVE_STRING_H 1 +#cmakedefine HAVE_SYS_TYPES_H 1 +#cmakedefine HAVE_WCHAR_H 1 #cmakedefine HAVE_PTHREAD_NP_H 1 -#cmakedefine HAVE_LIBUDEV_H 1 -#cmakedefine HAVE_DBUS_DBUS_H 1 -#cmakedefine HAVE_IBUS_IBUS_H 1 -#cmakedefine HAVE_FCITX_FRONTEND_H 1 -#cmakedefine HAVE_LIBSAMPLERATE_H 1 +#cmakedefine HAVE_LIBUNWIND_H 1 /* C library functions */ #cmakedefine HAVE_MALLOC 1 @@ -110,11 +96,18 @@ #cmakedefine HAVE_WCSLEN 1 #cmakedefine HAVE_WCSLCPY 1 #cmakedefine HAVE_WCSLCAT 1 +#cmakedefine HAVE__WCSDUP 1 +#cmakedefine HAVE_WCSDUP 1 +#cmakedefine HAVE_WCSSTR 1 #cmakedefine HAVE_WCSCMP 1 +#cmakedefine HAVE_WCSNCMP 1 +#cmakedefine HAVE_WCSCASECMP 1 +#cmakedefine HAVE__WCSICMP 1 +#cmakedefine HAVE_WCSNCASECMP 1 +#cmakedefine HAVE__WCSNICMP 1 #cmakedefine HAVE_STRLEN 1 #cmakedefine HAVE_STRLCPY 1 #cmakedefine HAVE_STRLCAT 1 -#cmakedefine HAVE_STRDUP 1 #cmakedefine HAVE__STRREV 1 #cmakedefine HAVE__STRUPR 1 #cmakedefine HAVE__STRLWR 1 @@ -123,6 +116,7 @@ #cmakedefine HAVE_STRCHR 1 #cmakedefine HAVE_STRRCHR 1 #cmakedefine HAVE_STRSTR 1 +#cmakedefine HAVE_STRTOK_R 1 #cmakedefine HAVE_ITOA 1 #cmakedefine HAVE__LTOA 1 #cmakedefine HAVE__UITOA 1 @@ -142,28 +136,52 @@ #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 -#cmakedefine HAVE_ATAN 1 -#cmakedefine HAVE_ATAN2 1 #cmakedefine HAVE_ACOS 1 +#cmakedefine HAVE_ACOSF 1 #cmakedefine HAVE_ASIN 1 +#cmakedefine HAVE_ASINF 1 +#cmakedefine HAVE_ATAN 1 +#cmakedefine HAVE_ATANF 1 +#cmakedefine HAVE_ATAN2 1 +#cmakedefine HAVE_ATAN2F 1 #cmakedefine HAVE_CEIL 1 +#cmakedefine HAVE_CEILF 1 #cmakedefine HAVE_COPYSIGN 1 +#cmakedefine HAVE_COPYSIGNF 1 #cmakedefine HAVE_COS 1 #cmakedefine HAVE_COSF 1 +#cmakedefine HAVE_EXP 1 +#cmakedefine HAVE_EXPF 1 #cmakedefine HAVE_FABS 1 +#cmakedefine HAVE_FABSF 1 #cmakedefine HAVE_FLOOR 1 +#cmakedefine HAVE_FLOORF 1 +#cmakedefine HAVE_FMOD 1 +#cmakedefine HAVE_FMODF 1 #cmakedefine HAVE_LOG 1 +#cmakedefine HAVE_LOGF 1 +#cmakedefine HAVE_LOG10 1 +#cmakedefine HAVE_LOG10F 1 +#cmakedefine HAVE_LROUND 1 +#cmakedefine HAVE_LROUNDF 1 #cmakedefine HAVE_POW 1 +#cmakedefine HAVE_POWF 1 +#cmakedefine HAVE_ROUND 1 +#cmakedefine HAVE_ROUNDF 1 #cmakedefine HAVE_SCALBN 1 +#cmakedefine HAVE_SCALBNF 1 #cmakedefine HAVE_SIN 1 #cmakedefine HAVE_SINF 1 #cmakedefine HAVE_SQRT 1 #cmakedefine HAVE_SQRTF 1 #cmakedefine HAVE_TAN 1 #cmakedefine HAVE_TANF 1 +#cmakedefine HAVE_TRUNC 1 +#cmakedefine HAVE_TRUNCF 1 #cmakedefine HAVE_FOPEN64 1 #cmakedefine HAVE_FSEEKO 1 #cmakedefine HAVE_FSEEKO64 1 @@ -181,16 +199,48 @@ #cmakedefine HAVE_PTHREAD_SET_NAME_NP 1 #cmakedefine HAVE_SEM_TIMEDWAIT 1 #cmakedefine HAVE_GETAUXVAL 1 +#cmakedefine HAVE_ELF_AUX_INFO 1 #cmakedefine HAVE_POLL 1 +#cmakedefine HAVE__EXIT 1 #elif __WIN32__ #cmakedefine HAVE_STDARG_H 1 #cmakedefine HAVE_STDDEF_H 1 +#cmakedefine HAVE_FLOAT_H 1 + #else /* We may need some replacement for stdarg.h here */ #include #endif /* HAVE_LIBC */ +#cmakedefine HAVE_ALTIVEC_H 1 +#cmakedefine HAVE_DBUS_DBUS_H 1 +#cmakedefine HAVE_FCITX 1 +#cmakedefine HAVE_IBUS_IBUS_H 1 +#cmakedefine HAVE_SYS_INOTIFY_H 1 +#cmakedefine HAVE_INOTIFY_INIT 1 +#cmakedefine HAVE_INOTIFY_INIT1 1 +#cmakedefine HAVE_INOTIFY 1 +#cmakedefine HAVE_IMMINTRIN_H 1 +#cmakedefine HAVE_LIBUDEV_H 1 +#cmakedefine HAVE_LIBSAMPLERATE_H 1 +#cmakedefine HAVE_LIBDECOR_H 1 + +#cmakedefine HAVE_D3D_H @HAVE_D3D_H@ +#cmakedefine HAVE_D3D11_H @HAVE_D3D11_H@ +#cmakedefine HAVE_DDRAW_H @HAVE_DDRAW_H@ +#cmakedefine HAVE_DSOUND_H @HAVE_DSOUND_H@ +#cmakedefine HAVE_DINPUT_H @HAVE_DINPUT_H@ +#cmakedefine HAVE_XINPUT_H @HAVE_XINPUT_H@ +#cmakedefine HAVE_DXGI_H @HAVE_DXGI_H@ + +#cmakedefine HAVE_MMDEVICEAPI_H @HAVE_MMDEVICEAPI_H@ +#cmakedefine HAVE_AUDIOCLIENT_H @HAVE_AUDIOCLIENT_H@ +#cmakedefine HAVE_SENSORSAPI_H @HAVE_SENSORSAPI_H@ + +#cmakedefine HAVE_XINPUT_GAMEPAD_EX @HAVE_XINPUT_GAMEPAD_EX@ +#cmakedefine HAVE_XINPUT_STATE_EX @HAVE_XINPUT_STATE_EX@ + /* SDL internal assertion support */ #cmakedefine SDL_DEFAULT_ASSERT_LEVEL @SDL_DEFAULT_ASSERT_LEVEL@ @@ -202,6 +252,7 @@ #cmakedefine SDL_FILE_DISABLED @SDL_FILE_DISABLED@ #cmakedefine SDL_JOYSTICK_DISABLED @SDL_JOYSTICK_DISABLED@ #cmakedefine SDL_HAPTIC_DISABLED @SDL_HAPTIC_DISABLED@ +#cmakedefine SDL_SENSOR_DISABLED @SDL_SENSOR_DISABLED@ #cmakedefine SDL_LOADSO_DISABLED @SDL_LOADSO_DISABLED@ #cmakedefine SDL_RENDER_DISABLED @SDL_RENDER_DISABLED@ #cmakedefine SDL_THREADS_DISABLED @SDL_THREADS_DISABLED@ @@ -214,6 +265,8 @@ #cmakedefine SDL_AUDIO_DRIVER_ALSA @SDL_AUDIO_DRIVER_ALSA@ #cmakedefine SDL_AUDIO_DRIVER_ALSA_DYNAMIC @SDL_AUDIO_DRIVER_ALSA_DYNAMIC@ #cmakedefine SDL_AUDIO_DRIVER_ANDROID @SDL_AUDIO_DRIVER_ANDROID@ +#cmakedefine SDL_AUDIO_DRIVER_OPENSLES @SDL_AUDIO_DRIVER_OPENSLES@ +#cmakedefine SDL_AUDIO_DRIVER_AAUDIO @SDL_AUDIO_DRIVER_AAUDIO@ #cmakedefine SDL_AUDIO_DRIVER_ARTS @SDL_AUDIO_DRIVER_ARTS@ #cmakedefine SDL_AUDIO_DRIVER_ARTS_DYNAMIC @SDL_AUDIO_DRIVER_ARTS_DYNAMIC@ #cmakedefine SDL_AUDIO_DRIVER_COREAUDIO @SDL_AUDIO_DRIVER_COREAUDIO@ @@ -234,6 +287,8 @@ #cmakedefine SDL_AUDIO_DRIVER_OSS @SDL_AUDIO_DRIVER_OSS@ #cmakedefine SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H @SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H@ #cmakedefine SDL_AUDIO_DRIVER_PAUDIO @SDL_AUDIO_DRIVER_PAUDIO@ +#cmakedefine SDL_AUDIO_DRIVER_PIPEWIRE @SDL_AUDIO_DRIVER_PIPEWIRE@ +#cmakedefine SDL_AUDIO_DRIVER_PIPEWIRE_DYNAMIC @SDL_AUDIO_DRIVER_PIPEWIRE_DYNAMIC@ #cmakedefine SDL_AUDIO_DRIVER_PULSEAUDIO @SDL_AUDIO_DRIVER_PULSEAUDIO@ #cmakedefine SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC @SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC@ #cmakedefine SDL_AUDIO_DRIVER_QSA @SDL_AUDIO_DRIVER_QSA@ @@ -242,12 +297,13 @@ #cmakedefine SDL_AUDIO_DRIVER_SUNAUDIO @SDL_AUDIO_DRIVER_SUNAUDIO@ #cmakedefine SDL_AUDIO_DRIVER_WASAPI @SDL_AUDIO_DRIVER_WASAPI@ #cmakedefine SDL_AUDIO_DRIVER_WINMM @SDL_AUDIO_DRIVER_WINMM@ -#cmakedefine SDL_AUDIO_DRIVER_XAUDIO2 @SDL_AUDIO_DRIVER_XAUDIO2@ +#cmakedefine SDL_AUDIO_DRIVER_OS2 @SDL_AUDIO_DRIVER_OS2@ +#cmakedefine SDL_AUDIO_DRIVER_VITA @SDL_AUDIO_DRIVER_VITA@ /* Enable various input drivers */ #cmakedefine SDL_INPUT_LINUXEV @SDL_INPUT_LINUXEV@ #cmakedefine SDL_INPUT_LINUXKD @SDL_INPUT_LINUXKD@ -#cmakedefine SDL_INPUT_TSLIB @SDL_INPUT_TSLIB@ +#cmakedefine SDL_INPUT_FBSDKBIO @SDL_INPUT_FBSDKBIO@ #cmakedefine SDL_JOYSTICK_ANDROID @SDL_JOYSTICK_ANDROID@ #cmakedefine SDL_JOYSTICK_HAIKU @SDL_JOYSTICK_HAIKU@ #cmakedefine SDL_JOYSTICK_DINPUT @SDL_JOYSTICK_DINPUT@ @@ -257,47 +313,71 @@ #cmakedefine SDL_JOYSTICK_MFI @SDL_JOYSTICK_MFI@ #cmakedefine SDL_JOYSTICK_LINUX @SDL_JOYSTICK_LINUX@ #cmakedefine SDL_JOYSTICK_WINMM @SDL_JOYSTICK_WINMM@ +#cmakedefine SDL_JOYSTICK_OS2 @SDL_JOYSTICK_OS2@ #cmakedefine SDL_JOYSTICK_USBHID @SDL_JOYSTICK_USBHID@ -#cmakedefine SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H @SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H@ +#cmakedefine SDL_HAVE_MACHINE_JOYSTICK_H @SDL_HAVE_MACHINE_JOYSTICK_H@ +#cmakedefine SDL_JOYSTICK_HIDAPI @SDL_JOYSTICK_HIDAPI@ +#cmakedefine SDL_JOYSTICK_RAWINPUT @SDL_JOYSTICK_RAWINPUT@ #cmakedefine SDL_JOYSTICK_EMSCRIPTEN @SDL_JOYSTICK_EMSCRIPTEN@ +#cmakedefine SDL_JOYSTICK_VIRTUAL @SDL_JOYSTICK_VIRTUAL@ +#cmakedefine SDL_JOYSTICK_VITA @SDL_JOYSTICK_VITA@ #cmakedefine SDL_HAPTIC_DUMMY @SDL_HAPTIC_DUMMY@ #cmakedefine SDL_HAPTIC_LINUX @SDL_HAPTIC_LINUX@ #cmakedefine SDL_HAPTIC_IOKIT @SDL_HAPTIC_IOKIT@ #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_WINDOWS @SDL_SENSOR_WINDOWS@ +#cmakedefine SDL_SENSOR_DUMMY @SDL_SENSOR_DUMMY@ +#cmakedefine SDL_SENSOR_VITA @SDL_SENSOR_VITA@ /* Enable various shared object loading systems */ #cmakedefine SDL_LOADSO_DLOPEN @SDL_LOADSO_DLOPEN@ #cmakedefine SDL_LOADSO_DUMMY @SDL_LOADSO_DUMMY@ #cmakedefine SDL_LOADSO_LDG @SDL_LOADSO_LDG@ #cmakedefine SDL_LOADSO_WINDOWS @SDL_LOADSO_WINDOWS@ +#cmakedefine SDL_LOADSO_OS2 @SDL_LOADSO_OS2@ /* Enable various threading systems */ +#cmakedefine SDL_THREAD_GENERIC_COND_SUFFIX @SDL_THREAD_GENERIC_COND_SUFFIX@ #cmakedefine SDL_THREAD_PTHREAD @SDL_THREAD_PTHREAD@ #cmakedefine SDL_THREAD_PTHREAD_RECURSIVE_MUTEX @SDL_THREAD_PTHREAD_RECURSIVE_MUTEX@ #cmakedefine SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP @SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP@ #cmakedefine SDL_THREAD_WINDOWS @SDL_THREAD_WINDOWS@ +#cmakedefine SDL_THREAD_OS2 @SDL_THREAD_OS2@ +#cmakedefine SDL_THREAD_VITA @SDL_THREAD_VITA@ /* Enable various timer systems */ #cmakedefine SDL_TIMER_HAIKU @SDL_TIMER_HAIKU@ #cmakedefine SDL_TIMER_DUMMY @SDL_TIMER_DUMMY@ #cmakedefine SDL_TIMER_UNIX @SDL_TIMER_UNIX@ #cmakedefine SDL_TIMER_WINDOWS @SDL_TIMER_WINDOWS@ -#cmakedefine SDL_TIMER_WINCE @SDL_TIMER_WINCE@ +#cmakedefine SDL_TIMER_OS2 @SDL_TIMER_OS2@ +#cmakedefine SDL_TIMER_VITA @SDL_TIMER_VITA@ /* Enable various video drivers */ #cmakedefine SDL_VIDEO_DRIVER_ANDROID @SDL_VIDEO_DRIVER_ANDROID@ +#cmakedefine SDL_VIDEO_DRIVER_EMSCRIPTEN @SDL_VIDEO_DRIVER_EMSCRIPTEN@ #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_WINRT @SDL_VIDEO_DRIVER_WINRT@ #cmakedefine SDL_VIDEO_DRIVER_WAYLAND @SDL_VIDEO_DRIVER_WAYLAND@ #cmakedefine SDL_VIDEO_DRIVER_RPI @SDL_VIDEO_DRIVER_RPI@ #cmakedefine SDL_VIDEO_DRIVER_VIVANTE @SDL_VIDEO_DRIVER_VIVANTE@ #cmakedefine SDL_VIDEO_DRIVER_VIVANTE_VDK @SDL_VIDEO_DRIVER_VIVANTE_VDK@ +#cmakedefine SDL_VIDEO_DRIVER_OS2 @SDL_VIDEO_DRIVER_OS2@ +#cmakedefine SDL_VIDEO_DRIVER_QNX @SDL_VIDEO_DRIVER_QNX@ #cmakedefine SDL_VIDEO_DRIVER_KMSDRM @SDL_VIDEO_DRIVER_KMSDRM@ #cmakedefine SDL_VIDEO_DRIVER_KMSDRM_DYNAMIC @SDL_VIDEO_DRIVER_KMSDRM_DYNAMIC@ @@ -308,11 +388,8 @@ #cmakedefine SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_EGL @SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_EGL@ #cmakedefine SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_CURSOR @SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_CURSOR@ #cmakedefine SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_XKBCOMMON @SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_XKBCOMMON@ +#cmakedefine SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_LIBDECOR @SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_LIBDECOR@ -#cmakedefine SDL_VIDEO_DRIVER_MIR @SDL_VIDEO_DRIVER_MIR@ -#cmakedefine SDL_VIDEO_DRIVER_MIR_DYNAMIC @SDL_VIDEO_DRIVER_MIR_DYNAMIC@ -#cmakedefine SDL_VIDEO_DRIVER_MIR_DYNAMIC_XKBCOMMON @SDL_VIDEO_DRIVER_MIR_DYNAMIC_XKBCOMMON@ -#cmakedefine SDL_VIDEO_DRIVER_EMSCRIPTEN @SDL_VIDEO_DRIVER_EMSCRIPTEN@ #cmakedefine SDL_VIDEO_DRIVER_X11 @SDL_VIDEO_DRIVER_X11@ #cmakedefine SDL_VIDEO_DRIVER_X11_DYNAMIC @SDL_VIDEO_DRIVER_X11_DYNAMIC@ #cmakedefine SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT @SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT@ @@ -334,6 +411,7 @@ #cmakedefine SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS @SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS@ #cmakedefine SDL_VIDEO_DRIVER_X11_CONST_PARAM_XEXTADDDISPLAY @SDL_VIDEO_DRIVER_X11_CONST_PARAM_XEXTADDDISPLAY@ #cmakedefine SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM @SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM@ +#cmakedefine SDL_VIDEO_DRIVER_VITA @SDL_VIDEO_DRIVER_VITA@ #cmakedefine SDL_VIDEO_RENDER_D3D @SDL_VIDEO_RENDER_D3D@ #cmakedefine SDL_VIDEO_RENDER_D3D11 @SDL_VIDEO_RENDER_D3D11@ @@ -341,6 +419,8 @@ #cmakedefine SDL_VIDEO_RENDER_OGL_ES @SDL_VIDEO_RENDER_OGL_ES@ #cmakedefine SDL_VIDEO_RENDER_OGL_ES2 @SDL_VIDEO_RENDER_OGL_ES2@ #cmakedefine SDL_VIDEO_RENDER_DIRECTFB @SDL_VIDEO_RENDER_DIRECTFB@ +#cmakedefine SDL_VIDEO_RENDER_METAL @SDL_VIDEO_RENDER_METAL@ +#cmakedefine SDL_VIDEO_RENDER_VITA_GXM @SDL_VIDEO_RENDER_VITA_GXM@ /* Enable OpenGL support */ #cmakedefine SDL_VIDEO_OPENGL @SDL_VIDEO_OPENGL@ @@ -357,14 +437,20 @@ /* 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_WINRT @SDL_POWER_WINRT@ #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@ +#cmakedefine SDL_POWER_VITA @SDL_POWER_VITA@ /* Enable system filesystem support */ #cmakedefine SDL_FILESYSTEM_ANDROID @SDL_FILESYSTEM_ANDROID@ @@ -374,16 +460,25 @@ #cmakedefine SDL_FILESYSTEM_UNIX @SDL_FILESYSTEM_UNIX@ #cmakedefine SDL_FILESYSTEM_WINDOWS @SDL_FILESYSTEM_WINDOWS@ #cmakedefine SDL_FILESYSTEM_EMSCRIPTEN @SDL_FILESYSTEM_EMSCRIPTEN@ +#cmakedefine SDL_FILESYSTEM_OS2 @SDL_FILESYSTEM_OS2@ +#cmakedefine SDL_FILESYSTEM_VITA @SDL_FILESYSTEM_VITA@ /* 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 */ -#if !defined(__WIN32__) +#cmakedefine SDL_IPHONE_KEYBOARD @SDL_IPHONE_KEYBOARD@ +#cmakedefine SDL_IPHONE_LAUNCHSCREEN @SDL_IPHONE_LAUNCHSCREEN@ + +#cmakedefine SDL_VIDEO_VITA_PIB @SDL_VIDEO_VITA_PIB@ + +#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; diff --git a/code/SDL2/include/SDL_config.h.in b/code/SDL2/include/SDL_config.h.in index 8b3d2088..ea877237 100644 --- a/code/SDL2/include/SDL_config.h.in +++ b/code/SDL2/include/SDL_config.h.in @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2017 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 @@ -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 */ @@ -42,51 +42,41 @@ #undef volatile /* C datatypes */ -#ifdef __LP64__ +#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 -#undef HAVE_DDRAW_H -#undef HAVE_DINPUT_H -#undef HAVE_DSOUND_H -#undef HAVE_DXGI_H -#undef HAVE_XINPUT_H -#undef HAVE_XINPUT_GAMEPAD_EX -#undef HAVE_XINPUT_STATE_EX - /* Comment this if you want to build without any C library requirements */ #undef HAVE_LIBC #if HAVE_LIBC /* Useful headers */ -#undef HAVE_ALLOCA_H -#undef HAVE_SYS_TYPES_H -#undef HAVE_STDIO_H #undef STDC_HEADERS -#undef HAVE_STDLIB_H -#undef HAVE_STDARG_H -#undef HAVE_MALLOC_H -#undef HAVE_MEMORY_H -#undef HAVE_STRING_H -#undef HAVE_STRINGS_H -#undef HAVE_WCHAR_H -#undef HAVE_INTTYPES_H -#undef HAVE_STDINT_H +#undef HAVE_ALLOCA_H #undef HAVE_CTYPE_H -#undef HAVE_MATH_H +#undef HAVE_FLOAT_H #undef HAVE_ICONV_H +#undef HAVE_INTTYPES_H +#undef HAVE_LIMITS_H +#undef HAVE_MALLOC_H +#undef HAVE_MATH_H +#undef HAVE_MEMORY_H #undef HAVE_SIGNAL_H -#undef HAVE_ALTIVEC_H +#undef HAVE_STDARG_H +#undef HAVE_STDINT_H +#undef HAVE_STDIO_H +#undef HAVE_STDLIB_H +#undef HAVE_STRINGS_H +#undef HAVE_STRING_H +#undef HAVE_SYS_TYPES_H +#undef HAVE_WCHAR_H #undef HAVE_PTHREAD_NP_H -#undef HAVE_LIBUDEV_H -#undef HAVE_DBUS_DBUS_H -#undef HAVE_IBUS_IBUS_H -#undef HAVE_FCITX_FRONTEND_H -#undef HAVE_LIBSAMPLERATE_H +#undef HAVE_LIBUNWIND_H /* C library functions */ #undef HAVE_MALLOC @@ -110,11 +100,18 @@ #undef HAVE_WCSLEN #undef HAVE_WCSLCPY #undef HAVE_WCSLCAT +#undef HAVE__WCSDUP +#undef HAVE_WCSDUP +#undef HAVE_WCSSTR #undef HAVE_WCSCMP +#undef HAVE_WCSNCMP +#undef HAVE_WCSCASECMP +#undef HAVE__WCSICMP +#undef HAVE_WCSNCASECMP +#undef HAVE__WCSNICMP #undef HAVE_STRLEN #undef HAVE_STRLCPY #undef HAVE_STRLCAT -#undef HAVE_STRDUP #undef HAVE__STRREV #undef HAVE__STRUPR #undef HAVE__STRLWR @@ -123,6 +120,7 @@ #undef HAVE_STRCHR #undef HAVE_STRRCHR #undef HAVE_STRSTR +#undef HAVE_STRTOK_R #undef HAVE_ITOA #undef HAVE__LTOA #undef HAVE__UITOA @@ -147,25 +145,48 @@ #undef HAVE_SNPRINTF #undef HAVE_VSNPRINTF #undef HAVE_M_PI -#undef HAVE_ATAN -#undef HAVE_ATAN2 #undef HAVE_ACOS +#undef HAVE_ACOSF #undef HAVE_ASIN +#undef HAVE_ASINF +#undef HAVE_ATAN +#undef HAVE_ATANF +#undef HAVE_ATAN2 +#undef HAVE_ATAN2F #undef HAVE_CEIL +#undef HAVE_CEILF #undef HAVE_COPYSIGN +#undef HAVE_COPYSIGNF #undef HAVE_COS #undef HAVE_COSF +#undef HAVE_EXP +#undef HAVE_EXPF #undef HAVE_FABS +#undef HAVE_FABSF #undef HAVE_FLOOR +#undef HAVE_FLOORF +#undef HAVE_FMOD +#undef HAVE_FMODF #undef HAVE_LOG +#undef HAVE_LOGF +#undef HAVE_LOG10 +#undef HAVE_LOG10F +#undef HAVE_LROUND +#undef HAVE_LROUNDF #undef HAVE_POW +#undef HAVE_POWF +#undef HAVE_ROUND +#undef HAVE_ROUNDF #undef HAVE_SCALBN +#undef HAVE_SCALBNF #undef HAVE_SIN #undef HAVE_SINF #undef HAVE_SQRT #undef HAVE_SQRTF #undef HAVE_TAN #undef HAVE_TANF +#undef HAVE_TRUNC +#undef HAVE_TRUNCF #undef HAVE_FOPEN64 #undef HAVE_FSEEKO #undef HAVE_FSEEKO64 @@ -183,14 +204,42 @@ #undef HAVE_PTHREAD_SET_NAME_NP #undef HAVE_SEM_TIMEDWAIT #undef HAVE_GETAUXVAL +#undef HAVE_ELF_AUX_INFO #undef HAVE_POLL +#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 +#undef HAVE_DBUS_DBUS_H +#undef HAVE_FCITX +#undef HAVE_SYS_INOTIFY_H +#undef HAVE_INOTIFY_INIT +#undef HAVE_INOTIFY_INIT1 +#undef HAVE_INOTIFY +#undef HAVE_IBUS_IBUS_H +#undef HAVE_IMMINTRIN_H +#undef HAVE_LIBUDEV_H +#undef HAVE_LIBSAMPLERATE_H +#undef HAVE_LIBDECOR_H + +#undef HAVE_DDRAW_H +#undef HAVE_DINPUT_H +#undef HAVE_DSOUND_H +#undef HAVE_DXGI_H +#undef HAVE_XINPUT_H + +#undef HAVE_MMDEVICEAPI_H +#undef HAVE_AUDIOCLIENT_H +#undef HAVE_SENSORSAPI_H + +#undef HAVE_XINPUT_GAMEPAD_EX +#undef HAVE_XINPUT_STATE_EX + /* SDL internal assertion support */ #undef SDL_DEFAULT_ASSERT_LEVEL @@ -202,6 +251,7 @@ #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 @@ -235,6 +285,8 @@ #undef SDL_AUDIO_DRIVER_OSS #undef SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H #undef SDL_AUDIO_DRIVER_PAUDIO +#undef SDL_AUDIO_DRIVER_PIPEWIRE +#undef SDL_AUDIO_DRIVER_PIPEWIRE_DYNAMIC #undef SDL_AUDIO_DRIVER_PULSEAUDIO #undef SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC #undef SDL_AUDIO_DRIVER_QSA @@ -243,46 +295,63 @@ #undef SDL_AUDIO_DRIVER_SUNAUDIO #undef SDL_AUDIO_DRIVER_WASAPI #undef SDL_AUDIO_DRIVER_WINMM -#undef SDL_AUDIO_DRIVER_XAUDIO2 +#undef SDL_AUDIO_DRIVER_OS2 /* Enable various input drivers */ #undef SDL_INPUT_LINUXEV +#undef SDL_INPUT_FBSDKBIO #undef SDL_INPUT_LINUXKD -#undef SDL_INPUT_TSLIB +#undef SDL_INPUT_WSCONS #undef SDL_JOYSTICK_HAIKU #undef SDL_JOYSTICK_DINPUT #undef SDL_JOYSTICK_XINPUT #undef SDL_JOYSTICK_DUMMY #undef SDL_JOYSTICK_IOKIT +#undef SDL_JOYSTICK_MFI #undef SDL_JOYSTICK_LINUX #undef SDL_JOYSTICK_ANDROID #undef SDL_JOYSTICK_WINMM +#undef SDL_JOYSTICK_OS2 #undef SDL_JOYSTICK_USBHID -#undef SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H +#undef SDL_HAVE_MACHINE_JOYSTICK_H +#undef SDL_JOYSTICK_HIDAPI +#undef SDL_JOYSTICK_RAWINPUT #undef SDL_JOYSTICK_EMSCRIPTEN +#undef SDL_JOYSTICK_VIRTUAL #undef SDL_HAPTIC_DUMMY +#undef SDL_HAPTIC_ANDROID #undef SDL_HAPTIC_LINUX #undef SDL_HAPTIC_IOKIT #undef SDL_HAPTIC_DINPUT #undef SDL_HAPTIC_XINPUT +/* Enable various sensor drivers */ +#undef SDL_SENSOR_ANDROID +#undef SDL_SENSOR_COREMOTION +#undef SDL_SENSOR_WINDOWS +#undef SDL_SENSOR_DUMMY + /* Enable various shared object loading systems */ #undef SDL_LOADSO_DLOPEN #undef SDL_LOADSO_DUMMY #undef SDL_LOADSO_LDG #undef SDL_LOADSO_WINDOWS +#undef SDL_LOADSO_OS2 /* Enable various threading systems */ +#undef SDL_THREAD_GENERIC_COND_SUFFIX #undef SDL_THREAD_PTHREAD #undef SDL_THREAD_PTHREAD_RECURSIVE_MUTEX #undef SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP #undef SDL_THREAD_WINDOWS +#undef SDL_THREAD_OS2 /* Enable various timer systems */ #undef SDL_TIMER_HAIKU #undef SDL_TIMER_DUMMY #undef SDL_TIMER_UNIX #undef SDL_TIMER_WINDOWS +#undef SDL_TIMER_OS2 /* Enable various video drivers */ #undef SDL_VIDEO_DRIVER_HAIKU @@ -297,9 +366,7 @@ #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_MIR -#undef SDL_VIDEO_DRIVER_MIR_DYNAMIC -#undef SDL_VIDEO_DRIVER_MIR_DYNAMIC_XKBCOMMON +#undef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_LIBDECOR #undef SDL_VIDEO_DRIVER_X11 #undef SDL_VIDEO_DRIVER_RPI #undef SDL_VIDEO_DRIVER_KMSDRM @@ -330,6 +397,7 @@ #undef SDL_VIDEO_DRIVER_NACL #undef SDL_VIDEO_DRIVER_VIVANTE #undef SDL_VIDEO_DRIVER_VIVANTE_VDK +#undef SDL_VIDEO_DRIVER_OS2 #undef SDL_VIDEO_DRIVER_QNX #undef SDL_VIDEO_RENDER_D3D @@ -338,6 +406,7 @@ #undef SDL_VIDEO_RENDER_OGL_ES #undef SDL_VIDEO_RENDER_OGL_ES2 #undef SDL_VIDEO_RENDER_DIRECTFB +#undef SDL_VIDEO_RENDER_METAL /* Enable OpenGL support */ #undef SDL_VIDEO_OPENGL @@ -354,6 +423,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 @@ -372,10 +444,13 @@ #undef SDL_FILESYSTEM_NACL #undef SDL_FILESYSTEM_ANDROID #undef SDL_FILESYSTEM_EMSCRIPTEN +#undef SDL_FILESYSTEM_OS2 /* 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 @@ -383,6 +458,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 --git a/code/SDL2/include/SDL_config_android.h b/code/SDL2/include/SDL_config_android.h index 361bad8b..09d00d24 100644 --- a/code/SDL2/include/SDL_config_android.h +++ b/code/SDL2/include/SDL_config_android.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2017 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 @@ -35,16 +35,17 @@ #define HAVE_GCC_ATOMICS 1 -#define HAVE_ALLOCA_H 1 -#define HAVE_SYS_TYPES_H 1 -#define HAVE_STDIO_H 1 #define STDC_HEADERS 1 -#define HAVE_STRING_H 1 -#define HAVE_INTTYPES_H 1 -#define HAVE_STDINT_H 1 +#define HAVE_ALLOCA_H 1 #define HAVE_CTYPE_H 1 +#define HAVE_INTTYPES_H 1 +#define HAVE_LIMITS_H 1 #define HAVE_MATH_H 1 #define HAVE_SIGNAL_H 1 +#define HAVE_STDINT_H 1 +#define HAVE_STDIO_H 1 +#define HAVE_STRING_H 1 +#define HAVE_SYS_TYPES_H 1 /* C library functions */ #define HAVE_MALLOC 1 @@ -67,10 +68,10 @@ #define HAVE_STRLEN 1 #define HAVE_STRLCPY 1 #define HAVE_STRLCAT 1 -#define HAVE_STRDUP 1 #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 @@ -84,41 +85,74 @@ #define HAVE_STRNCASECMP 1 #define HAVE_VSSCANF 1 #define HAVE_VSNPRINTF 1 -#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_ACOS 1 -#define HAVE_ASIN 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 #define HAVE_SIGACTION 1 #define HAVE_SETJMP 1 #define HAVE_NANOSLEEP 1 #define HAVE_SYSCONF 1 -#define HAVE_CLOCK_GETTIME 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 +#define SDL_AUDIO_DRIVER_OPENSLES 1 +#define SDL_AUDIO_DRIVER_AAUDIO 0 #define SDL_AUDIO_DRIVER_DUMMY 1 /* Enable various input drivers */ #define SDL_JOYSTICK_ANDROID 1 -#define SDL_HAPTIC_ANDROID 1 +#define SDL_JOYSTICK_HIDAPI 1 +#define SDL_JOYSTICK_VIRTUAL 1 +#define SDL_HAPTIC_ANDROID 1 + +/* Enable sensor driver */ +#define SDL_SENSOR_ANDROID 1 /* Enable various shared object loading systems */ #define SDL_LOADSO_DLOPEN 1 diff --git a/code/SDL2/include/SDL_config_iphoneos.h b/code/SDL2/include/SDL_config_iphoneos.h index deea0304..9a748beb 100644 --- a/code/SDL2/include/SDL_config_iphoneos.h +++ b/code/SDL2/include/SDL_config_iphoneos.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2017 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 @@ -33,16 +33,19 @@ #define HAVE_GCC_ATOMICS 1 -#define HAVE_ALLOCA_H 1 -#define HAVE_SYS_TYPES_H 1 -#define HAVE_STDIO_H 1 #define STDC_HEADERS 1 -#define HAVE_STRING_H 1 -#define HAVE_INTTYPES_H 1 -#define HAVE_STDINT_H 1 +#define HAVE_ALLOCA_H 1 #define HAVE_CTYPE_H 1 +#define HAVE_INTTYPES_H 1 +#define HAVE_LIMITS_H 1 #define HAVE_MATH_H 1 #define HAVE_SIGNAL_H 1 +#define HAVE_STDINT_H 1 +#define HAVE_STDIO_H 1 +#define HAVE_STRING_H 1 +#define HAVE_SYS_TYPES_H 1 +/* The libunwind functions are only available on x86 */ +/* #undef HAVE_LIBUNWIND_H */ /* C library functions */ #define HAVE_MALLOC 1 @@ -65,10 +68,10 @@ #define HAVE_STRLEN 1 #define HAVE_STRLCPY 1 #define HAVE_STRLCAT 1 -#define HAVE_STRDUP 1 #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 @@ -83,25 +86,48 @@ #define HAVE_VSSCANF 1 #define HAVE_VSNPRINTF 1 #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_ACOS 1 -#define HAVE_ASIN 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 #define HAVE_SIGACTION 1 #define HAVE_SETJMP 1 #define HAVE_NANOSLEEP 1 @@ -116,8 +142,18 @@ /* Enable the stub haptic driver (src/haptic/dummy/\*.c) */ #define SDL_HAPTIC_DUMMY 1 -/* Enable MFi joystick support */ +/* Enable joystick support */ +/* Only enable HIDAPI support if you want to support Steam Controllers on iOS and tvOS */ +/*#define SDL_JOYSTICK_HIDAPI 1*/ #define SDL_JOYSTICK_MFI 1 +#define SDL_JOYSTICK_VIRTUAL 1 + +#ifdef __TVOS__ +#define SDL_SENSOR_DUMMY 1 +#else +/* Enable the CoreMotion sensor driver */ +#define SDL_SENSOR_COREMOTION 1 +#endif /* Enable Unix style SO loading */ #define SDL_LOADSO_DLOPEN 1 @@ -133,17 +169,33 @@ #define SDL_VIDEO_DRIVER_UIKIT 1 #define SDL_VIDEO_DRIVER_DUMMY 1 -/* enable OpenGL ES */ +/* 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 -/* Enable Vulkan support */ -#if !TARGET_OS_SIMULATOR && !TARGET_CPU_ARM // Only 64-bit devices have Metal -#define SDL_VIDEO_VULKAN 1 +/* 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 + */ +#if (TARGET_OS_SIMULATOR && ((__IPHONE_OS_VERSION_MIN_REQUIRED >= 130000) || (__TV_OS_VERSION_MIN_REQUIRED >= 130000))) || (!TARGET_CPU_ARM && ((__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 90000))) +#define SDL_PLATFORM_SUPPORTS_METAL 1 #else -#define SDL_VIDEO_VULKAN 0 +#define SDL_PLATFORM_SUPPORTS_METAL 0 +#endif + +#if SDL_PLATFORM_SUPPORTS_METAL +#define SDL_VIDEO_RENDER_METAL 1 +#endif + +#if SDL_PLATFORM_SUPPORTS_METAL +#define SDL_VIDEO_VULKAN 1 +#endif + +#if SDL_PLATFORM_SUPPORTS_METAL +#define SDL_VIDEO_METAL 1 #endif /* Enable system power support */ @@ -155,11 +207,6 @@ /* enable iOS extended launch screen */ #define SDL_IPHONE_LAUNCHSCREEN 1 -/* Set max recognized G-force from accelerometer - See src/joystick/uikit/SDL_sysjoystick.m for notes on why this is needed - */ -#define SDL_IPHONE_MAX_GFORCE 5.0 - /* enable filesystem support */ #define SDL_FILESYSTEM_COCOA 1 diff --git a/code/SDL2/include/SDL_config_macosx.h b/code/SDL2/include/SDL_config_macosx.h index 9b098995..ec188662 100644 --- a/code/SDL2/include/SDL_config_macosx.h +++ b/code/SDL2/include/SDL_config_macosx.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2017 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 @@ -37,16 +37,19 @@ #endif /* Useful headers */ -#define HAVE_ALLOCA_H 1 -#define HAVE_SYS_TYPES_H 1 -#define HAVE_STDIO_H 1 #define STDC_HEADERS 1 -#define HAVE_STRING_H 1 -#define HAVE_INTTYPES_H 1 -#define HAVE_STDINT_H 1 +#define HAVE_ALLOCA_H 1 #define HAVE_CTYPE_H 1 +#define HAVE_FLOAT_H 1 +#define HAVE_INTTYPES_H 1 +#define HAVE_LIMITS_H 1 #define HAVE_MATH_H 1 #define HAVE_SIGNAL_H 1 +#define HAVE_STDINT_H 1 +#define HAVE_STDIO_H 1 +#define HAVE_STRING_H 1 +#define HAVE_SYS_TYPES_H 1 +#define HAVE_LIBUNWIND_H 1 /* C library functions */ #define HAVE_MALLOC 1 @@ -68,10 +71,10 @@ #define HAVE_STRLEN 1 #define HAVE_STRLCPY 1 #define HAVE_STRLCAT 1 -#define HAVE_STRDUP 1 #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 @@ -85,30 +88,62 @@ #define HAVE_STRNCASECMP 1 #define HAVE_VSSCANF 1 #define HAVE_VSNPRINTF 1 +#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 #define HAVE_SIGACTION 1 #define HAVE_SETJMP 1 #define HAVE_NANOSLEEP 1 #define HAVE_SYSCONF 1 #define HAVE_SYSCTLBYNAME 1 -#define HAVE_ATAN 1 -#define HAVE_ATAN2 1 -#define HAVE_ACOS 1 -#define HAVE_ASIN 1 + +#if defined(__has_include) && (defined(__i386__) || defined(__x86_64)) +# if __has_include() +# define HAVE_IMMINTRIN_H 1 +# endif +#endif + +#define HAVE_GCC_ATOMICS 1 /* Enable various audio drivers */ #define SDL_AUDIO_DRIVER_COREAUDIO 1 @@ -116,9 +151,19 @@ #define SDL_AUDIO_DRIVER_DUMMY 1 /* Enable various input drivers */ +#define SDL_JOYSTICK_HIDAPI 1 #define SDL_JOYSTICK_IOKIT 1 +#define SDL_JOYSTICK_VIRTUAL 1 #define SDL_HAPTIC_IOKIT 1 +/* The MFI controller support requires ARC Objective C runtime */ +#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1080 && !defined(__i386__) +#define SDL_JOYSTICK_MFI 1 +#endif + +/* Enable the dummy sensor driver */ +#define SDL_SENSOR_DUMMY 1 + /* Enable various shared object loading systems */ #define SDL_LOADSO_DLOPEN 1 @@ -133,13 +178,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 @@ -163,10 +208,35 @@ #define SDL_VIDEO_RENDER_OGL 1 #endif +#ifndef SDL_VIDEO_RENDER_OGL_ES2 +#define SDL_VIDEO_RENDER_OGL_ES2 1 +#endif + +/* Metal only supported on 64-bit architectures with 10.11+ */ +#if TARGET_RT_64_BIT && (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 +#endif +#endif + /* Enable OpenGL support */ #ifndef SDL_VIDEO_OPENGL #define SDL_VIDEO_OPENGL 1 #endif +#ifndef SDL_VIDEO_OPENGL_ES2 +#define SDL_VIDEO_OPENGL_ES2 1 +#endif +#ifndef SDL_VIDEO_OPENGL_EGL +#define SDL_VIDEO_OPENGL_EGL 1 +#endif #ifndef SDL_VIDEO_OPENGL_CGL #define SDL_VIDEO_OPENGL_CGL 1 #endif @@ -174,12 +244,21 @@ #define SDL_VIDEO_OPENGL_GLX 1 #endif -/* Enable Vulkan support */ -/* Metal/MoltenVK/Vulkan 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 +#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 */ diff --git a/code/SDL2/include/SDL_config_minimal.h b/code/SDL2/include/SDL_config_minimal.h index 31127006..b9c39584 100644 --- a/code/SDL2/include/SDL_config_minimal.h +++ b/code/SDL2/include/SDL_config_minimal.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2017 Sam Lantinga + Copyright (C) 1997-2020 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 @@ -64,6 +64,9 @@ typedef unsigned long uintptr_t; /* Enable the stub haptic driver (src/haptic/dummy/\*.c) */ #define SDL_HAPTIC_DISABLED 1 +/* Enable the stub sensor driver (src/sensor/dummy/\*.c) */ +#define SDL_SENSOR_DISABLED 1 + /* Enable the stub shared object loader (src/loadso/dummy/\*.c) */ #define SDL_LOADSO_DISABLED 1 diff --git a/code/SDL2/include/SDL_config_os2.h b/code/SDL2/include/SDL_config_os2.h index 1922217d..075753fc 100644 --- a/code/SDL2/include/SDL_config_os2.h +++ b/code/SDL2/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,13 +25,16 @@ #include "SDL_platform.h" +#define SIZEOF_VOIDP 4 + #define SDL_AUDIO_DRIVER_DUMMY 1 #define SDL_AUDIO_DRIVER_DISK 1 #define SDL_AUDIO_DRIVER_OS2 1 #define SDL_POWER_DISABLED 1 -#define SDL_JOYSTICK_DISABLED 1 #define SDL_HAPTIC_DISABLED 1 +#define SDL_JOYSTICK_DISABLED 1 +/*#undef SDL_JOYSTICK_OS2 */ /*#undef SDL_JOYSTICK_HIDAPI */ /*#undef SDL_JOYSTICK_VIRTUAL */ @@ -42,9 +45,6 @@ /* Enable OpenGL support */ /* #undef SDL_VIDEO_OPENGL */ -/* Enable Vulkan support */ -/* #undef SDL_VIDEO_VULKAN */ - #define SDL_THREAD_OS2 1 #define SDL_LOADSO_OS2 1 #define SDL_TIMER_OS2 1 @@ -105,14 +105,22 @@ #define HAVE_WCSCMP 1 #define HAVE__WCSICMP 1 #define HAVE__WCSNICMP 1 +#define HAVE_WCSLEN 1 +#define HAVE_WCSLCPY 1 +#define HAVE_WCSLCAT 1 +/* #undef HAVE_WCSDUP */ +#define HAVE__WCSDUP 1 +#define HAVE_WCSSTR 1 +#define HAVE_WCSCMP 1 +#define HAVE_WCSNCMP 1 #define HAVE_STRLEN 1 #define HAVE_STRLCPY 1 #define HAVE_STRLCAT 1 #define HAVE__STRREV 1 #define HAVE__STRUPR 1 #define HAVE__STRLWR 1 -#define HAVE_INDEX 1 -#define HAVE_RINDEX 1 +/* #undef HAVE_INDEX */ +/* #undef HAVE_RINDEX */ #define HAVE_STRCHR 1 #define HAVE_STRRCHR 1 #define HAVE_STRSTR 1 @@ -129,14 +137,6 @@ #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 @@ -184,5 +184,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/code/SDL2/include/SDL_config_pandora.h b/code/SDL2/include/SDL_config_pandora.h index ea62fe59..d57a79f2 100644 --- a/code/SDL2/include/SDL_config_pandora.h +++ b/code/SDL2/include/SDL_config_pandora.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2017 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 @@ -36,22 +36,24 @@ #define SDL_BYTEORDER 1234 -#define HAVE_ALLOCA_H 1 -#define HAVE_SYS_TYPES_H 1 -#define HAVE_STDIO_H 1 #define STDC_HEADERS 1 -#define HAVE_STDLIB_H 1 -#define HAVE_STDARG_H 1 -#define HAVE_MALLOC_H 1 -#define HAVE_MEMORY_H 1 -#define HAVE_STRING_H 1 -#define HAVE_STRINGS_H 1 -#define HAVE_INTTYPES_H 1 -#define HAVE_STDINT_H 1 +#define HAVE_ALLOCA_H 1 #define HAVE_CTYPE_H 1 -#define HAVE_MATH_H 1 #define HAVE_ICONV_H 1 +#define HAVE_INTTYPES_H 1 +#define HAVE_LIMITS_H 1 +#define HAVE_MALLOC_H 1 +#define HAVE_MATH_H 1 +#define HAVE_MEMORY_H 1 #define HAVE_SIGNAL_H 1 +#define HAVE_STDARG_H 1 +#define HAVE_STDINT_H 1 +#define HAVE_STDIO_H 1 +#define HAVE_STDLIB_H 1 +#define HAVE_STRINGS_H 1 +#define HAVE_STRING_H 1 +#define HAVE_SYS_TYPES_H 1 + #define HAVE_MALLOC 1 #define HAVE_CALLOC 1 #define HAVE_REALLOC 1 @@ -68,7 +70,6 @@ #define HAVE_MEMCPY 1 #define HAVE_MEMMOVE 1 #define HAVE_STRLEN 1 -#define HAVE_STRDUP 1 #define HAVE_STRCHR 1 #define HAVE_STRRCHR 1 #define HAVE_STRSTR 1 @@ -89,9 +90,15 @@ #define HAVE_COPYSIGN 1 #define HAVE_COS 1 #define HAVE_COSF 1 +#define HAVE_EXP 1 #define HAVE_FABS 1 #define HAVE_FLOOR 1 #define HAVE_LOG 1 +#define HAVE_LOG10 1 +#define HAVE_LROUND 1 +#define HAVE_LROUNDF 1 +#define HAVE_ROUND 1 +#define HAVE_ROUNDF 1 #define HAVE_SCALBN 1 #define HAVE_SIN 1 #define HAVE_SINF 1 @@ -99,6 +106,8 @@ #define HAVE_SQRTF 1 #define HAVE_TAN 1 #define HAVE_TANF 1 +#define HAVE_TRUNC 1 +#define HAVE_TRUNCF 1 #define HAVE_SIGACTION 1 #define HAVE_SETJMP 1 #define HAVE_NANOSLEEP 1 @@ -107,10 +116,12 @@ #define SDL_AUDIO_DRIVER_OSS 1 #define SDL_INPUT_LINUXEV 1 -#define SDL_INPUT_TSLIB 1 #define SDL_JOYSTICK_LINUX 1 +#define SDL_JOYSTICK_VIRTUAL 1 #define SDL_HAPTIC_LINUX 1 +#define SDL_SENSOR_DUMMY 1 + #define SDL_LOADSO_DLOPEN 1 #define SDL_THREAD_PTHREAD 1 diff --git a/code/SDL2/include/SDL_config_psp.h b/code/SDL2/include/SDL_config_psp.h index 28efb4c5..235fe08e 100644 --- a/code/SDL2/include/SDL_config_psp.h +++ b/code/SDL2/include/SDL_config_psp.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2017 Sam Lantinga + Copyright (C) 1997-2020 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 @@ -33,16 +33,17 @@ #define HAVE_GCC_ATOMICS 1 -#define HAVE_ALLOCA_H 1 -#define HAVE_SYS_TYPES_H 1 -#define HAVE_STDIO_H 1 #define STDC_HEADERS 1 -#define HAVE_STRING_H 1 -#define HAVE_INTTYPES_H 1 -#define HAVE_STDINT_H 1 +#define HAVE_ALLOCA_H 1 #define HAVE_CTYPE_H 1 +#define HAVE_INTTYPES_H 1 +#define HAVE_LIMITS_H 1 #define HAVE_MATH_H 1 #define HAVE_SIGNAL_H 1 +#define HAVE_STDINT_H 1 +#define HAVE_STDIO_H 1 +#define HAVE_STRING_H 1 +#define HAVE_SYS_TYPES_H 1 /* C library functions */ #define HAVE_MALLOC 1 @@ -65,7 +66,6 @@ #define HAVE_STRLEN 1 #define HAVE_STRLCPY 1 #define HAVE_STRLCAT 1 -#define HAVE_STRDUP 1 #define HAVE_STRCHR 1 #define HAVE_STRRCHR 1 #define HAVE_STRSTR 1 @@ -83,19 +83,36 @@ #define HAVE_VSSCANF 1 #define HAVE_VSNPRINTF 1 #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_ACOS 1 -#define HAVE_ASIN 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_POW 1 +#define HAVE_POWF 1 #define HAVE_SCALBN 1 +#define HAVE_SCALBNF 1 #define HAVE_SIN 1 #define HAVE_SINF 1 #define HAVE_SQRT 1 @@ -111,22 +128,26 @@ /* PSP isn't that sophisticated */ #define LACKS_SYS_MMAN_H 1 -/* Enable the stub thread support (src/thread/psp/\*.c) */ +/* Enable the PSP thread support (src/thread/psp/\*.c) */ #define SDL_THREAD_PSP 1 -/* Enable the stub timer support (src/timer/psp/\*.c) */ +/* Enable the PSP timer support (src/timer/psp/\*.c) */ #define SDL_TIMERS_PSP 1 -/* Enable the stub joystick driver (src/joystick/psp/\*.c) */ +/* Enable the PSP joystick driver (src/joystick/psp/\*.c) */ #define SDL_JOYSTICK_PSP 1 +#define SDL_JOYSTICK_VIRTUAL 1 -/* Enable the stub audio driver (src/audio/psp/\*.c) */ +/* Enable the dummy sensor driver */ +#define SDL_SENSOR_DUMMY 1 + +/* Enable the PSP audio driver (src/audio/psp/\*.c) */ #define SDL_AUDIO_DRIVER_PSP 1 -/* PSP video dirver */ +/* PSP video driver */ #define SDL_VIDEO_DRIVER_PSP 1 -/* PSP render dirver */ +/* PSP render driver */ #define SDL_VIDEO_RENDER_PSP 1 #define SDL_POWER_PSP 1 diff --git a/code/SDL2/include/SDL_config_windows.h b/code/SDL2/include/SDL_config_windows.h index 2456c843..33436c41 100644 --- a/code/SDL2/include/SDL_config_windows.h +++ b/code/SDL2/include/SDL_config_windows.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2017 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 @@ -28,7 +28,7 @@ /* This is a set of defines to configure the SDL features */ #if !defined(_STDINT_H_) && (!defined(HAVE_STDINT_H) || !_HAVE_STDINT_H) -#if defined(__GNUC__) || defined(__DMC__) || defined(__WATCOMC__) +#if defined(__GNUC__) || defined(__DMC__) || defined(__WATCOMC__) || defined(__clang__) #define HAVE_STDINT_H 1 #elif defined(_MSC_VER) typedef signed __int8 int8_t; @@ -82,16 +82,28 @@ typedef unsigned int uintptr_t; #define HAVE_DSOUND_H 1 #define HAVE_DXGI_H 1 #define HAVE_XINPUT_H 1 +#define HAVE_MMDEVICEAPI_H 1 +#define HAVE_AUDIOCLIENT_H 1 +#define HAVE_SENSORSAPI_H 1 +#if (defined(_M_IX86) || defined(_M_X64) || defined(_M_AMD64)) && (defined(_MSC_VER) && _MSC_VER >= 1600) +#define HAVE_IMMINTRIN_H 1 +#elif defined(__has_include) && (defined(__i386__) || defined(__x86_64)) +# if __has_include() +# define HAVE_IMMINTRIN_H 1 +# endif +#endif /* This is disabled by default to avoid C runtime dependencies and manifest requirements */ #ifdef HAVE_LIBC /* Useful headers */ -#define HAVE_STDIO_H 1 #define STDC_HEADERS 1 -#define HAVE_STRING_H 1 #define HAVE_CTYPE_H 1 +#define HAVE_FLOAT_H 1 +#define HAVE_LIMITS_H 1 #define HAVE_MATH_H 1 #define HAVE_SIGNAL_H 1 +#define HAVE_STDIO_H 1 +#define HAVE_STRING_H 1 /* C library functions */ #define HAVE_MALLOC 1 @@ -107,13 +119,16 @@ typedef unsigned int uintptr_t; #define HAVE_MEMCMP 1 #define HAVE_STRLEN 1 #define HAVE__STRREV 1 -#define HAVE__STRUPR 1 -#define HAVE__STRLWR 1 +/* These functions have security warnings, so we won't use them */ +/* #undef HAVE__STRUPR */ +/* #undef HAVE__STRLWR */ #define HAVE_STRCHR 1 #define HAVE_STRRCHR 1 #define HAVE_STRSTR 1 -#define HAVE__LTOA 1 -#define HAVE__ULTOA 1 +/* #undef HAVE_STRTOK_R */ +/* These functions have security warnings, so we won't use them */ +/* #undef HAVE__LTOA */ +/* #undef HAVE__ULTOA */ #define HAVE_STRTOL 1 #define HAVE_STRTOUL 1 #define HAVE_STRTOD 1 @@ -123,28 +138,60 @@ typedef unsigned int uintptr_t; #define HAVE_STRNCMP 1 #define HAVE__STRICMP 1 #define HAVE__STRNICMP 1 -#define HAVE_ATAN 1 -#define HAVE_ATAN2 1 -#define HAVE_ACOS 1 -#define HAVE_ASIN 1 -#define HAVE_CEIL 1 -#define HAVE_COS 1 -#define HAVE_COSF 1 -#define HAVE_FABS 1 -#define HAVE_FLOOR 1 -#define HAVE_LOG 1 -#define HAVE_POW 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__WCSICMP 1 +#define HAVE__WCSNICMP 1 +#define HAVE__WCSDUP 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_CEILF 1 +#define HAVE__COPYSIGN 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_POW 1 +#define HAVE_POWF 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 +#if defined(_MSC_VER) +/* 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_COPYSIGN 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 +#define HAVE_TRUNCF 1 +#endif +/* This function is available with at least the VC++ 2008 C runtime library */ +#if _MSC_VER >= 1400 +#define HAVE__FSEEKI64 1 +#endif #endif #if !defined(_MSC_VER) || defined(_USE_MATH_DEFINES) #define HAVE_M_PI 1 @@ -154,24 +201,49 @@ typedef unsigned int uintptr_t; #define HAVE_STDDEF_H 1 #endif +/* Check to see if we have Windows 10 build environment */ +#if defined(_MSC_VER) && (_MSC_VER >= 1911) /* Visual Studio 15.3 */ +#include +#if _WIN32_WINNT >= 0x0601 /* Windows 7 */ +#define SDL_WINDOWS7_SDK +#endif +#if _WIN32_WINNT >= 0x0602 /* Windows 8 */ +#define SDL_WINDOWS8_SDK +#endif +#if _WIN32_WINNT >= 0x0A00 /* Windows 10 */ +#define SDL_WINDOWS10_SDK +#endif +#endif /* _MSC_VER >= 1911 */ + /* Enable various audio drivers */ #define SDL_AUDIO_DRIVER_WASAPI 1 #define SDL_AUDIO_DRIVER_DSOUND 1 -#define SDL_AUDIO_DRIVER_XAUDIO2 0 #define SDL_AUDIO_DRIVER_WINMM 1 #define SDL_AUDIO_DRIVER_DISK 1 #define SDL_AUDIO_DRIVER_DUMMY 1 /* 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 +/* Enable the sensor driver */ +#define SDL_SENSOR_WINDOWS 1 + /* Enable various shared object loading systems */ #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 */ @@ -184,8 +256,8 @@ typedef unsigned int uintptr_t; #ifndef SDL_VIDEO_RENDER_D3D #define SDL_VIDEO_RENDER_D3D 1 #endif -#ifndef SDL_VIDEO_RENDER_D3D11 -#define SDL_VIDEO_RENDER_D3D11 0 +#ifdef SDL_WINDOWS7_SDK +#define SDL_VIDEO_RENDER_D3D11 1 #endif /* Enable OpenGL support */ @@ -223,3 +295,5 @@ typedef unsigned int uintptr_t; #endif #endif /* SDL_config_windows_h_ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/code/SDL2/include/SDL_config_winrt.h b/code/SDL2/include/SDL_config_winrt.h index 24f9e17f..c6d5c135 100644 --- a/code/SDL2/include/SDL_config_winrt.h +++ b/code/SDL2/include/SDL_config_winrt.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2017 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 @@ -44,7 +44,7 @@ #if !defined(_STDINT_H_) && (!defined(HAVE_STDINT_H) || !_HAVE_STDINT_H) #if defined(__GNUC__) || defined(__DMC__) || defined(__WATCOMC__) -#define HAVE_STDINT_H 1 +#define HAVE_STDINT_H 1 #elif defined(_MSC_VER) typedef signed __int8 int8_t; typedef unsigned __int8 uint8_t; @@ -97,14 +97,19 @@ typedef unsigned int uintptr_t; #if WINAPI_FAMILY != WINAPI_FAMILY_PHONE_APP #define HAVE_XINPUT_H 1 #endif + +#define HAVE_MMDEVICEAPI_H 1 +#define HAVE_AUDIOCLIENT_H 1 + #define HAVE_LIBC 1 -#define HAVE_STDIO_H 1 #define STDC_HEADERS 1 -#define HAVE_STRING_H 1 #define HAVE_CTYPE_H 1 -#define HAVE_MATH_H 1 #define HAVE_FLOAT_H 1 +#define HAVE_LIMITS_H 1 +#define HAVE_MATH_H 1 #define HAVE_SIGNAL_H 1 +#define HAVE_STDIO_H 1 +#define HAVE_STRING_H 1 /* C library functions */ #define HAVE_MALLOC 1 @@ -121,16 +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_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 @@ -139,47 +141,79 @@ 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_ATAN 1 -#define HAVE_ATAN2 1 -#define HAVE_CEIL 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_COS 1 -#define HAVE_COSF 1 -#define HAVE_FABS 1 -#define HAVE_FLOOR 1 -#define HAVE_LOG 1 -#define HAVE_POW 1 -//#define HAVE_SCALBN 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__SCALB 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_SIN 1 +#define HAVE_SINF 1 +#define HAVE_SQRT 1 +#define HAVE_SQRTF 1 +#define HAVE_TAN 1 +#define HAVE_TANF 1 +#define HAVE_TRUNC 1 +#define HAVE_TRUNCF 1 #define HAVE__FSEEKI64 1 /* Enable various audio drivers */ -#define SDL_AUDIO_DRIVER_XAUDIO2 1 -#define SDL_AUDIO_DRIVER_DISK 1 -#define SDL_AUDIO_DRIVER_DUMMY 1 +#define SDL_AUDIO_DRIVER_WASAPI 1 +#define SDL_AUDIO_DRIVER_DISK 1 +#define SDL_AUDIO_DRIVER_DUMMY 1 /* Enable various input drivers */ #if WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP #define SDL_JOYSTICK_DISABLED 1 -#define SDL_HAPTIC_DISABLED 1 +#define SDL_HAPTIC_DISABLED 1 #else +#define SDL_JOYSTICK_VIRTUAL 1 #define SDL_JOYSTICK_XINPUT 1 #define SDL_HAPTIC_XINPUT 1 #endif +/* Enable the dummy sensor driver */ +#define SDL_SENSOR_DUMMY 1 + /* Enable various shared object loading systems */ -#define SDL_LOADSO_WINDOWS 1 +#define SDL_LOADSO_WINDOWS 1 /* 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() */ @@ -187,10 +221,10 @@ typedef unsigned int uintptr_t; #endif /* Enable various timer systems */ -#define SDL_TIMER_WINDOWS 1 +#define SDL_TIMER_WINDOWS 1 /* Enable various video drivers */ -#define SDL_VIDEO_DRIVER_WINRT 1 +#define SDL_VIDEO_DRIVER_WINRT 1 #define SDL_VIDEO_DRIVER_DUMMY 1 /* Enable OpenGL ES 2.0 (via a modified ANGLE library) */ @@ -209,7 +243,7 @@ typedef unsigned int uintptr_t; /* Enable assembly routines (Win64 doesn't have inline asm) */ #ifndef _WIN64 -#define SDL_ASSEMBLY_ROUTINES 1 +#define SDL_ASSEMBLY_ROUTINES 1 #endif #endif /* SDL_config_winrt_h_ */ diff --git a/code/SDL2/include/SDL_config_wiz.h b/code/SDL2/include/SDL_config_wiz.h index 5bb845a0..7c552f25 100644 --- a/code/SDL2/include/SDL_config_wiz.h +++ b/code/SDL2/include/SDL_config_wiz.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2017 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,22 +30,24 @@ #define SDL_BYTEORDER 1234 -#define HAVE_ALLOCA_H 1 -#define HAVE_SYS_TYPES_H 1 -#define HAVE_STDIO_H 1 #define STDC_HEADERS 1 -#define HAVE_STDLIB_H 1 -#define HAVE_STDARG_H 1 -#define HAVE_MALLOC_H 1 -#define HAVE_MEMORY_H 1 -#define HAVE_STRING_H 1 -#define HAVE_STRINGS_H 1 -#define HAVE_INTTYPES_H 1 -#define HAVE_STDINT_H 1 +#define HAVE_ALLOCA_H 1 #define HAVE_CTYPE_H 1 -#define HAVE_MATH_H 1 #define HAVE_ICONV_H 1 +#define HAVE_INTTYPES_H 1 +#define HAVE_LIMITS_H 1 +#define HAVE_MALLOC_H 1 +#define HAVE_MATH_H 1 +#define HAVE_MEMORY_H 1 #define HAVE_SIGNAL_H 1 +#define HAVE_STDARG_H 1 +#define HAVE_STDINT_H 1 +#define HAVE_STDIO_H 1 +#define HAVE_STDLIB_H 1 +#define HAVE_STRINGS_H 1 +#define HAVE_STRING_H 1 +#define HAVE_SYS_TYPES_H 1 + #define HAVE_MALLOC 1 #define HAVE_CALLOC 1 #define HAVE_REALLOC 1 @@ -62,10 +64,10 @@ #define HAVE_MEMCPY 1 #define HAVE_MEMMOVE 1 #define HAVE_STRLEN 1 -#define HAVE_STRDUP 1 #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 @@ -79,20 +81,48 @@ #define HAVE_VSSCANF 1 #define HAVE_VSNPRINTF 1 #define HAVE_M_PI 1 -#define HAVE_CEIL 1 -#define HAVE_COPYSIGN 1 -#define HAVE_COS 1 -#define HAVE_COSF 1 -#define HAVE_FABS 1 -#define HAVE_FLOOR 1 -#define HAVE_LOG 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_SIN 1 -#define HAVE_SINF 1 -#define HAVE_SQRT 1 -#define HAVE_SQRTF 1 -#define HAVE_TAN 1 -#define HAVE_TANF 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 #define HAVE_SIGACTION 1 #define HAVE_SETJMP 1 #define HAVE_NANOSLEEP 1 @@ -102,10 +132,12 @@ #define SDL_AUDIO_DRIVER_OSS 1 #define SDL_INPUT_LINUXEV 1 -#define SDL_INPUT_TSLIB 1 #define SDL_JOYSTICK_LINUX 1 +#define SDL_JOYSTICK_VIRTUAL 1 #define SDL_HAPTIC_LINUX 1 +#define SDL_SENSOR_DUMMY 1 + #define SDL_LOADSO_DLOPEN 1 #define SDL_THREAD_PTHREAD 1 diff --git a/code/SDL2/include/SDL_copying.h b/code/SDL2/include/SDL_copying.h index 8f60af6b..15616ace 100644 --- a/code/SDL2/include/SDL_copying.h +++ b/code/SDL2/include/SDL_copying.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2017 Sam Lantinga + Copyright (C) 1997-2018 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/code/SDL2/include/SDL_egl.h b/code/SDL2/include/SDL_egl.h index 223357e5..531441e6 100644 --- a/code/SDL2/include/SDL_egl.h +++ b/code/SDL2/include/SDL_egl.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2021 Sam Lantinga + Copyright (C) 1997-2020 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/code/SDL2/include/SDL_error.h b/code/SDL2/include/SDL_error.h index f61a200c..962d62f6 100644 --- a/code/SDL2/include/SDL_error.h +++ b/code/SDL2/include/SDL_error.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2021 Sam Lantinga + Copyright (C) 1997-2020 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 @@ -40,84 +40,41 @@ extern "C" { /** - * Set the SDL error message for the current thread. + * \brief Set the error message for the current thread * - * Calling this function will replace any previous error message that was set. - * - * This function always returns -1, since SDL frequently uses -1 to signify an - * failing result, leading to this idiom: - * - * ```c - * if (error_code) { - * return SDL_SetError("This operation has failed: %d", error_code); - * } - * ``` - * - * \param fmt a printf()-style message format string - * \param ... additional parameters matching % tokens in the `fmt` string, if - * any - * \returns always -1. - * - * \sa SDL_ClearError - * \sa SDL_GetError + * \return -1, there is no error handling for this function */ extern DECLSPEC int SDLCALL SDL_SetError(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(1); /** - * Retrieve a message about the last error that occurred on the current - * thread. + * \brief Get the last error message that was set * - * It is possible for multiple errors to occur before calling SDL_GetError(). - * Only the last error is returned. + * SDL API functions may set error messages and then succeed, so you should + * only use the error value if a function fails. + * + * This returns a pointer to a static buffer for convenience and should not + * be called by multiple threads simultaneously. * - * The message is only applicable when an SDL function has signaled an error. - * You must check the return values of SDL function calls to determine when to - * appropriately call SDL_GetError(). You should _not_ use the results of - * SDL_GetError() to decide if an error has occurred! Sometimes SDL will set - * an error string even when reporting success. - * - * SDL will _not_ clear the error string for successful API calls. You _must_ - * check return values for failure cases before you can assume the error - * string applies. - * - * Error strings are set per-thread, so an error set in a different thread - * will not interfere with the current thread's operation. - * - * The returned string is internally allocated and must not be freed by the - * application. - * - * \returns a message with information about the specific error that occurred, - * or an empty string if there hasn't been an error message set since - * the last call to SDL_ClearError(). The message is only applicable - * when an SDL function has signaled an error. You must check the - * return values of SDL function calls to determine when to - * appropriately call SDL_GetError(). - * - * \sa SDL_ClearError - * \sa SDL_SetError + * \return a pointer to the last error message that was set */ extern DECLSPEC const char *SDLCALL SDL_GetError(void); /** - * Get the last error message that was set for the current thread. + * \brief Get the last error message that was set for the current thread * - * This allows the caller to copy the error string into a provided buffer, but - * otherwise operates exactly the same as SDL_GetError(). + * SDL API functions may set error messages and then succeed, so you should + * only use the error value if a function fails. + * + * \param errstr A buffer to fill with the last error message that was set + * for the current thread + * \param maxlen The size of the buffer pointed to by the errstr parameter * - * \param errstr A buffer to fill with the last error message that was set for - * the current thread - * \param maxlen The size of the buffer pointed to by the errstr parameter - * \returns the pointer passed in as the `errstr` parameter. - * - * \sa SDL_GetError + * \return errstr */ extern DECLSPEC char * SDLCALL SDL_GetErrorMsg(char *errstr, int maxlen); /** - * Clear any previous error message for this thread. - * - * \sa SDL_GetError - * \sa SDL_SetError + * \brief Clear the error message for the current thread */ extern DECLSPEC void SDLCALL SDL_ClearError(void); diff --git a/code/SDL2/include/SDL_filesystem.h b/code/SDL2/include/SDL_filesystem.h index 9dbd28ff..fa6a1fa6 100644 --- a/code/SDL2/include/SDL_filesystem.h +++ b/code/SDL2/include/SDL_filesystem.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2021 Sam Lantinga + Copyright (C) 1997-2018 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 @@ -38,97 +38,88 @@ extern "C" { #endif /** - * Get the directory where the application was run from. + * \brief Get the path where the application resides. * - * This is not necessarily a fast call, so you should call this once near - * startup and save the string if you need it. + * Get the "base path". This is the directory where the application was run + * from, which is probably the installation directory, and may or may not + * be the process's current working directory. * - * **Mac OS X and iOS Specific Functionality**: If the application is in a - * ".app" bundle, this function returns the Resource directory (e.g. - * MyApp.app/Contents/Resources/). This behaviour can be overridden by adding - * a property to the Info.plist file. Adding a string key with the name - * SDL_FILESYSTEM_BASE_DIR_TYPE with a supported value will change the - * behaviour. + * This returns an absolute path in UTF-8 encoding, and is guaranteed to + * end with a path separator ('\\' on Windows, '/' most other places). * - * Supported values for the SDL_FILESYSTEM_BASE_DIR_TYPE property (Given an - * application in /Applications/SDLApp/MyApp.app): + * The pointer returned by this function is owned by you. Please call + * SDL_free() on the pointer when you are done with it, or it will be a + * memory leak. This is not necessarily a fast call, though, so you should + * call this once near startup and save the string if you need it. * - * - `resource`: bundle resource directory (the default). For example: - * `/Applications/SDLApp/MyApp.app/Contents/Resources` - * - `bundle`: the Bundle directory. Fpr example: - * `/Applications/SDLApp/MyApp.app/` - * - `parent`: the containing directory of the bundle. For example: - * `/Applications/SDLApp/` + * Some platforms can't determine the application's path, and on other + * platforms, this might be meaningless. In such cases, this function will + * return NULL. * - * The returned path is guaranteed to end with a path separator ('\' on - * Windows, '/' on most other platforms). - * - * The pointer returned is owned by the caller. Please call SDL_free() on the - * pointer when done with it. - * - * \returns an absolute path in UTF-8 encoding to the application data - * directory. NULL will be returned on error or when the platform - * doesn't implement this functionality, call SDL_GetError() for more - * information. - * - * \since This function is available since SDL 2.0.1. + * \return String of base dir in UTF-8 encoding, or NULL on error. * * \sa SDL_GetPrefPath */ extern DECLSPEC char *SDLCALL SDL_GetBasePath(void); /** - * Get the user-and-app-specific path where files can be written. + * \brief Get the user-and-app-specific path where files can be written. * * Get the "pref dir". This is meant to be where users can write personal - * files (preferences and save games, etc) that are specific to your - * application. This directory is unique per user, per application. + * files (preferences and save games, etc) that are specific to your + * application. This directory is unique per user, per application. * - * This function will decide the appropriate location in the native - * filesystem, create the directory if necessary, and return a string of the - * absolute path to the directory in UTF-8 encoding. + * This function will decide the appropriate location in the native filesystem, + * create the directory if necessary, and return a string of the absolute + * path to the directory in UTF-8 encoding. * * On Windows, the string might look like: + * "C:\\Users\\bob\\AppData\\Roaming\\My Company\\My Program Name\\" * - * `C:\\Users\\bob\\AppData\\Roaming\\My Company\\My Program Name\\` - * - * On Linux, the string might look like" - * - * `/home/bob/.local/share/My Program Name/` + * On Linux, the string might look like: + * "/home/bob/.local/share/My Program Name/" * * On Mac OS X, the string might look like: + * "/Users/bob/Library/Application Support/My Program Name/" * - * `/Users/bob/Library/Application Support/My Program Name/` + * (etc.) * - * You should assume the path returned by this function is the only safe place - * to write files (and that SDL_GetBasePath(), while it might be writable, or - * even the parent of the returned path, isn't where you should be writing - * things). + * You specify the name of your organization (if it's not a real organization, + * your name or an Internet domain you own might do) and the name of your + * application. These should be untranslated proper names. * - * Both the org and app strings may become part of a directory name, so please - * follow these rules: + * Both the org and app strings may become part of a directory name, so + * please follow these rules: * - * - Try to use the same org string (_including case-sensitivity_) for all - * your applications that use this function. - * - Always use a unique app string for each one, and make sure it never - * changes for an app once you've decided on it. - * - Unicode characters are legal, as long as it's UTF-8 encoded, but... - * - ...only use letters, numbers, and spaces. Avoid punctuation like "Game - * Name 2: Bad Guy's Revenge!" ... "Game Name 2" is sufficient. + * - Try to use the same org string (including case-sensitivity) for + * all your applications that use this function. + * - Always use a unique app string for each one, and make sure it never + * changes for an app once you've decided on it. + * - Unicode characters are legal, as long as it's UTF-8 encoded, but... + * - ...only use letters, numbers, and spaces. Avoid punctuation like + * "Game Name 2: Bad Guy's Revenge!" ... "Game Name 2" is sufficient. * - * The returned path is guaranteed to end with a path separator ('\' on - * Windows, '/' on most other platforms). + * This returns an absolute path in UTF-8 encoding, and is guaranteed to + * end with a path separator ('\\' on Windows, '/' most other places). * - * The pointer returned is owned by the caller. Please call SDL_free() on the - * pointer when done with it. + * The pointer returned by this function is owned by you. Please call + * SDL_free() on the pointer when you are done with it, or it will be a + * memory leak. This is not necessarily a fast call, though, so you should + * call this once near startup and save the string if you need it. * - * \param org the name of your organization - * \param app the name of your application - * \returns a UTF-8 string of the user directory in platform-dependent - * notation. NULL if there's a problem (creating directory failed, - * etc.). + * You should assume the path returned by this function is the only safe + * place to write files (and that SDL_GetBasePath(), while it might be + * writable, or even the parent of the returned path, aren't where you + * should be writing things). * - * \since This function is available since SDL 2.0.1. + * Some platforms can't determine the pref path, and on other + * platforms, this might be meaningless. In such cases, this function will + * return NULL. + * + * \param org The name of your organization. + * \param app The name of your application. + * \return UTF-8 string of user dir in platform-dependent notation. NULL + * if there's a problem (creating directory failed, etc). * * \sa SDL_GetBasePath */ diff --git a/code/SDL2/include/SDL_gesture.h b/code/SDL2/include/SDL_gesture.h index 530b3d57..b223d80d 100644 --- a/code/SDL2/include/SDL_gesture.h +++ b/code/SDL2/include/SDL_gesture.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2021 Sam Lantinga + Copyright (C) 1997-2018 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 @@ -46,66 +46,36 @@ typedef Sint64 SDL_GestureID; /* Function prototypes */ /** - * Begin recording a gesture on a specified touch device or all touch devices. + * \brief Begin Recording a gesture on the specified touch, or all touches (-1) * - * If the parameter `touchId` is -1 (i.e., all devices), this function will - * always return 1, regardless of whether there actually are any devices. * - * \param touchId the touch device id, or -1 for all touch devices - * \returns 1 on success or 0 if the specified device could not be found. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GetTouchDevice */ extern DECLSPEC int SDLCALL SDL_RecordGesture(SDL_TouchID touchId); /** - * Save all currently loaded Dollar Gesture templates. + * \brief Save all currently loaded Dollar Gesture templates * - * \param dst a SDL_RWops to save to - * \returns the number of saved templates on success or 0 on failure; call - * SDL_GetError() for more information. * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_LoadDollarTemplates - * \sa SDL_SaveDollarTemplate */ extern DECLSPEC int SDLCALL SDL_SaveAllDollarTemplates(SDL_RWops *dst); /** - * Save a currently loaded Dollar Gesture template. + * \brief Save a currently loaded Dollar Gesture template * - * \param gestureId a gesture id - * \param dst a SDL_RWops to save to - * \returns 1 on success or 0 on failure; call SDL_GetError() for more - * information. * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_LoadDollarTemplates - * \sa SDL_SaveAllDollarTemplates */ extern DECLSPEC int SDLCALL SDL_SaveDollarTemplate(SDL_GestureID gestureId,SDL_RWops *dst); /** - * Load Dollar Gesture templates from a file. + * \brief Load Dollar Gesture templates from a file * - * \param touchId a touch id - * \param src a SDL_RWops to load from - * \returns the number of loaded templates on success or a negative error code - * (or 0) on failure; call SDL_GetError() for more information. * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_SaveAllDollarTemplates - * \sa SDL_SaveDollarTemplate */ extern DECLSPEC int SDLCALL SDL_LoadDollarTemplates(SDL_TouchID touchId, SDL_RWops *src); + /* Ends C function definitions when using C++ */ #ifdef __cplusplus } diff --git a/code/SDL2/include/SDL_haptic.h b/code/SDL2/include/SDL_haptic.h index bb53ed38..c27da118 100644 --- a/code/SDL2/include/SDL_haptic.h +++ b/code/SDL2/include/SDL_haptic.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2021 Sam Lantinga + Copyright (C) 1997-2020 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 @@ -821,491 +821,418 @@ typedef union SDL_HapticEffect /* Function prototypes */ /** - * Count the number of haptic devices attached to the system. + * \brief Count the number of haptic devices attached to the system. * - * \returns the number of haptic devices detected on the system or a negative - * error code on failure; call SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_HapticName + * \return Number of haptic devices detected on the system. */ extern DECLSPEC int SDLCALL SDL_NumHaptics(void); /** - * Get the implementation dependent name of a haptic device. + * \brief Get the implementation dependent name of a haptic device. * - * This can be called before any joysticks are opened. If no name can be - * found, this function returns NULL. + * This can be called before any joysticks are opened. + * If no name can be found, this function returns NULL. * - * \param device_index index of the device to query. - * \returns the name of the device or NULL on failure; call SDL_GetError() for - * more information. + * \param device_index Index of the device to get its name. + * \return Name of the device or NULL on error. * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_NumHaptics + * \sa SDL_NumHaptics */ extern DECLSPEC const char *SDLCALL SDL_HapticName(int device_index); /** - * Open a haptic device for use. + * \brief Opens a haptic device for use. * - * The index passed as an argument refers to the N'th haptic device on this - * system. + * The index passed as an argument refers to the N'th haptic device on this + * system. * - * When opening a haptic device, its gain will be set to maximum and - * autocenter will be disabled. To modify these values use SDL_HapticSetGain() - * and SDL_HapticSetAutocenter(). + * When opening a haptic device, its gain will be set to maximum and + * autocenter will be disabled. To modify these values use + * SDL_HapticSetGain() and SDL_HapticSetAutocenter(). * - * \param device_index index of the device to open - * \returns the device identifier or NULL on failure; call SDL_GetError() for - * more information. + * \param device_index Index of the device to open. + * \return Device identifier or NULL on error. * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_HapticClose - * \sa SDL_HapticIndex - * \sa SDL_HapticOpenFromJoystick - * \sa SDL_HapticOpenFromMouse - * \sa SDL_HapticPause - * \sa SDL_HapticSetAutocenter - * \sa SDL_HapticSetGain - * \sa SDL_HapticStopAll + * \sa SDL_HapticIndex + * \sa SDL_HapticOpenFromMouse + * \sa SDL_HapticOpenFromJoystick + * \sa SDL_HapticClose + * \sa SDL_HapticSetGain + * \sa SDL_HapticSetAutocenter + * \sa SDL_HapticPause + * \sa SDL_HapticStopAll */ extern DECLSPEC SDL_Haptic *SDLCALL SDL_HapticOpen(int device_index); /** - * Check if the haptic device at the designated index has been opened. + * \brief Checks if the haptic device at index has been opened. * - * \param device_index the index of the device to query - * \returns 1 if it has been opened, 0 if it hasn't or on failure; call - * SDL_GetError() for more information. + * \param device_index Index to check to see if it has been opened. + * \return 1 if it has been opened or 0 if it hasn't. * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_HapticIndex - * \sa SDL_HapticOpen + * \sa SDL_HapticOpen + * \sa SDL_HapticIndex */ extern DECLSPEC int SDLCALL SDL_HapticOpened(int device_index); /** - * Get the index of a haptic device. + * \brief Gets the index of a haptic device. * - * \param haptic the SDL_Haptic device to query - * \returns the index of the specified haptic device or a negative error code - * on failure; call SDL_GetError() for more information. + * \param haptic Haptic device to get the index of. + * \return The index of the haptic device or -1 on error. * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_HapticOpen - * \sa SDL_HapticOpened + * \sa SDL_HapticOpen + * \sa SDL_HapticOpened */ extern DECLSPEC int SDLCALL SDL_HapticIndex(SDL_Haptic * haptic); /** - * Query whether or not the current mouse has haptic capabilities. + * \brief Gets whether or not the current mouse has haptic capabilities. * - * \returns SDL_TRUE if the mouse is haptic or SDL_FALSE if it isn't. + * \return SDL_TRUE if the mouse is haptic, SDL_FALSE if it isn't. * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_HapticOpenFromMouse + * \sa SDL_HapticOpenFromMouse */ extern DECLSPEC int SDLCALL SDL_MouseIsHaptic(void); /** - * Try to open a haptic device from the current mouse. + * \brief Tries to open a haptic device from the current mouse. * - * \returns the haptic device identifier or NULL on failure; call - * SDL_GetError() for more information. + * \return The haptic device identifier or NULL on error. * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_HapticOpen - * \sa SDL_MouseIsHaptic + * \sa SDL_MouseIsHaptic + * \sa SDL_HapticOpen */ extern DECLSPEC SDL_Haptic *SDLCALL SDL_HapticOpenFromMouse(void); /** - * Query if a joystick has haptic features. + * \brief Checks to see if a joystick has haptic features. * - * \param joystick the SDL_Joystick to test for haptic capabilities - * \returns SDL_TRUE if the joystick is haptic, SDL_FALSE if it isn't, or a - * negative error code on failure; call SDL_GetError() for more - * information. + * \param joystick Joystick to test for haptic capabilities. + * \return SDL_TRUE if the joystick is haptic, SDL_FALSE if it isn't + * or -1 if an error occurred. * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_HapticOpenFromJoystick + * \sa SDL_HapticOpenFromJoystick */ extern DECLSPEC int SDLCALL SDL_JoystickIsHaptic(SDL_Joystick * joystick); /** - * Open a haptic device for use from a joystick device. + * \brief Opens a haptic device for use from a joystick device. * - * You must still close the haptic device separately. It will not be closed - * with the joystick. + * You must still close the haptic device separately. It will not be closed + * with the joystick. * - * When opened from a joystick you should first close the haptic device before - * closing the joystick device. If not, on some implementations the haptic - * device will also get unallocated and you'll be unable to use force feedback - * on that device. + * When opening from a joystick you should first close the haptic device before + * closing the joystick device. If not, on some implementations the haptic + * device will also get unallocated and you'll be unable to use force feedback + * on that device. * - * \param joystick the SDL_Joystick to create a haptic device from - * \returns a valid haptic device identifier on success or NULL on failure; - * call SDL_GetError() for more information. + * \param joystick Joystick to create a haptic device from. + * \return A valid haptic device identifier on success or NULL on error. * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_HapticClose - * \sa SDL_HapticOpen - * \sa SDL_JoystickIsHaptic + * \sa SDL_HapticOpen + * \sa SDL_HapticClose */ extern DECLSPEC SDL_Haptic *SDLCALL SDL_HapticOpenFromJoystick(SDL_Joystick * joystick); /** - * Close a haptic device previously opened with SDL_HapticOpen(). + * \brief Closes a haptic device previously opened with SDL_HapticOpen(). * - * \param haptic the SDL_Haptic device to close - * - * \sa SDL_HapticOpen + * \param haptic Haptic device to close. */ extern DECLSPEC void SDLCALL SDL_HapticClose(SDL_Haptic * haptic); /** - * Get the number of effects a haptic device can store. + * \brief Returns the number of effects a haptic device can store. * - * On some platforms this isn't fully supported, and therefore is an - * approximation. Always check to see if your created effect was actually - * created and do not rely solely on SDL_HapticNumEffects(). + * On some platforms this isn't fully supported, and therefore is an + * approximation. Always check to see if your created effect was actually + * created and do not rely solely on SDL_HapticNumEffects(). * - * \param haptic the SDL_Haptic device to query - * \returns the number of effects the haptic device can store or a negative - * error code on failure; call SDL_GetError() for more information. + * \param haptic The haptic device to query effect max. + * \return The number of effects the haptic device can store or + * -1 on error. * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_HapticNumEffectsPlaying - * \sa SDL_HapticQuery + * \sa SDL_HapticNumEffectsPlaying + * \sa SDL_HapticQuery */ extern DECLSPEC int SDLCALL SDL_HapticNumEffects(SDL_Haptic * haptic); /** - * Get the number of effects a haptic device can play at the same time. + * \brief Returns the number of effects a haptic device can play at the same + * time. * - * This is not supported on all platforms, but will always return a value. + * This is not supported on all platforms, but will always return a value. + * Added here for the sake of completeness. * - * \param haptic the SDL_Haptic device to query maximum playing effects - * \returns the number of effects the haptic device can play at the same time - * or a negative error code on failure; call SDL_GetError() for more - * information. + * \param haptic The haptic device to query maximum playing effects. + * \return The number of effects the haptic device can play at the same time + * or -1 on error. * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_HapticNumEffects - * \sa SDL_HapticQuery + * \sa SDL_HapticNumEffects + * \sa SDL_HapticQuery */ extern DECLSPEC int SDLCALL SDL_HapticNumEffectsPlaying(SDL_Haptic * haptic); /** - * Get the haptic device's supported features in bitwise manner. + * \brief Gets the haptic device's supported features in bitwise manner. * - * \param haptic the SDL_Haptic device to query - * \returns a list of supported haptic features in bitwise manner (OR'd), or 0 - * on failure; call SDL_GetError() for more information. + * Example: + * \code + * if (SDL_HapticQuery(haptic) & SDL_HAPTIC_CONSTANT) { + * printf("We have constant haptic effect!\n"); + * } + * \endcode * - * \since This function is available since SDL 2.0.0. + * \param haptic The haptic device to query. + * \return Haptic features in bitwise manner (OR'd). * - * \sa SDL_HapticEffectSupported - * \sa SDL_HapticNumEffects + * \sa SDL_HapticNumEffects + * \sa SDL_HapticEffectSupported */ extern DECLSPEC unsigned int SDLCALL SDL_HapticQuery(SDL_Haptic * haptic); /** - * Get the number of haptic axes the device has. + * \brief Gets the number of haptic axes the device has. * - * The number of haptic axes might be useful if working with the - * SDL_HapticDirection effect. - * - * \param haptic the SDL_Haptic device to query - * \returns the number of axes on success or a negative error code on failure; - * call SDL_GetError() for more information. + * \sa SDL_HapticDirection */ extern DECLSPEC int SDLCALL SDL_HapticNumAxes(SDL_Haptic * haptic); /** - * Check to see if an effect is supported by a haptic device. + * \brief Checks to see if effect is supported by haptic. * - * \param haptic the SDL_Haptic device to query - * \param effect the desired effect to query - * \returns SDL_TRUE if effect is supported, SDL_FALSE if it isn't, or a - * negative error code on failure; call SDL_GetError() for more - * information. + * \param haptic Haptic device to check on. + * \param effect Effect to check to see if it is supported. + * \return SDL_TRUE if effect is supported, SDL_FALSE if it isn't or -1 on error. * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_HapticNewEffect - * \sa SDL_HapticQuery + * \sa SDL_HapticQuery + * \sa SDL_HapticNewEffect */ extern DECLSPEC int SDLCALL SDL_HapticEffectSupported(SDL_Haptic * haptic, SDL_HapticEffect * effect); /** - * Create a new haptic effect on a specified device. + * \brief Creates a new haptic effect on the device. * - * \param haptic an SDL_Haptic device to create the effect on - * \param effect an SDL_HapticEffect structure containing the properties of - * the effect to create - * \returns the ID of the effect on success or a negative error code on - * failure; call SDL_GetError() for more information. + * \param haptic Haptic device to create the effect on. + * \param effect Properties of the effect to create. + * \return The identifier of the effect on success or -1 on error. * - * \sa SDL_HapticDestroyEffect - * \sa SDL_HapticRunEffect - * \sa SDL_HapticUpdateEffect + * \sa SDL_HapticUpdateEffect + * \sa SDL_HapticRunEffect + * \sa SDL_HapticDestroyEffect */ extern DECLSPEC int SDLCALL SDL_HapticNewEffect(SDL_Haptic * haptic, SDL_HapticEffect * effect); /** - * Update the properties of an effect. + * \brief Updates the properties of an effect. * - * Can be used dynamically, although behavior when dynamically changing - * direction may be strange. Specifically the effect may re-upload itself and - * start playing from the start. You also cannot change the type either when - * running SDL_HapticUpdateEffect(). + * Can be used dynamically, although behavior when dynamically changing + * direction may be strange. Specifically the effect may reupload itself + * and start playing from the start. You cannot change the type either when + * running SDL_HapticUpdateEffect(). * - * \param haptic the SDL_Haptic device that has the effect - * \param effect the identifier of the effect to update - * \param data an SDL_HapticEffect structure containing the new effect - * properties to use - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \param haptic Haptic device that has the effect. + * \param effect Identifier of the effect to update. + * \param data New effect properties to use. + * \return 0 on success or -1 on error. * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_HapticDestroyEffect - * \sa SDL_HapticNewEffect - * \sa SDL_HapticRunEffect + * \sa SDL_HapticNewEffect + * \sa SDL_HapticRunEffect + * \sa SDL_HapticDestroyEffect */ extern DECLSPEC int SDLCALL SDL_HapticUpdateEffect(SDL_Haptic * haptic, int effect, SDL_HapticEffect * data); /** - * Run the haptic effect on its associated haptic device. + * \brief Runs the haptic effect on its associated haptic device. * - * To repeat the effect over and over indefinitely, set `iterations` to - * `SDL_HAPTIC_INFINITY`. (Repeats the envelope - attack and fade.) To make - * one instance of the effect last indefinitely (so the effect does not fade), - * set the effect's `length` in its structure/union to `SDL_HAPTIC_INFINITY` - * instead. + * If iterations are ::SDL_HAPTIC_INFINITY, it'll run the effect over and over + * repeating the envelope (attack and fade) every time. If you only want the + * effect to last forever, set ::SDL_HAPTIC_INFINITY in the effect's length + * parameter. * - * \param haptic the SDL_Haptic device to run the effect on - * \param effect the ID of the haptic effect to run - * \param iterations the number of iterations to run the effect; use - * `SDL_HAPTIC_INFINITY` to repeat forever - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \param haptic Haptic device to run the effect on. + * \param effect Identifier of the haptic effect to run. + * \param iterations Number of iterations to run the effect. Use + * ::SDL_HAPTIC_INFINITY for infinity. + * \return 0 on success or -1 on error. * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_HapticDestroyEffect - * \sa SDL_HapticGetEffectStatus - * \sa SDL_HapticStopEffect + * \sa SDL_HapticStopEffect + * \sa SDL_HapticDestroyEffect + * \sa SDL_HapticGetEffectStatus */ extern DECLSPEC int SDLCALL SDL_HapticRunEffect(SDL_Haptic * haptic, int effect, Uint32 iterations); /** - * Stop the haptic effect on its associated haptic device. + * \brief Stops the haptic effect on its associated haptic device. * - * * + * \param haptic Haptic device to stop the effect on. + * \param effect Identifier of the effect to stop. + * \return 0 on success or -1 on error. * - * \param haptic the SDL_Haptic device to stop the effect on - * \param effect the ID of the haptic effect to stop - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_HapticDestroyEffect - * \sa SDL_HapticRunEffect + * \sa SDL_HapticRunEffect + * \sa SDL_HapticDestroyEffect */ extern DECLSPEC int SDLCALL SDL_HapticStopEffect(SDL_Haptic * haptic, int effect); /** - * Destroy a haptic effect on the device. + * \brief Destroys a haptic effect on the device. * - * This will stop the effect if it's running. Effects are automatically - * destroyed when the device is closed. + * This will stop the effect if it's running. Effects are automatically + * destroyed when the device is closed. * - * \param haptic the SDL_Haptic device to destroy the effect on - * \param effect the ID of the haptic effect to destroy + * \param haptic Device to destroy the effect on. + * \param effect Identifier of the effect to destroy. * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_HapticNewEffect + * \sa SDL_HapticNewEffect */ extern DECLSPEC void SDLCALL SDL_HapticDestroyEffect(SDL_Haptic * haptic, int effect); /** - * Get the status of the current effect on the specified haptic device. + * \brief Gets the status of the current effect on the haptic device. * - * Device must support the SDL_HAPTIC_STATUS feature. + * Device must support the ::SDL_HAPTIC_STATUS feature. * - * \param haptic the SDL_Haptic device to query for the effect status on - * \param effect the ID of the haptic effect to query its status - * \returns 0 if it isn't playing, 1 if it is playing, or a negative error - * code on failure; call SDL_GetError() for more information. + * \param haptic Haptic device to query the effect status on. + * \param effect Identifier of the effect to query its status. + * \return 0 if it isn't playing, 1 if it is playing or -1 on error. * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_HapticRunEffect - * \sa SDL_HapticStopEffect + * \sa SDL_HapticRunEffect + * \sa SDL_HapticStopEffect */ extern DECLSPEC int SDLCALL SDL_HapticGetEffectStatus(SDL_Haptic * haptic, int effect); /** - * Set the global gain of the specified haptic device. + * \brief Sets the global gain of the device. * - * Device must support the SDL_HAPTIC_GAIN feature. + * Device must support the ::SDL_HAPTIC_GAIN feature. * - * The user may specify the maximum gain by setting the environment variable - * `SDL_HAPTIC_GAIN_MAX` which should be between 0 and 100. All calls to - * SDL_HapticSetGain() will scale linearly using `SDL_HAPTIC_GAIN_MAX` as the - * maximum. + * The user may specify the maximum gain by setting the environment variable + * SDL_HAPTIC_GAIN_MAX which should be between 0 and 100. All calls to + * SDL_HapticSetGain() will scale linearly using SDL_HAPTIC_GAIN_MAX as the + * maximum. * - * \param haptic the SDL_Haptic device to set the gain on - * \param gain value to set the gain to, should be between 0 and 100 (0 - 100) - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \param haptic Haptic device to set the gain on. + * \param gain Value to set the gain to, should be between 0 and 100. + * \return 0 on success or -1 on error. * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_HapticQuery + * \sa SDL_HapticQuery */ extern DECLSPEC int SDLCALL SDL_HapticSetGain(SDL_Haptic * haptic, int gain); /** - * Set the global autocenter of the device. + * \brief Sets the global autocenter of the device. * - * Autocenter should be between 0 and 100. Setting it to 0 will disable - * autocentering. + * Autocenter should be between 0 and 100. Setting it to 0 will disable + * autocentering. * - * Device must support the SDL_HAPTIC_AUTOCENTER feature. + * Device must support the ::SDL_HAPTIC_AUTOCENTER feature. * - * \param haptic the SDL_Haptic device to set autocentering on - * \param autocenter value to set autocenter to (0-100) - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \param haptic Haptic device to set autocentering on. + * \param autocenter Value to set autocenter to, 0 disables autocentering. + * \return 0 on success or -1 on error. * - * \sa SDL_HapticQuery + * \sa SDL_HapticQuery */ extern DECLSPEC int SDLCALL SDL_HapticSetAutocenter(SDL_Haptic * haptic, int autocenter); /** - * Pause a haptic device. + * \brief Pauses a haptic device. * - * Device must support the `SDL_HAPTIC_PAUSE` feature. Call - * SDL_HapticUnpause() to resume playback. + * Device must support the ::SDL_HAPTIC_PAUSE feature. Call + * SDL_HapticUnpause() to resume playback. * - * Do not modify the effects nor add new ones while the device is paused. That - * can cause all sorts of weird errors. + * Do not modify the effects nor add new ones while the device is paused. + * That can cause all sorts of weird errors. * - * \param haptic the SDL_Haptic device to pause - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \param haptic Haptic device to pause. + * \return 0 on success or -1 on error. * - * \sa SDL_HapticUnpause + * \sa SDL_HapticUnpause */ extern DECLSPEC int SDLCALL SDL_HapticPause(SDL_Haptic * haptic); /** - * Unpause a haptic device. + * \brief Unpauses a haptic device. * - * Call to unpause after SDL_HapticPause(). + * Call to unpause after SDL_HapticPause(). * - * \param haptic the SDL_Haptic device to unpause - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \param haptic Haptic device to unpause. + * \return 0 on success or -1 on error. * - * \sa SDL_HapticPause + * \sa SDL_HapticPause */ extern DECLSPEC int SDLCALL SDL_HapticUnpause(SDL_Haptic * haptic); /** - * Stop all the currently playing effects on a haptic device. + * \brief Stops all the currently playing effects on a haptic device. * - * \param haptic the SDL_Haptic device to stop - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \param haptic Haptic device to stop. + * \return 0 on success or -1 on error. */ extern DECLSPEC int SDLCALL SDL_HapticStopAll(SDL_Haptic * haptic); /** - * Check whether rumble is supported on a haptic device. + * \brief Checks to see if rumble is supported on a haptic device. * - * \param haptic haptic device to check for rumble support - * \returns SDL_TRUE if effect is supported, SDL_FALSE if it isn't, or a - * negative error code on failure; call SDL_GetError() for more - * information. + * \param haptic Haptic device to check to see if it supports rumble. + * \return SDL_TRUE if effect is supported, SDL_FALSE if it isn't or -1 on error. * - * \sa SDL_HapticRumbleInit - * \sa SDL_HapticRumblePlay - * \sa SDL_HapticRumbleStop + * \sa SDL_HapticRumbleInit + * \sa SDL_HapticRumblePlay + * \sa SDL_HapticRumbleStop */ extern DECLSPEC int SDLCALL SDL_HapticRumbleSupported(SDL_Haptic * haptic); /** - * Initialize a haptic device for simple rumble playback. + * \brief Initializes the haptic device for simple rumble playback. * - * \param haptic the haptic device to initialize for simple rumble playback - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \param haptic Haptic device to initialize for simple rumble playback. + * \return 0 on success or -1 on error. * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_HapticOpen - * \sa SDL_HapticRumblePlay - * \sa SDL_HapticRumbleStop - * \sa SDL_HapticRumbleSupported + * \sa SDL_HapticOpen + * \sa SDL_HapticRumbleSupported + * \sa SDL_HapticRumblePlay + * \sa SDL_HapticRumbleStop */ extern DECLSPEC int SDLCALL SDL_HapticRumbleInit(SDL_Haptic * haptic); /** - * Run a simple rumble effect on a haptic device. + * \brief Runs simple rumble on a haptic device * - * \param haptic the haptic device to play the rumble effect on - * \param strength strength of the rumble to play as a 0-1 float value - * \param length length of the rumble to play in milliseconds - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \param haptic Haptic device to play rumble effect on. + * \param strength Strength of the rumble to play as a 0-1 float value. + * \param length Length of the rumble to play in milliseconds. + * \return 0 on success or -1 on error. * - * \sa SDL_HapticRumbleInit - * \sa SDL_HapticRumbleStop - * \sa SDL_HapticRumbleSupported + * \sa SDL_HapticRumbleSupported + * \sa SDL_HapticRumbleInit + * \sa SDL_HapticRumbleStop */ extern DECLSPEC int SDLCALL SDL_HapticRumblePlay(SDL_Haptic * haptic, float strength, Uint32 length ); /** - * Stop the simple rumble on a haptic device. + * \brief Stops the simple rumble on a haptic device. * - * \param haptic the haptic device to stop the rumble effect on - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \param haptic Haptic to stop the rumble on. + * \return 0 on success or -1 on error. * - * \sa SDL_HapticRumbleInit - * \sa SDL_HapticRumblePlay - * \sa SDL_HapticRumbleSupported + * \sa SDL_HapticRumbleSupported + * \sa SDL_HapticRumbleInit + * \sa SDL_HapticRumblePlay */ extern DECLSPEC int SDLCALL SDL_HapticRumbleStop(SDL_Haptic * haptic); diff --git a/code/SDL2/include/SDL_keyboard.h b/code/SDL2/include/SDL_keyboard.h index 4260b5e8..87482317 100644 --- a/code/SDL2/include/SDL_keyboard.h +++ b/code/SDL2/include/SDL_keyboard.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2021 Sam Lantinga + Copyright (C) 1997-2018 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 @@ -55,231 +55,154 @@ typedef struct SDL_Keysym /* Function prototypes */ /** - * Query the window which currently has keyboard focus. - * - * \returns the window with keyboard focus. + * \brief Get the window which currently has keyboard focus. */ extern DECLSPEC SDL_Window * SDLCALL SDL_GetKeyboardFocus(void); /** - * Get a snapshot of the current state of the keyboard. + * \brief Get a snapshot of the current state of the keyboard. * - * The pointer returned is a pointer to an internal SDL array. It will be - * valid for the whole lifetime of the application and should not be freed by - * the caller. + * \param numkeys if non-NULL, receives the length of the returned array. * - * A array element with a value of 1 means that the key is pressed and a value - * of 0 means that it is not. Indexes into this array are obtained by using - * SDL_Scancode values. + * \return An array of key states. Indexes into this array are obtained by using ::SDL_Scancode values. * - * Use SDL_PumpEvents() to update the state array. - * - * This function gives you the current state after all events have been - * processed, so if a key or button has been pressed and released before you - * process events, then the pressed state will never show up in the - * SDL_GetKeyboardState() calls. - * - * Note: This function doesn't take into account whether shift has been - * pressed or not. - * - * \param numkeys if non-NULL, receives the length of the returned array - * \returns a pointer to an array of key states. - * - * \sa SDL_PumpEvents + * \b Example: + * \code + * const Uint8 *state = SDL_GetKeyboardState(NULL); + * if ( state[SDL_SCANCODE_RETURN] ) { + * printf(" is pressed.\n"); + * } + * \endcode */ extern DECLSPEC const Uint8 *SDLCALL SDL_GetKeyboardState(int *numkeys); /** - * Get the current key modifier state for the keyboard. - * - * \returns an OR'd combination of the modifier keys for the keyboard. See - * SDL_Keymod for details. - * - * \sa SDL_GetKeyboardState - * \sa SDL_SetModState + * \brief Get the current key modifier state for the keyboard. */ extern DECLSPEC SDL_Keymod SDLCALL SDL_GetModState(void); /** - * Set the current key modifier state for the keyboard. + * \brief Set the current key modifier state for the keyboard. * - * The inverse of SDL_GetModState(), SDL_SetModState() allows you to impose - * modifier key states on your application. Simply pass your desired modifier - * states into `modstate`. This value may be a bitwise, OR'd combination of - * SDL_Keymod values. - * - * This does not change the keyboard state, only the key modifier flags that - * SDL reports. - * - * \param modstate the desired SDL_Keymod for the keyboard - * - * \sa SDL_GetModState + * \note This does not change the keyboard state, only the key modifier flags. */ extern DECLSPEC void SDLCALL SDL_SetModState(SDL_Keymod modstate); /** - * Get the key code corresponding to the given scancode according to the - * current keyboard layout. + * \brief Get the key code corresponding to the given scancode according + * to the current keyboard layout. * - * See SDL_Keycode for details. + * See ::SDL_Keycode for details. * - * \param scancode the desired SDL_Scancode to query - * \returns the SDL_Keycode that corresponds to the given SDL_Scancode. - * - * \sa SDL_GetKeyName - * \sa SDL_GetScancodeFromKey + * \sa SDL_GetKeyName() */ extern DECLSPEC SDL_Keycode SDLCALL SDL_GetKeyFromScancode(SDL_Scancode scancode); /** - * Get the scancode corresponding to the given key code according to the - * current keyboard layout. + * \brief Get the scancode corresponding to the given key code according to the + * current keyboard layout. * - * See SDL_Scancode for details. + * See ::SDL_Scancode for details. * - * \param key the desired SDL_Keycode to query - * \returns the SDL_Scancode that corresponds to the given SDL_Keycode. - * - * \sa SDL_GetKeyFromScancode - * \sa SDL_GetScancodeName + * \sa SDL_GetScancodeName() */ extern DECLSPEC SDL_Scancode SDLCALL SDL_GetScancodeFromKey(SDL_Keycode key); /** - * Get a human-readable name for a scancode. + * \brief Get a human-readable name for a scancode. * - * See SDL_Scancode for details. + * \return A pointer to the name for the scancode. + * If the scancode doesn't have a name, this function returns + * an empty string (""). * - * **Warning**: The returned name is by design not stable across platforms, - * e.g. the name for `SDL_SCANCODE_LGUI` is "Left GUI" under Linux but "Left - * Windows" under Microsoft Windows, and some scancodes like - * `SDL_SCANCODE_NONUSBACKSLASH` don't have any name at all. There are even - * scancodes that share names, e.g. `SDL_SCANCODE_RETURN` and - * `SDL_SCANCODE_RETURN2` (both called "Return"). This function is therefore - * unsuitable for creating a stable cross-platform two-way mapping between - * strings and scancodes. - * - * \param scancode the desired SDL_Scancode to query - * \returns a pointer to the name for the scancode. If the scancode doesn't - * have a name this function returns an empty string (""). - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GetScancodeFromKey - * \sa SDL_GetScancodeFromName + * \sa SDL_Scancode */ extern DECLSPEC const char *SDLCALL SDL_GetScancodeName(SDL_Scancode scancode); /** - * Get a scancode from a human-readable name. + * \brief Get a scancode from a human-readable name * - * \param name the human-readable scancode name - * \returns the SDL_Scancode, or `SDL_SCANCODE_UNKNOWN` if the name wasn't - * recognized; call SDL_GetError() for more information. + * \return scancode, or SDL_SCANCODE_UNKNOWN if the name wasn't recognized * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GetKeyFromName - * \sa SDL_GetScancodeFromKey - * \sa SDL_GetScancodeName + * \sa SDL_Scancode */ extern DECLSPEC SDL_Scancode SDLCALL SDL_GetScancodeFromName(const char *name); /** - * Get a human-readable name for a key. + * \brief Get a human-readable name for a key. * - * See SDL_Scancode and SDL_Keycode for details. + * \return A pointer to a UTF-8 string that stays valid at least until the next + * call to this function. If you need it around any longer, you must + * copy it. If the key doesn't have a name, this function returns an + * empty string (""). * - * \param key the desired SDL_Keycode to query - * \returns a pointer to a UTF-8 string that stays valid at least until the - * next call to this function. If you need it around any longer, you - * must copy it. If the key doesn't have a name, this function - * returns an empty string (""). - * - * \sa SDL_GetKeyFromName - * \sa SDL_GetKeyFromScancode - * \sa SDL_GetScancodeFromKey + * \sa SDL_Keycode */ extern DECLSPEC const char *SDLCALL SDL_GetKeyName(SDL_Keycode key); /** - * Get a key code from a human-readable name. + * \brief Get a key code from a human-readable name * - * \param name the human-readable key name - * \returns key code, or `SDLK_UNKNOWN` if the name wasn't recognized; call - * SDL_GetError() for more information. + * \return key code, or SDLK_UNKNOWN if the name wasn't recognized * - * \sa SDL_GetKeyFromScancode - * \sa SDL_GetKeyName - * \sa SDL_GetScancodeFromName + * \sa SDL_Keycode */ extern DECLSPEC SDL_Keycode SDLCALL SDL_GetKeyFromName(const char *name); /** - * Start accepting Unicode text input events. + * \brief Start accepting Unicode text input events. + * This function will show the on-screen keyboard if supported. * - * This function will start accepting Unicode text input events in the focused - * SDL window, and start emitting SDL_TextInputEvent (SDL_TEXTINPUT) and - * SDL_TextEditingEvent (SDL_TEXTEDITING) events. Please use this function in - * pair with SDL_StopTextInput(). - * - * On some platforms using this function activates the screen keyboard. - * - * \sa SDL_SetTextInputRect - * \sa SDL_StopTextInput + * \sa SDL_StopTextInput() + * \sa SDL_SetTextInputRect() + * \sa SDL_HasScreenKeyboardSupport() */ extern DECLSPEC void SDLCALL SDL_StartTextInput(void); /** - * Check whether or not Unicode text input events are enabled. + * \brief Return whether or not Unicode text input events are enabled. * - * \returns SDL_TRUE if text input events are enabled else SDL_FALSE. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_StartTextInput + * \sa SDL_StartTextInput() + * \sa SDL_StopTextInput() */ extern DECLSPEC SDL_bool SDLCALL SDL_IsTextInputActive(void); /** - * Stop receiving any text input events. + * \brief Stop receiving any text input events. + * This function will hide the on-screen keyboard if supported. * - * \sa SDL_StartTextInput + * \sa SDL_StartTextInput() + * \sa SDL_HasScreenKeyboardSupport() */ extern DECLSPEC void SDLCALL SDL_StopTextInput(void); /** - * Set the rectangle used to type Unicode text inputs. + * \brief Set the rectangle used to type Unicode text inputs. + * This is used as a hint for IME and on-screen keyboard placement. * - * \param rect the SDL_Rect structure representing the rectangle to receive - * text (ignored if NULL) - * - * \sa SDL_StartTextInput + * \sa SDL_StartTextInput() */ extern DECLSPEC void SDLCALL SDL_SetTextInputRect(SDL_Rect *rect); /** - * Check whether the platform has screen keyboard support. + * \brief Returns whether the platform has some screen keyboard support. * - * \returns SDL_TRUE if the platform has some screen keyboard support or - * SDL_FALSE if not. + * \return SDL_TRUE if some keyboard support is available else SDL_FALSE. * - * \since This function is available since SDL 2.0.0. + * \note Not all screen keyboard functions are supported on all platforms. * - * \sa SDL_StartTextInput - * \sa SDL_IsScreenKeyboardShown + * \sa SDL_IsScreenKeyboardShown() */ extern DECLSPEC SDL_bool SDLCALL SDL_HasScreenKeyboardSupport(void); /** - * Check whether the screen keyboard is shown for given window. + * \brief Returns whether the screen keyboard is shown for given window. * - * \param window the window for which screen keyboard should be queried - * \returns SDL_TRUE if screen keyboard is shown or SDL_FALSE if not. + * \param window The window for which screen keyboard should be queried. * - * \since This function is available since SDL 2.0.0. + * \return SDL_TRUE if screen keyboard is shown else SDL_FALSE. * - * \sa SDL_HasScreenKeyboardSupport + * \sa SDL_HasScreenKeyboardSupport() */ extern DECLSPEC SDL_bool SDLCALL SDL_IsScreenKeyboardShown(SDL_Window *window); diff --git a/code/SDL2/include/SDL_loadso.h b/code/SDL2/include/SDL_loadso.h index e6a33a0a..da56fb45 100644 --- a/code/SDL2/include/SDL_loadso.h +++ b/code/SDL2/include/SDL_loadso.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2021 Sam Lantinga + Copyright (C) 1997-2018 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 @@ -51,50 +51,22 @@ extern "C" { #endif /** - * Dynamically load a shared object. - * - * \param sofile a system-dependent name of the object file - * \returns an opaque pointer to the object handle or NULL if there was an - * error; call SDL_GetError() for more information. - * - * \sa SDL_LoadFunction - * \sa SDL_UnloadObject + * This function dynamically loads a shared object and returns a pointer + * to the object handle (or NULL if there was an error). + * The 'sofile' parameter is a system dependent name of the object file. */ extern DECLSPEC void *SDLCALL SDL_LoadObject(const char *sofile); /** - * Look up the address of the named function in a shared object. - * - * This function pointer is no longer valid after calling SDL_UnloadObject(). - * - * This function can only look up C function names. Other languages may have - * name mangling and intrinsic language support that varies from compiler to - * compiler. - * - * Make sure you declare your function pointers with the same calling - * convention as the actual library function. Your code will crash - * mysteriously if you do not do this. - * - * If the requested function doesn't exist, NULL is returned. - * - * \param handle a valid shared object handle returned by SDL_LoadObject() - * \param name the name of the function to look up - * \returns a pointer to the function or NULL if there was an error; call - * SDL_GetError() for more information. - * - * \sa SDL_LoadObject - * \sa SDL_UnloadObject + * Given an object handle, this function looks up the address of the + * named function in the shared object and returns it. This address + * is no longer valid after calling SDL_UnloadObject(). */ extern DECLSPEC void *SDLCALL SDL_LoadFunction(void *handle, const char *name); /** - * Unload a shared object from memory. - * - * \param handle a valid shared object handle returned by SDL_LoadObject() - * - * \sa SDL_LoadFunction - * \sa SDL_LoadObject + * Unload a shared object from memory. */ extern DECLSPEC void SDLCALL SDL_UnloadObject(void *handle); diff --git a/code/SDL2/include/SDL_locale.h b/code/SDL2/include/SDL_locale.h index cb4b0437..1f4b0c46 100644 --- a/code/SDL2/include/SDL_locale.h +++ b/code/SDL2/include/SDL_locale.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2021 Sam Lantinga + Copyright (C) 1997-2020 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 @@ -47,44 +47,44 @@ typedef struct SDL_Locale } SDL_Locale; /** - * Report the user's preferred locale. + * \brief Report the user's preferred locale. * - * This returns an array of SDL_Locale structs, the final item zeroed out. - * When the caller is done with this array, it should call SDL_free() on the - * returned value; all the memory involved is allocated in a single block, so - * a single SDL_free() will suffice. + * This returns an array of SDL_Locale structs, the final item zeroed out. + * When the caller is done with this array, it should call SDL_free() on + * the returned value; all the memory involved is allocated in a single + * block, so a single SDL_free() will suffice. * - * Returned language strings are in the format xx, where 'xx' is an ISO-639 - * language specifier (such as "en" for English, "de" for German, etc). - * Country strings are in the format YY, where "YY" is an ISO-3166 country - * code (such as "US" for the United States, "CA" for Canada, etc). Country - * might be NULL if there's no specific guidance on them (so you might get { - * "en", "US" } for American English, but { "en", NULL } means "English - * language, generically"). Language strings are never NULL, except to - * terminate the array. + * Returned language strings are in the format xx, where 'xx' is an ISO-639 + * language specifier (such as "en" for English, "de" for German, etc). + * Country strings are in the format YY, where "YY" is an ISO-3166 country + * code (such as "US" for the United States, "CA" for Canada, etc). Country + * might be NULL if there's no specific guidance on them (so you might get + * { "en", "US" } for American English, but { "en", NULL } means "English + * language, generically"). Language strings are never NULL, except to + * terminate the array. * - * Please note that not all of these strings are 2 characters; some are three - * or more. + * Please note that not all of these strings are 2 characters; some are + * three or more. * - * The returned list of locales are in the order of the user's preference. For - * example, a German citizen that is fluent in US English and knows enough - * Japanese to navigate around Tokyo might have a list like: { "de", "en_US", - * "jp", NULL }. Someone from England might prefer British English (where - * "color" is spelled "colour", etc), but will settle for anything like it: { - * "en_GB", "en", NULL }. + * The returned list of locales are in the order of the user's preference. + * For example, a German citizen that is fluent in US English and knows + * enough Japanese to navigate around Tokyo might have a list like: + * { "de", "en_US", "jp", NULL }. Someone from England might prefer British + * English (where "color" is spelled "colour", etc), but will settle for + * anything like it: { "en_GB", "en", NULL }. * - * This function returns NULL on error, including when the platform does not - * supply this information at all. + * This function returns NULL on error, including when the platform does not + * supply this information at all. * - * This might be a "slow" call that has to query the operating system. It's - * best to ask for this once and save the results. However, this list can - * change, usually because the user has changed a system preference outside of - * your program; SDL will send an SDL_LOCALECHANGED event in this case, if - * possible, and you can call this function again to get an updated copy of - * preferred locales. + * This might be a "slow" call that has to query the operating system. It's + * best to ask for this once and save the results. However, this list can + * change, usually because the user has changed a system preference outside + * of your program; SDL will send an SDL_LOCALECHANGED event in this case, + * if possible, and you can call this function again to get an updated copy + * of preferred locales. * - * \return array of locales, terminated with a locale with a NULL language - * field. Will return NULL on error. + * \return array of locales, terminated with a locale with a NULL language + * field. Will return NULL on error. */ extern DECLSPEC SDL_Locale * SDLCALL SDL_GetPreferredLocales(void); diff --git a/code/SDL2/include/SDL_log.h b/code/SDL2/include/SDL_log.h index e85961ac..c1751fd7 100644 --- a/code/SDL2/include/SDL_log.h +++ b/code/SDL2/include/SDL_log.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2021 Sam Lantinga + Copyright (C) 1997-2020 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,255 +112,90 @@ typedef enum /** - * Set the priority of all log categories. - * - * \param priority the SDL_LogPriority to assign - * - * \sa SDL_LogSetPriority + * \brief Set the priority of all log categories */ extern DECLSPEC void SDLCALL SDL_LogSetAllPriority(SDL_LogPriority priority); /** - * Set the priority of a particular log category. - * - * \param category the category to assign a priority to - * \param priority the SDL_LogPriority to assign - * - * \sa SDL_LogGetPriority - * \sa SDL_LogSetAllPriority + * \brief Set the priority of a particular log category */ extern DECLSPEC void SDLCALL SDL_LogSetPriority(int category, SDL_LogPriority priority); /** - * Get the priority of a particular log category. - * - * \param category the category to query - * \returns the SDL_LogPriority for the requested category - * - * \sa SDL_LogSetPriority + * \brief Get the priority of a particular log category */ extern DECLSPEC SDL_LogPriority SDLCALL SDL_LogGetPriority(int category); /** - * Reset all priorities to default. + * \brief Reset all priorities to default. * - * This is called by SDL_Quit(). - * - * \sa SDL_LogSetAllPriority - * \sa SDL_LogSetPriority + * \note This is called in SDL_Quit(). */ extern DECLSPEC void SDLCALL SDL_LogResetPriorities(void); /** - * Log a message with SDL_LOG_CATEGORY_APPLICATION and SDL_LOG_PRIORITY_INFO. - * - * = * \param fmt a printf() style message format string - * - * \param ... additional parameters matching % tokens in the `fmt` string, if - * any - * - * \sa SDL_LogCritical - * \sa SDL_LogDebug - * \sa SDL_LogError - * \sa SDL_LogInfo - * \sa SDL_LogMessage - * \sa SDL_LogMessageV - * \sa SDL_LogVerbose - * \sa SDL_LogWarn + * \brief Log a message with SDL_LOG_CATEGORY_APPLICATION and SDL_LOG_PRIORITY_INFO */ extern DECLSPEC void SDLCALL SDL_Log(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(1); /** - * Log a message with SDL_LOG_PRIORITY_VERBOSE. - * - * \param category the category of the message - * \param fmt a printf() style message format string - * \param ... additional parameters matching % tokens in the **fmt** string, - * if any - * - * \sa SDL_Log - * \sa SDL_LogCritical - * \sa SDL_LogDebug - * \sa SDL_LogError - * \sa SDL_LogInfo - * \sa SDL_LogMessage - * \sa SDL_LogMessageV - * \sa SDL_LogWarn + * \brief Log a message with SDL_LOG_PRIORITY_VERBOSE */ extern DECLSPEC void SDLCALL SDL_LogVerbose(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2); /** - * Log a message with SDL_LOG_PRIORITY_DEBUG. - * - * \param category the category of the message - * \param fmt a printf() style message format string - * \param ... additional parameters matching % tokens in the **fmt** string, - * if any - * - * \sa SDL_Log - * \sa SDL_LogCritical - * \sa SDL_LogError - * \sa SDL_LogInfo - * \sa SDL_LogMessage - * \sa SDL_LogMessageV - * \sa SDL_LogVerbose - * \sa SDL_LogWarn + * \brief Log a message with SDL_LOG_PRIORITY_DEBUG */ extern DECLSPEC void SDLCALL SDL_LogDebug(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2); /** - * Log a message with SDL_LOG_PRIORITY_INFO. - * - * \param category the category of the message - * \param fmt a printf() style message format string - * \param ... additional parameters matching % tokens in the **fmt** string, - * if any - * - * \sa SDL_Log - * \sa SDL_LogCritical - * \sa SDL_LogDebug - * \sa SDL_LogError - * \sa SDL_LogMessage - * \sa SDL_LogMessageV - * \sa SDL_LogVerbose - * \sa SDL_LogWarn + * \brief Log a message with SDL_LOG_PRIORITY_INFO */ extern DECLSPEC void SDLCALL SDL_LogInfo(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2); /** - * Log a message with SDL_LOG_PRIORITY_WARN. - * - * \param category the category of the message - * \param fmt a printf() style message format string - * \param ... additional parameters matching % tokens in the **fmt** string, - * if any - * - * \sa SDL_Log - * \sa SDL_LogCritical - * \sa SDL_LogDebug - * \sa SDL_LogError - * \sa SDL_LogInfo - * \sa SDL_LogMessage - * \sa SDL_LogMessageV - * \sa SDL_LogVerbose + * \brief Log a message with SDL_LOG_PRIORITY_WARN */ extern DECLSPEC void SDLCALL SDL_LogWarn(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2); /** - * Log a message with SDL_LOG_PRIORITY_ERROR. - * - * \param category the category of the message - * \param fmt a printf() style message format string - * \param ... additional parameters matching % tokens in the **fmt** string, - * if any - * - * \sa SDL_Log - * \sa SDL_LogCritical - * \sa SDL_LogDebug - * \sa SDL_LogInfo - * \sa SDL_LogMessage - * \sa SDL_LogMessageV - * \sa SDL_LogVerbose - * \sa SDL_LogWarn + * \brief Log a message with SDL_LOG_PRIORITY_ERROR */ extern DECLSPEC void SDLCALL SDL_LogError(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2); /** - * Log a message with SDL_LOG_PRIORITY_CRITICAL. - * - * \param category the category of the message - * \param fmt a printf() style message format string - * \param ... additional parameters matching % tokens in the **fmt** string, - * if any - * - * \sa SDL_Log - * \sa SDL_LogDebug - * \sa SDL_LogError - * \sa SDL_LogInfo - * \sa SDL_LogMessage - * \sa SDL_LogMessageV - * \sa SDL_LogVerbose - * \sa SDL_LogWarn + * \brief Log a message with SDL_LOG_PRIORITY_CRITICAL */ extern DECLSPEC void SDLCALL SDL_LogCritical(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2); /** - * Log a message with the specified category and priority. - * - * \param category the category of the message - * \param priority the priority of the message - * \param fmt a printf() style message format string - * \param ... additional parameters matching % tokens in the **fmt** string, - * if any - * - * \sa SDL_Log - * \sa SDL_LogCritical - * \sa SDL_LogDebug - * \sa SDL_LogError - * \sa SDL_LogInfo - * \sa SDL_LogMessageV - * \sa SDL_LogVerbose - * \sa SDL_LogWarn + * \brief Log a message with the specified category and priority. */ extern DECLSPEC void SDLCALL SDL_LogMessage(int category, SDL_LogPriority priority, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(3); /** - * Log a message with the specified category and priority. - * - * \param category the category of the message - * \param priority the priority of the message - * \param fmt a printf() style message format string - * \param ap a variable argument list - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_Log - * \sa SDL_LogCritical - * \sa SDL_LogDebug - * \sa SDL_LogError - * \sa SDL_LogInfo - * \sa SDL_LogMessage - * \sa SDL_LogVerbose - * \sa SDL_LogWarn + * \brief Log a message with the specified category and priority. */ extern DECLSPEC void SDLCALL SDL_LogMessageV(int category, SDL_LogPriority priority, const char *fmt, va_list ap); /** - * The prototype for the log output callback function. - * - * This function is called by SDL when there is new text to be logged. - * - * \param userdata what was passed as `userdata` to SDL_LogSetOutputFunction() - * \param category the category of the message - * \param priority the priority of the message - * \param message the message being output + * \brief The prototype for the log output function */ typedef void (SDLCALL *SDL_LogOutputFunction)(void *userdata, int category, SDL_LogPriority priority, const char *message); /** - * Get the current log output function. - * - * \param callback an SDL_LogOutputFunction filled in with the current log - * callback - * \param userdata a pointer filled in with the pointer that is passed to - * `callback` - * - * \sa SDL_LogSetOutputFunction + * \brief Get the current log output function. */ extern DECLSPEC void SDLCALL SDL_LogGetOutputFunction(SDL_LogOutputFunction *callback, void **userdata); /** - * Replace the default log output function with one of your own. - * - * \param callback an SDL_LogOutputFunction to call instead of the default - * \param userdata a pointer that is passed to `callback` - * - * \sa SDL_LogGetOutputFunction + * \brief This function allows you to replace the default log output + * function with one of your own. */ extern DECLSPEC void SDLCALL SDL_LogSetOutputFunction(SDL_LogOutputFunction callback, void *userdata); diff --git a/code/SDL2/include/SDL_main.h b/code/SDL2/include/SDL_main.h index 087193b2..fcb5c17d 100644 --- a/code/SDL2/include/SDL_main.h +++ b/code/SDL2/include/SDL_main.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2021 Sam Lantinga + Copyright (C) 1997-2020 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 @@ -122,22 +122,18 @@ extern SDLMAIN_DECLSPEC int SDL_main(int argc, char *argv[]); /** - * Circumvent failure of SDL_Init() when not using SDL_main() as an entry - * point. + * This is called by the real SDL main function to let the rest of the + * library know that initialization was done properly. * - * This function is defined in SDL_main.h, along with the preprocessor rule to - * redefine main() as SDL_main(). Thus to ensure that your main() function - * will not be changed it is necessary to define SDL_MAIN_HANDLED before - * including SDL.h. - * - * \sa SDL_Init + * Calling this yourself without knowing what you're doing can cause + * crashes and hard to diagnose problems with your application. */ extern DECLSPEC void SDLCALL SDL_SetMainReady(void); #ifdef __WIN32__ /** - * This can be called to set the application class at startup + * This can be called to set the application class at startup */ extern DECLSPEC int SDLCALL SDL_RegisterApp(char *name, Uint32 style, void *hInst); extern DECLSPEC void SDLCALL SDL_UnregisterApp(void); @@ -148,14 +144,12 @@ extern DECLSPEC void SDLCALL SDL_UnregisterApp(void); #ifdef __WINRT__ /** - * Initialize and launch an SDL/WinRT application. + * \brief Initializes and launches an SDL/WinRT application. * - * \param mainFunction the SDL app's C-style main(), an SDL_main_func - * \param reserved reserved for future use; should be NULL - * \returns 0 on success or -1 on failure; call SDL_GetError() to retrieve - * more information on the failure. - * - * \since This function is available since SDL 2.0.3. + * \param mainFunction The SDL app's C-style main(). + * \param reserved Reserved for future use; should be NULL + * \return 0 on success, -1 on failure. On failure, use SDL_GetError to retrieve more + * information on the failure. */ extern DECLSPEC int SDLCALL SDL_WinRTRunApp(SDL_main_func mainFunction, void * reserved); @@ -164,12 +158,12 @@ extern DECLSPEC int SDLCALL SDL_WinRTRunApp(SDL_main_func mainFunction, void * r #if defined(__IPHONEOS__) /** - * Initializes and launches an SDL application. + * \brief Initializes and launches an SDL application. * - * \param argc The argc parameter from the application's main() function - * \param argv The argv parameter from the application's main() function - * \param mainFunction The SDL app's C-style main(), an SDL_main_func - * \return the return value from mainFunction + * \param argc The argc parameter from the application's main() function + * \param argv The argv parameter from the application's main() function + * \param mainFunction The SDL app's C-style main(). + * \return the return value from mainFunction */ extern DECLSPEC int SDLCALL SDL_UIKitRunApp(int argc, char *argv[], SDL_main_func mainFunction); diff --git a/code/SDL2/include/SDL_messagebox.h b/code/SDL2/include/SDL_messagebox.h index c2aef70f..03639ce4 100644 --- a/code/SDL2/include/SDL_messagebox.h +++ b/code/SDL2/include/SDL_messagebox.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2021 Sam Lantinga + Copyright (C) 1997-2020 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 @@ -32,7 +32,7 @@ extern "C" { #endif /** - * SDL_MessageBox flags. If supported will display warning icon, etc. + * \brief SDL_MessageBox flags. If supported will display warning icon, etc. */ typedef enum { @@ -44,7 +44,7 @@ typedef enum } SDL_MessageBoxFlags; /** - * Flags for SDL_MessageBoxButtonData. + * \brief Flags for SDL_MessageBoxButtonData. */ typedef enum { @@ -53,7 +53,7 @@ typedef enum } SDL_MessageBoxButtonFlags; /** - * Individual button data. + * \brief Individual button data. */ typedef struct { @@ -63,7 +63,7 @@ typedef struct } SDL_MessageBoxButtonData; /** - * RGB value used in a message box color scheme + * \brief RGB value used in a message box color scheme */ typedef struct { @@ -81,7 +81,7 @@ typedef enum } SDL_MessageBoxColorType; /** - * A set of colors to use for message box dialogs + * \brief A set of colors to use for message box dialogs */ typedef struct { @@ -89,7 +89,7 @@ typedef struct } SDL_MessageBoxColorScheme; /** - * MessageBox structure containing title, text, window, etc. + * \brief MessageBox structure containing title, text, window, etc. */ typedef struct { @@ -105,77 +105,32 @@ typedef struct } SDL_MessageBoxData; /** - * Create a modal message box. + * \brief Create a modal message box. * - * If your needs aren't complex, it might be easier to use - * SDL_ShowSimpleMessageBox. + * \param messageboxdata The SDL_MessageBoxData structure with title, text, etc. + * \param buttonid The pointer to which user id of hit button should be copied. * - * This function should be called on the thread that created the parent - * window, or on the main thread if the messagebox has no parent. It will - * block execution of that thread until the user clicks a button or closes the - * messagebox. + * \return -1 on error, otherwise 0 and buttonid contains user id of button + * hit or -1 if dialog was closed. * - * This function may be called at any time, even before SDL_Init(). This makes - * it useful for reporting errors like a failure to create a renderer or - * OpenGL context. - * - * On X11, SDL rolls its own dialog box with X11 primitives instead of a - * formal toolkit like GTK+ or Qt. - * - * Note that if SDL_Init() would fail because there isn't any available video - * target, this function is likely to fail for the same reasons. If this is a - * concern, check the return value from this function and fall back to writing - * to stderr if you can. - * - * \param messageboxdata the SDL_MessageBoxData structure with title, text and - * other options - * \param buttonid the pointer to which user id of hit button should be copied - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_ShowSimpleMessageBox + * \note This function should be called on the thread that created the parent + * window, or on the main thread if the messagebox has no parent. It will + * block execution of that thread until the user clicks a button or + * closes the messagebox. */ extern DECLSPEC int SDLCALL SDL_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid); /** - * Display a simple modal message box. + * \brief Create a simple modal message box * - * If your needs aren't complex, this function is preferred over - * SDL_ShowMessageBox. + * \param flags ::SDL_MessageBoxFlags + * \param title UTF-8 title text + * \param message UTF-8 message text + * \param window The parent window, or NULL for no parent * - * `flags` may be any of the following: + * \return 0 on success, -1 on error * - * - `SDL_MESSAGEBOX_ERROR`: error dialog - * - `SDL_MESSAGEBOX_WARNING`: warning dialog - * - `SDL_MESSAGEBOX_INFORMATION`: informational dialog - * - * This function should be called on the thread that created the parent - * window, or on the main thread if the messagebox has no parent. It will - * block execution of that thread until the user clicks a button or closes the - * messagebox. - * - * This function may be called at any time, even before SDL_Init(). This makes - * it useful for reporting errors like a failure to create a renderer or - * OpenGL context. - * - * On X11, SDL rolls its own dialog box with X11 primitives instead of a - * formal toolkit like GTK+ or Qt. - * - * Note that if SDL_Init() would fail because there isn't any available video - * target, this function is likely to fail for the same reasons. If this is a - * concern, check the return value from this function and fall back to writing - * to stderr if you can. - * - * \param flags an SDL_MessageBoxFlags value - * \param title UTF-8 title text - * \param message UTF-8 message text - * \param window the parent window, or NULL for no parent - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \sa SDL_ShowMessageBox + * \sa SDL_ShowMessageBox */ extern DECLSPEC int SDLCALL SDL_ShowSimpleMessageBox(Uint32 flags, const char *title, const char *message, SDL_Window *window); diff --git a/code/SDL2/include/SDL_metal.h b/code/SDL2/include/SDL_metal.h index 60bcb6e1..f9673577 100644 --- a/code/SDL2/include/SDL_metal.h +++ b/code/SDL2/include/SDL_metal.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2021 Sam Lantinga + Copyright (C) 1997-2020 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 @@ -49,46 +49,59 @@ typedef void *SDL_MetalView; /* @{ */ /** - * Create a CAMetalLayer-backed NSView/UIView and attach it to the specified - * window. + * \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. + * 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. To access - * the backing CAMetalLayer, call SDL_Metal_GetLayer(). + * The returned handle can be casted directly to a NSView or UIView. + * To access the backing CAMetalLayer, call SDL_Metal_GetLayer(). * - * \sa SDL_Metal_DestroyView - * \sa SDL_Metal_GetLayer + * \note \a window must be created with the SDL_WINDOW_METAL flag. + * + * \sa SDL_Metal_DestroyView + * \sa SDL_Metal_GetLayer */ extern DECLSPEC SDL_MetalView SDLCALL SDL_Metal_CreateView(SDL_Window * window); /** - * Destroy an existing SDL_MetalView object. + * \brief Destroy an existing SDL_MetalView object. * - * This should be called before SDL_DestroyWindow, if SDL_Metal_CreateView was - * called after SDL_CreateWindow. + * This should be called before SDL_DestroyWindow, if SDL_Metal_CreateView was + * called after SDL_CreateWindow. * - * \sa SDL_Metal_CreateView + * \sa SDL_Metal_CreateView */ extern DECLSPEC void SDLCALL SDL_Metal_DestroyView(SDL_MetalView view); /** - * Get a pointer to the backing CAMetalLayer for the given view. + * \brief Get a pointer to the backing CAMetalLayer for the given view. * - * \sa SDL_MetalCreateView + * \sa SDL_MetalCreateView */ extern DECLSPEC void *SDLCALL SDL_Metal_GetLayer(SDL_MetalView view); /** - * Get the size of a window's underlying drawable in pixels (for use with - * setting viewport, scissor & etc). + * \brief Get the size of a window's underlying drawable in pixels (for use + * with setting viewport, scissor & etc). * - * \param window SDL_Window from which the drawable size should be queried - * \param w Pointer to variable for storing the width in pixels, may be NULL + * \param window SDL_Window from which the drawable size should be queried + * \param w Pointer to variable for storing the width in pixels, + * may be NULL + * \param h Pointer to variable for storing the height in pixels, + * may be NULL * - * \sa SDL_GetWindowSize - * \sa SDL_CreateWindow + * This may differ from SDL_GetWindowSize() if we're rendering to a high-DPI + * drawable, i.e. the window was created with SDL_WINDOW_ALLOW_HIGHDPI on a + * platform with high-DPI support (Apple calls this "Retina"), and not disabled + * by the \c SDL_HINT_VIDEO_HIGHDPI_DISABLED hint. + * + * \note On macOS high-DPI support must be enabled for an application by + * setting NSHighResolutionCapable to true in its Info.plist. + * + * \sa SDL_GetWindowSize() + * \sa SDL_CreateWindow() */ extern DECLSPEC void SDLCALL SDL_Metal_GetDrawableSize(SDL_Window* window, int *w, int *h); diff --git a/code/SDL2/include/SDL_misc.h b/code/SDL2/include/SDL_misc.h index 7cd4d578..a04f19ba 100644 --- a/code/SDL2/include/SDL_misc.h +++ b/code/SDL2/include/SDL_misc.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2021 Sam Lantinga + Copyright (C) 1997-2020 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 @@ -38,33 +38,29 @@ extern "C" { #endif /** - * Open a URL/URI in the browser or other appropriate external application. + * \brief Open an URL / URI in the browser or other * * Open a URL in a separate, system-provided application. How this works will - * vary wildly depending on the platform. This will likely launch what makes - * sense to handle a specific URL's protocol (a web browser for `http://`, - * etc), but it might also be able to launch file managers for directories and - * other things. + * vary wildly depending on the platform. This will likely launch what + * makes sense to handle a specific URL's protocol (a web browser for http://, + * etc), but it might also be able to launch file managers for directories + * and other things. * * What happens when you open a URL varies wildly as well: your game window - * may lose focus (and may or may not lose focus if your game was fullscreen - * or grabbing input at the time). On mobile devices, your app will likely - * move to the background or your process might be paused. Any given platform - * may or may not handle a given URL. + * may lose focus (and may or may not lose focus if your game was fullscreen + * or grabbing input at the time). On mobile devices, your app will likely + * move to the background or your process might be paused. Any given platform + * may or may not handle a given URL. * * If this is unimplemented (or simply unavailable) for a platform, this will - * fail with an error. A successful result does not mean the URL loaded, just - * that we launched _something_ to handle it (or at least believe we did). + * fail with an error. A successful result does not mean the URL loaded, just + * that we launched something to handle it (or at least believe we did). * * All this to say: this function can be useful, but you should definitely - * test it on every platform you target. + * test it on every platform you target. * - * \param url A valid URL/URI to open. Use `file:///full/path/to/file` for - * local files, if supported. - * \returns 0 on success, or -1 on error; call SDL_GetError() for more - * information. - * - * \since This function is available in SDL 2.0.14 and newer + * \param url A valid URL to open. + * \return 0 on success, or -1 on error. */ extern DECLSPEC int SDLCALL SDL_OpenURL(const char *url); diff --git a/code/SDL2/include/SDL_mouse.h b/code/SDL2/include/SDL_mouse.h index 8fbe38f8..d3c9f615 100644 --- a/code/SDL2/include/SDL_mouse.h +++ b/code/SDL2/include/SDL_mouse.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2021 Sam Lantinga + Copyright (C) 1997-2018 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 @@ -72,226 +72,150 @@ typedef enum /* Function prototypes */ /** - * Get the window which currently has mouse focus. - * - * \returns the window with mouse focus. + * \brief Get the window which currently has mouse focus. */ extern DECLSPEC SDL_Window * SDLCALL SDL_GetMouseFocus(void); /** - * Retrieve the current state of the mouse. + * \brief Retrieve the current state of the mouse. * - * The current button state is returned as a button bitmask, which can be - * tested using the `SDL_BUTTON(X)` macros (where `X` is generally 1 for the - * left, 2 for middle, 3 for the right button), and `x` and `y` are set to the - * mouse cursor position relative to the focus window. You can pass NULL for - * either `x` or `y`. - * - * \param x the x coordinate of the mouse cursor position relative to the - * focus window - * \param y the y coordinate of the mouse cursor position relative to the - * focus window - * \returns a 32-bit button bitmask of the current button state. - * - * \sa SDL_GetGlobalMouseState - * \sa SDL_GetRelativeMouseState - * \sa SDL_PumpEvents + * The current button state is returned as a button bitmask, which can + * be tested using the SDL_BUTTON(X) macros, and x and y are set to the + * mouse cursor position relative to the focus window for the currently + * selected mouse. You can pass NULL for either x or y. */ extern DECLSPEC Uint32 SDLCALL SDL_GetMouseState(int *x, int *y); /** - * Get the current state of the mouse in relation to the desktop. + * \brief Get the current state of the mouse, in relation to the desktop * - * This works similarly to SDL_GetMouseState(), but the coordinates will be - * reported relative to the top-left of the desktop. This can be useful if you - * need to track the mouse outside of a specific window and SDL_CaptureMouse() - * doesn't fit your needs. For example, it could be useful if you need to - * track the mouse while dragging a window, where coordinates relative to a - * window might not be in sync at all times. + * This works just like SDL_GetMouseState(), but the coordinates will be + * reported relative to the top-left of the desktop. This can be useful if + * you need to track the mouse outside of a specific window and + * SDL_CaptureMouse() doesn't fit your needs. For example, it could be + * useful if you need to track the mouse while dragging a window, where + * coordinates relative to a window might not be in sync at all times. * - * Note: SDL_GetMouseState() returns the mouse position as SDL understands it - * from the last pump of the event queue. This function, however, queries the - * OS for the current mouse position, and as such, might be a slightly less - * efficient function. Unless you know what you're doing and have a good - * reason to use this function, you probably want SDL_GetMouseState() instead. + * \note SDL_GetMouseState() returns the mouse position as SDL understands + * it from the last pump of the event queue. This function, however, + * queries the OS for the current mouse position, and as such, might + * be a slightly less efficient function. Unless you know what you're + * doing and have a good reason to use this function, you probably want + * SDL_GetMouseState() instead. * - * \param x filled in with the current X coord relative to the desktop; can be - * NULL - * \param y filled in with the current Y coord relative to the desktop; can be - * NULL - * \returns the current button state as a bitmask which can be tested using - * the SDL_BUTTON(X) macros. + * \param x Returns the current X coord, relative to the desktop. Can be NULL. + * \param y Returns the current Y coord, relative to the desktop. Can be NULL. + * \return The current button state as a bitmask, which can be tested using the SDL_BUTTON(X) macros. * - * \since This function is available since SDL 2.0.4. - * - * \sa SDL_CaptureMouse + * \sa SDL_GetMouseState */ extern DECLSPEC Uint32 SDLCALL SDL_GetGlobalMouseState(int *x, int *y); /** - * Retrieve the relative state of the mouse. + * \brief Retrieve the relative state of the mouse. * - * The current button state is returned as a button bitmask, which can be - * tested using the `SDL_BUTTON(X)` macros (where `X` is generally 1 for the - * left, 2 for middle, 3 for the right button), and `x` and `y` are set to the - * mouse deltas since the last call to SDL_GetRelativeMouseState() or since - * event initialization. You can pass NULL for either `x` or `y`. - * - * \param x a pointer filled with the last recorded x coordinate of the mouse - * \param y a pointer filled with the last recorded y coordinate of the mouse - * \returns a 32-bit button bitmask of the relative button state. - * - * \sa SDL_GetMouseState + * The current button state is returned as a button bitmask, which can + * be tested using the SDL_BUTTON(X) macros, and x and y are set to the + * mouse deltas since the last call to SDL_GetRelativeMouseState(). */ extern DECLSPEC Uint32 SDLCALL SDL_GetRelativeMouseState(int *x, int *y); /** - * Move the mouse cursor to the given position within the window. + * \brief Moves the mouse to the given position within the window. * - * This function generates a mouse motion event. + * \param window The window to move the mouse into, or NULL for the current mouse focus + * \param x The x coordinate within the window + * \param y The y coordinate within the window * - * Note that this function will appear to succeed, but not actually move the - * mouse when used over Microsoft Remote Desktop. - * - * \param window the window to move the mouse into, or NULL for the current - * mouse focus - * \param x the x coordinate within the window - * \param y the y coordinate within the window - * - * \sa SDL_WarpMouseGlobal + * \note This function generates a mouse motion event */ extern DECLSPEC void SDLCALL SDL_WarpMouseInWindow(SDL_Window * window, int x, int y); /** - * Move the mouse to the given position in global screen space. + * \brief Moves the mouse to the given position in global screen space. * - * This function generates a mouse motion event. + * \param x The x coordinate + * \param y The y coordinate + * \return 0 on success, -1 on error (usually: unsupported by a platform). * - * A failure of this function usually means that it is unsupported by a - * platform. - * - * Note that this function will appear to succeed, but not actually move the - * mouse when used over Microsoft Remote Desktop. - * - * \param x the x coordinate - * \param y the y coordinate - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.4. - * - * \sa SDL_WarpMouseInWindow + * \note This function generates a mouse motion event */ extern DECLSPEC int SDLCALL SDL_WarpMouseGlobal(int x, int y); /** - * Set relative mouse mode. + * \brief Set relative mouse mode. * - * While the mouse is in relative mode, the cursor is hidden, and the driver - * will try to report continuous motion in the current window. Only relative - * motion events will be delivered, the mouse position will not change. + * \param enabled Whether or not to enable relative mode * - * Note that this function will not be able to provide continuous relative - * motion when used over Microsoft Remote Desktop, instead motion is limited - * to the bounds of the screen. + * \return 0 on success, or -1 if relative mode is not supported. * - * This function will flush any pending mouse motion. + * While the mouse is in relative mode, the cursor is hidden, and the + * driver will try to report continuous motion in the current window. + * Only relative motion events will be delivered, the mouse position + * will not change. * - * \param enabled SDL_TRUE to enable relative mode, SDL_FALSE to disable. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \note This function will flush any pending mouse motion. * - * If relative mode is not supported, this returns -1. - * - * \sa SDL_GetRelativeMouseMode + * \sa SDL_GetRelativeMouseMode() */ extern DECLSPEC int SDLCALL SDL_SetRelativeMouseMode(SDL_bool enabled); /** - * Capture the mouse and to track input outside an SDL window. + * \brief Capture the mouse, to track input outside an SDL window. * - * Capturing enables your app to obtain mouse events globally, instead of just - * within your window. Not all video targets support this function. When - * capturing is enabled, the current window will get all mouse events, but - * unlike relative mode, no change is made to the cursor and it is not - * restrained to your window. + * \param enabled Whether or not to enable capturing * - * This function may also deny mouse input to other windows--both those in - * your application and others on the system--so you should use this function - * sparingly, and in small bursts. For example, you might want to track the - * mouse while the user is dragging something, until the user releases a mouse - * button. It is not recommended that you capture the mouse for long periods - * of time, such as the entire time your app is running. For that, you should - * probably use SDL_SetRelativeMouseMode() or SDL_SetWindowGrab(), depending - * on your goals. + * Capturing enables your app to obtain mouse events globally, instead of + * just within your window. Not all video targets support this function. + * When capturing is enabled, the current window will get all mouse events, + * but unlike relative mode, no change is made to the cursor and it is + * not restrained to your window. * - * While captured, mouse events still report coordinates relative to the - * current (foreground) window, but those coordinates may be outside the - * bounds of the window (including negative values). Capturing is only allowed - * for the foreground window. If the window loses focus while capturing, the - * capture will be disabled automatically. + * This function may also deny mouse input to other windows--both those in + * your application and others on the system--so you should use this + * function sparingly, and in small bursts. For example, you might want to + * track the mouse while the user is dragging something, until the user + * releases a mouse button. It is not recommended that you capture the mouse + * for long periods of time, such as the entire time your app is running. * - * While capturing is enabled, the current window will have the - * `SDL_WINDOW_MOUSE_CAPTURE` flag set. + * While captured, mouse events still report coordinates relative to the + * current (foreground) window, but those coordinates may be outside the + * bounds of the window (including negative values). Capturing is only + * allowed for the foreground window. If the window loses focus while + * capturing, the capture will be disabled automatically. * - * \param enabled SDL_TRUE to enable capturing, SDL_FALSE to disable. - * \returns 0 on success or -1 if not supported; call SDL_GetError() for more - * information. + * While capturing is enabled, the current window will have the + * SDL_WINDOW_MOUSE_CAPTURE flag set. * - * \since This function is available since SDL 2.0.4. - * - * \sa SDL_GetGlobalMouseState + * \return 0 on success, or -1 if not supported. */ extern DECLSPEC int SDLCALL SDL_CaptureMouse(SDL_bool enabled); /** - * Query whether relative mouse mode is enabled. + * \brief Query whether relative mouse mode is enabled. * - * \returns SDL_TRUE if relative mode is enabled or SDL_FALSE otherwise. - * - * \sa SDL_SetRelativeMouseMode + * \sa SDL_SetRelativeMouseMode() */ extern DECLSPEC SDL_bool SDLCALL SDL_GetRelativeMouseMode(void); /** - * Create a cursor using the specified bitmap data and mask (in MSB format). + * \brief Create a cursor, using the specified bitmap data and + * mask (in MSB format). * - * `mask` has to be in MSB (Most Significant Bit) format. + * The cursor width must be a multiple of 8 bits. * - * The cursor width (`w`) must be a multiple of 8 bits. + * The cursor is created in black and white according to the following: + * + * + * + * + * + * + *
data mask resulting pixel on screen
0 1 White
1 1 Black
0 0 Transparent
1 0 Inverted color if possible, black + * if not.
* - * The cursor is created in black and white according to the following: - * - * - data=0, mask=1: white - * - data=1, mask=1: black - * - data=0, mask=0: transparent - * - data=1, mask=0: inverted color if possible, black if not. - * - * Cursors created with this function must be freed with SDL_FreeCursor(). - * - * If you want to have a color cursor, or create your cursor from an - * SDL_Surface, you should use SDL_CreateColorCursor(). Alternately, you can - * hide the cursor and draw your own as part of your game's rendering, but it - * will be bound to the framerate. - * - * Also, since SDL 2.0.0, SDL_CreateSystemCursor() is available, which - * provides twelve readily available system cursors to pick from. - * - * \param data the color value for each pixel of the cursor - * \param mask the mask value for each pixel of the cursor - * \param w the width of the cursor - * \param h the height of the cursor - * \param hot_x the X-axis location of the upper left corner of the cursor - * relative to the actual mouse position - * \param hot_y the Y-axis location of the upper left corner of the cursor - * relative to the actual mouse position - * \returns a new cursor with the specified parameters on success or NULL on - * failure; call SDL_GetError() for more information. - * - * \sa SDL_FreeCursor - * \sa SDL_SetCursor - * \sa SDL_ShowCursor + * \sa SDL_FreeCursor() */ extern DECLSPEC SDL_Cursor *SDLCALL SDL_CreateCursor(const Uint8 * data, const Uint8 * mask, @@ -299,115 +223,60 @@ extern DECLSPEC SDL_Cursor *SDLCALL SDL_CreateCursor(const Uint8 * data, int hot_y); /** - * Create a color cursor. + * \brief Create a color cursor. * - * \param surface an SDL_Surface structure representing the cursor image - * \param hot_x the x position of the cursor hot spot - * \param hot_y the y position of the cursor hot spot - * \returns the new cursor on success or NULL on failure; call SDL_GetError() - * for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_CreateCursor - * \sa SDL_FreeCursor + * \sa SDL_FreeCursor() */ extern DECLSPEC SDL_Cursor *SDLCALL SDL_CreateColorCursor(SDL_Surface *surface, int hot_x, int hot_y); /** - * Create a system cursor. + * \brief Create a system cursor. * - * \param id an SDL_SystemCursor enum value - * \returns a cursor on success or NULL on failure; call SDL_GetError() for - * more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_FreeCursor + * \sa SDL_FreeCursor() */ extern DECLSPEC SDL_Cursor *SDLCALL SDL_CreateSystemCursor(SDL_SystemCursor id); /** - * Set the active cursor. - * - * This function sets the currently active cursor to the specified one. If the - * cursor is currently visible, the change will be immediately represented on - * the display. SDL_SetCursor(NULL) can be used to force cursor redraw, if - * this is desired for any reason. - * - * \param cursor a cursor to make active - * - * \sa SDL_CreateCursor - * \sa SDL_GetCursor - * \sa SDL_ShowCursor + * \brief Set the active cursor. */ extern DECLSPEC void SDLCALL SDL_SetCursor(SDL_Cursor * cursor); /** - * Get the active cursor. - * - * This function returns a pointer to the current cursor which is owned by the - * library. It is not necessary to free the cursor with SDL_FreeCursor(). - * - * \returns the active cursor or NULL if there is no mouse. - * - * \sa SDL_SetCursor + * \brief Return the active cursor. */ extern DECLSPEC SDL_Cursor *SDLCALL SDL_GetCursor(void); /** - * Get the default cursor. - * - * \returns the default cursor on success or NULL on failure. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_CreateSystemCursor + * \brief Return the default cursor. */ extern DECLSPEC SDL_Cursor *SDLCALL SDL_GetDefaultCursor(void); /** - * Free a previously-created cursor. + * \brief Frees a cursor created with SDL_CreateCursor() or similar functions. * - * Use this function to free cursor resources created with SDL_CreateCursor(), - * SDL_CreateColorCursor() or SDL_CreateSystemCursor(). - * - * \param cursor the cursor to free - * - * \sa SDL_CreateColorCursor - * \sa SDL_CreateCursor - * \sa SDL_CreateSystemCursor + * \sa SDL_CreateCursor() + * \sa SDL_CreateColorCursor() + * \sa SDL_CreateSystemCursor() */ extern DECLSPEC void SDLCALL SDL_FreeCursor(SDL_Cursor * cursor); /** - * Toggle whether or not the cursor is shown. + * \brief Toggle whether or not the cursor is shown. * - * The cursor starts off displayed but can be turned off. Passing `SDL_ENABLE` - * displays the cursor and passing `SDL_DISABLE` hides it. + * \param toggle 1 to show the cursor, 0 to hide it, -1 to query the current + * state. * - * The current state of the mouse cursor can be queried by passing - * `SDL_QUERY`; either `SDL_DISABLE` or `SDL_ENABLE` will be returned. - * - * \param toggle `SDL_ENABLE` to show the cursor, `SDL_DISABLE` to hide it, - * `SDL_QUERY` to query the current state without changing it. - * \returns `SDL_ENABLE` if the cursor is shown, or `SDL_DISABLE` if the - * cursor is hidden, or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \sa SDL_CreateCursor - * \sa SDL_SetCursor + * \return 1 if the cursor is shown, or 0 if the cursor is hidden. */ extern DECLSPEC int SDLCALL SDL_ShowCursor(int toggle); /** - * Used as a mask when testing buttons in buttonstate. - * - * - Button 1: Left mouse button - * - Button 2: Middle mouse button - * - Button 3: Right mouse button + * Used as a mask when testing buttons in buttonstate. + * - Button 1: Left mouse button + * - Button 2: Middle mouse button + * - Button 3: Right mouse button */ #define SDL_BUTTON(X) (1 << ((X)-1)) #define SDL_BUTTON_LEFT 1 @@ -421,6 +290,7 @@ extern DECLSPEC int SDLCALL SDL_ShowCursor(int toggle); #define SDL_BUTTON_X1MASK SDL_BUTTON(SDL_BUTTON_X1) #define SDL_BUTTON_X2MASK SDL_BUTTON(SDL_BUTTON_X2) + /* Ends C function definitions when using C++ */ #ifdef __cplusplus } diff --git a/code/SDL2/include/SDL_name.h b/code/SDL2/include/SDL_name.h index 21e1b798..ecd863f4 100644 --- a/code/SDL2/include/SDL_name.h +++ b/code/SDL2/include/SDL_name.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2021 Sam Lantinga + Copyright (C) 1997-2018 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/code/SDL2/include/SDL_opengl.h b/code/SDL2/include/SDL_opengl.h index 95b51ae4..253d9c93 100644 --- a/code/SDL2/include/SDL_opengl.h +++ b/code/SDL2/include/SDL_opengl.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2021 Sam Lantinga + Copyright (C) 1997-2018 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/code/SDL2/include/SDL_opengles.h b/code/SDL2/include/SDL_opengles.h index 7ebf4cc6..18dd984b 100644 --- a/code/SDL2/include/SDL_opengles.h +++ b/code/SDL2/include/SDL_opengles.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2021 Sam Lantinga + Copyright (C) 1997-2018 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/code/SDL2/include/SDL_opengles2.h b/code/SDL2/include/SDL_opengles2.h index ce114ae1..6ccecf21 100644 --- a/code/SDL2/include/SDL_opengles2.h +++ b/code/SDL2/include/SDL_opengles2.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2021 Sam Lantinga + Copyright (C) 1997-2018 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/code/SDL2/include/SDL_pixels.h b/code/SDL2/include/SDL_pixels.h index a6d464c7..aa90cbc2 100644 --- a/code/SDL2/include/SDL_pixels.h +++ b/code/SDL2/include/SDL_pixels.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2021 Sam Lantinga + Copyright (C) 1997-2020 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 @@ -345,29 +345,16 @@ typedef struct SDL_PixelFormat } SDL_PixelFormat; /** - * Get the human readable name of a pixel format. - * - * \param format the pixel format to query - * \returns the human readable name of the specified pixel format or - * `SDL_PIXELFORMAT_UNKNOWN` if the format isn't recognized. - * - * \since This function is available since SDL 2.0.0. + * \brief Get the human readable name of a pixel format */ extern DECLSPEC const char* SDLCALL SDL_GetPixelFormatName(Uint32 format); /** - * Convert one of the enumerated pixel formats to a bpp value and RGBA masks. + * \brief Convert one of the enumerated pixel formats to a bpp and RGBA masks. * - * \param format one of the SDL_PixelFormatEnum values - * \param bpp a bits per pixel value; usually 15, 16, or 32 - * \param Rmask a pointer filled in with the red mask for the format - * \param Gmask a pointer filled in with the green mask for the format - * \param Bmask a pointer filled in with the blue mask for the format - * \param Amask a pointer filled in with the alpha mask for the format - * \returns SDL_TRUE on success or SDL_FALSE if the conversion wasn't - * possible; call SDL_GetError() for more information. + * \return SDL_TRUE, or SDL_FALSE if the conversion wasn't possible. * - * \sa SDL_MasksToPixelFormatEnum + * \sa SDL_MasksToPixelFormatEnum() */ extern DECLSPEC SDL_bool SDLCALL SDL_PixelFormatEnumToMasks(Uint32 format, int *bpp, @@ -377,19 +364,12 @@ extern DECLSPEC SDL_bool SDLCALL SDL_PixelFormatEnumToMasks(Uint32 format, Uint32 * Amask); /** - * Convert a bpp value and RGBA masks to an enumerated pixel format. + * \brief Convert a bpp and RGBA masks to an enumerated pixel format. * - * This will return `SDL_PIXELFORMAT_UNKNOWN` if the conversion wasn't - * possible. + * \return The pixel format, or ::SDL_PIXELFORMAT_UNKNOWN if the conversion + * wasn't possible. * - * \param bpp a bits per pixel value; usually 15, 16, or 32 - * \param Rmask the red mask for the format - * \param Gmask the green mask for the format - * \param Bmask the blue mask for the format - * \param Amask the alpha mask for the format - * \returns one of the SDL_PixelFormatEnum values - * - * \sa SDL_PixelFormatEnumToMasks + * \sa SDL_PixelFormatEnumToMasks() */ extern DECLSPEC Uint32 SDLCALL SDL_MasksToPixelFormatEnum(int bpp, Uint32 Rmask, @@ -398,193 +378,84 @@ extern DECLSPEC Uint32 SDLCALL SDL_MasksToPixelFormatEnum(int bpp, Uint32 Amask); /** - * Create an SDL_PixelFormat structure corresponding to a pixel format. - * - * Returned structure may come from a shared global cache (i.e. not newly - * allocated), and hence should not be modified, especially the palette. Weird - * errors such as `Blit combination not supported` may occur. - * - * \param pixel_format one of the SDL_PixelFormatEnum values - * \returns the new SDL_PixelFormat structure or NULL on failure; call - * SDL_GetError() for more information. - * - * \sa SDL_FreeFormat + * \brief Create an SDL_PixelFormat structure from a pixel format enum. */ extern DECLSPEC SDL_PixelFormat * SDLCALL SDL_AllocFormat(Uint32 pixel_format); /** - * Free an SDL_PixelFormat structure allocated by SDL_AllocFormat(). - * - * \param format the SDL_PixelFormat structure to free - * - * \sa SDL_AllocFormat + * \brief Free an SDL_PixelFormat structure. */ extern DECLSPEC void SDLCALL SDL_FreeFormat(SDL_PixelFormat *format); /** - * Create a palette structure with the specified number of color entries. + * \brief Create a palette structure with the specified number of color + * entries. * - * The palette entries are initialized to white. + * \return A new palette, or NULL if there wasn't enough memory. * - * \param ncolors represents the number of color entries in the color palette - * \returns a new SDL_Palette structure on success or NULL on failure (e.g. if - * there wasn't enough memory); call SDL_GetError() for more - * information. + * \note The palette entries are initialized to white. * - * \sa SDL_FreePalette + * \sa SDL_FreePalette() */ extern DECLSPEC SDL_Palette *SDLCALL SDL_AllocPalette(int ncolors); /** - * Set the palette for a pixel format structure. - * - * \param format the SDL_PixelFormat structure that will use the palette - * \param palette the SDL_Palette structure that will be used - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \sa SDL_AllocPalette - * \sa SDL_FreePalette + * \brief Set the palette for a pixel format structure. */ extern DECLSPEC int SDLCALL SDL_SetPixelFormatPalette(SDL_PixelFormat * format, SDL_Palette *palette); /** - * Set a range of colors in a palette. + * \brief Set a range of colors in a palette. * - * \param palette the SDL_Palette structure to modify - * \param colors an array of SDL_Color structures to copy into the palette - * \param firstcolor the index of the first palette entry to modify - * \param ncolors the number of entries to modify - * \returns 0 on success or a negative error code if not all of the colors - * could be set; call SDL_GetError() for more information. + * \param palette The palette to modify. + * \param colors An array of colors to copy into the palette. + * \param firstcolor The index of the first palette entry to modify. + * \param ncolors The number of entries to modify. * - * \sa SDL_AllocPalette - * \sa SDL_CreateRGBSurface + * \return 0 on success, or -1 if not all of the colors could be set. */ extern DECLSPEC int SDLCALL SDL_SetPaletteColors(SDL_Palette * palette, const SDL_Color * colors, int firstcolor, int ncolors); /** - * Free a palette created with SDL_AllocPalette(). + * \brief Free a palette created with SDL_AllocPalette(). * - * \param palette the SDL_Palette structure to be freed - * - * \sa SDL_AllocPalette + * \sa SDL_AllocPalette() */ extern DECLSPEC void SDLCALL SDL_FreePalette(SDL_Palette * palette); /** - * Map an RGB triple to an opaque pixel value for a given pixel format. + * \brief Maps an RGB triple to an opaque pixel value for a given pixel format. * - * This function maps the RGB color value to the specified pixel format and - * returns the pixel value best approximating the given RGB color value for - * the given pixel format. - * - * If the format has a palette (8-bit) the index of the closest matching color - * in the palette will be returned. - * - * If the specified pixel format has an alpha component it will be returned as - * all 1 bits (fully opaque). - * - * If the pixel format bpp (color depth) is less than 32-bpp then the unused - * upper bits of the return value can safely be ignored (e.g., with a 16-bpp - * format the return value can be assigned to a Uint16, and similarly a Uint8 - * for an 8-bpp format). - * - * \param format an SDL_PixelFormat structure describing the pixel format - * \param r the red component of the pixel in the range 0-255 - * \param g the green component of the pixel in the range 0-255 - * \param b the blue component of the pixel in the range 0-255 - * \returns a pixel value - * - * \sa SDL_GetRGB - * \sa SDL_GetRGBA - * \sa SDL_MapRGBA + * \sa SDL_MapRGBA */ extern DECLSPEC Uint32 SDLCALL SDL_MapRGB(const SDL_PixelFormat * format, Uint8 r, Uint8 g, Uint8 b); /** - * Map an RGBA quadruple to a pixel value for a given pixel format. + * \brief Maps an RGBA quadruple to a pixel value for a given pixel format. * - * This function maps the RGBA color value to the specified pixel format and - * returns the pixel value best approximating the given RGBA color value for - * the given pixel format. - * - * If the specified pixel format has no alpha component the alpha value will - * be ignored (as it will be in formats with a palette). - * - * If the format has a palette (8-bit) the index of the closest matching color - * in the palette will be returned. - * - * If the pixel format bpp (color depth) is less than 32-bpp then the unused - * upper bits of the return value can safely be ignored (e.g., with a 16-bpp - * format the return value can be assigned to a Uint16, and similarly a Uint8 - * for an 8-bpp format). - * - * \param format an SDL_PixelFormat structure describing the format of the - * pixel - * \param r the red component of the pixel in the range 0-255 - * \param g the green component of the pixel in the range 0-255 - * \param b the blue component of the pixel in the range 0-255 - * \param a the alpha component of the pixel in the range 0-255 - * \returns a pixel value - * - * \sa SDL_GetRGB - * \sa SDL_GetRGBA - * \sa SDL_MapRGB + * \sa SDL_MapRGB */ extern DECLSPEC Uint32 SDLCALL SDL_MapRGBA(const SDL_PixelFormat * format, Uint8 r, Uint8 g, Uint8 b, Uint8 a); /** - * Get RGB values from a pixel in the specified format. + * \brief Get the RGB components from a pixel of the specified format. * - * This function uses the entire 8-bit [0..255] range when converting color - * components from pixel formats with less than 8-bits per RGB component - * (e.g., a completely white pixel in 16-bit RGB565 format would return [0xff, - * 0xff, 0xff] not [0xf8, 0xfc, 0xf8]). - * - * \param pixel a pixel value - * \param format an SDL_PixelFormat structure describing the format of the - * pixel - * \param r a pointer filled in with the red component - * \param g a pointer filled in with the green component - * \param b a pointer filled in with the blue component - * - * \sa SDL_GetRGBA - * \sa SDL_MapRGB - * \sa SDL_MapRGBA + * \sa SDL_GetRGBA */ extern DECLSPEC void SDLCALL SDL_GetRGB(Uint32 pixel, const SDL_PixelFormat * format, Uint8 * r, Uint8 * g, Uint8 * b); /** - * Get RGBA values from a pixel in the specified format. + * \brief Get the RGBA components from a pixel of the specified format. * - * This function uses the entire 8-bit [0..255] range when converting color - * components from pixel formats with less than 8-bits per RGB component - * (e.g., a completely white pixel in 16-bit RGB565 format would return [0xff, - * 0xff, 0xff] not [0xf8, 0xfc, 0xf8]). - * - * If the surface has no alpha component, the alpha will be returned as 0xff - * (100% opaque). - * - * \param pixel a pixel value - * \param format an SDL_PixelFormat structure describing the format of the - * pixel - * \param r a pointer filled in with the red component - * \param g a pointer filled in with the green component - * \param b a pointer filled in with the blue component - * \param a a pointer filled in with the alpha component - * - * \sa SDL_GetRGB - * \sa SDL_MapRGB - * \sa SDL_MapRGBA + * \sa SDL_GetRGB */ extern DECLSPEC void SDLCALL SDL_GetRGBA(Uint32 pixel, const SDL_PixelFormat * format, @@ -592,12 +463,7 @@ extern DECLSPEC void SDLCALL SDL_GetRGBA(Uint32 pixel, Uint8 * a); /** - * Calculate a 256 entry gamma ramp for a gamma value. - * - * \param gamma a gamma value where 0.0 is black and 1.0 is identity - * \param ramp an array of 256 values filled in with the gamma ramp - * - * \sa SDL_SetWindowGammaRamp + * \brief Calculate a 256 entry gamma ramp for a gamma value. */ extern DECLSPEC void SDLCALL SDL_CalculateGammaRamp(float gamma, Uint16 * ramp); diff --git a/code/SDL2/include/SDL_power.h b/code/SDL2/include/SDL_power.h index 872be184..a4fe8a93 100644 --- a/code/SDL2/include/SDL_power.h +++ b/code/SDL2/include/SDL_power.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2021 Sam Lantinga + Copyright (C) 1997-2018 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 @@ -37,7 +37,7 @@ extern "C" { #endif /** - * The basic state for the system's power supply. + * \brief The basic state for the system's power supply. */ typedef enum { @@ -50,28 +50,17 @@ typedef enum /** - * Get the current power supply details. + * \brief Get the current power supply details. * - * You should never take a battery status as absolute truth. Batteries - * (especially failing batteries) are delicate hardware, and the values - * reported here are best estimates based on what that hardware reports. It's - * not uncommon for older batteries to lose stored power much faster than it - * reports, or completely drain when reporting it has 20 percent left, etc. + * \param secs Seconds of battery life left. You can pass a NULL here if + * you don't care. Will return -1 if we can't determine a + * value, or we're not running on a battery. * - * Battery status can change at any time; if you are concerned with power - * state, you should call this function frequently, and perhaps ignore changes - * until they seem to be stable for a few seconds. + * \param pct Percentage of battery life left, between 0 and 100. You can + * pass a NULL here if you don't care. Will return -1 if we + * can't determine a value, or we're not running on a battery. * - * It's possible a platform can only report battery percentage or time left - * but not both. - * - * \param secs seconds of battery life left, you can pass a NULL here if you - * don't care, will return -1 if we can't determine a value, or - * we're not running on a battery - * \param pct percentage of battery life left, between 0 and 100, you can pass - * a NULL here if you don't care, will return -1 if we can't - * determine a value, or we're not running on a battery - * \returns an SDL_PowerState enum representing the current battery state. + * \return The state of the battery (if any). */ extern DECLSPEC SDL_PowerState SDLCALL SDL_GetPowerInfo(int *secs, int *pct); diff --git a/code/SDL2/include/SDL_quit.h b/code/SDL2/include/SDL_quit.h index 28250500..fea56a8d 100644 --- a/code/SDL2/include/SDL_quit.h +++ b/code/SDL2/include/SDL_quit.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2021 Sam Lantinga + Copyright (C) 1997-2018 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/code/SDL2/include/SDL_rect.h b/code/SDL2/include/SDL_rect.h index a17ea44f..47f0d207 100644 --- a/code/SDL2/include/SDL_rect.h +++ b/code/SDL2/include/SDL_rect.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2021 Sam Lantinga + Copyright (C) 1997-2020 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 @@ -40,10 +40,10 @@ extern "C" { #endif /** - * The structure that defines a point (integer) + * \brief The structure that defines a point (integer) * - * \sa SDL_EnclosePoints - * \sa SDL_PointInRect + * \sa SDL_EnclosePoints + * \sa SDL_PointInRect */ typedef struct SDL_Point { @@ -52,10 +52,10 @@ typedef struct SDL_Point } SDL_Point; /** - * The structure that defines a point (floating point) + * \brief The structure that defines a point (floating point) * - * \sa SDL_EnclosePoints - * \sa SDL_PointInRect + * \sa SDL_EnclosePoints + * \sa SDL_PointInRect */ typedef struct SDL_FPoint { @@ -65,14 +65,14 @@ typedef struct SDL_FPoint /** - * A rectangle, with the origin at the upper left (integer). + * \brief A rectangle, with the origin at the upper left (integer). * - * \sa SDL_RectEmpty - * \sa SDL_RectEquals - * \sa SDL_HasIntersection - * \sa SDL_IntersectRect - * \sa SDL_UnionRect - * \sa SDL_EnclosePoints + * \sa SDL_RectEmpty + * \sa SDL_RectEquals + * \sa SDL_HasIntersection + * \sa SDL_IntersectRect + * \sa SDL_UnionRect + * \sa SDL_EnclosePoints */ typedef struct SDL_Rect { @@ -82,7 +82,7 @@ typedef struct SDL_Rect /** - * A rectangle, with the origin at the upper left (floating point). + * \brief A rectangle, with the origin at the upper left (floating point). */ typedef struct SDL_FRect { @@ -94,7 +94,7 @@ typedef struct SDL_FRect /** - * Returns true if point resides inside a rectangle. + * \brief Returns true if point resides inside a rectangle. */ SDL_FORCE_INLINE SDL_bool SDL_PointInRect(const SDL_Point *p, const SDL_Rect *r) { @@ -103,7 +103,7 @@ SDL_FORCE_INLINE SDL_bool SDL_PointInRect(const SDL_Point *p, const SDL_Rect *r) } /** - * Returns true if the rectangle has no area. + * \brief Returns true if the rectangle has no area. */ SDL_FORCE_INLINE SDL_bool SDL_RectEmpty(const SDL_Rect *r) { @@ -111,7 +111,7 @@ SDL_FORCE_INLINE SDL_bool SDL_RectEmpty(const SDL_Rect *r) } /** - * Returns true if the two rectangles are equal. + * \brief Returns true if the two rectangles are equal. */ SDL_FORCE_INLINE SDL_bool SDL_RectEquals(const SDL_Rect *a, const SDL_Rect *b) { @@ -120,66 +120,33 @@ SDL_FORCE_INLINE SDL_bool SDL_RectEquals(const SDL_Rect *a, const SDL_Rect *b) } /** - * Determine whether two rectangles intersect. + * \brief Determine whether two rectangles intersect. * - * If either pointer is NULL the function will return SDL_FALSE. - * - * \param A an SDL_Rect structure representing the first rectangle - * \param B an SDL_Rect structure representing the second rectangle - * \returns SDL_TRUE if there is an intersection, SDL_FALSE otherwise. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_IntersectRect + * \return SDL_TRUE if there is an intersection, SDL_FALSE otherwise. */ extern DECLSPEC SDL_bool SDLCALL SDL_HasIntersection(const SDL_Rect * A, const SDL_Rect * B); /** - * Calculate the intersection of two rectangles. + * \brief Calculate the intersection of two rectangles. * - * If `result` is NULL then this function will return SDL_FALSE. - * - * \param A an SDL_Rect structure representing the first rectangle - * \param B an SDL_Rect structure representing the second rectangle - * \param result an SDL_Rect structure filled in with the intersection of - * rectangles `A` and `B` - * \returns SDL_TRUE if there is an intersection, SDL_FALSE otherwise. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_HasIntersection + * \return SDL_TRUE if there is an intersection, SDL_FALSE otherwise. */ extern DECLSPEC SDL_bool SDLCALL SDL_IntersectRect(const SDL_Rect * A, const SDL_Rect * B, SDL_Rect * result); /** - * Calculate the union of two rectangles. - * - * \param A an SDL_Rect structure representing the first rectangle - * \param B an SDL_Rect structure representing the second rectangle - * \param result an SDL_Rect structure filled in with the union of rectangles - * `A` and `B` + * \brief Calculate the union of two rectangles. */ extern DECLSPEC void SDLCALL SDL_UnionRect(const SDL_Rect * A, const SDL_Rect * B, SDL_Rect * result); /** - * Calculate a minimal rectangle enclosing a set of points. + * \brief Calculate a minimal rectangle enclosing a set of points * - * If `clip` is not NULL then only points inside of the clipping rectangle are - * considered. - * - * \param points an array of SDL_Point structures representing points to be - * enclosed - * \param count the number of structures in the `points` array - * \param clip an SDL_Rect used for clipping or NULL to enclose all points - * \param result an SDL_Rect structure filled in with the minimal enclosing - * rectangle - * \returns SDL_TRUE if any points were enclosed or SDL_FALSE if all the - * points were outside of the clipping rectangle. + * \return SDL_TRUE if any points were within the clipping rect */ extern DECLSPEC SDL_bool SDLCALL SDL_EnclosePoints(const SDL_Point * points, int count, @@ -187,20 +154,9 @@ extern DECLSPEC SDL_bool SDLCALL SDL_EnclosePoints(const SDL_Point * points, SDL_Rect * result); /** - * Calculate the intersection of a rectangle and line segment. + * \brief Calculate the intersection of a rectangle and line segment. * - * This function is used to clip a line segment to a rectangle. A line segment - * contained entirely within the rectangle or that does not intersect will - * remain unchanged. A line segment that crosses the rectangle at either or - * both ends will be clipped to the boundary of the rectangle and the new - * coordinates saved in `X1`, `Y1`, `X2`, and/or `Y2` as necessary. - * - * \param rect an SDL_Rect structure representing the rectangle to intersect - * \param X1 a pointer to the starting X-coordinate of the line - * \param Y1 a pointer to the starting Y-coordinate of the line - * \param X2 a pointer to the ending X-coordinate of the line - * \param Y2 a pointer to the ending Y-coordinate of the line - * \returns SDL_TRUE if there is an intersection, SDL_FALSE otherwise. + * \return SDL_TRUE if there is an intersection, SDL_FALSE otherwise. */ extern DECLSPEC SDL_bool SDLCALL SDL_IntersectRectAndLine(const SDL_Rect * rect, int *X1, diff --git a/code/SDL2/include/SDL_scancode.h b/code/SDL2/include/SDL_scancode.h index e54c1e00..63871aa3 100644 --- a/code/SDL2/include/SDL_scancode.h +++ b/code/SDL2/include/SDL_scancode.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2021 Sam Lantinga + Copyright (C) 1997-2018 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 @@ -38,7 +38,7 @@ * SDL_Event structure. * * The values in this enumeration are based on the USB usage page standard: - * https://www.usb.org/sites/default/files/documents/hut1_12v2.pdf + * http://www.usb.org/developers/hidpage/Hut1_12v2.pdf */ typedef enum { diff --git a/code/SDL2/include/SDL_sensor.h b/code/SDL2/include/SDL_sensor.h index 3bab8a4e..e6236341 100644 --- a/code/SDL2/include/SDL_sensor.h +++ b/code/SDL2/include/SDL_sensor.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2021 Sam Lantinga + Copyright (C) 1997-2020 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 @@ -130,130 +130,126 @@ typedef enum * If you are using the sensor API or handling events from multiple threads * you should use these locking functions to protect access to the sensors. * - * In particular, you are guaranteed that the sensor list won't change, so the - * API functions that take a sensor index will be valid, and sensor events - * will not be delivered. + * In particular, you are guaranteed that the sensor list won't change, so + * the API functions that take a sensor index will be valid, and sensor + * events will not be delivered. */ extern DECLSPEC void SDLCALL SDL_LockSensors(void); extern DECLSPEC void SDLCALL SDL_UnlockSensors(void); /** - * Count the number of sensors attached to the system right now. - * - * \returns the number of sensors detected. + * \brief Count the number of sensors attached to the system right now */ extern DECLSPEC int SDLCALL SDL_NumSensors(void); /** - * Get the implementation dependent name of a sensor. + * \brief Get the implementation dependent name of a sensor. * - * \param device_index The sensor to obtain name from - * \returns the sensor name, or NULL if `device_index` is out of range. + * This can be called before any sensors are opened. + * + * \return The sensor name, or NULL if device_index is out of range. */ extern DECLSPEC const char *SDLCALL SDL_SensorGetDeviceName(int device_index); /** - * Get the type of a sensor. + * \brief Get the type of a sensor. * - * \param device_index The sensor to get the type from - * \returns the SDL_SensorType, or `SDL_SENSOR_INVALID` if `device_index` is - * out of range. + * This can be called before any sensors are opened. + * + * \return The sensor type, or SDL_SENSOR_INVALID if device_index is out of range. */ extern DECLSPEC SDL_SensorType SDLCALL SDL_SensorGetDeviceType(int device_index); /** - * Get the platform dependent type of a sensor. + * \brief Get the platform dependent type of a sensor. * - * \param device_index The sensor to check - * \returns the sensor platform dependent type, or -1 if `device_index` is out - * of range. + * This can be called before any sensors are opened. + * + * \return The sensor platform dependent type, or -1 if device_index is out of range. */ extern DECLSPEC int SDLCALL SDL_SensorGetDeviceNonPortableType(int device_index); /** - * Get the instance ID of a sensor. + * \brief Get the instance ID of a sensor. * - * \param device_index The sensor to get instance id from - * \returns the sensor instance ID, or -1 if `device_index` is out of range. + * This can be called before any sensors are opened. + * + * \return The sensor instance ID, or -1 if device_index is out of range. */ extern DECLSPEC SDL_SensorID SDLCALL SDL_SensorGetDeviceInstanceID(int device_index); /** - * Open a sensor for use. + * \brief Open a sensor for use. * - * \param device_index The sensor to open - * \returns an SDL_Sensor sensor object, or NULL if an error occurred. + * The index passed as an argument refers to the N'th sensor on the system. + * + * \return A sensor identifier, or NULL if an error occurred. */ extern DECLSPEC SDL_Sensor *SDLCALL SDL_SensorOpen(int device_index); /** * Return the SDL_Sensor associated with an instance id. - * - * \param instance_id The sensor from instance id - * \returns an SDL_Sensor object. */ extern DECLSPEC SDL_Sensor *SDLCALL SDL_SensorFromInstanceID(SDL_SensorID instance_id); /** - * Get the implementation dependent name of a sensor + * \brief Get the implementation dependent name of a sensor. * - * \param sensor The SDL_Sensor object - * \returns the sensor name, or NULL if `sensor` is NULL. + * \return The sensor name, or NULL if the sensor is NULL. */ extern DECLSPEC const char *SDLCALL SDL_SensorGetName(SDL_Sensor *sensor); /** - * Get the type of a sensor. + * \brief Get the type of a sensor. * - * \param sensor The SDL_Sensor object to inspect - * \returns the SDL_SensorType type, or `SDL_SENSOR_INVALID` if `sensor` is - * NULL. + * This can be called before any sensors are opened. + * + * \return The sensor type, or SDL_SENSOR_INVALID if the sensor is NULL. */ extern DECLSPEC SDL_SensorType SDLCALL SDL_SensorGetType(SDL_Sensor *sensor); /** - * Get the platform dependent type of a sensor. + * \brief Get the platform dependent type of a sensor. * - * \param sensor The SDL_Sensor object to inspect - * \returns the sensor platform dependent type, or -1 if `sensor` is NULL. + * This can be called before any sensors are opened. + * + * \return The sensor platform dependent type, or -1 if the sensor is NULL. */ extern DECLSPEC int SDLCALL SDL_SensorGetNonPortableType(SDL_Sensor *sensor); /** - * Get the instance ID of a sensor. + * \brief Get the instance ID of a sensor. * - * \param sensor The SDL_Sensor object to inspect - * \returns the sensor instance ID, or -1 if `sensor` is NULL. + * This can be called before any sensors are opened. + * + * \return The sensor instance ID, or -1 if the sensor is NULL. */ extern DECLSPEC SDL_SensorID SDLCALL SDL_SensorGetInstanceID(SDL_Sensor *sensor); /** - * Get the current state of an opened sensor. + * Get the current state of an opened sensor. * - * The number of values and interpretation of the data is sensor dependent. + * The number of values and interpretation of the data is sensor dependent. * - * \param sensor The SDL_Sensor object to query - * \param data A pointer filled with the current sensor state - * \param num_values The number of values to write to data - * \returns 0 or -1 if an error occurred. + * \param sensor The sensor to query + * \param data A pointer filled with the current sensor state + * \param num_values The number of values to write to data + * + * \return 0 or -1 if an error occurred. */ extern DECLSPEC int SDLCALL SDL_SensorGetData(SDL_Sensor * sensor, float *data, int num_values); /** - * Close a sensor previously opened with SDL_SensorOpen(). - * - * \param sensor The SDL_Sensor object to close + * Close a sensor previously opened with SDL_SensorOpen() */ extern DECLSPEC void SDLCALL SDL_SensorClose(SDL_Sensor * sensor); /** - * Update the current state of the open sensors. + * Update the current state of the open sensors. * - * This is called automatically by the event loop if sensor events are - * enabled. + * This is called automatically by the event loop if sensor events are enabled. * - * This needs to be called from the thread that initialized the sensor - * subsystem. + * This needs to be called from the thread that initialized the sensor subsystem. */ extern DECLSPEC void SDLCALL SDL_SensorUpdate(void); diff --git a/code/SDL2/include/SDL_shape.h b/code/SDL2/include/SDL_shape.h index 8903e043..40a6baaa 100644 --- a/code/SDL2/include/SDL_shape.h +++ b/code/SDL2/include/SDL_shape.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2021 Sam Lantinga + Copyright (C) 1997-2018 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 @@ -44,34 +44,33 @@ extern "C" { #define SDL_WINDOW_LACKS_SHAPE -3 /** - * Create a window that can be shaped with the specified position, dimensions, - * and flags. + * \brief Create a window that can be shaped with the specified position, dimensions, and flags. * - * \param title The title of the window, in UTF-8 encoding. - * \param x The x position of the window, ::SDL_WINDOWPOS_CENTERED, or - * ::SDL_WINDOWPOS_UNDEFINED. - * \param y The y position of the window, ::SDL_WINDOWPOS_CENTERED, or - * ::SDL_WINDOWPOS_UNDEFINED. - * \param w The width of the window. - * \param h The height of the window. - * \param flags The flags for the window, a mask of SDL_WINDOW_BORDERLESS with - * any of the following: ::SDL_WINDOW_OPENGL, - * ::SDL_WINDOW_INPUT_GRABBED, ::SDL_WINDOW_HIDDEN, - * ::SDL_WINDOW_RESIZABLE, ::SDL_WINDOW_MAXIMIZED, - * ::SDL_WINDOW_MINIMIZED, ::SDL_WINDOW_BORDERLESS is always set, - * and ::SDL_WINDOW_FULLSCREEN is always unset. - * \return the window created, or NULL if window creation failed. + * \param title The title of the window, in UTF-8 encoding. + * \param x The x position of the window, ::SDL_WINDOWPOS_CENTERED, or + * ::SDL_WINDOWPOS_UNDEFINED. + * \param y The y position of the window, ::SDL_WINDOWPOS_CENTERED, or + * ::SDL_WINDOWPOS_UNDEFINED. + * \param w The width of the window. + * \param h The height of the window. + * \param flags The flags for the window, a mask of SDL_WINDOW_BORDERLESS with any of the following: + * ::SDL_WINDOW_OPENGL, ::SDL_WINDOW_INPUT_GRABBED, + * ::SDL_WINDOW_HIDDEN, ::SDL_WINDOW_RESIZABLE, + * ::SDL_WINDOW_MAXIMIZED, ::SDL_WINDOW_MINIMIZED, + * ::SDL_WINDOW_BORDERLESS is always set, and ::SDL_WINDOW_FULLSCREEN is always unset. * - * \sa SDL_DestroyWindow + * \return The window created, or NULL if window creation failed. + * + * \sa SDL_DestroyWindow() */ extern DECLSPEC SDL_Window * SDLCALL SDL_CreateShapedWindow(const char *title,unsigned int x,unsigned int y,unsigned int w,unsigned int h,Uint32 flags); /** - * Return whether the given window is a shaped window. + * \brief Return whether the given window is a shaped window. * * \param window The window to query for being shaped. - * \return SDL_TRUE if the window is a window that can be shaped, SDL_FALSE if - * the window is unshaped or NULL. + * + * \return SDL_TRUE if the window is a window that can be shaped, SDL_FALSE if the window is unshaped or NULL. * * \sa SDL_CreateShapedWindow */ @@ -107,31 +106,29 @@ typedef struct SDL_WindowShapeMode { } SDL_WindowShapeMode; /** - * Set the shape and parameters of a shaped window. + * \brief Set the shape and parameters of a shaped window. * * \param window The shaped window whose parameters should be set. * \param shape A surface encoding the desired shape for the window. * \param shape_mode The parameters to set for the shaped window. - * \return 0 on success, SDL_INVALID_SHAPE_ARGUMENT on an invalid shape - * argument, or SDL_NONSHAPEABLE_WINDOW if the SDL_Window given does - * not reference a valid shaped window. + * + * \return 0 on success, SDL_INVALID_SHAPE_ARGUMENT on an invalid shape argument, or SDL_NONSHAPEABLE_WINDOW + * if the SDL_Window given does not reference a valid shaped window. * * \sa SDL_WindowShapeMode - * \sa SDL_GetShapedWindowMode + * \sa SDL_GetShapedWindowMode. */ extern DECLSPEC int SDLCALL SDL_SetWindowShape(SDL_Window *window,SDL_Surface *shape,SDL_WindowShapeMode *shape_mode); /** - * Get the shape parameters of a shaped window. + * \brief Get the shape parameters of a shaped window. * * \param window The shaped window whose parameters should be retrieved. - * \param shape_mode An empty shape-mode structure to fill, or NULL to check - * whether the window has a shape. - * \return 0 if the window has a shape and, provided shape_mode was not NULL, - * shape_mode has been filled with the mode data, - * SDL_NONSHAPEABLE_WINDOW if the SDL_Window given is not a shaped - * window, or SDL_WINDOW_LACKS_SHAPE if the SDL_Window given is a - * shapeable window currently lacking a shape. + * \param shape_mode An empty shape-mode structure to fill, or NULL to check whether the window has a shape. + * + * \return 0 if the window has a shape and, provided shape_mode was not NULL, shape_mode has been filled with the mode + * data, SDL_NONSHAPEABLE_WINDOW if the SDL_Window given is not a shaped window, or SDL_WINDOW_LACKS_SHAPE if + * the SDL_Window given is a shapeable window currently lacking a shape. * * \sa SDL_WindowShapeMode * \sa SDL_SetWindowShape diff --git a/code/SDL2/include/SDL_test.h b/code/SDL2/include/SDL_test.h index 66fde839..6cc373bf 100644 --- a/code/SDL2/include/SDL_test.h +++ b/code/SDL2/include/SDL_test.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2021 Sam Lantinga + Copyright (C) 1997-2018 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/code/SDL2/include/SDL_test_assert.h b/code/SDL2/include/SDL_test_assert.h index d8e9d7de..1788d7a2 100644 --- a/code/SDL2/include/SDL_test_assert.h +++ b/code/SDL2/include/SDL_test_assert.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2021 Sam Lantinga + Copyright (C) 1997-2018 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 @@ -66,7 +66,7 @@ void SDLTest_Assert(int assertCondition, SDL_PRINTF_FORMAT_STRING const char *as * \param assertCondition Evaluated condition or variable to assert; fail (==0) or pass (!=0). * \param assertDescription Message to log with the assert describing it. * - * \returns the assertCondition so it can be used to externally to break execution flow if desired. + * \returns Returns the assertCondition so it can be used to externally to break execution flow if desired. */ int SDLTest_AssertCheck(int assertCondition, SDL_PRINTF_FORMAT_STRING const char *assertDescription, ...) SDL_PRINTF_VARARG_FUNC(2); diff --git a/code/SDL2/include/SDL_test_compare.h b/code/SDL2/include/SDL_test_compare.h index ee42c9d3..c22e447d 100644 --- a/code/SDL2/include/SDL_test_compare.h +++ b/code/SDL2/include/SDL_test_compare.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2021 Sam Lantinga + Copyright (C) 1997-2018 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/code/SDL2/include/SDL_test_crc32.h b/code/SDL2/include/SDL_test_crc32.h index f41e24e2..3d235d07 100644 --- a/code/SDL2/include/SDL_test_crc32.h +++ b/code/SDL2/include/SDL_test_crc32.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2021 Sam Lantinga + Copyright (C) 1997-2018 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/code/SDL2/include/SDL_test_font.h b/code/SDL2/include/SDL_test_font.h index daa6670c..59cbdcad 100644 --- a/code/SDL2/include/SDL_test_font.h +++ b/code/SDL2/include/SDL_test_font.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2021 Sam Lantinga + Copyright (C) 1997-2018 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,7 +48,7 @@ extern "C" { * \param y The Y coordinate of the upper left corner of the character. * \param c The character to draw. * - * \returns 0 on success, -1 on failure. + * \returns Returns 0 on success, -1 on failure. */ int SDLTest_DrawCharacter(SDL_Renderer *renderer, int x, int y, char c); @@ -60,7 +60,7 @@ int SDLTest_DrawCharacter(SDL_Renderer *renderer, int x, int y, char c); * \param y The Y coordinate of the upper left corner of the string. * \param s The string to draw. * - * \returns 0 on success, -1 on failure. + * \returns Returns 0 on success, -1 on failure. */ int SDLTest_DrawString(SDL_Renderer *renderer, int x, int y, const char *s); diff --git a/code/SDL2/include/SDL_test_fuzzer.h b/code/SDL2/include/SDL_test_fuzzer.h index 84278bfb..8fcb9ebb 100644 --- a/code/SDL2/include/SDL_test_fuzzer.h +++ b/code/SDL2/include/SDL_test_fuzzer.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2021 Sam Lantinga + Copyright (C) 1997-2018 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 @@ -66,14 +66,14 @@ void SDLTest_FuzzerInit(Uint64 execKey); /** * Returns a random Uint8 * - * \returns a generated integer + * \returns Generated integer */ Uint8 SDLTest_RandomUint8(void); /** * Returns a random Sint8 * - * \returns a generated signed integer + * \returns Generated signed integer */ Sint8 SDLTest_RandomSint8(void); @@ -81,14 +81,14 @@ Sint8 SDLTest_RandomSint8(void); /** * Returns a random Uint16 * - * \returns a generated integer + * \returns Generated integer */ Uint16 SDLTest_RandomUint16(void); /** * Returns a random Sint16 * - * \returns a generated signed integer + * \returns Generated signed integer */ Sint16 SDLTest_RandomSint16(void); @@ -96,7 +96,7 @@ Sint16 SDLTest_RandomSint16(void); /** * Returns a random integer * - * \returns a generated integer + * \returns Generated integer */ Sint32 SDLTest_RandomSint32(void); @@ -104,14 +104,14 @@ Sint32 SDLTest_RandomSint32(void); /** * Returns a random positive integer * - * \returns a generated integer + * \returns Generated integer */ Uint32 SDLTest_RandomUint32(void); /** * Returns random Uint64. * - * \returns a generated integer + * \returns Generated integer */ Uint64 SDLTest_RandomUint64(void); @@ -119,28 +119,28 @@ Uint64 SDLTest_RandomUint64(void); /** * Returns random Sint64. * - * \returns a generated signed integer + * \returns Generated signed integer */ Sint64 SDLTest_RandomSint64(void); /** - * \returns a random float in range [0.0 - 1.0] + * \returns random float in range [0.0 - 1.0[ */ float SDLTest_RandomUnitFloat(void); /** - * \returns a random double in range [0.0 - 1.0] + * \returns random double in range [0.0 - 1.0[ */ double SDLTest_RandomUnitDouble(void); /** - * \returns a random float. + * \returns random float. * */ float SDLTest_RandomFloat(void); /** - * \returns a random double. + * \returns random double. * */ double SDLTest_RandomDouble(void); @@ -162,7 +162,7 @@ double SDLTest_RandomDouble(void); * \param boundary2 Upper boundary limit * \param validDomain Should the generated boundary be valid (=within the bounds) or not? * - * \returns a random boundary value for the given range and domain or 0 with error set + * \returns Random boundary value for the given range and domain or 0 with error set */ Uint8 SDLTest_RandomUint8BoundaryValue(Uint8 boundary1, Uint8 boundary2, SDL_bool validDomain); @@ -183,7 +183,7 @@ Uint8 SDLTest_RandomUint8BoundaryValue(Uint8 boundary1, Uint8 boundary2, SDL_boo * \param boundary2 Upper boundary limit * \param validDomain Should the generated boundary be valid (=within the bounds) or not? * - * \returns a random boundary value for the given range and domain or 0 with error set + * \returns Random boundary value for the given range and domain or 0 with error set */ Uint16 SDLTest_RandomUint16BoundaryValue(Uint16 boundary1, Uint16 boundary2, SDL_bool validDomain); @@ -204,7 +204,7 @@ Uint16 SDLTest_RandomUint16BoundaryValue(Uint16 boundary1, Uint16 boundary2, SDL * \param boundary2 Upper boundary limit * \param validDomain Should the generated boundary be valid (=within the bounds) or not? * - * \returns a random boundary value for the given range and domain or 0 with error set + * \returns Random boundary value for the given range and domain or 0 with error set */ Uint32 SDLTest_RandomUint32BoundaryValue(Uint32 boundary1, Uint32 boundary2, SDL_bool validDomain); @@ -225,7 +225,7 @@ Uint32 SDLTest_RandomUint32BoundaryValue(Uint32 boundary1, Uint32 boundary2, SDL * \param boundary2 Upper boundary limit * \param validDomain Should the generated boundary be valid (=within the bounds) or not? * - * \returns a random boundary value for the given range and domain or 0 with error set + * \returns Random boundary value for the given range and domain or 0 with error set */ Uint64 SDLTest_RandomUint64BoundaryValue(Uint64 boundary1, Uint64 boundary2, SDL_bool validDomain); @@ -246,7 +246,7 @@ Uint64 SDLTest_RandomUint64BoundaryValue(Uint64 boundary1, Uint64 boundary2, SDL * \param boundary2 Upper boundary limit * \param validDomain Should the generated boundary be valid (=within the bounds) or not? * - * \returns a random boundary value for the given range and domain or SINT8_MIN with error set + * \returns Random boundary value for the given range and domain or SINT8_MIN with error set */ Sint8 SDLTest_RandomSint8BoundaryValue(Sint8 boundary1, Sint8 boundary2, SDL_bool validDomain); @@ -268,7 +268,7 @@ Sint8 SDLTest_RandomSint8BoundaryValue(Sint8 boundary1, Sint8 boundary2, SDL_boo * \param boundary2 Upper boundary limit * \param validDomain Should the generated boundary be valid (=within the bounds) or not? * - * \returns a random boundary value for the given range and domain or SINT16_MIN with error set + * \returns Random boundary value for the given range and domain or SINT16_MIN with error set */ Sint16 SDLTest_RandomSint16BoundaryValue(Sint16 boundary1, Sint16 boundary2, SDL_bool validDomain); @@ -289,7 +289,7 @@ Sint16 SDLTest_RandomSint16BoundaryValue(Sint16 boundary1, Sint16 boundary2, SDL * \param boundary2 Upper boundary limit * \param validDomain Should the generated boundary be valid (=within the bounds) or not? * - * \returns a random boundary value for the given range and domain or SINT32_MIN with error set + * \returns Random boundary value for the given range and domain or SINT32_MIN with error set */ Sint32 SDLTest_RandomSint32BoundaryValue(Sint32 boundary1, Sint32 boundary2, SDL_bool validDomain); @@ -310,7 +310,7 @@ Sint32 SDLTest_RandomSint32BoundaryValue(Sint32 boundary1, Sint32 boundary2, SDL * \param boundary2 Upper boundary limit * \param validDomain Should the generated boundary be valid (=within the bounds) or not? * - * \returns a random boundary value for the given range and domain or SINT64_MIN with error set + * \returns Random boundary value for the given range and domain or SINT64_MIN with error set */ Sint64 SDLTest_RandomSint64BoundaryValue(Sint64 boundary1, Sint64 boundary2, SDL_bool validDomain); @@ -324,7 +324,7 @@ Sint64 SDLTest_RandomSint64BoundaryValue(Sint64 boundary1, Sint64 boundary2, SDL * \param min Minimum inclusive value of returned random number * \param max Maximum inclusive value of returned random number * - * \returns a generated random integer in range + * \returns Generated random integer in range */ Sint32 SDLTest_RandomIntegerInRange(Sint32 min, Sint32 max); @@ -336,7 +336,7 @@ Sint32 SDLTest_RandomIntegerInRange(Sint32 min, Sint32 max); * * Note: Returned string needs to be deallocated. * - * \returns a newly allocated random string; or NULL if length was invalid or string could not be allocated. + * \returns Newly allocated random string; or NULL if length was invalid or string could not be allocated. */ char * SDLTest_RandomAsciiString(void); @@ -350,7 +350,7 @@ char * SDLTest_RandomAsciiString(void); * * \param maxLength The maximum length of the generated string. * - * \returns a newly allocated random string; or NULL if maxLength was invalid or string could not be allocated. + * \returns Newly allocated random string; or NULL if maxLength was invalid or string could not be allocated. */ char * SDLTest_RandomAsciiStringWithMaximumLength(int maxLength); @@ -364,14 +364,12 @@ char * SDLTest_RandomAsciiStringWithMaximumLength(int maxLength); * * \param size The length of the generated string * - * \returns a newly allocated random string; or NULL if size was invalid or string could not be allocated. + * \returns Newly allocated random string; or NULL if size was invalid or string could not be allocated. */ char * SDLTest_RandomAsciiStringOfSize(int size); /** - * Get the invocation count for the fuzzer since last ...FuzzerInit. - * - * \returns the invocation count. + * Returns the invocation count for the fuzzer since last ...FuzzerInit. */ int SDLTest_GetFuzzerInvocationCount(void); diff --git a/code/SDL2/include/SDL_test_harness.h b/code/SDL2/include/SDL_test_harness.h index 106464cf..8641e0a7 100644 --- a/code/SDL2/include/SDL_test_harness.h +++ b/code/SDL2/include/SDL_test_harness.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2021 Sam Lantinga + Copyright (C) 1997-2018 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 @@ -105,7 +105,7 @@ typedef struct SDLTest_TestSuiteReference { * * \param length The length of the seed string to generate * - * \returns the generated seed string + * \returns The generated seed string */ char *SDLTest_GenerateRunSeed(const int length); @@ -118,7 +118,7 @@ char *SDLTest_GenerateRunSeed(const int length); * \param filter Filter specification. NULL disables. Case sensitive. * \param testIterations Number of iterations to run each test case. * - * \returns the test run result: 0 when all tests passed, 1 if any tests failed. + * \returns Test run result; 0 when all tests passed, 1 if any tests failed. */ int SDLTest_RunSuites(SDLTest_TestSuiteReference *testSuites[], const char *userRunSeed, Uint64 userExecKey, const char *filter, int testIterations); diff --git a/code/SDL2/include/SDL_test_images.h b/code/SDL2/include/SDL_test_images.h index a379cf1c..9c4dd5b8 100644 --- a/code/SDL2/include/SDL_test_images.h +++ b/code/SDL2/include/SDL_test_images.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2021 Sam Lantinga + Copyright (C) 1997-2018 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/code/SDL2/include/SDL_test_log.h b/code/SDL2/include/SDL_test_log.h index 0caddca8..ebd44fb5 100644 --- a/code/SDL2/include/SDL_test_log.h +++ b/code/SDL2/include/SDL_test_log.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2021 Sam Lantinga + Copyright (C) 1997-2018 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/code/SDL2/include/SDL_test_md5.h b/code/SDL2/include/SDL_test_md5.h index ca29757c..0e410576 100644 --- a/code/SDL2/include/SDL_test_md5.h +++ b/code/SDL2/include/SDL_test_md5.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2021 Sam Lantinga + Copyright (C) 1997-2018 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/code/SDL2/include/SDL_test_memory.h b/code/SDL2/include/SDL_test_memory.h index 4a19c1d8..df69f93e 100644 --- a/code/SDL2/include/SDL_test_memory.h +++ b/code/SDL2/include/SDL_test_memory.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2021 Sam Lantinga + Copyright (C) 1997-2020 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/code/SDL2/include/SDL_test_random.h b/code/SDL2/include/SDL_test_random.h index 8297f94f..0eb414ff 100644 --- a/code/SDL2/include/SDL_test_random.h +++ b/code/SDL2/include/SDL_test_random.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2021 Sam Lantinga + Copyright (C) 1997-2018 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 @@ -98,7 +98,7 @@ extern "C" { * * \param rndContext pointer to context structure * - * \returns a random number (32bit unsigned integer) + * \returns A random number (32bit unsigned integer) * */ unsigned int SDLTest_Random(SDLTest_RandomContext *rndContext); diff --git a/code/SDL2/include/SDL_timer.h b/code/SDL2/include/SDL_timer.h index 04696dc8..5600618f 100644 --- a/code/SDL2/include/SDL_timer.h +++ b/code/SDL2/include/SDL_timer.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2021 Sam Lantinga + Copyright (C) 1997-2018 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 @@ -38,75 +38,45 @@ extern "C" { #endif /** - * Get the number of milliseconds since SDL library initialization. + * \brief Get the number of milliseconds since the SDL library initialization. * - * This value wraps if the program runs for more than ~49 days. - * - * \returns an unsigned 32-bit value representing the number of milliseconds - * since the SDL library initialized. - * - * \sa SDL_TICKS_PASSED + * \note This value wraps if the program runs for more than ~49 days. */ extern DECLSPEC Uint32 SDLCALL SDL_GetTicks(void); /** - * Compare SDL ticks values, and return true if `A` has passed `B`. + * \brief Compare SDL ticks values, and return true if A has passed B * - * For example, if you want to wait 100 ms, you could do this: - * - * ```c++ - * Uint32 timeout = SDL_GetTicks() + 100; - * while (!SDL_TICKS_PASSED(SDL_GetTicks(), timeout)) { - * // ... do work until timeout has elapsed - * } - * ``` + * e.g. if you want to wait 100 ms, you could do this: + * Uint32 timeout = SDL_GetTicks() + 100; + * while (!SDL_TICKS_PASSED(SDL_GetTicks(), timeout)) { + * ... do work until timeout has elapsed + * } */ #define SDL_TICKS_PASSED(A, B) ((Sint32)((B) - (A)) <= 0) /** - * Get the current value of the high resolution counter. - * - * This function is typically used for profiling. - * - * The counter values are only meaningful relative to each other. Differences - * between values can be converted to times by using - * SDL_GetPerformanceFrequency(). - * - * \returns the current counter value. - * - * \sa SDL_GetPerformanceFrequency + * \brief Get the current value of the high resolution counter */ extern DECLSPEC Uint64 SDLCALL SDL_GetPerformanceCounter(void); /** - * Get the count per second of the high resolution counter. - * - * \returns a platform-specific count per second. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GetPerformanceCounter + * \brief Get the count per second of the high resolution counter */ extern DECLSPEC Uint64 SDLCALL SDL_GetPerformanceFrequency(void); /** - * Wait a specified number of milliseconds before returning. - * - * This function waits a specified number of milliseconds before returning. It - * waits at least the specified time, but possibly longer due to OS - * scheduling. - * - * \param ms the number of milliseconds to delay + * \brief Wait a specified number of milliseconds before returning. */ extern DECLSPEC void SDLCALL SDL_Delay(Uint32 ms); /** - * Function prototype for the timer callback function. + * Function prototype for the timer callback function. * - * The callback function is passed the current timer interval and returns - * the next timer interval. If the returned value is the same as the one - * passed in, the periodic alarm continues, otherwise a new alarm is - * scheduled. If the callback returns 0, the periodic alarm is cancelled. + * The callback function is passed the current timer interval and returns + * the next timer interval. If the returned value is the same as the one + * passed in, the periodic alarm continues, otherwise a new alarm is + * scheduled. If the callback returns 0, the periodic alarm is cancelled. */ typedef Uint32 (SDLCALL * SDL_TimerCallback) (Uint32 interval, void *param); @@ -116,47 +86,20 @@ typedef Uint32 (SDLCALL * SDL_TimerCallback) (Uint32 interval, void *param); typedef int SDL_TimerID; /** - * Call a callback function at a future time. + * \brief Add a new timer to the pool of timers already running. * - * If you use this function, you must pass `SDL_INIT_TIMER` to SDL_Init(). - * - * The callback function is passed the current timer interval and the user - * supplied parameter from the SDL_AddTimer() call and should return the next - * timer interval. If the value returned from the callback is 0, the timer is - * canceled. - * - * The callback is run on a separate thread. - * - * Timers take into account the amount of time it took to execute the - * callback. For example, if the callback took 250 ms to execute and returned - * 1000 (ms), the timer would only wait another 750 ms before its next - * iteration. - * - * Timing may be inexact due to OS scheduling. Be sure to note the current - * time with SDL_GetTicks() or SDL_GetPerformanceCounter() in case your - * callback needs to adjust for variances. - * - * \param interval the timer delay, in milliseconds, passed to `callback` - * \param callback the SDL_TimerCallback function to call when the specified - * `interval` elapses - * \param param a pointer that is passed to `callback` - * \returns a timer ID or 0 if an error occurs; call SDL_GetError() for more - * information. - * - * \sa SDL_RemoveTimer + * \return A timer ID, or 0 when an error occurs. */ extern DECLSPEC SDL_TimerID SDLCALL SDL_AddTimer(Uint32 interval, SDL_TimerCallback callback, void *param); /** - * Remove a timer created with SDL_AddTimer(). + * \brief Remove a timer knowing its ID. * - * \param id the ID of the timer to remove - * \returns SDL_TRUE if the timer is removed or SDL_FALSE if the timer wasn't - * found. + * \return A boolean value indicating success or failure. * - * \sa SDL_AddTimer + * \warning It is not safe to remove a timer multiple times. */ extern DECLSPEC SDL_bool SDLCALL SDL_RemoveTimer(SDL_TimerID id); diff --git a/code/SDL2/include/SDL_touch.h b/code/SDL2/include/SDL_touch.h index f370a673..fa5a37ce 100644 --- a/code/SDL2/include/SDL_touch.h +++ b/code/SDL2/include/SDL_touch.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2021 Sam Lantinga + Copyright (C) 1997-2020 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 @@ -64,66 +64,30 @@ typedef struct SDL_Finger #define SDL_MOUSE_TOUCHID ((Sint64)-1) +/* Function prototypes */ + /** - * Get the number of registered touch devices. - * - * On some platforms SDL first sees the touch device if it was actually used. - * Therefore SDL_GetNumTouchDevices() may return 0 although devices are - * available. After using all devices at least once the number will be - * correct. - * - * This was fixed for Android in SDL 2.0.1. - * - * \returns the number of registered touch devices. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GetTouchDevice + * \brief Get the number of registered touch devices. */ extern DECLSPEC int SDLCALL SDL_GetNumTouchDevices(void); /** - * Get the touch ID with the given index. - * - * \param index the touch device index - * \returns the touch ID with the given index on success or 0 if the index is - * invalid; call SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GetNumTouchDevices + * \brief Get the touch ID with the given index, or 0 if the index is invalid. */ extern DECLSPEC SDL_TouchID SDLCALL SDL_GetTouchDevice(int index); /** - * Get the type of the given touch device. + * \brief Get the type of the given touch device. */ extern DECLSPEC SDL_TouchDeviceType SDLCALL SDL_GetTouchDeviceType(SDL_TouchID touchID); /** - * Get the number of active fingers for a given touch device. - * - * \param touchID the ID of a touch device - * \returns the number of active fingers for a given touch device on success - * or 0 on failure; call SDL_GetError() for more information. - * - * \since This function is available since SDL 2.0.0. - * - * \sa SDL_GetTouchFinger + * \brief Get the number of active fingers for a given touch device. */ extern DECLSPEC int SDLCALL SDL_GetNumTouchFingers(SDL_TouchID touchID); /** - * Get the finger object for specified touch device ID and finger index. - * - * The returned resource is owned by SDL and should not be deallocated. - * - * \param touchID the ID of the requested touch device - * \param index the index of the requested finger - * \returns a pointer to the SDL_Finger object or NULL if no object at the - * given ID and index could be found. - * - * \sa SDL_RecordGesture + * \brief Get the finger object of the given touch, with the given index. */ extern DECLSPEC SDL_Finger * SDLCALL SDL_GetTouchFinger(SDL_TouchID touchID, int index); diff --git a/code/SDL2/include/SDL_types.h b/code/SDL2/include/SDL_types.h index 4267f366..4ac248c8 100644 --- a/code/SDL2/include/SDL_types.h +++ b/code/SDL2/include/SDL_types.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2021 Sam Lantinga + Copyright (C) 1997-2018 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/code/SDL2/include/SDL_vulkan.h b/code/SDL2/include/SDL_vulkan.h index 006c5aaf..a3de1cea 100644 --- a/code/SDL2/include/SDL_vulkan.h +++ b/code/SDL2/include/SDL_vulkan.h @@ -66,138 +66,201 @@ typedef VkSurfaceKHR SDL_vulkanSurface; /* for compatibility with Tizen */ /* @{ */ /** - * Dynamically load the Vulkan loader library. + * \brief Dynamically load a Vulkan loader library. * - * This should be called after initializing the video driver, but before - * creating any Vulkan windows. If no Vulkan loader library is loaded, the - * default library will be loaded upon creation of the first Vulkan window. + * \param [in] path The platform dependent Vulkan loader library name, or + * \c NULL. * - * It is fairly common for Vulkan applications to link with libvulkan instead - * of explicitly loading it at run time. This will work with SDL provided the - * application links to a dynamic library and both it and SDL use the same - * search path. + * \return \c 0 on success, or \c -1 if the library couldn't be loaded. * - * If you specify a non-NULL `path`, an application should retrieve all of the - * Vulkan functions it uses from the dynamic library using - * SDL_Vulkan_GetVkGetInstanceProcAddr unless you can guarantee `path` points - * to the same vulkan loader library the application linked to. + * If \a path is NULL SDL will use the value of the environment variable + * \c SDL_VULKAN_LIBRARY, if set, otherwise it loads the default Vulkan + * loader library. * - * On Apple devices, if `path` is NULL, SDL will attempt to find the - * `vkGetInstanceProcAddr` address within all the Mach-O images of the current - * process. This is because it is fairly common for Vulkan applications to - * link with libvulkan (and historically MoltenVK was provided as a static - * library). If it is not found, on macOS, SDL will attempt to load - * `vulkan.framework/vulkan`, `libvulkan.1.dylib`, - * `MoltenVK.framework/MoltenVK`, and `libMoltenVK.dylib`, in that order. On - * iOS, SDL will attempt to load `libMoltenVK.dylib`. Applications using a - * dynamic framework or .dylib must ensure it is included in its application - * bundle. + * This should be called after initializing the video driver, but before + * creating any Vulkan windows. If no Vulkan loader library is loaded, the + * default library will be loaded upon creation of the first Vulkan window. * - * On non-Apple devices, application linking with a static libvulkan is not - * supported. Either do not link to the Vulkan loader or link to a dynamic - * library version. + * \note It is fairly common for Vulkan applications to link with \a libvulkan + * instead of explicitly loading it at run time. This will work with + * SDL provided the application links to a dynamic library and both it + * and SDL use the same search path. * - * \param path The platform dependent Vulkan loader library name or NULL - * \returns 0 on success or -1 if the library couldn't be loaded; call - * SDL_GetError() for more information. + * \note If you specify a non-NULL \c path, an application should retrieve all + * of the Vulkan functions it uses from the dynamic library using + * \c SDL_Vulkan_GetVkGetInstanceProcAddr() unless you can guarantee + * \c path points to the same vulkan loader library the application + * linked to. * - * \since This function is available in SDL 2.0.8 + * \note On Apple devices, if \a path is NULL, SDL will attempt to find + * the vkGetInstanceProcAddr address within all the mach-o images of + * the current process. This is because it is fairly common for Vulkan + * applications to link with libvulkan (and historically MoltenVK was + * provided as a static library). If it is not found then, on macOS, SDL + * will attempt to load \c vulkan.framework/vulkan, \c libvulkan.1.dylib, + * followed by \c libvulkan.dylib, in that order. + * On iOS SDL will attempt to load \c libvulkan.dylib only. Applications + * using a dynamic framework or .dylib must ensure it is included in its + * application bundle. * - * \sa SDL_Vulkan_GetVkInstanceProcAddr - * \sa SDL_Vulkan_UnloadLibrary + * \note On non-Apple devices, application linking with a static libvulkan is + * not supported. Either do not link to the Vulkan loader or link to a + * dynamic library version. + * + * \note This function will fail if there are no working Vulkan drivers + * installed. + * + * \sa SDL_Vulkan_GetVkGetInstanceProcAddr() + * \sa SDL_Vulkan_UnloadLibrary() */ extern DECLSPEC int SDLCALL SDL_Vulkan_LoadLibrary(const char *path); /** - * Get the address of the `vkGetInstanceProcAddr` function. + * \brief Get the address of the \c vkGetInstanceProcAddr function. * - * This should be called after either calling SDL_Vulkan_LoadLibrary() or - * creating an SDL_Window with the `SDL_WINDOW_VULKAN` flag. - * - * \returns the function pointer for `vkGetInstanceProcAddr` or NULL on error. + * \note This should be called after either calling SDL_Vulkan_LoadLibrary + * or creating an SDL_Window with the SDL_WINDOW_VULKAN flag. */ extern DECLSPEC void *SDLCALL SDL_Vulkan_GetVkGetInstanceProcAddr(void); /** - * Unload the Vulkan library previously loaded by SDL_Vulkan_LoadLibrary() + * \brief Unload the Vulkan loader library previously loaded by + * \c SDL_Vulkan_LoadLibrary(). * - * \since This function is available in SDL 2.0.8 - * - * \sa SDL_Vulkan_LoadLibrary + * \sa SDL_Vulkan_LoadLibrary() */ extern DECLSPEC void SDLCALL SDL_Vulkan_UnloadLibrary(void); /** - * Get the names of the Vulkan instance extensions needed to create a surface - * with SDL_Vulkan_CreateSurface. + * \brief Get the names of the Vulkan instance extensions needed to create + * a surface with \c SDL_Vulkan_CreateSurface(). * - * If `pNames` is NULL, then the number of required Vulkan instance extensions - * is returned in `pCount`. Otherwise, `pCount` must point to a variable set - * to the number of elements in the `pNames` array, and on return the variable - * is overwritten with the number of names actually written to `pNames`. If - * `pCount` is less than the number of required extensions, at most `pCount` - * structures will be written. If `pCount` is smaller than the number of - * required extensions, SDL_FALSE will be returned instead of SDL_TRUE, to - * indicate that not all the required extensions were returned. + * \param [in] \c NULL or window Window for which the required Vulkan instance + * extensions should be retrieved + * \param [in,out] pCount pointer to an \c unsigned related to the number of + * required Vulkan instance extensions + * \param [out] pNames \c NULL or a pointer to an array to be filled with the + * required Vulkan instance extensions * - * The `window` parameter is currently needed to be valid as of SDL 2.0.8, - * however, this parameter will likely be removed in future releases + * \return \c SDL_TRUE on success, \c SDL_FALSE on error. * - * \param window A window for which the required Vulkan instance extensions - * should be retrieved (will be deprecated in a future release) - * \param pCount A pointer to an unsigned int corresponding to the number of - * extensions to be returned - * \param pNames NULL or a pointer to an array to be filled with required - * Vulkan instance extensions - * \returns SDL_TRUE on success, SDL_FALSE on error. + * If \a pNames is \c NULL, then the number of required Vulkan instance + * extensions is returned in pCount. Otherwise, \a pCount must point to a + * variable set to the number of elements in the \a pNames array, and on + * return the variable is overwritten with the number of names actually + * written to \a pNames. If \a pCount is less than the number of required + * extensions, at most \a pCount structures will be written. If \a pCount + * is smaller than the number of required extensions, \c SDL_FALSE will be + * returned instead of \c SDL_TRUE, to indicate that not all the required + * extensions were returned. * - * \since This function is available in SDL 2.0.8 + * \note If \c window is not NULL, it will be checked against its creation + * flags to ensure that the Vulkan flag is present. This parameter + * will be removed in a future major release. * - * \sa SDL_Vulkan_CreateSurface + * \note The returned list of extensions will contain \c VK_KHR_surface + * and zero or more platform specific extensions + * + * \note The extension names queried here must be enabled when calling + * VkCreateInstance, otherwise surface creation will fail. + * + * \note \c window should have been created with the \c SDL_WINDOW_VULKAN flag + * or be \c NULL + * + * \code + * unsigned int count; + * // get count of required extensions + * if(!SDL_Vulkan_GetInstanceExtensions(NULL, &count, NULL)) + * handle_error(); + * + * static const char *const additionalExtensions[] = + * { + * VK_EXT_DEBUG_REPORT_EXTENSION_NAME, // example additional extension + * }; + * size_t additionalExtensionsCount = sizeof(additionalExtensions) / sizeof(additionalExtensions[0]); + * size_t extensionCount = count + additionalExtensionsCount; + * const char **names = malloc(sizeof(const char *) * extensionCount); + * if(!names) + * handle_error(); + * + * // get names of required extensions + * if(!SDL_Vulkan_GetInstanceExtensions(NULL, &count, names)) + * handle_error(); + * + * // copy additional extensions after required extensions + * for(size_t i = 0; i < additionalExtensionsCount; i++) + * names[i + count] = additionalExtensions[i]; + * + * VkInstanceCreateInfo instanceCreateInfo = {}; + * instanceCreateInfo.enabledExtensionCount = extensionCount; + * instanceCreateInfo.ppEnabledExtensionNames = names; + * // fill in rest of instanceCreateInfo + * + * VkInstance instance; + * // create the Vulkan instance + * VkResult result = vkCreateInstance(&instanceCreateInfo, NULL, &instance); + * free(names); + * \endcode + * + * \sa SDL_Vulkan_CreateSurface() */ extern DECLSPEC SDL_bool SDLCALL SDL_Vulkan_GetInstanceExtensions(SDL_Window *window, unsigned int *pCount, const char **pNames); /** - * Create a Vulkan rendering surface for a window. + * \brief Create a Vulkan rendering surface for a window. * - * The `window` must have been created with the `SDL_WINDOW_VULKAN` flag and - * `instance` must have been created with extensions returned by - * SDL_Vulkan_GetInstanceExtensions() enabled. + * \param [in] window SDL_Window to which to attach the rendering surface. + * \param [in] instance handle to the Vulkan instance to use. + * \param [out] surface pointer to a VkSurfaceKHR handle to receive the + * handle of the newly created surface. * - * \param window The window to which to attach the Vulkan surface - * \param instance The Vulkan instance handle - * \param surface A pointer to a VkSurfaceKHR handle to output the newly - * created surface - * \returns SDL_TRUE on success, SDL_FALSE on error. + * \return \c SDL_TRUE on success, \c SDL_FALSE on error. * - * \since This function is available in SDL 2.0.8 + * \code + * VkInstance instance; + * SDL_Window *window; * - * \sa SDL_Vulkan_GetInstanceExtensions - * \sa SDL_Vulkan_GetDrawableSize + * // create instance and window + * + * // create the Vulkan surface + * VkSurfaceKHR surface; + * if(!SDL_Vulkan_CreateSurface(window, instance, &surface)) + * handle_error(); + * \endcode + * + * \note \a window should have been created with the \c SDL_WINDOW_VULKAN flag. + * + * \note \a instance should have been created with the extensions returned + * by \c SDL_Vulkan_CreateSurface() enabled. + * + * \sa SDL_Vulkan_GetInstanceExtensions() */ extern DECLSPEC SDL_bool SDLCALL SDL_Vulkan_CreateSurface(SDL_Window *window, VkInstance instance, VkSurfaceKHR* surface); /** - * Get the size of the window's underlying drawable dimensions in pixels. + * \brief Get the size of a window's underlying drawable in pixels (for use + * with setting viewport, scissor & etc). + * + * \param window SDL_Window from which the drawable size should be queried + * \param w Pointer to variable for storing the width in pixels, + * may be NULL + * \param h Pointer to variable for storing the height in pixels, + * may be NULL * * This may differ from SDL_GetWindowSize() if we're rendering to a high-DPI - * drawable, i.e. the window was created with `SDL_WINDOW_ALLOW_HIGHDPI` on a - * platform with high-DPI support (Apple calls this "Retina"), and not - * disabled by the `SDL_HINT_VIDEO_HIGHDPI_DISABLED` hint. + * drawable, i.e. the window was created with SDL_WINDOW_ALLOW_HIGHDPI on a + * platform with high-DPI support (Apple calls this "Retina"), and not disabled + * by the \c SDL_HINT_VIDEO_HIGHDPI_DISABLED hint. * - * \param window an SDL_Window for which the size is to be queried - * \param w Pointer to the variable to write the width to or NULL - * \param h Pointer to the variable to write the height to or NULL + * \note On macOS high-DPI support must be enabled for an application by + * setting NSHighResolutionCapable to true in its Info.plist. * - * \since This function is available in SDL 2.0.8 - * - * \sa SDL_GetWindowSize - * \sa SDL_CreateWindow - * \sa SDL_Vulkan_CreateSurface + * \sa SDL_GetWindowSize() + * \sa SDL_CreateWindow() */ extern DECLSPEC void SDLCALL SDL_Vulkan_GetDrawableSize(SDL_Window * window, int *w, int *h); diff --git a/code/SDL2/include/begin_code.h b/code/SDL2/include/begin_code.h index 37bf9750..1ca40ccd 100644 --- a/code/SDL2/include/begin_code.h +++ b/code/SDL2/include/begin_code.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2021 Sam Lantinga + Copyright (C) 1997-2020 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/code/SDL2/include/close_code.h b/code/SDL2/include/close_code.h index c65a2162..6aa411b0 100644 --- a/code/SDL2/include/close_code.h +++ b/code/SDL2/include/close_code.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2021 Sam Lantinga + Copyright (C) 1997-2020 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/code/libs/macosx/libSDL2-2.0.0.dylib b/code/libs/macosx/libSDL2-2.0.0.dylib index 30a0dea9..ecddbcac 100755 Binary files a/code/libs/macosx/libSDL2-2.0.0.dylib and b/code/libs/macosx/libSDL2-2.0.0.dylib differ diff --git a/code/libs/macosx/libSDL2main.a b/code/libs/macosx/libSDL2main.a index 12279e2c..306d55b9 100644 Binary files a/code/libs/macosx/libSDL2main.a and b/code/libs/macosx/libSDL2main.a differ