Updated SDL 2.0.16 headers and Mac version of libraries to fix GitHub actions

This commit is contained in:
Tom Kidd 2021-10-02 21:54:26 -05:00
parent bc96500fe6
commit 294eeb3c1c
63 changed files with 1875 additions and 2694 deletions

View file

@ -1,6 +1,6 @@
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages
@ -93,120 +93,37 @@ extern "C" {
/* @} */ /* @} */
/** /**
* Initialize the SDL library. * This function initializes the subsystems specified by \c flags
*
* 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
*/ */
extern DECLSPEC int SDLCALL SDL_Init(Uint32 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. * Subsystem initialization is ref-counted, you must call
* * SDL_QuitSubSystem() for each SDL_InitSubSystem() to correctly
* \param flags any of the flags used by SDL_Init(); see SDL_Init for details. * shutdown a subsystem manually (or call SDL_Quit() to force shutdown).
* \returns 0 on success or a negative error code on failure; call * If a subsystem is already loaded then this call will
* SDL_GetError() for more information. * increase the ref-count and return.
*
* \sa SDL_Init
* \sa SDL_Quit
* \sa SDL_QuitSubSystem
*/ */
extern DECLSPEC int SDLCALL SDL_InitSubSystem(Uint32 flags); extern DECLSPEC int SDLCALL SDL_InitSubSystem(Uint32 flags);
/** /**
* Shut down specific SDL subsystems. * This function cleans up 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
*/ */
extern DECLSPEC void SDLCALL SDL_QuitSubSystem(Uint32 flags); 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. * If \c flags is 0, it returns a mask of all initialized subsystems.
* \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
*/ */
extern DECLSPEC Uint32 SDLCALL SDL_WasInit(Uint32 flags); extern DECLSPEC Uint32 SDLCALL SDL_WasInit(Uint32 flags);
/** /**
* Clean up all initialized subsystems. * This function cleans up all initialized subsystems. You should
* * call it upon all exit conditions.
* 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
*/ */
extern DECLSPEC void SDLCALL SDL_Quit(void); extern DECLSPEC void SDLCALL SDL_Quit(void);

View file

@ -1,6 +1,6 @@
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages
@ -89,47 +89,25 @@ extern "C" {
typedef int SDL_SpinLock; 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 * \param lock Points to the lock.
* doing. Please be careful using any sort of spinlock!***
* *
* \param lock a pointer to a lock variable * \return SDL_TRUE if the lock succeeded, SDL_FALSE if the lock is already held.
* \returns SDL_TRUE if the lock succeeded, SDL_FALSE if the lock is already
* held.
*
* \sa SDL_AtomicLock
* \sa SDL_AtomicUnlock
*/ */
extern DECLSPEC SDL_bool SDLCALL SDL_AtomicTryLock(SDL_SpinLock *lock); 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 * \param lock Points to the lock.
* doing. Please be careful using any sort of spinlock!***
*
* \param lock a pointer to a lock variable
*
* \sa SDL_AtomicTryLock
* \sa SDL_AtomicUnlock
*/ */
extern DECLSPEC void SDLCALL SDL_AtomicLock(SDL_SpinLock *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. * \param lock Points to the lock.
*
* ***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
*/ */
extern DECLSPEC void SDLCALL SDL_AtomicUnlock(SDL_SpinLock *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 * 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. * 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 * A typical pattern would be for thread A to write some data and a flag,
* for thread B to read the flag and get the data. In this case you would * and for thread B to read the flag and get the data. In this case you
* insert a release barrier between writing the data and the flag, * would insert a release barrier between writing the data and the flag,
* guaranteeing that the data write completes no later than the flag is * guaranteeing that the data write completes no later than the flag is
* written, and you would insert an acquire barrier between reading the flag * written, and you would insert an acquire barrier between reading the
* and reading the data, to ensure that all the reads associated with the flag * flag and reading the data, to ensure that all the reads associated
* have completed. * with the flag have completed.
* *
* In this pattern you should always see a release barrier paired with an * In this pattern you should always see a release barrier paired with
* acquire barrier and you should gate the data reads/writes with a single * an acquire barrier and you should gate the data reads/writes with a
* flag variable. * single flag variable.
* *
* For more information on these semantics, take a look at the blog post: * For more information on these semantics, take a look at the blog post:
* http://preshing.com/20120913/acquire-and-release-semantics * http://preshing.com/20120913/acquire-and-release-semantics
@ -238,67 +216,32 @@ typedef void (*SDL_KernelMemoryBarrierFunc)();
typedef struct { int value; } SDL_atomic_t; 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 * \return SDL_TRUE if the atomic variable was set, SDL_FALSE otherwise.
* it!***
* *
* \param a a pointer to an SDL_atomic_t variable to be modified * \note If you don't know what this function is for, you shouldn't use it!
* \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
*/
extern DECLSPEC SDL_bool SDLCALL SDL_AtomicCAS(SDL_atomic_t *a, int oldval, int newval); 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. * \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
* \returns the previous value of the atomic variable.
*
* \sa SDL_AtomicGet
*/ */
extern DECLSPEC int SDLCALL SDL_AtomicSet(SDL_atomic_t *a, int v); extern DECLSPEC int SDLCALL SDL_AtomicSet(SDL_atomic_t *a, int v);
/** /**
* Get the value of an atomic variable. * \brief 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
*/ */
extern DECLSPEC int SDLCALL SDL_AtomicGet(SDL_atomic_t *a); 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 * \note This same style can be used for any number operation
* 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
*/ */
extern DECLSPEC int SDLCALL SDL_AtomicAdd(SDL_atomic_t *a, int v); 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 #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 * \return SDL_TRUE if the pointer was set, SDL_FALSE otherwise.
* it!***
* *
* \param a a pointer to a pointer * \note If you don't know what this function is for, you shouldn't use it!
* \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
*/
extern DECLSPEC SDL_bool SDLCALL SDL_AtomicCASPtr(void **a, void *oldval, void *newval); 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 * \return The previous value of the pointer.
* 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
*/ */
extern DECLSPEC void* SDLCALL SDL_AtomicSetPtr(void **a, void* v); extern DECLSPEC void* SDLCALL SDL_AtomicSetPtr(void **a, void* v);
/** /**
* Get the value of a pointer atomically. * \brief 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
*/ */
extern DECLSPEC void* SDLCALL SDL_AtomicGetPtr(void **a); extern DECLSPEC void* SDLCALL SDL_AtomicGetPtr(void **a);

View file

@ -1,6 +1,6 @@
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages
@ -91,96 +91,19 @@ typedef enum
} SDL_BlendFactor; } 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 * \param srcColorFactor source color factor
* the SDL_BlendMode returned by this function if the renderer supports it. * \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 * The result of the blend mode operation will be:
* combined with the pixels from the render target (destination). First, the * dstRGB = dstRGB * dstColorFactor colorOperation srcRGB * srcColorFactor
* components of the source and destination pixels get multiplied with their * and
* blend factors. Then, the blend operation takes the two products and * dstA = dstA * dstAlphaFactor alphaOperation srcA * srcAlphaFactor
* 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
*/ */
extern DECLSPEC SDL_BlendMode SDLCALL SDL_ComposeCustomBlendMode(SDL_BlendFactor srcColorFactor, extern DECLSPEC SDL_BlendMode SDLCALL SDL_ComposeCustomBlendMode(SDL_BlendFactor srcColorFactor,
SDL_BlendFactor dstColorFactor, SDL_BlendFactor dstColorFactor,

View file

@ -1,6 +1,6 @@
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages
@ -39,41 +39,23 @@ extern "C" {
/* Function prototypes */ /* 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 * \sa SDL_GetClipboardText()
* \returns 0 on success or a negative error code on failure; call
* SDL_GetError() for more information.
*
* \sa SDL_GetClipboardText
* \sa SDL_HasClipboardText
*/ */
extern DECLSPEC int SDLCALL SDL_SetClipboardText(const char *text); 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 * \sa SDL_SetClipboardText()
* 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
*/ */
extern DECLSPEC char * SDLCALL SDL_GetClipboardText(void); 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. * \sa SDL_GetClipboardText()
*
* \since This function is available since SDL 2.0.0.
*
* \sa SDL_GetClipboardText
* \sa SDL_SetClipboardText
*/ */
extern DECLSPEC SDL_bool SDLCALL SDL_HasClipboardText(void); extern DECLSPEC SDL_bool SDLCALL SDL_HasClipboardText(void);

View file

@ -1,6 +1,6 @@
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages 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. 3. This notice may not be removed or altered from any source distribution.
*/ */
#ifndef SDL_config_windows_h_ #ifndef SDL_config_h_
#define SDL_config_windows_h_
#define SDL_config_h_ #define SDL_config_h_
#include "SDL_platform.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) /* Add any platform that doesn't build using the configure system. */
#if defined(__GNUC__) || defined(__DMC__) || defined(__WATCOMC__) || defined(__clang__) #if defined(__WIN32__)
#define HAVE_STDINT_H 1 #include "SDL_config_windows.h"
#elif defined(_MSC_VER) #elif defined(__WINRT__)
typedef signed __int8 int8_t; #include "SDL_config_winrt.h"
typedef unsigned __int8 uint8_t; #elif defined(__MACOSX__)
typedef signed __int16 int16_t; #include "SDL_config_macosx.h"
typedef unsigned __int16 uint16_t; #elif defined(__IPHONEOS__)
typedef signed __int32 int32_t; #include "SDL_config_iphoneos.h"
typedef unsigned __int32 uint32_t; #elif defined(__ANDROID__)
typedef signed __int64 int64_t; #include "SDL_config_android.h"
typedef unsigned __int64 uint64_t; #elif defined(__PSP__)
#ifndef _UINTPTR_T_DEFINED #include "SDL_config_psp.h"
#ifdef _WIN64 #elif defined(__OS2__)
typedef unsigned __int64 uintptr_t; #include "SDL_config_os2.h"
#else #else
typedef unsigned int uintptr_t; /* This is a minimal configuration just to get SDL running on new platforms. */
#endif #include "SDL_config_minimal.h"
#define _UINTPTR_T_DEFINED #endif /* platform config */
#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 */
#ifdef _WIN64 #ifdef USING_GENERATED_CONFIG_H
# define SIZEOF_VOIDP 8 #error Wrong SDL_config.h, check your include path?
#else
# define SIZEOF_VOIDP 4
#endif #endif
#define HAVE_DDRAW_H 1 #endif /* SDL_config_h_ */
#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(<immintrin.h>)
# 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 <sdkddkver.h>
#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: */

View file

@ -1,6 +1,6 @@
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages
@ -38,7 +38,7 @@
/* C datatypes */ /* C datatypes */
/* Define SIZEOF_VOIDP for 64/32 architectures */ /* Define SIZEOF_VOIDP for 64/32 architectures */
#ifdef __LP64__ #if defined(__LP64__) || defined(_LP64) || defined(_WIN64)
#define SIZEOF_VOIDP 8 #define SIZEOF_VOIDP 8
#else #else
#define SIZEOF_VOIDP 4 #define SIZEOF_VOIDP 4
@ -47,46 +47,32 @@
#cmakedefine HAVE_GCC_ATOMICS @HAVE_GCC_ATOMICS@ #cmakedefine HAVE_GCC_ATOMICS @HAVE_GCC_ATOMICS@
#cmakedefine HAVE_GCC_SYNC_LOCK_TEST_AND_SET @HAVE_GCC_SYNC_LOCK_TEST_AND_SET@ #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 */ /* Comment this if you want to build without any C library requirements */
#cmakedefine HAVE_LIBC 1 #cmakedefine HAVE_LIBC 1
#if HAVE_LIBC #if HAVE_LIBC
/* Useful headers */ /* Useful headers */
#cmakedefine HAVE_ALLOCA_H 1
#cmakedefine HAVE_SYS_TYPES_H 1
#cmakedefine HAVE_STDIO_H 1
#cmakedefine STDC_HEADERS 1 #cmakedefine STDC_HEADERS 1
#cmakedefine HAVE_STDLIB_H 1 #cmakedefine HAVE_ALLOCA_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_CTYPE_H 1 #cmakedefine HAVE_CTYPE_H 1
#cmakedefine HAVE_MATH_H 1 #cmakedefine HAVE_FLOAT_H 1
#cmakedefine HAVE_ICONV_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_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_PTHREAD_NP_H 1
#cmakedefine HAVE_LIBUDEV_H 1 #cmakedefine HAVE_LIBUNWIND_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
/* C library functions */ /* C library functions */
#cmakedefine HAVE_MALLOC 1 #cmakedefine HAVE_MALLOC 1
@ -110,11 +96,18 @@
#cmakedefine HAVE_WCSLEN 1 #cmakedefine HAVE_WCSLEN 1
#cmakedefine HAVE_WCSLCPY 1 #cmakedefine HAVE_WCSLCPY 1
#cmakedefine HAVE_WCSLCAT 1 #cmakedefine HAVE_WCSLCAT 1
#cmakedefine HAVE__WCSDUP 1
#cmakedefine HAVE_WCSDUP 1
#cmakedefine HAVE_WCSSTR 1
#cmakedefine HAVE_WCSCMP 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_STRLEN 1
#cmakedefine HAVE_STRLCPY 1 #cmakedefine HAVE_STRLCPY 1
#cmakedefine HAVE_STRLCAT 1 #cmakedefine HAVE_STRLCAT 1
#cmakedefine HAVE_STRDUP 1
#cmakedefine HAVE__STRREV 1 #cmakedefine HAVE__STRREV 1
#cmakedefine HAVE__STRUPR 1 #cmakedefine HAVE__STRUPR 1
#cmakedefine HAVE__STRLWR 1 #cmakedefine HAVE__STRLWR 1
@ -123,6 +116,7 @@
#cmakedefine HAVE_STRCHR 1 #cmakedefine HAVE_STRCHR 1
#cmakedefine HAVE_STRRCHR 1 #cmakedefine HAVE_STRRCHR 1
#cmakedefine HAVE_STRSTR 1 #cmakedefine HAVE_STRSTR 1
#cmakedefine HAVE_STRTOK_R 1
#cmakedefine HAVE_ITOA 1 #cmakedefine HAVE_ITOA 1
#cmakedefine HAVE__LTOA 1 #cmakedefine HAVE__LTOA 1
#cmakedefine HAVE__UITOA 1 #cmakedefine HAVE__UITOA 1
@ -142,28 +136,52 @@
#cmakedefine HAVE_STRCASECMP 1 #cmakedefine HAVE_STRCASECMP 1
#cmakedefine HAVE__STRNICMP 1 #cmakedefine HAVE__STRNICMP 1
#cmakedefine HAVE_STRNCASECMP 1 #cmakedefine HAVE_STRNCASECMP 1
#cmakedefine HAVE_SSCANF 1
#cmakedefine HAVE_VSSCANF 1 #cmakedefine HAVE_VSSCANF 1
#cmakedefine HAVE_VSNPRINTF 1 #cmakedefine HAVE_VSNPRINTF 1
#cmakedefine HAVE_M_PI 1 #cmakedefine HAVE_M_PI 1
#cmakedefine HAVE_ATAN 1
#cmakedefine HAVE_ATAN2 1
#cmakedefine HAVE_ACOS 1 #cmakedefine HAVE_ACOS 1
#cmakedefine HAVE_ACOSF 1
#cmakedefine HAVE_ASIN 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_CEIL 1
#cmakedefine HAVE_CEILF 1
#cmakedefine HAVE_COPYSIGN 1 #cmakedefine HAVE_COPYSIGN 1
#cmakedefine HAVE_COPYSIGNF 1
#cmakedefine HAVE_COS 1 #cmakedefine HAVE_COS 1
#cmakedefine HAVE_COSF 1 #cmakedefine HAVE_COSF 1
#cmakedefine HAVE_EXP 1
#cmakedefine HAVE_EXPF 1
#cmakedefine HAVE_FABS 1 #cmakedefine HAVE_FABS 1
#cmakedefine HAVE_FABSF 1
#cmakedefine HAVE_FLOOR 1 #cmakedefine HAVE_FLOOR 1
#cmakedefine HAVE_FLOORF 1
#cmakedefine HAVE_FMOD 1
#cmakedefine HAVE_FMODF 1
#cmakedefine HAVE_LOG 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_POW 1
#cmakedefine HAVE_POWF 1
#cmakedefine HAVE_ROUND 1
#cmakedefine HAVE_ROUNDF 1
#cmakedefine HAVE_SCALBN 1 #cmakedefine HAVE_SCALBN 1
#cmakedefine HAVE_SCALBNF 1
#cmakedefine HAVE_SIN 1 #cmakedefine HAVE_SIN 1
#cmakedefine HAVE_SINF 1 #cmakedefine HAVE_SINF 1
#cmakedefine HAVE_SQRT 1 #cmakedefine HAVE_SQRT 1
#cmakedefine HAVE_SQRTF 1 #cmakedefine HAVE_SQRTF 1
#cmakedefine HAVE_TAN 1 #cmakedefine HAVE_TAN 1
#cmakedefine HAVE_TANF 1 #cmakedefine HAVE_TANF 1
#cmakedefine HAVE_TRUNC 1
#cmakedefine HAVE_TRUNCF 1
#cmakedefine HAVE_FOPEN64 1 #cmakedefine HAVE_FOPEN64 1
#cmakedefine HAVE_FSEEKO 1 #cmakedefine HAVE_FSEEKO 1
#cmakedefine HAVE_FSEEKO64 1 #cmakedefine HAVE_FSEEKO64 1
@ -181,16 +199,48 @@
#cmakedefine HAVE_PTHREAD_SET_NAME_NP 1 #cmakedefine HAVE_PTHREAD_SET_NAME_NP 1
#cmakedefine HAVE_SEM_TIMEDWAIT 1 #cmakedefine HAVE_SEM_TIMEDWAIT 1
#cmakedefine HAVE_GETAUXVAL 1 #cmakedefine HAVE_GETAUXVAL 1
#cmakedefine HAVE_ELF_AUX_INFO 1
#cmakedefine HAVE_POLL 1 #cmakedefine HAVE_POLL 1
#cmakedefine HAVE__EXIT 1
#elif __WIN32__ #elif __WIN32__
#cmakedefine HAVE_STDARG_H 1 #cmakedefine HAVE_STDARG_H 1
#cmakedefine HAVE_STDDEF_H 1 #cmakedefine HAVE_STDDEF_H 1
#cmakedefine HAVE_FLOAT_H 1
#else #else
/* We may need some replacement for stdarg.h here */ /* We may need some replacement for stdarg.h here */
#include <stdarg.h> #include <stdarg.h>
#endif /* HAVE_LIBC */ #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 */ /* SDL internal assertion support */
#cmakedefine SDL_DEFAULT_ASSERT_LEVEL @SDL_DEFAULT_ASSERT_LEVEL@ #cmakedefine SDL_DEFAULT_ASSERT_LEVEL @SDL_DEFAULT_ASSERT_LEVEL@
@ -202,6 +252,7 @@
#cmakedefine SDL_FILE_DISABLED @SDL_FILE_DISABLED@ #cmakedefine SDL_FILE_DISABLED @SDL_FILE_DISABLED@
#cmakedefine SDL_JOYSTICK_DISABLED @SDL_JOYSTICK_DISABLED@ #cmakedefine SDL_JOYSTICK_DISABLED @SDL_JOYSTICK_DISABLED@
#cmakedefine SDL_HAPTIC_DISABLED @SDL_HAPTIC_DISABLED@ #cmakedefine SDL_HAPTIC_DISABLED @SDL_HAPTIC_DISABLED@
#cmakedefine SDL_SENSOR_DISABLED @SDL_SENSOR_DISABLED@
#cmakedefine SDL_LOADSO_DISABLED @SDL_LOADSO_DISABLED@ #cmakedefine SDL_LOADSO_DISABLED @SDL_LOADSO_DISABLED@
#cmakedefine SDL_RENDER_DISABLED @SDL_RENDER_DISABLED@ #cmakedefine SDL_RENDER_DISABLED @SDL_RENDER_DISABLED@
#cmakedefine SDL_THREADS_DISABLED @SDL_THREADS_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 @SDL_AUDIO_DRIVER_ALSA@
#cmakedefine SDL_AUDIO_DRIVER_ALSA_DYNAMIC @SDL_AUDIO_DRIVER_ALSA_DYNAMIC@ #cmakedefine SDL_AUDIO_DRIVER_ALSA_DYNAMIC @SDL_AUDIO_DRIVER_ALSA_DYNAMIC@
#cmakedefine SDL_AUDIO_DRIVER_ANDROID @SDL_AUDIO_DRIVER_ANDROID@ #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 @SDL_AUDIO_DRIVER_ARTS@
#cmakedefine SDL_AUDIO_DRIVER_ARTS_DYNAMIC @SDL_AUDIO_DRIVER_ARTS_DYNAMIC@ #cmakedefine SDL_AUDIO_DRIVER_ARTS_DYNAMIC @SDL_AUDIO_DRIVER_ARTS_DYNAMIC@
#cmakedefine SDL_AUDIO_DRIVER_COREAUDIO @SDL_AUDIO_DRIVER_COREAUDIO@ #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 @SDL_AUDIO_DRIVER_OSS@
#cmakedefine SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H @SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H@ #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_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 @SDL_AUDIO_DRIVER_PULSEAUDIO@
#cmakedefine SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC @SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC@ #cmakedefine SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC @SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC@
#cmakedefine SDL_AUDIO_DRIVER_QSA @SDL_AUDIO_DRIVER_QSA@ #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_SUNAUDIO @SDL_AUDIO_DRIVER_SUNAUDIO@
#cmakedefine SDL_AUDIO_DRIVER_WASAPI @SDL_AUDIO_DRIVER_WASAPI@ #cmakedefine SDL_AUDIO_DRIVER_WASAPI @SDL_AUDIO_DRIVER_WASAPI@
#cmakedefine SDL_AUDIO_DRIVER_WINMM @SDL_AUDIO_DRIVER_WINMM@ #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 */ /* Enable various input drivers */
#cmakedefine SDL_INPUT_LINUXEV @SDL_INPUT_LINUXEV@ #cmakedefine SDL_INPUT_LINUXEV @SDL_INPUT_LINUXEV@
#cmakedefine SDL_INPUT_LINUXKD @SDL_INPUT_LINUXKD@ #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_ANDROID @SDL_JOYSTICK_ANDROID@
#cmakedefine SDL_JOYSTICK_HAIKU @SDL_JOYSTICK_HAIKU@ #cmakedefine SDL_JOYSTICK_HAIKU @SDL_JOYSTICK_HAIKU@
#cmakedefine SDL_JOYSTICK_DINPUT @SDL_JOYSTICK_DINPUT@ #cmakedefine SDL_JOYSTICK_DINPUT @SDL_JOYSTICK_DINPUT@
@ -257,47 +313,71 @@
#cmakedefine SDL_JOYSTICK_MFI @SDL_JOYSTICK_MFI@ #cmakedefine SDL_JOYSTICK_MFI @SDL_JOYSTICK_MFI@
#cmakedefine SDL_JOYSTICK_LINUX @SDL_JOYSTICK_LINUX@ #cmakedefine SDL_JOYSTICK_LINUX @SDL_JOYSTICK_LINUX@
#cmakedefine SDL_JOYSTICK_WINMM @SDL_JOYSTICK_WINMM@ #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 @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_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_DUMMY @SDL_HAPTIC_DUMMY@
#cmakedefine SDL_HAPTIC_LINUX @SDL_HAPTIC_LINUX@ #cmakedefine SDL_HAPTIC_LINUX @SDL_HAPTIC_LINUX@
#cmakedefine SDL_HAPTIC_IOKIT @SDL_HAPTIC_IOKIT@ #cmakedefine SDL_HAPTIC_IOKIT @SDL_HAPTIC_IOKIT@
#cmakedefine SDL_HAPTIC_DINPUT @SDL_HAPTIC_DINPUT@ #cmakedefine SDL_HAPTIC_DINPUT @SDL_HAPTIC_DINPUT@
#cmakedefine SDL_HAPTIC_XINPUT @SDL_HAPTIC_XINPUT@ #cmakedefine SDL_HAPTIC_XINPUT @SDL_HAPTIC_XINPUT@
#cmakedefine SDL_HAPTIC_ANDROID @SDL_HAPTIC_ANDROID@ #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 */ /* Enable various shared object loading systems */
#cmakedefine SDL_LOADSO_DLOPEN @SDL_LOADSO_DLOPEN@ #cmakedefine SDL_LOADSO_DLOPEN @SDL_LOADSO_DLOPEN@
#cmakedefine SDL_LOADSO_DUMMY @SDL_LOADSO_DUMMY@ #cmakedefine SDL_LOADSO_DUMMY @SDL_LOADSO_DUMMY@
#cmakedefine SDL_LOADSO_LDG @SDL_LOADSO_LDG@ #cmakedefine SDL_LOADSO_LDG @SDL_LOADSO_LDG@
#cmakedefine SDL_LOADSO_WINDOWS @SDL_LOADSO_WINDOWS@ #cmakedefine SDL_LOADSO_WINDOWS @SDL_LOADSO_WINDOWS@
#cmakedefine SDL_LOADSO_OS2 @SDL_LOADSO_OS2@
/* Enable various threading systems */ /* 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 @SDL_THREAD_PTHREAD@
#cmakedefine SDL_THREAD_PTHREAD_RECURSIVE_MUTEX @SDL_THREAD_PTHREAD_RECURSIVE_MUTEX@ #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_PTHREAD_RECURSIVE_MUTEX_NP @SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP@
#cmakedefine SDL_THREAD_WINDOWS @SDL_THREAD_WINDOWS@ #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 */ /* Enable various timer systems */
#cmakedefine SDL_TIMER_HAIKU @SDL_TIMER_HAIKU@ #cmakedefine SDL_TIMER_HAIKU @SDL_TIMER_HAIKU@
#cmakedefine SDL_TIMER_DUMMY @SDL_TIMER_DUMMY@ #cmakedefine SDL_TIMER_DUMMY @SDL_TIMER_DUMMY@
#cmakedefine SDL_TIMER_UNIX @SDL_TIMER_UNIX@ #cmakedefine SDL_TIMER_UNIX @SDL_TIMER_UNIX@
#cmakedefine SDL_TIMER_WINDOWS @SDL_TIMER_WINDOWS@ #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 */ /* Enable various video drivers */
#cmakedefine SDL_VIDEO_DRIVER_ANDROID @SDL_VIDEO_DRIVER_ANDROID@ #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_HAIKU @SDL_VIDEO_DRIVER_HAIKU@
#cmakedefine SDL_VIDEO_DRIVER_COCOA @SDL_VIDEO_DRIVER_COCOA@ #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 @SDL_VIDEO_DRIVER_DIRECTFB@
#cmakedefine SDL_VIDEO_DRIVER_DIRECTFB_DYNAMIC @SDL_VIDEO_DRIVER_DIRECTFB_DYNAMIC@ #cmakedefine SDL_VIDEO_DRIVER_DIRECTFB_DYNAMIC @SDL_VIDEO_DRIVER_DIRECTFB_DYNAMIC@
#cmakedefine SDL_VIDEO_DRIVER_DUMMY @SDL_VIDEO_DRIVER_DUMMY@ #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_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_WAYLAND @SDL_VIDEO_DRIVER_WAYLAND@
#cmakedefine SDL_VIDEO_DRIVER_RPI @SDL_VIDEO_DRIVER_RPI@ #cmakedefine SDL_VIDEO_DRIVER_RPI @SDL_VIDEO_DRIVER_RPI@
#cmakedefine SDL_VIDEO_DRIVER_VIVANTE @SDL_VIDEO_DRIVER_VIVANTE@ #cmakedefine SDL_VIDEO_DRIVER_VIVANTE @SDL_VIDEO_DRIVER_VIVANTE@
#cmakedefine SDL_VIDEO_DRIVER_VIVANTE_VDK @SDL_VIDEO_DRIVER_VIVANTE_VDK@ #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 @SDL_VIDEO_DRIVER_KMSDRM@
#cmakedefine SDL_VIDEO_DRIVER_KMSDRM_DYNAMIC @SDL_VIDEO_DRIVER_KMSDRM_DYNAMIC@ #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_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_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_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 @SDL_VIDEO_DRIVER_X11@
#cmakedefine SDL_VIDEO_DRIVER_X11_DYNAMIC @SDL_VIDEO_DRIVER_X11_DYNAMIC@ #cmakedefine SDL_VIDEO_DRIVER_X11_DYNAMIC @SDL_VIDEO_DRIVER_X11_DYNAMIC@
#cmakedefine SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT @SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT@ #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_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_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_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_D3D @SDL_VIDEO_RENDER_D3D@
#cmakedefine SDL_VIDEO_RENDER_D3D11 @SDL_VIDEO_RENDER_D3D11@ #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_ES @SDL_VIDEO_RENDER_OGL_ES@
#cmakedefine SDL_VIDEO_RENDER_OGL_ES2 @SDL_VIDEO_RENDER_OGL_ES2@ #cmakedefine SDL_VIDEO_RENDER_OGL_ES2 @SDL_VIDEO_RENDER_OGL_ES2@
#cmakedefine SDL_VIDEO_RENDER_DIRECTFB @SDL_VIDEO_RENDER_DIRECTFB@ #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 */ /* Enable OpenGL support */
#cmakedefine SDL_VIDEO_OPENGL @SDL_VIDEO_OPENGL@ #cmakedefine SDL_VIDEO_OPENGL @SDL_VIDEO_OPENGL@
@ -357,14 +437,20 @@
/* Enable Vulkan support */ /* Enable Vulkan support */
#cmakedefine SDL_VIDEO_VULKAN @SDL_VIDEO_VULKAN@ #cmakedefine SDL_VIDEO_VULKAN @SDL_VIDEO_VULKAN@
/* Enable Metal support */
#cmakedefine SDL_VIDEO_METAL @SDL_VIDEO_METAL@
/* Enable system power support */ /* Enable system power support */
#cmakedefine SDL_POWER_ANDROID @SDL_POWER_ANDROID@ #cmakedefine SDL_POWER_ANDROID @SDL_POWER_ANDROID@
#cmakedefine SDL_POWER_LINUX @SDL_POWER_LINUX@ #cmakedefine SDL_POWER_LINUX @SDL_POWER_LINUX@
#cmakedefine SDL_POWER_WINDOWS @SDL_POWER_WINDOWS@ #cmakedefine SDL_POWER_WINDOWS @SDL_POWER_WINDOWS@
#cmakedefine SDL_POWER_WINRT @SDL_POWER_WINRT@
#cmakedefine SDL_POWER_MACOSX @SDL_POWER_MACOSX@ #cmakedefine SDL_POWER_MACOSX @SDL_POWER_MACOSX@
#cmakedefine SDL_POWER_UIKIT @SDL_POWER_UIKIT@
#cmakedefine SDL_POWER_HAIKU @SDL_POWER_HAIKU@ #cmakedefine SDL_POWER_HAIKU @SDL_POWER_HAIKU@
#cmakedefine SDL_POWER_EMSCRIPTEN @SDL_POWER_EMSCRIPTEN@ #cmakedefine SDL_POWER_EMSCRIPTEN @SDL_POWER_EMSCRIPTEN@
#cmakedefine SDL_POWER_HARDWIRED @SDL_POWER_HARDWIRED@ #cmakedefine SDL_POWER_HARDWIRED @SDL_POWER_HARDWIRED@
#cmakedefine SDL_POWER_VITA @SDL_POWER_VITA@
/* Enable system filesystem support */ /* Enable system filesystem support */
#cmakedefine SDL_FILESYSTEM_ANDROID @SDL_FILESYSTEM_ANDROID@ #cmakedefine SDL_FILESYSTEM_ANDROID @SDL_FILESYSTEM_ANDROID@
@ -374,16 +460,25 @@
#cmakedefine SDL_FILESYSTEM_UNIX @SDL_FILESYSTEM_UNIX@ #cmakedefine SDL_FILESYSTEM_UNIX @SDL_FILESYSTEM_UNIX@
#cmakedefine SDL_FILESYSTEM_WINDOWS @SDL_FILESYSTEM_WINDOWS@ #cmakedefine SDL_FILESYSTEM_WINDOWS @SDL_FILESYSTEM_WINDOWS@
#cmakedefine SDL_FILESYSTEM_EMSCRIPTEN @SDL_FILESYSTEM_EMSCRIPTEN@ #cmakedefine SDL_FILESYSTEM_EMSCRIPTEN @SDL_FILESYSTEM_EMSCRIPTEN@
#cmakedefine SDL_FILESYSTEM_OS2 @SDL_FILESYSTEM_OS2@
#cmakedefine SDL_FILESYSTEM_VITA @SDL_FILESYSTEM_VITA@
/* Enable assembly routines */ /* Enable assembly routines */
#cmakedefine SDL_ASSEMBLY_ROUTINES @SDL_ASSEMBLY_ROUTINES@ #cmakedefine SDL_ASSEMBLY_ROUTINES @SDL_ASSEMBLY_ROUTINES@
#cmakedefine SDL_ALTIVEC_BLITTERS @SDL_ALTIVEC_BLITTERS@ #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 */ /* Enable dynamic libsamplerate support */
#cmakedefine SDL_LIBSAMPLERATE_DYNAMIC @SDL_LIBSAMPLERATE_DYNAMIC@ #cmakedefine SDL_LIBSAMPLERATE_DYNAMIC @SDL_LIBSAMPLERATE_DYNAMIC@
/* Platform specific definitions */ /* 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) # if !defined(_STDINT_H_) && !defined(_STDINT_H) && !defined(HAVE_STDINT_H) && !defined(_HAVE_STDINT_H)
typedef unsigned int size_t; typedef unsigned int size_t;
typedef signed char int8_t; typedef signed char int8_t;

View file

@ -1,6 +1,6 @@
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages 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++ */ /* Make sure that this isn't included by Visual C++ */
#ifdef _MSC_VER #ifdef _MSC_VER
#error You should run hg revert SDL_config.h #error You should run hg revert SDL_config.h
#endif #endif
/* C language features */ /* C language features */
@ -42,51 +42,41 @@
#undef volatile #undef volatile
/* C datatypes */ /* C datatypes */
#ifdef __LP64__ #if defined(__LP64__) || defined(_LP64) || defined(_WIN64)
#define SIZEOF_VOIDP 8 #define SIZEOF_VOIDP 8
#else #else
#define SIZEOF_VOIDP 4 #define SIZEOF_VOIDP 4
#endif #endif
#undef HAVE_GCC_ATOMICS #undef HAVE_GCC_ATOMICS
#undef HAVE_GCC_SYNC_LOCK_TEST_AND_SET #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 */ /* Comment this if you want to build without any C library requirements */
#undef HAVE_LIBC #undef HAVE_LIBC
#if HAVE_LIBC #if HAVE_LIBC
/* Useful headers */ /* Useful headers */
#undef HAVE_ALLOCA_H
#undef HAVE_SYS_TYPES_H
#undef HAVE_STDIO_H
#undef STDC_HEADERS #undef STDC_HEADERS
#undef HAVE_STDLIB_H #undef HAVE_ALLOCA_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_CTYPE_H #undef HAVE_CTYPE_H
#undef HAVE_MATH_H #undef HAVE_FLOAT_H
#undef HAVE_ICONV_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_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_PTHREAD_NP_H
#undef HAVE_LIBUDEV_H #undef HAVE_LIBUNWIND_H
#undef HAVE_DBUS_DBUS_H
#undef HAVE_IBUS_IBUS_H
#undef HAVE_FCITX_FRONTEND_H
#undef HAVE_LIBSAMPLERATE_H
/* C library functions */ /* C library functions */
#undef HAVE_MALLOC #undef HAVE_MALLOC
@ -110,11 +100,18 @@
#undef HAVE_WCSLEN #undef HAVE_WCSLEN
#undef HAVE_WCSLCPY #undef HAVE_WCSLCPY
#undef HAVE_WCSLCAT #undef HAVE_WCSLCAT
#undef HAVE__WCSDUP
#undef HAVE_WCSDUP
#undef HAVE_WCSSTR
#undef HAVE_WCSCMP #undef HAVE_WCSCMP
#undef HAVE_WCSNCMP
#undef HAVE_WCSCASECMP
#undef HAVE__WCSICMP
#undef HAVE_WCSNCASECMP
#undef HAVE__WCSNICMP
#undef HAVE_STRLEN #undef HAVE_STRLEN
#undef HAVE_STRLCPY #undef HAVE_STRLCPY
#undef HAVE_STRLCAT #undef HAVE_STRLCAT
#undef HAVE_STRDUP
#undef HAVE__STRREV #undef HAVE__STRREV
#undef HAVE__STRUPR #undef HAVE__STRUPR
#undef HAVE__STRLWR #undef HAVE__STRLWR
@ -123,6 +120,7 @@
#undef HAVE_STRCHR #undef HAVE_STRCHR
#undef HAVE_STRRCHR #undef HAVE_STRRCHR
#undef HAVE_STRSTR #undef HAVE_STRSTR
#undef HAVE_STRTOK_R
#undef HAVE_ITOA #undef HAVE_ITOA
#undef HAVE__LTOA #undef HAVE__LTOA
#undef HAVE__UITOA #undef HAVE__UITOA
@ -147,25 +145,48 @@
#undef HAVE_SNPRINTF #undef HAVE_SNPRINTF
#undef HAVE_VSNPRINTF #undef HAVE_VSNPRINTF
#undef HAVE_M_PI #undef HAVE_M_PI
#undef HAVE_ATAN
#undef HAVE_ATAN2
#undef HAVE_ACOS #undef HAVE_ACOS
#undef HAVE_ACOSF
#undef HAVE_ASIN #undef HAVE_ASIN
#undef HAVE_ASINF
#undef HAVE_ATAN
#undef HAVE_ATANF
#undef HAVE_ATAN2
#undef HAVE_ATAN2F
#undef HAVE_CEIL #undef HAVE_CEIL
#undef HAVE_CEILF
#undef HAVE_COPYSIGN #undef HAVE_COPYSIGN
#undef HAVE_COPYSIGNF
#undef HAVE_COS #undef HAVE_COS
#undef HAVE_COSF #undef HAVE_COSF
#undef HAVE_EXP
#undef HAVE_EXPF
#undef HAVE_FABS #undef HAVE_FABS
#undef HAVE_FABSF
#undef HAVE_FLOOR #undef HAVE_FLOOR
#undef HAVE_FLOORF
#undef HAVE_FMOD
#undef HAVE_FMODF
#undef HAVE_LOG #undef HAVE_LOG
#undef HAVE_LOGF
#undef HAVE_LOG10
#undef HAVE_LOG10F
#undef HAVE_LROUND
#undef HAVE_LROUNDF
#undef HAVE_POW #undef HAVE_POW
#undef HAVE_POWF
#undef HAVE_ROUND
#undef HAVE_ROUNDF
#undef HAVE_SCALBN #undef HAVE_SCALBN
#undef HAVE_SCALBNF
#undef HAVE_SIN #undef HAVE_SIN
#undef HAVE_SINF #undef HAVE_SINF
#undef HAVE_SQRT #undef HAVE_SQRT
#undef HAVE_SQRTF #undef HAVE_SQRTF
#undef HAVE_TAN #undef HAVE_TAN
#undef HAVE_TANF #undef HAVE_TANF
#undef HAVE_TRUNC
#undef HAVE_TRUNCF
#undef HAVE_FOPEN64 #undef HAVE_FOPEN64
#undef HAVE_FSEEKO #undef HAVE_FSEEKO
#undef HAVE_FSEEKO64 #undef HAVE_FSEEKO64
@ -183,14 +204,42 @@
#undef HAVE_PTHREAD_SET_NAME_NP #undef HAVE_PTHREAD_SET_NAME_NP
#undef HAVE_SEM_TIMEDWAIT #undef HAVE_SEM_TIMEDWAIT
#undef HAVE_GETAUXVAL #undef HAVE_GETAUXVAL
#undef HAVE_ELF_AUX_INFO
#undef HAVE_POLL #undef HAVE_POLL
#undef HAVE__EXIT
#else #else
#define HAVE_STDARG_H 1 #define HAVE_STDARG_H 1
#define HAVE_STDDEF_H 1 #define HAVE_STDDEF_H 1
#define HAVE_STDINT_H 1 #define HAVE_STDINT_H 1
#endif /* HAVE_LIBC */ #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 */ /* SDL internal assertion support */
#undef SDL_DEFAULT_ASSERT_LEVEL #undef SDL_DEFAULT_ASSERT_LEVEL
@ -202,6 +251,7 @@
#undef SDL_FILE_DISABLED #undef SDL_FILE_DISABLED
#undef SDL_JOYSTICK_DISABLED #undef SDL_JOYSTICK_DISABLED
#undef SDL_HAPTIC_DISABLED #undef SDL_HAPTIC_DISABLED
#undef SDL_SENSOR_DISABLED
#undef SDL_LOADSO_DISABLED #undef SDL_LOADSO_DISABLED
#undef SDL_RENDER_DISABLED #undef SDL_RENDER_DISABLED
#undef SDL_THREADS_DISABLED #undef SDL_THREADS_DISABLED
@ -235,6 +285,8 @@
#undef SDL_AUDIO_DRIVER_OSS #undef SDL_AUDIO_DRIVER_OSS
#undef SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H #undef SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H
#undef SDL_AUDIO_DRIVER_PAUDIO #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
#undef SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC #undef SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC
#undef SDL_AUDIO_DRIVER_QSA #undef SDL_AUDIO_DRIVER_QSA
@ -243,46 +295,63 @@
#undef SDL_AUDIO_DRIVER_SUNAUDIO #undef SDL_AUDIO_DRIVER_SUNAUDIO
#undef SDL_AUDIO_DRIVER_WASAPI #undef SDL_AUDIO_DRIVER_WASAPI
#undef SDL_AUDIO_DRIVER_WINMM #undef SDL_AUDIO_DRIVER_WINMM
#undef SDL_AUDIO_DRIVER_XAUDIO2 #undef SDL_AUDIO_DRIVER_OS2
/* Enable various input drivers */ /* Enable various input drivers */
#undef SDL_INPUT_LINUXEV #undef SDL_INPUT_LINUXEV
#undef SDL_INPUT_FBSDKBIO
#undef SDL_INPUT_LINUXKD #undef SDL_INPUT_LINUXKD
#undef SDL_INPUT_TSLIB #undef SDL_INPUT_WSCONS
#undef SDL_JOYSTICK_HAIKU #undef SDL_JOYSTICK_HAIKU
#undef SDL_JOYSTICK_DINPUT #undef SDL_JOYSTICK_DINPUT
#undef SDL_JOYSTICK_XINPUT #undef SDL_JOYSTICK_XINPUT
#undef SDL_JOYSTICK_DUMMY #undef SDL_JOYSTICK_DUMMY
#undef SDL_JOYSTICK_IOKIT #undef SDL_JOYSTICK_IOKIT
#undef SDL_JOYSTICK_MFI
#undef SDL_JOYSTICK_LINUX #undef SDL_JOYSTICK_LINUX
#undef SDL_JOYSTICK_ANDROID #undef SDL_JOYSTICK_ANDROID
#undef SDL_JOYSTICK_WINMM #undef SDL_JOYSTICK_WINMM
#undef SDL_JOYSTICK_OS2
#undef SDL_JOYSTICK_USBHID #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_EMSCRIPTEN
#undef SDL_JOYSTICK_VIRTUAL
#undef SDL_HAPTIC_DUMMY #undef SDL_HAPTIC_DUMMY
#undef SDL_HAPTIC_ANDROID
#undef SDL_HAPTIC_LINUX #undef SDL_HAPTIC_LINUX
#undef SDL_HAPTIC_IOKIT #undef SDL_HAPTIC_IOKIT
#undef SDL_HAPTIC_DINPUT #undef SDL_HAPTIC_DINPUT
#undef SDL_HAPTIC_XINPUT #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 */ /* Enable various shared object loading systems */
#undef SDL_LOADSO_DLOPEN #undef SDL_LOADSO_DLOPEN
#undef SDL_LOADSO_DUMMY #undef SDL_LOADSO_DUMMY
#undef SDL_LOADSO_LDG #undef SDL_LOADSO_LDG
#undef SDL_LOADSO_WINDOWS #undef SDL_LOADSO_WINDOWS
#undef SDL_LOADSO_OS2
/* Enable various threading systems */ /* Enable various threading systems */
#undef SDL_THREAD_GENERIC_COND_SUFFIX
#undef SDL_THREAD_PTHREAD #undef SDL_THREAD_PTHREAD
#undef SDL_THREAD_PTHREAD_RECURSIVE_MUTEX #undef SDL_THREAD_PTHREAD_RECURSIVE_MUTEX
#undef SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP #undef SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP
#undef SDL_THREAD_WINDOWS #undef SDL_THREAD_WINDOWS
#undef SDL_THREAD_OS2
/* Enable various timer systems */ /* Enable various timer systems */
#undef SDL_TIMER_HAIKU #undef SDL_TIMER_HAIKU
#undef SDL_TIMER_DUMMY #undef SDL_TIMER_DUMMY
#undef SDL_TIMER_UNIX #undef SDL_TIMER_UNIX
#undef SDL_TIMER_WINDOWS #undef SDL_TIMER_WINDOWS
#undef SDL_TIMER_OS2
/* Enable various video drivers */ /* Enable various video drivers */
#undef SDL_VIDEO_DRIVER_HAIKU #undef SDL_VIDEO_DRIVER_HAIKU
@ -297,9 +366,7 @@
#undef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_EGL #undef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_EGL
#undef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_CURSOR #undef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_CURSOR
#undef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_XKBCOMMON #undef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_XKBCOMMON
#undef SDL_VIDEO_DRIVER_MIR #undef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_LIBDECOR
#undef SDL_VIDEO_DRIVER_MIR_DYNAMIC
#undef SDL_VIDEO_DRIVER_MIR_DYNAMIC_XKBCOMMON
#undef SDL_VIDEO_DRIVER_X11 #undef SDL_VIDEO_DRIVER_X11
#undef SDL_VIDEO_DRIVER_RPI #undef SDL_VIDEO_DRIVER_RPI
#undef SDL_VIDEO_DRIVER_KMSDRM #undef SDL_VIDEO_DRIVER_KMSDRM
@ -330,6 +397,7 @@
#undef SDL_VIDEO_DRIVER_NACL #undef SDL_VIDEO_DRIVER_NACL
#undef SDL_VIDEO_DRIVER_VIVANTE #undef SDL_VIDEO_DRIVER_VIVANTE
#undef SDL_VIDEO_DRIVER_VIVANTE_VDK #undef SDL_VIDEO_DRIVER_VIVANTE_VDK
#undef SDL_VIDEO_DRIVER_OS2
#undef SDL_VIDEO_DRIVER_QNX #undef SDL_VIDEO_DRIVER_QNX
#undef SDL_VIDEO_RENDER_D3D #undef SDL_VIDEO_RENDER_D3D
@ -338,6 +406,7 @@
#undef SDL_VIDEO_RENDER_OGL_ES #undef SDL_VIDEO_RENDER_OGL_ES
#undef SDL_VIDEO_RENDER_OGL_ES2 #undef SDL_VIDEO_RENDER_OGL_ES2
#undef SDL_VIDEO_RENDER_DIRECTFB #undef SDL_VIDEO_RENDER_DIRECTFB
#undef SDL_VIDEO_RENDER_METAL
/* Enable OpenGL support */ /* Enable OpenGL support */
#undef SDL_VIDEO_OPENGL #undef SDL_VIDEO_OPENGL
@ -354,6 +423,9 @@
/* Enable Vulkan support */ /* Enable Vulkan support */
#undef SDL_VIDEO_VULKAN #undef SDL_VIDEO_VULKAN
/* Enable Metal support */
#undef SDL_VIDEO_METAL
/* Enable system power support */ /* Enable system power support */
#undef SDL_POWER_LINUX #undef SDL_POWER_LINUX
#undef SDL_POWER_WINDOWS #undef SDL_POWER_WINDOWS
@ -372,10 +444,13 @@
#undef SDL_FILESYSTEM_NACL #undef SDL_FILESYSTEM_NACL
#undef SDL_FILESYSTEM_ANDROID #undef SDL_FILESYSTEM_ANDROID
#undef SDL_FILESYSTEM_EMSCRIPTEN #undef SDL_FILESYSTEM_EMSCRIPTEN
#undef SDL_FILESYSTEM_OS2
/* Enable assembly routines */ /* Enable assembly routines */
#undef SDL_ASSEMBLY_ROUTINES #undef SDL_ASSEMBLY_ROUTINES
#undef SDL_ALTIVEC_BLITTERS #undef SDL_ALTIVEC_BLITTERS
#undef SDL_ARM_SIMD_BLITTERS
#undef SDL_ARM_NEON_BLITTERS
/* Enable ime support */ /* Enable ime support */
#undef SDL_USE_IME #undef SDL_USE_IME
@ -383,6 +458,9 @@
/* Enable dynamic udev support */ /* Enable dynamic udev support */
#undef SDL_UDEV_DYNAMIC #undef SDL_UDEV_DYNAMIC
/* Enable dynamic libusb support */
#undef SDL_LIBUSB_DYNAMIC
/* Enable dynamic libsamplerate support */ /* Enable dynamic libsamplerate support */
#undef SDL_LIBSAMPLERATE_DYNAMIC #undef SDL_LIBSAMPLERATE_DYNAMIC

View file

@ -1,6 +1,6 @@
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages
@ -35,16 +35,17 @@
#define HAVE_GCC_ATOMICS 1 #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 STDC_HEADERS 1
#define HAVE_STRING_H 1 #define HAVE_ALLOCA_H 1
#define HAVE_INTTYPES_H 1
#define HAVE_STDINT_H 1
#define HAVE_CTYPE_H 1 #define HAVE_CTYPE_H 1
#define HAVE_INTTYPES_H 1
#define HAVE_LIMITS_H 1
#define HAVE_MATH_H 1 #define HAVE_MATH_H 1
#define HAVE_SIGNAL_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 */ /* C library functions */
#define HAVE_MALLOC 1 #define HAVE_MALLOC 1
@ -67,10 +68,10 @@
#define HAVE_STRLEN 1 #define HAVE_STRLEN 1
#define HAVE_STRLCPY 1 #define HAVE_STRLCPY 1
#define HAVE_STRLCAT 1 #define HAVE_STRLCAT 1
#define HAVE_STRDUP 1
#define HAVE_STRCHR 1 #define HAVE_STRCHR 1
#define HAVE_STRRCHR 1 #define HAVE_STRRCHR 1
#define HAVE_STRSTR 1 #define HAVE_STRSTR 1
#define HAVE_STRTOK_R 1
#define HAVE_STRTOL 1 #define HAVE_STRTOL 1
#define HAVE_STRTOUL 1 #define HAVE_STRTOUL 1
#define HAVE_STRTOLL 1 #define HAVE_STRTOLL 1
@ -84,41 +85,74 @@
#define HAVE_STRNCASECMP 1 #define HAVE_STRNCASECMP 1
#define HAVE_VSSCANF 1 #define HAVE_VSSCANF 1
#define HAVE_VSNPRINTF 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_ATAN 1
#define HAVE_ATANF 1
#define HAVE_ATAN2 1 #define HAVE_ATAN2 1
#define HAVE_ACOS 1 #define HAVE_ATAN2F 1
#define HAVE_ASIN 1
#define HAVE_CEIL 1 #define HAVE_CEIL 1
#define HAVE_CEILF 1
#define HAVE_COPYSIGN 1 #define HAVE_COPYSIGN 1
#define HAVE_COPYSIGNF 1
#define HAVE_COS 1 #define HAVE_COS 1
#define HAVE_COSF 1 #define HAVE_COSF 1
#define HAVE_EXP 1
#define HAVE_EXPF 1
#define HAVE_FABS 1 #define HAVE_FABS 1
#define HAVE_FABSF 1
#define HAVE_FLOOR 1 #define HAVE_FLOOR 1
#define HAVE_FLOORF 1
#define HAVE_FMOD 1
#define HAVE_FMODF 1
#define HAVE_LOG 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_POW 1
#define HAVE_POWF 1
#define HAVE_ROUND 1
#define HAVE_ROUNDF 1
#define HAVE_SCALBN 1 #define HAVE_SCALBN 1
#define HAVE_SCALBNF 1
#define HAVE_SIN 1 #define HAVE_SIN 1
#define HAVE_SINF 1 #define HAVE_SINF 1
#define HAVE_SQRT 1 #define HAVE_SQRT 1
#define HAVE_SQRTF 1 #define HAVE_SQRTF 1
#define HAVE_TAN 1 #define HAVE_TAN 1
#define HAVE_TANF 1 #define HAVE_TANF 1
#define HAVE_TRUNC 1
#define HAVE_TRUNCF 1
#define HAVE_SIGACTION 1 #define HAVE_SIGACTION 1
#define HAVE_SETJMP 1 #define HAVE_SETJMP 1
#define HAVE_NANOSLEEP 1 #define HAVE_NANOSLEEP 1
#define HAVE_SYSCONF 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 #define SIZEOF_VOIDP 4
#endif
/* Enable various audio drivers */ /* Enable various audio drivers */
#define SDL_AUDIO_DRIVER_ANDROID 1 #define SDL_AUDIO_DRIVER_ANDROID 1
#define SDL_AUDIO_DRIVER_OPENSLES 1
#define SDL_AUDIO_DRIVER_AAUDIO 0
#define SDL_AUDIO_DRIVER_DUMMY 1 #define SDL_AUDIO_DRIVER_DUMMY 1
/* Enable various input drivers */ /* Enable various input drivers */
#define SDL_JOYSTICK_ANDROID 1 #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 */ /* Enable various shared object loading systems */
#define SDL_LOADSO_DLOPEN 1 #define SDL_LOADSO_DLOPEN 1

View file

@ -1,6 +1,6 @@
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages
@ -33,16 +33,19 @@
#define HAVE_GCC_ATOMICS 1 #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 STDC_HEADERS 1
#define HAVE_STRING_H 1 #define HAVE_ALLOCA_H 1
#define HAVE_INTTYPES_H 1
#define HAVE_STDINT_H 1
#define HAVE_CTYPE_H 1 #define HAVE_CTYPE_H 1
#define HAVE_INTTYPES_H 1
#define HAVE_LIMITS_H 1
#define HAVE_MATH_H 1 #define HAVE_MATH_H 1
#define HAVE_SIGNAL_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 */ /* C library functions */
#define HAVE_MALLOC 1 #define HAVE_MALLOC 1
@ -65,10 +68,10 @@
#define HAVE_STRLEN 1 #define HAVE_STRLEN 1
#define HAVE_STRLCPY 1 #define HAVE_STRLCPY 1
#define HAVE_STRLCAT 1 #define HAVE_STRLCAT 1
#define HAVE_STRDUP 1
#define HAVE_STRCHR 1 #define HAVE_STRCHR 1
#define HAVE_STRRCHR 1 #define HAVE_STRRCHR 1
#define HAVE_STRSTR 1 #define HAVE_STRSTR 1
#define HAVE_STRTOK_R 1
#define HAVE_STRTOL 1 #define HAVE_STRTOL 1
#define HAVE_STRTOUL 1 #define HAVE_STRTOUL 1
#define HAVE_STRTOLL 1 #define HAVE_STRTOLL 1
@ -83,25 +86,48 @@
#define HAVE_VSSCANF 1 #define HAVE_VSSCANF 1
#define HAVE_VSNPRINTF 1 #define HAVE_VSNPRINTF 1
#define HAVE_M_PI 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_ATAN 1
#define HAVE_ATANF 1
#define HAVE_ATAN2 1 #define HAVE_ATAN2 1
#define HAVE_ACOS 1 #define HAVE_ATAN2F 1
#define HAVE_ASIN 1
#define HAVE_CEIL 1 #define HAVE_CEIL 1
#define HAVE_CEILF 1
#define HAVE_COPYSIGN 1 #define HAVE_COPYSIGN 1
#define HAVE_COPYSIGNF 1
#define HAVE_COS 1 #define HAVE_COS 1
#define HAVE_COSF 1 #define HAVE_COSF 1
#define HAVE_EXP 1
#define HAVE_EXPF 1
#define HAVE_FABS 1 #define HAVE_FABS 1
#define HAVE_FABSF 1
#define HAVE_FLOOR 1 #define HAVE_FLOOR 1
#define HAVE_FLOORF 1
#define HAVE_FMOD 1
#define HAVE_FMODF 1
#define HAVE_LOG 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_POW 1
#define HAVE_POWF 1
#define HAVE_ROUND 1
#define HAVE_ROUNDF 1
#define HAVE_SCALBN 1 #define HAVE_SCALBN 1
#define HAVE_SCALBNF 1
#define HAVE_SIN 1 #define HAVE_SIN 1
#define HAVE_SINF 1 #define HAVE_SINF 1
#define HAVE_SQRT 1 #define HAVE_SQRT 1
#define HAVE_SQRTF 1 #define HAVE_SQRTF 1
#define HAVE_TAN 1 #define HAVE_TAN 1
#define HAVE_TANF 1 #define HAVE_TANF 1
#define HAVE_TRUNC 1
#define HAVE_TRUNCF 1
#define HAVE_SIGACTION 1 #define HAVE_SIGACTION 1
#define HAVE_SETJMP 1 #define HAVE_SETJMP 1
#define HAVE_NANOSLEEP 1 #define HAVE_NANOSLEEP 1
@ -116,8 +142,18 @@
/* Enable the stub haptic driver (src/haptic/dummy/\*.c) */ /* Enable the stub haptic driver (src/haptic/dummy/\*.c) */
#define SDL_HAPTIC_DUMMY 1 #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_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 */ /* Enable Unix style SO loading */
#define SDL_LOADSO_DLOPEN 1 #define SDL_LOADSO_DLOPEN 1
@ -133,17 +169,33 @@
#define SDL_VIDEO_DRIVER_UIKIT 1 #define SDL_VIDEO_DRIVER_UIKIT 1
#define SDL_VIDEO_DRIVER_DUMMY 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_ES2 1
#define SDL_VIDEO_OPENGL_ES 1 #define SDL_VIDEO_OPENGL_ES 1
#define SDL_VIDEO_RENDER_OGL_ES 1 #define SDL_VIDEO_RENDER_OGL_ES 1
#define SDL_VIDEO_RENDER_OGL_ES2 1 #define SDL_VIDEO_RENDER_OGL_ES2 1
#endif
/* Enable Vulkan support */ /* Metal supported on 64-bit devices running iOS 8.0 and tvOS 9.0 and newer
#if !TARGET_OS_SIMULATOR && !TARGET_CPU_ARM // Only 64-bit devices have Metal Also supported in simulator from iOS 13.0 and tvOS 13.0
#define SDL_VIDEO_VULKAN 1 */
#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 #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 #endif
/* Enable system power support */ /* Enable system power support */
@ -155,11 +207,6 @@
/* enable iOS extended launch screen */ /* enable iOS extended launch screen */
#define SDL_IPHONE_LAUNCHSCREEN 1 #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 */ /* enable filesystem support */
#define SDL_FILESYSTEM_COCOA 1 #define SDL_FILESYSTEM_COCOA 1

View file

@ -1,6 +1,6 @@
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages
@ -37,16 +37,19 @@
#endif #endif
/* Useful headers */ /* Useful headers */
#define HAVE_ALLOCA_H 1
#define HAVE_SYS_TYPES_H 1
#define HAVE_STDIO_H 1
#define STDC_HEADERS 1 #define STDC_HEADERS 1
#define HAVE_STRING_H 1 #define HAVE_ALLOCA_H 1
#define HAVE_INTTYPES_H 1
#define HAVE_STDINT_H 1
#define HAVE_CTYPE_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_MATH_H 1
#define HAVE_SIGNAL_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 */ /* C library functions */
#define HAVE_MALLOC 1 #define HAVE_MALLOC 1
@ -68,10 +71,10 @@
#define HAVE_STRLEN 1 #define HAVE_STRLEN 1
#define HAVE_STRLCPY 1 #define HAVE_STRLCPY 1
#define HAVE_STRLCAT 1 #define HAVE_STRLCAT 1
#define HAVE_STRDUP 1
#define HAVE_STRCHR 1 #define HAVE_STRCHR 1
#define HAVE_STRRCHR 1 #define HAVE_STRRCHR 1
#define HAVE_STRSTR 1 #define HAVE_STRSTR 1
#define HAVE_STRTOK_R 1
#define HAVE_STRTOL 1 #define HAVE_STRTOL 1
#define HAVE_STRTOUL 1 #define HAVE_STRTOUL 1
#define HAVE_STRTOLL 1 #define HAVE_STRTOLL 1
@ -85,30 +88,62 @@
#define HAVE_STRNCASECMP 1 #define HAVE_STRNCASECMP 1
#define HAVE_VSSCANF 1 #define HAVE_VSSCANF 1
#define HAVE_VSNPRINTF 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_CEIL 1
#define HAVE_CEILF 1
#define HAVE_COPYSIGN 1 #define HAVE_COPYSIGN 1
#define HAVE_COPYSIGNF 1
#define HAVE_COS 1 #define HAVE_COS 1
#define HAVE_COSF 1 #define HAVE_COSF 1
#define HAVE_EXP 1
#define HAVE_EXPF 1
#define HAVE_FABS 1 #define HAVE_FABS 1
#define HAVE_FABSF 1
#define HAVE_FLOOR 1 #define HAVE_FLOOR 1
#define HAVE_FLOORF 1
#define HAVE_FMOD 1
#define HAVE_FMODF 1
#define HAVE_LOG 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_POW 1
#define HAVE_POWF 1
#define HAVE_ROUND 1
#define HAVE_ROUNDF 1
#define HAVE_SCALBN 1 #define HAVE_SCALBN 1
#define HAVE_SCALBNF 1
#define HAVE_SIN 1 #define HAVE_SIN 1
#define HAVE_SINF 1 #define HAVE_SINF 1
#define HAVE_SQRT 1 #define HAVE_SQRT 1
#define HAVE_SQRTF 1 #define HAVE_SQRTF 1
#define HAVE_TAN 1 #define HAVE_TAN 1
#define HAVE_TANF 1 #define HAVE_TANF 1
#define HAVE_TRUNC 1
#define HAVE_TRUNCF 1
#define HAVE_SIGACTION 1 #define HAVE_SIGACTION 1
#define HAVE_SETJMP 1 #define HAVE_SETJMP 1
#define HAVE_NANOSLEEP 1 #define HAVE_NANOSLEEP 1
#define HAVE_SYSCONF 1 #define HAVE_SYSCONF 1
#define HAVE_SYSCTLBYNAME 1 #define HAVE_SYSCTLBYNAME 1
#define HAVE_ATAN 1
#define HAVE_ATAN2 1 #if defined(__has_include) && (defined(__i386__) || defined(__x86_64))
#define HAVE_ACOS 1 # if __has_include(<immintrin.h>)
#define HAVE_ASIN 1 # define HAVE_IMMINTRIN_H 1
# endif
#endif
#define HAVE_GCC_ATOMICS 1
/* Enable various audio drivers */ /* Enable various audio drivers */
#define SDL_AUDIO_DRIVER_COREAUDIO 1 #define SDL_AUDIO_DRIVER_COREAUDIO 1
@ -116,9 +151,19 @@
#define SDL_AUDIO_DRIVER_DUMMY 1 #define SDL_AUDIO_DRIVER_DUMMY 1
/* Enable various input drivers */ /* Enable various input drivers */
#define SDL_JOYSTICK_HIDAPI 1
#define SDL_JOYSTICK_IOKIT 1 #define SDL_JOYSTICK_IOKIT 1
#define SDL_JOYSTICK_VIRTUAL 1
#define SDL_HAPTIC_IOKIT 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 */ /* Enable various shared object loading systems */
#define SDL_LOADSO_DLOPEN 1 #define SDL_LOADSO_DLOPEN 1
@ -133,13 +178,13 @@
#define SDL_VIDEO_DRIVER_COCOA 1 #define SDL_VIDEO_DRIVER_COCOA 1
#define SDL_VIDEO_DRIVER_DUMMY 1 #define SDL_VIDEO_DRIVER_DUMMY 1
#undef SDL_VIDEO_DRIVER_X11 #undef SDL_VIDEO_DRIVER_X11
#define SDL_VIDEO_DRIVER_X11_DYNAMIC "/usr/X11R6/lib/libX11.6.dylib" #define SDL_VIDEO_DRIVER_X11_DYNAMIC "/opt/X11/lib/libX11.6.dylib"
#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT "/usr/X11R6/lib/libXext.6.dylib" #define SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT "/opt/X11/lib/libXext.6.dylib"
#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XINERAMA "/usr/X11R6/lib/libXinerama.1.dylib" #define SDL_VIDEO_DRIVER_X11_DYNAMIC_XINERAMA "/opt/X11/lib/libXinerama.1.dylib"
#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT2 "/usr/X11R6/lib/libXi.6.dylib" #define SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT2 "/opt/X11/lib/libXi.6.dylib"
#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR "/usr/X11R6/lib/libXrandr.2.dylib" #define SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR "/opt/X11/lib/libXrandr.2.dylib"
#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS "/usr/X11R6/lib/libXss.1.dylib" #define SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS "/opt/X11/lib/libXss.1.dylib"
#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XVIDMODE "/usr/X11R6/lib/libXxf86vm.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_XDBE 1
#define SDL_VIDEO_DRIVER_X11_XINERAMA 1 #define SDL_VIDEO_DRIVER_X11_XINERAMA 1
#define SDL_VIDEO_DRIVER_X11_XRANDR 1 #define SDL_VIDEO_DRIVER_X11_XRANDR 1
@ -163,10 +208,35 @@
#define SDL_VIDEO_RENDER_OGL 1 #define SDL_VIDEO_RENDER_OGL 1
#endif #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 */ /* Enable OpenGL support */
#ifndef SDL_VIDEO_OPENGL #ifndef SDL_VIDEO_OPENGL
#define SDL_VIDEO_OPENGL 1 #define SDL_VIDEO_OPENGL 1
#endif #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 #ifndef SDL_VIDEO_OPENGL_CGL
#define SDL_VIDEO_OPENGL_CGL 1 #define SDL_VIDEO_OPENGL_CGL 1
#endif #endif
@ -174,12 +244,21 @@
#define SDL_VIDEO_OPENGL_GLX 1 #define SDL_VIDEO_OPENGL_GLX 1
#endif #endif
/* Enable Vulkan support */ /* Enable Vulkan and Metal support */
/* Metal/MoltenVK/Vulkan only supported on 64-bit architectures with 10.11+ */ #ifndef SDL_VIDEO_VULKAN
#if TARGET_CPU_X86_64 && (MAC_OS_X_VERSION_MAX_ALLOWED >= 101100) #if SDL_PLATFORM_SUPPORTS_METAL
#define SDL_VIDEO_VULKAN 1 #define SDL_VIDEO_VULKAN 1
#else #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 #endif
/* Enable system power support */ /* Enable system power support */

View file

@ -1,6 +1,6 @@
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages 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) */ /* Enable the stub haptic driver (src/haptic/dummy/\*.c) */
#define SDL_HAPTIC_DISABLED 1 #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) */ /* Enable the stub shared object loader (src/loadso/dummy/\*.c) */
#define SDL_LOADSO_DISABLED 1 #define SDL_LOADSO_DISABLED 1

View file

@ -1,6 +1,6 @@
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages
@ -25,13 +25,16 @@
#include "SDL_platform.h" #include "SDL_platform.h"
#define SIZEOF_VOIDP 4
#define SDL_AUDIO_DRIVER_DUMMY 1 #define SDL_AUDIO_DRIVER_DUMMY 1
#define SDL_AUDIO_DRIVER_DISK 1 #define SDL_AUDIO_DRIVER_DISK 1
#define SDL_AUDIO_DRIVER_OS2 1 #define SDL_AUDIO_DRIVER_OS2 1
#define SDL_POWER_DISABLED 1 #define SDL_POWER_DISABLED 1
#define SDL_JOYSTICK_DISABLED 1
#define SDL_HAPTIC_DISABLED 1 #define SDL_HAPTIC_DISABLED 1
#define SDL_JOYSTICK_DISABLED 1
/*#undef SDL_JOYSTICK_OS2 */
/*#undef SDL_JOYSTICK_HIDAPI */ /*#undef SDL_JOYSTICK_HIDAPI */
/*#undef SDL_JOYSTICK_VIRTUAL */ /*#undef SDL_JOYSTICK_VIRTUAL */
@ -42,9 +45,6 @@
/* Enable OpenGL support */ /* Enable OpenGL support */
/* #undef SDL_VIDEO_OPENGL */ /* #undef SDL_VIDEO_OPENGL */
/* Enable Vulkan support */
/* #undef SDL_VIDEO_VULKAN */
#define SDL_THREAD_OS2 1 #define SDL_THREAD_OS2 1
#define SDL_LOADSO_OS2 1 #define SDL_LOADSO_OS2 1
#define SDL_TIMER_OS2 1 #define SDL_TIMER_OS2 1
@ -105,14 +105,22 @@
#define HAVE_WCSCMP 1 #define HAVE_WCSCMP 1
#define HAVE__WCSICMP 1 #define HAVE__WCSICMP 1
#define HAVE__WCSNICMP 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_STRLEN 1
#define HAVE_STRLCPY 1 #define HAVE_STRLCPY 1
#define HAVE_STRLCAT 1 #define HAVE_STRLCAT 1
#define HAVE__STRREV 1 #define HAVE__STRREV 1
#define HAVE__STRUPR 1 #define HAVE__STRUPR 1
#define HAVE__STRLWR 1 #define HAVE__STRLWR 1
#define HAVE_INDEX 1 /* #undef HAVE_INDEX */
#define HAVE_RINDEX 1 /* #undef HAVE_RINDEX */
#define HAVE_STRCHR 1 #define HAVE_STRCHR 1
#define HAVE_STRRCHR 1 #define HAVE_STRRCHR 1
#define HAVE_STRSTR 1 #define HAVE_STRSTR 1
@ -129,14 +137,6 @@
#define HAVE_STRTOD 1 #define HAVE_STRTOD 1
#define HAVE_ATOI 1 #define HAVE_ATOI 1
#define HAVE_ATOF 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_STRCMP 1
#define HAVE_STRNCMP 1 #define HAVE_STRNCMP 1
#define HAVE_STRICMP 1 #define HAVE_STRICMP 1
@ -184,5 +184,9 @@
/* #undef HAVE_TANF */ /* #undef HAVE_TANF */
/* #undef HAVE_TRUNC */ /* #undef HAVE_TRUNC */
/* #undef HAVE_TRUNCF */ /* #undef HAVE_TRUNCF */
/* #undef HAVE_LROUND */
/* #undef HAVE_LROUNDF */
/* #undef HAVE_ROUND */
/* #undef HAVE_ROUNDF */
#endif /* SDL_config_os2_h_ */ #endif /* SDL_config_os2_h_ */

View file

@ -1,6 +1,6 @@
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages
@ -36,22 +36,24 @@
#define SDL_BYTEORDER 1234 #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 STDC_HEADERS 1
#define HAVE_STDLIB_H 1 #define HAVE_ALLOCA_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_CTYPE_H 1 #define HAVE_CTYPE_H 1
#define HAVE_MATH_H 1
#define HAVE_ICONV_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_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_MALLOC 1
#define HAVE_CALLOC 1 #define HAVE_CALLOC 1
#define HAVE_REALLOC 1 #define HAVE_REALLOC 1
@ -68,7 +70,6 @@
#define HAVE_MEMCPY 1 #define HAVE_MEMCPY 1
#define HAVE_MEMMOVE 1 #define HAVE_MEMMOVE 1
#define HAVE_STRLEN 1 #define HAVE_STRLEN 1
#define HAVE_STRDUP 1
#define HAVE_STRCHR 1 #define HAVE_STRCHR 1
#define HAVE_STRRCHR 1 #define HAVE_STRRCHR 1
#define HAVE_STRSTR 1 #define HAVE_STRSTR 1
@ -89,9 +90,15 @@
#define HAVE_COPYSIGN 1 #define HAVE_COPYSIGN 1
#define HAVE_COS 1 #define HAVE_COS 1
#define HAVE_COSF 1 #define HAVE_COSF 1
#define HAVE_EXP 1
#define HAVE_FABS 1 #define HAVE_FABS 1
#define HAVE_FLOOR 1 #define HAVE_FLOOR 1
#define HAVE_LOG 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_SCALBN 1
#define HAVE_SIN 1 #define HAVE_SIN 1
#define HAVE_SINF 1 #define HAVE_SINF 1
@ -99,6 +106,8 @@
#define HAVE_SQRTF 1 #define HAVE_SQRTF 1
#define HAVE_TAN 1 #define HAVE_TAN 1
#define HAVE_TANF 1 #define HAVE_TANF 1
#define HAVE_TRUNC 1
#define HAVE_TRUNCF 1
#define HAVE_SIGACTION 1 #define HAVE_SIGACTION 1
#define HAVE_SETJMP 1 #define HAVE_SETJMP 1
#define HAVE_NANOSLEEP 1 #define HAVE_NANOSLEEP 1
@ -107,10 +116,12 @@
#define SDL_AUDIO_DRIVER_OSS 1 #define SDL_AUDIO_DRIVER_OSS 1
#define SDL_INPUT_LINUXEV 1 #define SDL_INPUT_LINUXEV 1
#define SDL_INPUT_TSLIB 1
#define SDL_JOYSTICK_LINUX 1 #define SDL_JOYSTICK_LINUX 1
#define SDL_JOYSTICK_VIRTUAL 1
#define SDL_HAPTIC_LINUX 1 #define SDL_HAPTIC_LINUX 1
#define SDL_SENSOR_DUMMY 1
#define SDL_LOADSO_DLOPEN 1 #define SDL_LOADSO_DLOPEN 1
#define SDL_THREAD_PTHREAD 1 #define SDL_THREAD_PTHREAD 1

View file

@ -1,6 +1,6 @@
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages
@ -33,16 +33,17 @@
#define HAVE_GCC_ATOMICS 1 #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 STDC_HEADERS 1
#define HAVE_STRING_H 1 #define HAVE_ALLOCA_H 1
#define HAVE_INTTYPES_H 1
#define HAVE_STDINT_H 1
#define HAVE_CTYPE_H 1 #define HAVE_CTYPE_H 1
#define HAVE_INTTYPES_H 1
#define HAVE_LIMITS_H 1
#define HAVE_MATH_H 1 #define HAVE_MATH_H 1
#define HAVE_SIGNAL_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 */ /* C library functions */
#define HAVE_MALLOC 1 #define HAVE_MALLOC 1
@ -65,7 +66,6 @@
#define HAVE_STRLEN 1 #define HAVE_STRLEN 1
#define HAVE_STRLCPY 1 #define HAVE_STRLCPY 1
#define HAVE_STRLCAT 1 #define HAVE_STRLCAT 1
#define HAVE_STRDUP 1
#define HAVE_STRCHR 1 #define HAVE_STRCHR 1
#define HAVE_STRRCHR 1 #define HAVE_STRRCHR 1
#define HAVE_STRSTR 1 #define HAVE_STRSTR 1
@ -83,19 +83,36 @@
#define HAVE_VSSCANF 1 #define HAVE_VSSCANF 1
#define HAVE_VSNPRINTF 1 #define HAVE_VSNPRINTF 1
#define HAVE_M_PI 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_ATAN 1
#define HAVE_ATANF 1
#define HAVE_ATAN2 1 #define HAVE_ATAN2 1
#define HAVE_ACOS 1 #define HAVE_ATAN2F 1
#define HAVE_ASIN 1
#define HAVE_CEIL 1 #define HAVE_CEIL 1
#define HAVE_CEILF 1
#define HAVE_COPYSIGN 1 #define HAVE_COPYSIGN 1
#define HAVE_COPYSIGNF 1
#define HAVE_COS 1 #define HAVE_COS 1
#define HAVE_COSF 1 #define HAVE_COSF 1
#define HAVE_EXP 1
#define HAVE_EXPF 1
#define HAVE_FABS 1 #define HAVE_FABS 1
#define HAVE_FABSF 1
#define HAVE_FLOOR 1 #define HAVE_FLOOR 1
#define HAVE_FLOORF 1
#define HAVE_FMOD 1
#define HAVE_FMODF 1
#define HAVE_LOG 1 #define HAVE_LOG 1
#define HAVE_LOGF 1
#define HAVE_LOG10 1
#define HAVE_LOG10F 1
#define HAVE_POW 1 #define HAVE_POW 1
#define HAVE_POWF 1
#define HAVE_SCALBN 1 #define HAVE_SCALBN 1
#define HAVE_SCALBNF 1
#define HAVE_SIN 1 #define HAVE_SIN 1
#define HAVE_SINF 1 #define HAVE_SINF 1
#define HAVE_SQRT 1 #define HAVE_SQRT 1
@ -111,22 +128,26 @@
/* PSP isn't that sophisticated */ /* PSP isn't that sophisticated */
#define LACKS_SYS_MMAN_H 1 #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 #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 #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_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 #define SDL_AUDIO_DRIVER_PSP 1
/* PSP video dirver */ /* PSP video driver */
#define SDL_VIDEO_DRIVER_PSP 1 #define SDL_VIDEO_DRIVER_PSP 1
/* PSP render dirver */ /* PSP render driver */
#define SDL_VIDEO_RENDER_PSP 1 #define SDL_VIDEO_RENDER_PSP 1
#define SDL_POWER_PSP 1 #define SDL_POWER_PSP 1

View file

@ -1,6 +1,6 @@
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages 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 */ /* This is a set of defines to configure the SDL features */
#if !defined(_STDINT_H_) && (!defined(HAVE_STDINT_H) || !_HAVE_STDINT_H) #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 #define HAVE_STDINT_H 1
#elif defined(_MSC_VER) #elif defined(_MSC_VER)
typedef signed __int8 int8_t; typedef signed __int8 int8_t;
@ -82,16 +82,28 @@ typedef unsigned int uintptr_t;
#define HAVE_DSOUND_H 1 #define HAVE_DSOUND_H 1
#define HAVE_DXGI_H 1 #define HAVE_DXGI_H 1
#define HAVE_XINPUT_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(<immintrin.h>)
# define HAVE_IMMINTRIN_H 1
# endif
#endif
/* This is disabled by default to avoid C runtime dependencies and manifest requirements */ /* This is disabled by default to avoid C runtime dependencies and manifest requirements */
#ifdef HAVE_LIBC #ifdef HAVE_LIBC
/* Useful headers */ /* Useful headers */
#define HAVE_STDIO_H 1
#define STDC_HEADERS 1 #define STDC_HEADERS 1
#define HAVE_STRING_H 1
#define HAVE_CTYPE_H 1 #define HAVE_CTYPE_H 1
#define HAVE_FLOAT_H 1
#define HAVE_LIMITS_H 1
#define HAVE_MATH_H 1 #define HAVE_MATH_H 1
#define HAVE_SIGNAL_H 1 #define HAVE_SIGNAL_H 1
#define HAVE_STDIO_H 1
#define HAVE_STRING_H 1
/* C library functions */ /* C library functions */
#define HAVE_MALLOC 1 #define HAVE_MALLOC 1
@ -107,13 +119,16 @@ typedef unsigned int uintptr_t;
#define HAVE_MEMCMP 1 #define HAVE_MEMCMP 1
#define HAVE_STRLEN 1 #define HAVE_STRLEN 1
#define HAVE__STRREV 1 #define HAVE__STRREV 1
#define HAVE__STRUPR 1 /* These functions have security warnings, so we won't use them */
#define HAVE__STRLWR 1 /* #undef HAVE__STRUPR */
/* #undef HAVE__STRLWR */
#define HAVE_STRCHR 1 #define HAVE_STRCHR 1
#define HAVE_STRRCHR 1 #define HAVE_STRRCHR 1
#define HAVE_STRSTR 1 #define HAVE_STRSTR 1
#define HAVE__LTOA 1 /* #undef HAVE_STRTOK_R */
#define HAVE__ULTOA 1 /* These functions have security warnings, so we won't use them */
/* #undef HAVE__LTOA */
/* #undef HAVE__ULTOA */
#define HAVE_STRTOL 1 #define HAVE_STRTOL 1
#define HAVE_STRTOUL 1 #define HAVE_STRTOUL 1
#define HAVE_STRTOD 1 #define HAVE_STRTOD 1
@ -123,28 +138,60 @@ typedef unsigned int uintptr_t;
#define HAVE_STRNCMP 1 #define HAVE_STRNCMP 1
#define HAVE__STRICMP 1 #define HAVE__STRICMP 1
#define HAVE__STRNICMP 1 #define HAVE__STRNICMP 1
#define HAVE_ATAN 1 #define HAVE__WCSICMP 1
#define HAVE_ATAN2 1 #define HAVE__WCSNICMP 1
#define HAVE_ACOS 1 #define HAVE__WCSDUP 1
#define HAVE_ASIN 1 #define HAVE_ACOS 1
#define HAVE_CEIL 1 #define HAVE_ACOSF 1
#define HAVE_COS 1 #define HAVE_ASIN 1
#define HAVE_COSF 1 #define HAVE_ASINF 1
#define HAVE_FABS 1 #define HAVE_ATAN 1
#define HAVE_FLOOR 1 #define HAVE_ATANF 1
#define HAVE_LOG 1 #define HAVE_ATAN2 1
#define HAVE_POW 1 #define HAVE_ATAN2F 1
#define HAVE_SIN 1 #define HAVE_CEILF 1
#define HAVE_SINF 1 #define HAVE__COPYSIGN 1
#define HAVE_SQRT 1 #define HAVE_COS 1
#define HAVE_SQRTF 1 #define HAVE_COSF 1
#define HAVE_TAN 1 #define HAVE_EXP 1
#define HAVE_TANF 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 #if _MSC_VER >= 1800
#define HAVE_STRTOLL 1 #define HAVE_STRTOLL 1
#define HAVE_STRTOULL 1
#define HAVE_VSSCANF 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_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 #endif
#if !defined(_MSC_VER) || defined(_USE_MATH_DEFINES) #if !defined(_MSC_VER) || defined(_USE_MATH_DEFINES)
#define HAVE_M_PI 1 #define HAVE_M_PI 1
@ -154,24 +201,49 @@ typedef unsigned int uintptr_t;
#define HAVE_STDDEF_H 1 #define HAVE_STDDEF_H 1
#endif #endif
/* Check to see if we have Windows 10 build environment */
#if defined(_MSC_VER) && (_MSC_VER >= 1911) /* Visual Studio 15.3 */
#include <sdkddkver.h>
#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 */ /* Enable various audio drivers */
#define SDL_AUDIO_DRIVER_WASAPI 1 #define SDL_AUDIO_DRIVER_WASAPI 1
#define SDL_AUDIO_DRIVER_DSOUND 1 #define SDL_AUDIO_DRIVER_DSOUND 1
#define SDL_AUDIO_DRIVER_XAUDIO2 0
#define SDL_AUDIO_DRIVER_WINMM 1 #define SDL_AUDIO_DRIVER_WINMM 1
#define SDL_AUDIO_DRIVER_DISK 1 #define SDL_AUDIO_DRIVER_DISK 1
#define SDL_AUDIO_DRIVER_DUMMY 1 #define SDL_AUDIO_DRIVER_DUMMY 1
/* Enable various input drivers */ /* Enable various input drivers */
#define SDL_JOYSTICK_DINPUT 1 #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_JOYSTICK_XINPUT 1
#define SDL_HAPTIC_DINPUT 1 #define SDL_HAPTIC_DINPUT 1
#define SDL_HAPTIC_XINPUT 1 #define SDL_HAPTIC_XINPUT 1
/* Enable the sensor driver */
#define SDL_SENSOR_WINDOWS 1
/* Enable various shared object loading systems */ /* Enable various shared object loading systems */
#define SDL_LOADSO_WINDOWS 1 #define SDL_LOADSO_WINDOWS 1
/* Enable various threading systems */ /* Enable various threading systems */
#define SDL_THREAD_GENERIC_COND_SUFFIX 1
#define SDL_THREAD_WINDOWS 1 #define SDL_THREAD_WINDOWS 1
/* Enable various timer systems */ /* Enable various timer systems */
@ -184,8 +256,8 @@ typedef unsigned int uintptr_t;
#ifndef SDL_VIDEO_RENDER_D3D #ifndef SDL_VIDEO_RENDER_D3D
#define SDL_VIDEO_RENDER_D3D 1 #define SDL_VIDEO_RENDER_D3D 1
#endif #endif
#ifndef SDL_VIDEO_RENDER_D3D11 #ifdef SDL_WINDOWS7_SDK
#define SDL_VIDEO_RENDER_D3D11 0 #define SDL_VIDEO_RENDER_D3D11 1
#endif #endif
/* Enable OpenGL support */ /* Enable OpenGL support */
@ -223,3 +295,5 @@ typedef unsigned int uintptr_t;
#endif #endif
#endif /* SDL_config_windows_h_ */ #endif /* SDL_config_windows_h_ */
/* vi: set ts=4 sw=4 expandtab: */

View file

@ -1,6 +1,6 @@
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages 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(_STDINT_H_) && (!defined(HAVE_STDINT_H) || !_HAVE_STDINT_H)
#if defined(__GNUC__) || defined(__DMC__) || defined(__WATCOMC__) #if defined(__GNUC__) || defined(__DMC__) || defined(__WATCOMC__)
#define HAVE_STDINT_H 1 #define HAVE_STDINT_H 1
#elif defined(_MSC_VER) #elif defined(_MSC_VER)
typedef signed __int8 int8_t; typedef signed __int8 int8_t;
typedef unsigned __int8 uint8_t; typedef unsigned __int8 uint8_t;
@ -97,14 +97,19 @@ typedef unsigned int uintptr_t;
#if WINAPI_FAMILY != WINAPI_FAMILY_PHONE_APP #if WINAPI_FAMILY != WINAPI_FAMILY_PHONE_APP
#define HAVE_XINPUT_H 1 #define HAVE_XINPUT_H 1
#endif #endif
#define HAVE_MMDEVICEAPI_H 1
#define HAVE_AUDIOCLIENT_H 1
#define HAVE_LIBC 1 #define HAVE_LIBC 1
#define HAVE_STDIO_H 1
#define STDC_HEADERS 1 #define STDC_HEADERS 1
#define HAVE_STRING_H 1
#define HAVE_CTYPE_H 1 #define HAVE_CTYPE_H 1
#define HAVE_MATH_H 1
#define HAVE_FLOAT_H 1 #define HAVE_FLOAT_H 1
#define HAVE_LIMITS_H 1
#define HAVE_MATH_H 1
#define HAVE_SIGNAL_H 1 #define HAVE_SIGNAL_H 1
#define HAVE_STDIO_H 1
#define HAVE_STRING_H 1
/* C library functions */ /* C library functions */
#define HAVE_MALLOC 1 #define HAVE_MALLOC 1
@ -121,16 +126,13 @@ typedef unsigned int uintptr_t;
#define HAVE_STRLEN 1 #define HAVE_STRLEN 1
#define HAVE__STRREV 1 #define HAVE__STRREV 1
#define HAVE__STRUPR 1 #define HAVE__STRUPR 1
//#define HAVE__STRLWR 1 // TODO, WinRT: consider using _strlwr_s instead
#define HAVE_STRCHR 1 #define HAVE_STRCHR 1
#define HAVE_STRRCHR 1 #define HAVE_STRRCHR 1
#define HAVE_STRSTR 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_STRTOL 1
#define HAVE_STRTOUL 1 #define HAVE_STRTOUL 1
//#define HAVE_STRTOLL 1 /* #undef HAVE_STRTOLL */
/* #undef HAVE_STRTOULL */
#define HAVE_STRTOD 1 #define HAVE_STRTOD 1
#define HAVE_ATOI 1 #define HAVE_ATOI 1
#define HAVE_ATOF 1 #define HAVE_ATOF 1
@ -139,47 +141,79 @@ typedef unsigned int uintptr_t;
#define HAVE__STRICMP 1 #define HAVE__STRICMP 1
#define HAVE__STRNICMP 1 #define HAVE__STRNICMP 1
#define HAVE_VSNPRINTF 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_M_PI 1
#define HAVE_ATAN 1 #define HAVE_ACOS 1
#define HAVE_ATAN2 1 #define HAVE_ACOSF 1
#define HAVE_CEIL 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__COPYSIGN 1
#define HAVE_COS 1 #define HAVE_COS 1
#define HAVE_COSF 1 #define HAVE_COSF 1
#define HAVE_FABS 1 #define HAVE_EXP 1
#define HAVE_FLOOR 1 #define HAVE_EXPF 1
#define HAVE_LOG 1 #define HAVE_FABS 1
#define HAVE_POW 1 #define HAVE_FABSF 1
//#define HAVE_SCALBN 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__SCALB 1
#define HAVE_SIN 1 #define HAVE_SIN 1
#define HAVE_SINF 1 #define HAVE_SINF 1
#define HAVE_SQRT 1 #define HAVE_SQRT 1
#define HAVE_SQRTF 1 #define HAVE_SQRTF 1
#define HAVE_TAN 1 #define HAVE_TAN 1
#define HAVE_TANF 1 #define HAVE_TANF 1
#define HAVE_TRUNC 1
#define HAVE_TRUNCF 1
#define HAVE__FSEEKI64 1 #define HAVE__FSEEKI64 1
/* Enable various audio drivers */ /* Enable various audio drivers */
#define SDL_AUDIO_DRIVER_XAUDIO2 1 #define SDL_AUDIO_DRIVER_WASAPI 1
#define SDL_AUDIO_DRIVER_DISK 1 #define SDL_AUDIO_DRIVER_DISK 1
#define SDL_AUDIO_DRIVER_DUMMY 1 #define SDL_AUDIO_DRIVER_DUMMY 1
/* Enable various input drivers */ /* Enable various input drivers */
#if WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP #if WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP
#define SDL_JOYSTICK_DISABLED 1 #define SDL_JOYSTICK_DISABLED 1
#define SDL_HAPTIC_DISABLED 1 #define SDL_HAPTIC_DISABLED 1
#else #else
#define SDL_JOYSTICK_VIRTUAL 1
#define SDL_JOYSTICK_XINPUT 1 #define SDL_JOYSTICK_XINPUT 1
#define SDL_HAPTIC_XINPUT 1 #define SDL_HAPTIC_XINPUT 1
#endif #endif
/* Enable the dummy sensor driver */
#define SDL_SENSOR_DUMMY 1
/* Enable various shared object loading systems */ /* Enable various shared object loading systems */
#define SDL_LOADSO_WINDOWS 1 #define SDL_LOADSO_WINDOWS 1
/* Enable various threading systems */ /* Enable various threading systems */
#if (NTDDI_VERSION >= NTDDI_WINBLUE) #if (NTDDI_VERSION >= NTDDI_WINBLUE)
#define SDL_THREAD_GENERIC_COND_SUFFIX 1
#define SDL_THREAD_WINDOWS 1 #define SDL_THREAD_WINDOWS 1
#else #else
/* WinRT on Windows 8.0 and Windows Phone 8.0 don't support CreateThread() */ /* WinRT on Windows 8.0 and Windows Phone 8.0 don't support CreateThread() */
@ -187,10 +221,10 @@ typedef unsigned int uintptr_t;
#endif #endif
/* Enable various timer systems */ /* Enable various timer systems */
#define SDL_TIMER_WINDOWS 1 #define SDL_TIMER_WINDOWS 1
/* Enable various video drivers */ /* Enable various video drivers */
#define SDL_VIDEO_DRIVER_WINRT 1 #define SDL_VIDEO_DRIVER_WINRT 1
#define SDL_VIDEO_DRIVER_DUMMY 1 #define SDL_VIDEO_DRIVER_DUMMY 1
/* Enable OpenGL ES 2.0 (via a modified ANGLE library) */ /* 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) */ /* Enable assembly routines (Win64 doesn't have inline asm) */
#ifndef _WIN64 #ifndef _WIN64
#define SDL_ASSEMBLY_ROUTINES 1 #define SDL_ASSEMBLY_ROUTINES 1
#endif #endif
#endif /* SDL_config_winrt_h_ */ #endif /* SDL_config_winrt_h_ */

View file

@ -1,6 +1,6 @@
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages
@ -30,22 +30,24 @@
#define SDL_BYTEORDER 1234 #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 STDC_HEADERS 1
#define HAVE_STDLIB_H 1 #define HAVE_ALLOCA_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_CTYPE_H 1 #define HAVE_CTYPE_H 1
#define HAVE_MATH_H 1
#define HAVE_ICONV_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_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_MALLOC 1
#define HAVE_CALLOC 1 #define HAVE_CALLOC 1
#define HAVE_REALLOC 1 #define HAVE_REALLOC 1
@ -62,10 +64,10 @@
#define HAVE_MEMCPY 1 #define HAVE_MEMCPY 1
#define HAVE_MEMMOVE 1 #define HAVE_MEMMOVE 1
#define HAVE_STRLEN 1 #define HAVE_STRLEN 1
#define HAVE_STRDUP 1
#define HAVE_STRCHR 1 #define HAVE_STRCHR 1
#define HAVE_STRRCHR 1 #define HAVE_STRRCHR 1
#define HAVE_STRSTR 1 #define HAVE_STRSTR 1
#define HAVE_STRTOK_R 1
#define HAVE_STRTOL 1 #define HAVE_STRTOL 1
#define HAVE_STRTOUL 1 #define HAVE_STRTOUL 1
#define HAVE_STRTOLL 1 #define HAVE_STRTOLL 1
@ -79,20 +81,48 @@
#define HAVE_VSSCANF 1 #define HAVE_VSSCANF 1
#define HAVE_VSNPRINTF 1 #define HAVE_VSNPRINTF 1
#define HAVE_M_PI 1 #define HAVE_M_PI 1
#define HAVE_CEIL 1 #define HAVE_ACOS 1
#define HAVE_COPYSIGN 1 #define HAVE_ACOSF 1
#define HAVE_COS 1 #define HAVE_ASIN 1
#define HAVE_COSF 1 #define HAVE_ASINF 1
#define HAVE_FABS 1 #define HAVE_ATAN 1
#define HAVE_FLOOR 1 #define HAVE_ATANF 1
#define HAVE_LOG 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_SCALBN 1
#define HAVE_SIN 1 #define HAVE_SCALBNF 1
#define HAVE_SINF 1 #define HAVE_SIN 1
#define HAVE_SQRT 1 #define HAVE_SINF 1
#define HAVE_SQRTF 1 #define HAVE_SQRT 1
#define HAVE_TAN 1 #define HAVE_SQRTF 1
#define HAVE_TANF 1 #define HAVE_TAN 1
#define HAVE_TANF 1
#define HAVE_TRUNC 1
#define HAVE_TRUNCF 1
#define HAVE_SIGACTION 1 #define HAVE_SIGACTION 1
#define HAVE_SETJMP 1 #define HAVE_SETJMP 1
#define HAVE_NANOSLEEP 1 #define HAVE_NANOSLEEP 1
@ -102,10 +132,12 @@
#define SDL_AUDIO_DRIVER_OSS 1 #define SDL_AUDIO_DRIVER_OSS 1
#define SDL_INPUT_LINUXEV 1 #define SDL_INPUT_LINUXEV 1
#define SDL_INPUT_TSLIB 1
#define SDL_JOYSTICK_LINUX 1 #define SDL_JOYSTICK_LINUX 1
#define SDL_JOYSTICK_VIRTUAL 1
#define SDL_HAPTIC_LINUX 1 #define SDL_HAPTIC_LINUX 1
#define SDL_SENSOR_DUMMY 1
#define SDL_LOADSO_DLOPEN 1 #define SDL_LOADSO_DLOPEN 1
#define SDL_THREAD_PTHREAD 1 #define SDL_THREAD_PTHREAD 1

View file

@ -1,6 +1,6 @@
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages

View file

@ -1,6 +1,6 @@
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages

View file

@ -1,6 +1,6 @@
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages 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. * \return -1, there is no error handling for this function
*
* 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
*/ */
extern DECLSPEC int SDLCALL SDL_SetError(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(1); 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 * \brief Get the last error message that was set
* thread.
* *
* It is possible for multiple errors to occur before calling SDL_GetError(). * SDL API functions may set error messages and then succeed, so you should
* Only the last error is returned. * 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. * \return a pointer to the last error message that was set
* 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
*/ */
extern DECLSPEC const char *SDLCALL SDL_GetError(void); 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 * SDL API functions may set error messages and then succeed, so you should
* otherwise operates exactly the same as SDL_GetError(). * 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 * \return errstr
* 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
*/ */
extern DECLSPEC char * SDLCALL SDL_GetErrorMsg(char *errstr, int maxlen); extern DECLSPEC char * SDLCALL SDL_GetErrorMsg(char *errstr, int maxlen);
/** /**
* Clear any previous error message for this thread. * \brief Clear the error message for the current thread
*
* \sa SDL_GetError
* \sa SDL_SetError
*/ */
extern DECLSPEC void SDLCALL SDL_ClearError(void); extern DECLSPEC void SDLCALL SDL_ClearError(void);

View file

@ -1,6 +1,6 @@
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages
@ -38,97 +38,88 @@ extern "C" {
#endif #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 * Get the "base path". This is the directory where the application was run
* startup and save the string if you need it. * 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 * This returns an absolute path in UTF-8 encoding, and is guaranteed to
* ".app" bundle, this function returns the Resource directory (e.g. * end with a path separator ('\\' on Windows, '/' most other places).
* 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.
* *
* Supported values for the SDL_FILESYSTEM_BASE_DIR_TYPE property (Given an * The pointer returned by this function is owned by you. Please call
* application in /Applications/SDLApp/MyApp.app): * 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: * Some platforms can't determine the application's path, and on other
* `/Applications/SDLApp/MyApp.app/Contents/Resources` * platforms, this might be meaningless. In such cases, this function will
* - `bundle`: the Bundle directory. Fpr example: * return NULL.
* `/Applications/SDLApp/MyApp.app/`
* - `parent`: the containing directory of the bundle. For example:
* `/Applications/SDLApp/`
* *
* The returned path is guaranteed to end with a path separator ('\' on * \return String of base dir in UTF-8 encoding, or NULL on error.
* 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.
* *
* \sa SDL_GetPrefPath * \sa SDL_GetPrefPath
*/ */
extern DECLSPEC char *SDLCALL SDL_GetBasePath(void); 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 * 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 * files (preferences and save games, etc) that are specific to your
* application. This directory is unique per user, per application. * application. This directory is unique per user, per application.
* *
* This function will decide the appropriate location in the native * This function will decide the appropriate location in the native filesystem,
* filesystem, create the directory if necessary, and return a string of the * create the directory if necessary, and return a string of the absolute
* absolute path to the directory in UTF-8 encoding. * path to the directory in UTF-8 encoding.
* *
* On Windows, the string might look like: * 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: * 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 * You specify the name of your organization (if it's not a real organization,
* to write files (and that SDL_GetBasePath(), while it might be writable, or * your name or an Internet domain you own might do) and the name of your
* even the parent of the returned path, isn't where you should be writing * application. These should be untranslated proper names.
* things).
* *
* Both the org and app strings may become part of a directory name, so please * Both the org and app strings may become part of a directory name, so
* follow these rules: * please follow these rules:
* *
* - Try to use the same org string (_including case-sensitivity_) for all * - Try to use the same org string (including case-sensitivity) for
* your applications that use this function. * all your applications that use this function.
* - Always use a unique app string for each one, and make sure it never * - Always use a unique app string for each one, and make sure it never
* changes for an app once you've decided on it. * changes for an app once you've decided on it.
* - Unicode characters are legal, as long as it's UTF-8 encoded, but... * - Unicode characters are legal, as long as it's UTF-8 encoded, but...
* - ...only use letters, numbers, and spaces. Avoid punctuation like "Game * - ...only use letters, numbers, and spaces. Avoid punctuation like
* Name 2: Bad Guy's Revenge!" ... "Game Name 2" is sufficient. * "Game Name 2: Bad Guy's Revenge!" ... "Game Name 2" is sufficient.
* *
* The returned path is guaranteed to end with a path separator ('\' on * This returns an absolute path in UTF-8 encoding, and is guaranteed to
* Windows, '/' on most other platforms). * end with a path separator ('\\' on Windows, '/' most other places).
* *
* The pointer returned is owned by the caller. Please call SDL_free() on the * The pointer returned by this function is owned by you. Please call
* pointer when done with it. * 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 * You should assume the path returned by this function is the only safe
* \param app the name of your application * place to write files (and that SDL_GetBasePath(), while it might be
* \returns a UTF-8 string of the user directory in platform-dependent * writable, or even the parent of the returned path, aren't where you
* notation. NULL if there's a problem (creating directory failed, * should be writing things).
* etc.).
* *
* \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 * \sa SDL_GetBasePath
*/ */

View file

@ -1,6 +1,6 @@
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages
@ -46,66 +46,36 @@ typedef Sint64 SDL_GestureID;
/* Function prototypes */ /* 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); 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); 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); 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); extern DECLSPEC int SDLCALL SDL_LoadDollarTemplates(SDL_TouchID touchId, SDL_RWops *src);
/* Ends C function definitions when using C++ */ /* Ends C function definitions when using C++ */
#ifdef __cplusplus #ifdef __cplusplus
} }

View file

@ -1,6 +1,6 @@
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages
@ -821,491 +821,418 @@ typedef union SDL_HapticEffect
/* Function prototypes */ /* 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 * \return Number of haptic devices detected on the system.
* error code on failure; call SDL_GetError() for more information.
*
* \since This function is available since SDL 2.0.0.
*
* \sa SDL_HapticName
*/ */
extern DECLSPEC int SDLCALL SDL_NumHaptics(void); 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 * This can be called before any joysticks are opened.
* found, this function returns NULL. * If no name can be found, this function returns NULL.
* *
* \param device_index index of the device to query. * \param device_index Index of the device to get its name.
* \returns the name of the device or NULL on failure; call SDL_GetError() for * \return Name of the device or NULL on error.
* more information.
* *
* \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); 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 * The index passed as an argument refers to the N'th haptic device on this
* system. * system.
* *
* When opening a haptic device, its gain will be set to maximum and * When opening a haptic device, its gain will be set to maximum and
* autocenter will be disabled. To modify these values use SDL_HapticSetGain() * autocenter will be disabled. To modify these values use
* and SDL_HapticSetAutocenter(). * SDL_HapticSetGain() and SDL_HapticSetAutocenter().
* *
* \param device_index index of the device to open * \param device_index Index of the device to open.
* \returns the device identifier or NULL on failure; call SDL_GetError() for * \return Device identifier or NULL on error.
* more information.
* *
* \since This function is available since SDL 2.0.0. * \sa SDL_HapticIndex
* * \sa SDL_HapticOpenFromMouse
* \sa SDL_HapticClose * \sa SDL_HapticOpenFromJoystick
* \sa SDL_HapticIndex * \sa SDL_HapticClose
* \sa SDL_HapticOpenFromJoystick * \sa SDL_HapticSetGain
* \sa SDL_HapticOpenFromMouse * \sa SDL_HapticSetAutocenter
* \sa SDL_HapticPause * \sa SDL_HapticPause
* \sa SDL_HapticSetAutocenter * \sa SDL_HapticStopAll
* \sa SDL_HapticSetGain
* \sa SDL_HapticStopAll
*/ */
extern DECLSPEC SDL_Haptic *SDLCALL SDL_HapticOpen(int device_index); 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 * \param device_index Index to check to see if it has been opened.
* \returns 1 if it has been opened, 0 if it hasn't or on failure; call * \return 1 if it has been opened or 0 if it hasn't.
* SDL_GetError() for more information.
* *
* \since This function is available since SDL 2.0.0. * \sa SDL_HapticOpen
* * \sa SDL_HapticIndex
* \sa SDL_HapticIndex
* \sa SDL_HapticOpen
*/ */
extern DECLSPEC int SDLCALL SDL_HapticOpened(int device_index); 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 * \param haptic Haptic device to get the index of.
* \returns the index of the specified haptic device or a negative error code * \return The index of the haptic device or -1 on error.
* on failure; call SDL_GetError() for more information.
* *
* \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); 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); 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 * \return The haptic device identifier or NULL on error.
* SDL_GetError() for more information.
* *
* \since This function is available since SDL 2.0.0. * \sa SDL_MouseIsHaptic
* * \sa SDL_HapticOpen
* \sa SDL_HapticOpen
* \sa SDL_MouseIsHaptic
*/ */
extern DECLSPEC SDL_Haptic *SDLCALL SDL_HapticOpenFromMouse(void); 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 * \param joystick Joystick to test for haptic capabilities.
* \returns SDL_TRUE if the joystick is haptic, SDL_FALSE if it isn't, or a * \return SDL_TRUE if the joystick is haptic, SDL_FALSE if it isn't
* negative error code on failure; call SDL_GetError() for more * or -1 if an error occurred.
* information.
* *
* \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); 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 * You must still close the haptic device separately. It will not be closed
* with the joystick. * with the joystick.
* *
* When opened from a joystick you should first close the haptic device before * When opening from a joystick you should first close the haptic device before
* closing the joystick device. If not, on some implementations the haptic * 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 * device will also get unallocated and you'll be unable to use force feedback
* on that device. * on that device.
* *
* \param joystick the SDL_Joystick to create a haptic device from * \param joystick Joystick to create a haptic device from.
* \returns a valid haptic device identifier on success or NULL on failure; * \return A valid haptic device identifier on success or NULL on error.
* call SDL_GetError() for more information.
* *
* \since This function is available since SDL 2.0.0. * \sa SDL_HapticOpen
* * \sa SDL_HapticClose
* \sa SDL_HapticClose
* \sa SDL_HapticOpen
* \sa SDL_JoystickIsHaptic
*/ */
extern DECLSPEC SDL_Haptic *SDLCALL SDL_HapticOpenFromJoystick(SDL_Joystick * extern DECLSPEC SDL_Haptic *SDLCALL SDL_HapticOpenFromJoystick(SDL_Joystick *
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 * \param haptic Haptic device to close.
*
* \sa SDL_HapticOpen
*/ */
extern DECLSPEC void SDLCALL SDL_HapticClose(SDL_Haptic * haptic); 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 * On some platforms this isn't fully supported, and therefore is an
* approximation. Always check to see if your created effect was actually * approximation. Always check to see if your created effect was actually
* created and do not rely solely on SDL_HapticNumEffects(). * created and do not rely solely on SDL_HapticNumEffects().
* *
* \param haptic the SDL_Haptic device to query * \param haptic The haptic device to query effect max.
* \returns the number of effects the haptic device can store or a negative * \return The number of effects the haptic device can store or
* error code on failure; call SDL_GetError() for more information. * -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); 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 * \param haptic The haptic device to query maximum playing effects.
* \returns the number of effects the haptic device can play at the same time * \return 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 * or -1 on error.
* information.
* *
* \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); 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 * Example:
* \returns a list of supported haptic features in bitwise manner (OR'd), or 0 * \code
* on failure; call SDL_GetError() for more information. * 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); 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 * \sa SDL_HapticDirection
* 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.
*/ */
extern DECLSPEC int SDLCALL SDL_HapticNumAxes(SDL_Haptic * haptic); 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 haptic Haptic device to check on.
* \param effect the desired effect to query * \param effect Effect to check to see if it is supported.
* \returns SDL_TRUE if effect is supported, SDL_FALSE if it isn't, or a * \return SDL_TRUE if effect is supported, SDL_FALSE if it isn't or -1 on error.
* negative error code on failure; call SDL_GetError() for more
* information.
* *
* \since This function is available since SDL 2.0.0. * \sa SDL_HapticQuery
* * \sa SDL_HapticNewEffect
* \sa SDL_HapticNewEffect
* \sa SDL_HapticQuery
*/ */
extern DECLSPEC int SDLCALL SDL_HapticEffectSupported(SDL_Haptic * haptic, extern DECLSPEC int SDLCALL SDL_HapticEffectSupported(SDL_Haptic * haptic,
SDL_HapticEffect * SDL_HapticEffect *
effect); 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 haptic Haptic device to create the effect on.
* \param effect an SDL_HapticEffect structure containing the properties of * \param effect Properties of the effect to create.
* the effect to create * \return The identifier of the effect on success or -1 on error.
* \returns the ID of the effect on success or a negative error code on
* failure; call SDL_GetError() for more information.
* *
* \sa SDL_HapticDestroyEffect * \sa SDL_HapticUpdateEffect
* \sa SDL_HapticRunEffect * \sa SDL_HapticRunEffect
* \sa SDL_HapticUpdateEffect * \sa SDL_HapticDestroyEffect
*/ */
extern DECLSPEC int SDLCALL SDL_HapticNewEffect(SDL_Haptic * haptic, extern DECLSPEC int SDLCALL SDL_HapticNewEffect(SDL_Haptic * haptic,
SDL_HapticEffect * effect); 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 * Can be used dynamically, although behavior when dynamically changing
* direction may be strange. Specifically the effect may re-upload itself and * direction may be strange. Specifically the effect may reupload itself
* start playing from the start. You also cannot change the type either when * and start playing from the start. You cannot change the type either when
* running SDL_HapticUpdateEffect(). * running SDL_HapticUpdateEffect().
* *
* \param haptic the SDL_Haptic device that has the effect * \param haptic Haptic device that has the effect.
* \param effect the identifier of the effect to update * \param effect Identifier of the effect to update.
* \param data an SDL_HapticEffect structure containing the new effect * \param data New effect properties to use.
* properties to use * \return 0 on success or -1 on error.
* \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_HapticNewEffect
* * \sa SDL_HapticRunEffect
* \sa SDL_HapticDestroyEffect * \sa SDL_HapticDestroyEffect
* \sa SDL_HapticNewEffect
* \sa SDL_HapticRunEffect
*/ */
extern DECLSPEC int SDLCALL SDL_HapticUpdateEffect(SDL_Haptic * haptic, extern DECLSPEC int SDLCALL SDL_HapticUpdateEffect(SDL_Haptic * haptic,
int effect, int effect,
SDL_HapticEffect * data); 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 * If iterations are ::SDL_HAPTIC_INFINITY, it'll run the effect over and over
* `SDL_HAPTIC_INFINITY`. (Repeats the envelope - attack and fade.) To make * repeating the envelope (attack and fade) every time. If you only want the
* one instance of the effect last indefinitely (so the effect does not fade), * effect to last forever, set ::SDL_HAPTIC_INFINITY in the effect's length
* set the effect's `length` in its structure/union to `SDL_HAPTIC_INFINITY` * parameter.
* instead.
* *
* \param haptic the SDL_Haptic device to run the effect on * \param haptic Haptic device to run the effect on.
* \param effect the ID of the haptic effect to run * \param effect Identifier of the haptic effect to run.
* \param iterations the number of iterations to run the effect; use * \param iterations Number of iterations to run the effect. Use
* `SDL_HAPTIC_INFINITY` to repeat forever * ::SDL_HAPTIC_INFINITY for infinity.
* \returns 0 on success or a negative error code on failure; call * \return 0 on success or -1 on error.
* SDL_GetError() for more information.
* *
* \since This function is available since SDL 2.0.0. * \sa SDL_HapticStopEffect
* * \sa SDL_HapticDestroyEffect
* \sa SDL_HapticDestroyEffect * \sa SDL_HapticGetEffectStatus
* \sa SDL_HapticGetEffectStatus
* \sa SDL_HapticStopEffect
*/ */
extern DECLSPEC int SDLCALL SDL_HapticRunEffect(SDL_Haptic * haptic, extern DECLSPEC int SDLCALL SDL_HapticRunEffect(SDL_Haptic * haptic,
int effect, int effect,
Uint32 iterations); 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 * \sa SDL_HapticRunEffect
* \param effect the ID of the haptic effect to stop * \sa SDL_HapticDestroyEffect
* \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
*/ */
extern DECLSPEC int SDLCALL SDL_HapticStopEffect(SDL_Haptic * haptic, extern DECLSPEC int SDLCALL SDL_HapticStopEffect(SDL_Haptic * haptic,
int effect); 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 * This will stop the effect if it's running. Effects are automatically
* destroyed when the device is closed. * destroyed when the device is closed.
* *
* \param haptic the SDL_Haptic device to destroy the effect on * \param haptic Device to destroy the effect on.
* \param effect the ID of the haptic effect to destroy * \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, extern DECLSPEC void SDLCALL SDL_HapticDestroyEffect(SDL_Haptic * haptic,
int effect); 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 haptic Haptic device to query the effect status on.
* \param effect the ID of the haptic effect to query its status * \param effect Identifier of the effect to query its status.
* \returns 0 if it isn't playing, 1 if it is playing, or a negative error * \return 0 if it isn't playing, 1 if it is playing or -1 on error.
* code on failure; call SDL_GetError() for more information.
* *
* \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, extern DECLSPEC int SDLCALL SDL_HapticGetEffectStatus(SDL_Haptic * haptic,
int effect); 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 * 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_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 * SDL_HapticSetGain() will scale linearly using SDL_HAPTIC_GAIN_MAX as the
* maximum. * maximum.
* *
* \param haptic the SDL_Haptic device to set the gain on * \param haptic Haptic device to set the gain on.
* \param gain value to set the gain to, should be between 0 and 100 (0 - 100) * \param gain Value to set the gain to, should be between 0 and 100.
* \returns 0 on success or a negative error code on failure; call * \return 0 on success or -1 on error.
* SDL_GetError() for more information.
* *
* \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); 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 * Autocenter should be between 0 and 100. Setting it to 0 will disable
* autocentering. * 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 haptic Haptic device to set autocentering on.
* \param autocenter value to set autocenter to (0-100) * \param autocenter Value to set autocenter to, 0 disables autocentering.
* \returns 0 on success or a negative error code on failure; call * \return 0 on success or -1 on error.
* SDL_GetError() for more information.
* *
* \sa SDL_HapticQuery * \sa SDL_HapticQuery
*/ */
extern DECLSPEC int SDLCALL SDL_HapticSetAutocenter(SDL_Haptic * haptic, extern DECLSPEC int SDLCALL SDL_HapticSetAutocenter(SDL_Haptic * haptic,
int autocenter); int autocenter);
/** /**
* Pause a haptic device. * \brief Pauses a haptic device.
* *
* Device must support the `SDL_HAPTIC_PAUSE` feature. Call * Device must support the ::SDL_HAPTIC_PAUSE feature. Call
* SDL_HapticUnpause() to resume playback. * SDL_HapticUnpause() to resume playback.
* *
* Do not modify the effects nor add new ones while the device is paused. That * Do not modify the effects nor add new ones while the device is paused.
* can cause all sorts of weird errors. * That can cause all sorts of weird errors.
* *
* \param haptic the SDL_Haptic device to pause * \param haptic Haptic device to pause.
* \returns 0 on success or a negative error code on failure; call * \return 0 on success or -1 on error.
* SDL_GetError() for more information.
* *
* \sa SDL_HapticUnpause * \sa SDL_HapticUnpause
*/ */
extern DECLSPEC int SDLCALL SDL_HapticPause(SDL_Haptic * haptic); 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 * \param haptic Haptic device to unpause.
* \returns 0 on success or a negative error code on failure; call * \return 0 on success or -1 on error.
* SDL_GetError() for more information.
* *
* \sa SDL_HapticPause * \sa SDL_HapticPause
*/ */
extern DECLSPEC int SDLCALL SDL_HapticUnpause(SDL_Haptic * haptic); 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 * \param haptic Haptic device to stop.
* \returns 0 on success or a negative error code on failure; call * \return 0 on success or -1 on error.
* SDL_GetError() for more information.
*/ */
extern DECLSPEC int SDLCALL SDL_HapticStopAll(SDL_Haptic * haptic); 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 * \param haptic Haptic device to check to see if it supports rumble.
* \returns SDL_TRUE if effect is supported, SDL_FALSE if it isn't, or a * \return SDL_TRUE if effect is supported, SDL_FALSE if it isn't or -1 on error.
* negative error code on failure; call SDL_GetError() for more
* information.
* *
* \sa SDL_HapticRumbleInit * \sa SDL_HapticRumbleInit
* \sa SDL_HapticRumblePlay * \sa SDL_HapticRumblePlay
* \sa SDL_HapticRumbleStop * \sa SDL_HapticRumbleStop
*/ */
extern DECLSPEC int SDLCALL SDL_HapticRumbleSupported(SDL_Haptic * haptic); 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 * \param haptic Haptic device to initialize for simple rumble playback.
* \returns 0 on success or a negative error code on failure; call * \return 0 on success or -1 on error.
* SDL_GetError() for more information.
* *
* \since This function is available since SDL 2.0.0. * \sa SDL_HapticOpen
* * \sa SDL_HapticRumbleSupported
* \sa SDL_HapticOpen * \sa SDL_HapticRumblePlay
* \sa SDL_HapticRumblePlay * \sa SDL_HapticRumbleStop
* \sa SDL_HapticRumbleStop
* \sa SDL_HapticRumbleSupported
*/ */
extern DECLSPEC int SDLCALL SDL_HapticRumbleInit(SDL_Haptic * haptic); 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 haptic Haptic device to play rumble effect on.
* \param strength strength of the rumble to play as a 0-1 float value * \param strength Strength of the rumble to play as a 0-1 float value.
* \param length length of the rumble to play in milliseconds * \param length Length of the rumble to play in milliseconds.
* \returns 0 on success or a negative error code on failure; call * \return 0 on success or -1 on error.
* SDL_GetError() for more information.
* *
* \sa SDL_HapticRumbleInit * \sa SDL_HapticRumbleSupported
* \sa SDL_HapticRumbleStop * \sa SDL_HapticRumbleInit
* \sa SDL_HapticRumbleSupported * \sa SDL_HapticRumbleStop
*/ */
extern DECLSPEC int SDLCALL SDL_HapticRumblePlay(SDL_Haptic * haptic, float strength, Uint32 length ); 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 * \param haptic Haptic to stop the rumble on.
* \returns 0 on success or a negative error code on failure; call * \return 0 on success or -1 on error.
* SDL_GetError() for more information.
* *
* \sa SDL_HapticRumbleInit * \sa SDL_HapticRumbleSupported
* \sa SDL_HapticRumblePlay * \sa SDL_HapticRumbleInit
* \sa SDL_HapticRumbleSupported * \sa SDL_HapticRumblePlay
*/ */
extern DECLSPEC int SDLCALL SDL_HapticRumbleStop(SDL_Haptic * haptic); extern DECLSPEC int SDLCALL SDL_HapticRumbleStop(SDL_Haptic * haptic);

View file

@ -1,6 +1,6 @@
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages
@ -55,231 +55,154 @@ typedef struct SDL_Keysym
/* Function prototypes */ /* Function prototypes */
/** /**
* Query the window which currently has keyboard focus. * \brief Get the window which currently has keyboard focus.
*
* \returns the window with keyboard focus.
*/ */
extern DECLSPEC SDL_Window * SDLCALL SDL_GetKeyboardFocus(void); 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 * \param numkeys if non-NULL, receives the length of the returned array.
* valid for the whole lifetime of the application and should not be freed by
* the caller.
* *
* A array element with a value of 1 means that the key is pressed and a value * \return An array of key states. Indexes into this array are obtained by using ::SDL_Scancode values.
* of 0 means that it is not. Indexes into this array are obtained by using
* SDL_Scancode values.
* *
* Use SDL_PumpEvents() to update the state array. * \b Example:
* * \code
* This function gives you the current state after all events have been * const Uint8 *state = SDL_GetKeyboardState(NULL);
* processed, so if a key or button has been pressed and released before you * if ( state[SDL_SCANCODE_RETURN] ) {
* process events, then the pressed state will never show up in the * printf("<RETURN> is pressed.\n");
* SDL_GetKeyboardState() calls. * }
* * \endcode
* 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
*/ */
extern DECLSPEC const Uint8 *SDLCALL SDL_GetKeyboardState(int *numkeys); extern DECLSPEC const Uint8 *SDLCALL SDL_GetKeyboardState(int *numkeys);
/** /**
* Get the current key modifier state for the keyboard. * \brief 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
*/ */
extern DECLSPEC SDL_Keymod SDLCALL SDL_GetModState(void); 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 * \note This does not change the keyboard state, only the key modifier flags.
* 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
*/ */
extern DECLSPEC void SDLCALL SDL_SetModState(SDL_Keymod modstate); extern DECLSPEC void SDLCALL SDL_SetModState(SDL_Keymod modstate);
/** /**
* Get the key code corresponding to the given scancode according to the * \brief Get the key code corresponding to the given scancode according
* current keyboard layout. * to the current keyboard layout.
* *
* See SDL_Keycode for details. * See ::SDL_Keycode for details.
* *
* \param scancode the desired SDL_Scancode to query * \sa SDL_GetKeyName()
* \returns the SDL_Keycode that corresponds to the given SDL_Scancode.
*
* \sa SDL_GetKeyName
* \sa SDL_GetScancodeFromKey
*/ */
extern DECLSPEC SDL_Keycode SDLCALL SDL_GetKeyFromScancode(SDL_Scancode scancode); extern DECLSPEC SDL_Keycode SDLCALL SDL_GetKeyFromScancode(SDL_Scancode scancode);
/** /**
* Get the scancode corresponding to the given key code according to the * \brief Get the scancode corresponding to the given key code according to the
* current keyboard layout. * current keyboard layout.
* *
* See SDL_Scancode for details. * See ::SDL_Scancode for details.
* *
* \param key the desired SDL_Keycode to query * \sa SDL_GetScancodeName()
* \returns the SDL_Scancode that corresponds to the given SDL_Keycode.
*
* \sa SDL_GetKeyFromScancode
* \sa SDL_GetScancodeName
*/ */
extern DECLSPEC SDL_Scancode SDLCALL SDL_GetScancodeFromKey(SDL_Keycode key); 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, * \sa SDL_Scancode
* 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
*/ */
extern DECLSPEC const char *SDLCALL SDL_GetScancodeName(SDL_Scancode 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 * \return scancode, or SDL_SCANCODE_UNKNOWN if the name wasn't recognized
* \returns the SDL_Scancode, or `SDL_SCANCODE_UNKNOWN` if the name wasn't
* recognized; call SDL_GetError() for more information.
* *
* \since This function is available since SDL 2.0.0. * \sa SDL_Scancode
*
* \sa SDL_GetKeyFromName
* \sa SDL_GetScancodeFromKey
* \sa SDL_GetScancodeName
*/ */
extern DECLSPEC SDL_Scancode SDLCALL SDL_GetScancodeFromName(const char *name); 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 * \sa SDL_Keycode
* \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
*/ */
extern DECLSPEC const char *SDLCALL SDL_GetKeyName(SDL_Keycode key); 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 * \return key code, or SDLK_UNKNOWN if the name wasn't recognized
* \returns key code, or `SDLK_UNKNOWN` if the name wasn't recognized; call
* SDL_GetError() for more information.
* *
* \sa SDL_GetKeyFromScancode * \sa SDL_Keycode
* \sa SDL_GetKeyName
* \sa SDL_GetScancodeFromName
*/ */
extern DECLSPEC SDL_Keycode SDLCALL SDL_GetKeyFromName(const char *name); 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 * \sa SDL_StopTextInput()
* SDL window, and start emitting SDL_TextInputEvent (SDL_TEXTINPUT) and * \sa SDL_SetTextInputRect()
* SDL_TextEditingEvent (SDL_TEXTEDITING) events. Please use this function in * \sa SDL_HasScreenKeyboardSupport()
* pair with SDL_StopTextInput().
*
* On some platforms using this function activates the screen keyboard.
*
* \sa SDL_SetTextInputRect
* \sa SDL_StopTextInput
*/ */
extern DECLSPEC void SDLCALL SDL_StartTextInput(void); 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. * \sa SDL_StartTextInput()
* * \sa SDL_StopTextInput()
* \since This function is available since SDL 2.0.0.
*
* \sa SDL_StartTextInput
*/ */
extern DECLSPEC SDL_bool SDLCALL SDL_IsTextInputActive(void); 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); 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 * \sa SDL_StartTextInput()
* text (ignored if NULL)
*
* \sa SDL_StartTextInput
*/ */
extern DECLSPEC void SDLCALL SDL_SetTextInputRect(SDL_Rect *rect); 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 * \return SDL_TRUE if some keyboard support is available else SDL_FALSE.
* SDL_FALSE if not.
* *
* \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); 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 * \param window The window for which screen keyboard should be queried.
* \returns SDL_TRUE if screen keyboard is shown or SDL_FALSE if not.
* *
* \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); extern DECLSPEC SDL_bool SDLCALL SDL_IsScreenKeyboardShown(SDL_Window *window);

View file

@ -1,6 +1,6 @@
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages
@ -51,50 +51,22 @@ extern "C" {
#endif #endif
/** /**
* Dynamically load a shared object. * This function dynamically loads a shared object and returns a pointer
* * to the object handle (or NULL if there was an error).
* \param sofile a system-dependent name of the object file * The 'sofile' parameter is 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
*/ */
extern DECLSPEC void *SDLCALL SDL_LoadObject(const char *sofile); extern DECLSPEC void *SDLCALL SDL_LoadObject(const char *sofile);
/** /**
* Look up the address of the named function in a shared object. * Given an object handle, this function looks up the address of the
* * named function in the shared object and returns it. This address
* This function pointer is no longer valid after calling SDL_UnloadObject(). * 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
*/ */
extern DECLSPEC void *SDLCALL SDL_LoadFunction(void *handle, extern DECLSPEC void *SDLCALL SDL_LoadFunction(void *handle,
const char *name); const char *name);
/** /**
* Unload a shared object from memory. * Unload a shared object from memory.
*
* \param handle a valid shared object handle returned by SDL_LoadObject()
*
* \sa SDL_LoadFunction
* \sa SDL_LoadObject
*/ */
extern DECLSPEC void SDLCALL SDL_UnloadObject(void *handle); extern DECLSPEC void SDLCALL SDL_UnloadObject(void *handle);

View file

@ -1,6 +1,6 @@
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages
@ -47,44 +47,44 @@ typedef struct SDL_Locale
} 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. * 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 * When the caller is done with this array, it should call SDL_free() on
* returned value; all the memory involved is allocated in a single block, so * the returned value; all the memory involved is allocated in a single
* a single SDL_free() will suffice. * block, so a single SDL_free() will suffice.
* *
* Returned language strings are in the format xx, where 'xx' is an ISO-639 * 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). * 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 * 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 * 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 { * 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 * { "en", "US" } for American English, but { "en", NULL } means "English
* language, generically"). Language strings are never NULL, except to * language, generically"). Language strings are never NULL, except to
* terminate the array. * terminate the array.
* *
* Please note that not all of these strings are 2 characters; some are three * Please note that not all of these strings are 2 characters; some are
* or more. * three or more.
* *
* The returned list of locales are in the order of the user's preference. For * The returned list of locales are in the order of the user's preference.
* example, a German citizen that is fluent in US English and knows enough * For example, a German citizen that is fluent in US English and knows
* Japanese to navigate around Tokyo might have a list like: { "de", "en_US", * enough Japanese to navigate around Tokyo might have a list like:
* "jp", NULL }. Someone from England might prefer British English (where * { "de", "en_US", "jp", NULL }. Someone from England might prefer British
* "color" is spelled "colour", etc), but will settle for anything like it: { * English (where "color" is spelled "colour", etc), but will settle for
* "en_GB", "en", NULL }. * anything like it: { "en_GB", "en", NULL }.
* *
* This function returns NULL on error, including when the platform does not * This function returns NULL on error, including when the platform does not
* supply this information at all. * supply this information at all.
* *
* This might be a "slow" call that has to query the operating system. It's * 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 * 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 * change, usually because the user has changed a system preference outside
* your program; SDL will send an SDL_LOCALECHANGED event in this case, if * of your program; SDL will send an SDL_LOCALECHANGED event in this case,
* possible, and you can call this function again to get an updated copy of * if possible, and you can call this function again to get an updated copy
* preferred locales. * of preferred locales.
* *
* \return array of locales, terminated with a locale with a NULL language * \return array of locales, terminated with a locale with a NULL language
* field. Will return NULL on error. * field. Will return NULL on error.
*/ */
extern DECLSPEC SDL_Locale * SDLCALL SDL_GetPreferredLocales(void); extern DECLSPEC SDL_Locale * SDLCALL SDL_GetPreferredLocales(void);

View file

@ -1,6 +1,6 @@
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages 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. * \brief Set the priority of all log categories
*
* \param priority the SDL_LogPriority to assign
*
* \sa SDL_LogSetPriority
*/ */
extern DECLSPEC void SDLCALL SDL_LogSetAllPriority(SDL_LogPriority priority); extern DECLSPEC void SDLCALL SDL_LogSetAllPriority(SDL_LogPriority priority);
/** /**
* Set the priority of a particular log category. * \brief 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
*/ */
extern DECLSPEC void SDLCALL SDL_LogSetPriority(int category, extern DECLSPEC void SDLCALL SDL_LogSetPriority(int category,
SDL_LogPriority priority); SDL_LogPriority priority);
/** /**
* Get the priority of a particular log category. * \brief 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
*/ */
extern DECLSPEC SDL_LogPriority SDLCALL SDL_LogGetPriority(int 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(). * \note This is called in SDL_Quit().
*
* \sa SDL_LogSetAllPriority
* \sa SDL_LogSetPriority
*/ */
extern DECLSPEC void SDLCALL SDL_LogResetPriorities(void); extern DECLSPEC void SDLCALL SDL_LogResetPriorities(void);
/** /**
* Log a message with SDL_LOG_CATEGORY_APPLICATION and SDL_LOG_PRIORITY_INFO. * \brief 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
*/ */
extern DECLSPEC void SDLCALL SDL_Log(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(1); 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. * \brief 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
*/ */
extern DECLSPEC void SDLCALL SDL_LogVerbose(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2); 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. * \brief 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
*/ */
extern DECLSPEC void SDLCALL SDL_LogDebug(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2); 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. * \brief 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
*/ */
extern DECLSPEC void SDLCALL SDL_LogInfo(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2); 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. * \brief 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
*/ */
extern DECLSPEC void SDLCALL SDL_LogWarn(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2); 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. * \brief 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
*/ */
extern DECLSPEC void SDLCALL SDL_LogError(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2); 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. * \brief 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
*/ */
extern DECLSPEC void SDLCALL SDL_LogCritical(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2); 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. * \brief 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
*/ */
extern DECLSPEC void SDLCALL SDL_LogMessage(int category, extern DECLSPEC void SDLCALL SDL_LogMessage(int category,
SDL_LogPriority priority, SDL_LogPriority priority,
SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(3); SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(3);
/** /**
* Log a message with the specified category and priority. * \brief 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
*/ */
extern DECLSPEC void SDLCALL SDL_LogMessageV(int category, extern DECLSPEC void SDLCALL SDL_LogMessageV(int category,
SDL_LogPriority priority, SDL_LogPriority priority,
const char *fmt, va_list ap); const char *fmt, va_list ap);
/** /**
* The prototype for the log output callback function. * \brief The prototype for the log output 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
*/ */
typedef void (SDLCALL *SDL_LogOutputFunction)(void *userdata, int category, SDL_LogPriority priority, const char *message); typedef void (SDLCALL *SDL_LogOutputFunction)(void *userdata, int category, SDL_LogPriority priority, const char *message);
/** /**
* Get the current log output function. * \brief 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
*/ */
extern DECLSPEC void SDLCALL SDL_LogGetOutputFunction(SDL_LogOutputFunction *callback, void **userdata); extern DECLSPEC void SDLCALL SDL_LogGetOutputFunction(SDL_LogOutputFunction *callback, void **userdata);
/** /**
* Replace the default log output function with one of your own. * \brief This function allows you to 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
*/ */
extern DECLSPEC void SDLCALL SDL_LogSetOutputFunction(SDL_LogOutputFunction callback, void *userdata); extern DECLSPEC void SDLCALL SDL_LogSetOutputFunction(SDL_LogOutputFunction callback, void *userdata);

View file

@ -1,6 +1,6 @@
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages 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 * This is called by the real SDL main function to let the rest of the
* point. * library know that initialization was done properly.
* *
* This function is defined in SDL_main.h, along with the preprocessor rule to * Calling this yourself without knowing what you're doing can cause
* redefine main() as SDL_main(). Thus to ensure that your main() function * crashes and hard to diagnose problems with your application.
* will not be changed it is necessary to define SDL_MAIN_HANDLED before
* including SDL.h.
*
* \sa SDL_Init
*/ */
extern DECLSPEC void SDLCALL SDL_SetMainReady(void); extern DECLSPEC void SDLCALL SDL_SetMainReady(void);
#ifdef __WIN32__ #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 int SDLCALL SDL_RegisterApp(char *name, Uint32 style, void *hInst);
extern DECLSPEC void SDLCALL SDL_UnregisterApp(void); extern DECLSPEC void SDLCALL SDL_UnregisterApp(void);
@ -148,14 +144,12 @@ extern DECLSPEC void SDLCALL SDL_UnregisterApp(void);
#ifdef __WINRT__ #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 mainFunction The SDL app's C-style main().
* \param reserved reserved for future use; should be NULL * \param reserved Reserved for future use; should be NULL
* \returns 0 on success or -1 on failure; call SDL_GetError() to retrieve * \return 0 on success, -1 on failure. On failure, use SDL_GetError to retrieve more
* more information on the failure. * information on the failure.
*
* \since This function is available since SDL 2.0.3.
*/ */
extern DECLSPEC int SDLCALL SDL_WinRTRunApp(SDL_main_func mainFunction, void * reserved); 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__) #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 argc The argc parameter from the application's main() function
* \param argv The argv 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 * \param mainFunction The SDL app's C-style main().
* \return the return value from mainFunction * \return the return value from mainFunction
*/ */
extern DECLSPEC int SDLCALL SDL_UIKitRunApp(int argc, char *argv[], SDL_main_func mainFunction); extern DECLSPEC int SDLCALL SDL_UIKitRunApp(int argc, char *argv[], SDL_main_func mainFunction);

View file

@ -1,6 +1,6 @@
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages
@ -32,7 +32,7 @@ extern "C" {
#endif #endif
/** /**
* SDL_MessageBox flags. If supported will display warning icon, etc. * \brief SDL_MessageBox flags. If supported will display warning icon, etc.
*/ */
typedef enum typedef enum
{ {
@ -44,7 +44,7 @@ typedef enum
} SDL_MessageBoxFlags; } SDL_MessageBoxFlags;
/** /**
* Flags for SDL_MessageBoxButtonData. * \brief Flags for SDL_MessageBoxButtonData.
*/ */
typedef enum typedef enum
{ {
@ -53,7 +53,7 @@ typedef enum
} SDL_MessageBoxButtonFlags; } SDL_MessageBoxButtonFlags;
/** /**
* Individual button data. * \brief Individual button data.
*/ */
typedef struct typedef struct
{ {
@ -63,7 +63,7 @@ typedef struct
} SDL_MessageBoxButtonData; } SDL_MessageBoxButtonData;
/** /**
* RGB value used in a message box color scheme * \brief RGB value used in a message box color scheme
*/ */
typedef struct typedef struct
{ {
@ -81,7 +81,7 @@ typedef enum
} SDL_MessageBoxColorType; } 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 typedef struct
{ {
@ -89,7 +89,7 @@ typedef struct
} SDL_MessageBoxColorScheme; } SDL_MessageBoxColorScheme;
/** /**
* MessageBox structure containing title, text, window, etc. * \brief MessageBox structure containing title, text, window, etc.
*/ */
typedef struct typedef struct
{ {
@ -105,77 +105,32 @@ typedef struct
} SDL_MessageBoxData; } 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 * \param messageboxdata The SDL_MessageBoxData structure with title, text, etc.
* SDL_ShowSimpleMessageBox. * \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 * \return -1 on error, otherwise 0 and buttonid contains user id of button
* window, or on the main thread if the messagebox has no parent. It will * hit or -1 if dialog was closed.
* 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 * \note This function should be called on the thread that created the parent
* it useful for reporting errors like a failure to create a renderer or * window, or on the main thread if the messagebox has no parent. It will
* OpenGL context. * block execution of that thread until the user clicks a button or
* * closes the messagebox.
* 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
*/ */
extern DECLSPEC int SDLCALL SDL_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid); 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 * \param flags ::SDL_MessageBoxFlags
* SDL_ShowMessageBox. * \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 * \sa SDL_ShowMessageBox
* - `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
*/ */
extern DECLSPEC int SDLCALL SDL_ShowSimpleMessageBox(Uint32 flags, const char *title, const char *message, SDL_Window *window); extern DECLSPEC int SDLCALL SDL_ShowSimpleMessageBox(Uint32 flags, const char *title, const char *message, SDL_Window *window);

View file

@ -1,6 +1,6 @@
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages 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 * \brief Create a CAMetalLayer-backed NSView/UIView and attach it to the
* window. * specified window.
* *
* On macOS, this does *not* associate a MTLDevice with the CAMetalLayer on * On macOS, this does *not* associate a MTLDevice with the CAMetalLayer on its
* its own. It is up to user code to do that. * 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 returned handle can be casted directly to a NSView or UIView.
* the backing CAMetalLayer, call SDL_Metal_GetLayer(). * To access the backing CAMetalLayer, call SDL_Metal_GetLayer().
* *
* \sa SDL_Metal_DestroyView * \note \a window must be created with the SDL_WINDOW_METAL flag.
* \sa SDL_Metal_GetLayer *
* \sa SDL_Metal_DestroyView
* \sa SDL_Metal_GetLayer
*/ */
extern DECLSPEC SDL_MetalView SDLCALL SDL_Metal_CreateView(SDL_Window * window); 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 * This should be called before SDL_DestroyWindow, if SDL_Metal_CreateView was
* called after SDL_CreateWindow. * called after SDL_CreateWindow.
* *
* \sa SDL_Metal_CreateView * \sa SDL_Metal_CreateView
*/ */
extern DECLSPEC void SDLCALL SDL_Metal_DestroyView(SDL_MetalView view); 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); extern DECLSPEC void *SDLCALL SDL_Metal_GetLayer(SDL_MetalView view);
/** /**
* Get the size of a window's underlying drawable in pixels (for use with * \brief Get the size of a window's underlying drawable in pixels (for use
* setting viewport, scissor & etc). * with setting viewport, scissor & etc).
* *
* \param window SDL_Window from which the drawable size should be queried * \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 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 * This may differ from SDL_GetWindowSize() if we're rendering to a high-DPI
* \sa SDL_CreateWindow * 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, extern DECLSPEC void SDLCALL SDL_Metal_GetDrawableSize(SDL_Window* window, int *w,
int *h); int *h);

View file

@ -1,6 +1,6 @@
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages
@ -38,33 +38,29 @@ extern "C" {
#endif #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 * 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 * vary wildly depending on the platform. This will likely launch what
* sense to handle a specific URL's protocol (a web browser for `http://`, * 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 * etc), but it might also be able to launch file managers for directories
* other things. * and other things.
* *
* What happens when you open a URL varies wildly as well: your game window * 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 * 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 * 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 * move to the background or your process might be paused. Any given platform
* may or may not handle a given URL. * may or may not handle a given URL.
* *
* If this is unimplemented (or simply unavailable) for a platform, this will * 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 * 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). * 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 * 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 * \param url A valid URL to open.
* local files, if supported. * \return 0 on success, or -1 on error.
* \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
*/ */
extern DECLSPEC int SDLCALL SDL_OpenURL(const char *url); extern DECLSPEC int SDLCALL SDL_OpenURL(const char *url);

View file

@ -1,6 +1,6 @@
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages
@ -72,226 +72,150 @@ typedef enum
/* Function prototypes */ /* Function prototypes */
/** /**
* Get the window which currently has mouse focus. * \brief Get the window which currently has mouse focus.
*
* \returns the window with mouse focus.
*/ */
extern DECLSPEC SDL_Window * SDLCALL SDL_GetMouseFocus(void); 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 * The current button state is returned as a button bitmask, which can
* tested using the `SDL_BUTTON(X)` macros (where `X` is generally 1 for the * be tested using the SDL_BUTTON(X) macros, and x and y are set to 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 for the currently
* mouse cursor position relative to the focus window. You can pass NULL for * selected mouse. You can pass NULL for either x or y.
* 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
*/ */
extern DECLSPEC Uint32 SDLCALL SDL_GetMouseState(int *x, int *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 * 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 * reported relative to the top-left of the desktop. This can be useful if
* need to track the mouse outside of a specific window and SDL_CaptureMouse() * you need to track the mouse outside of a specific window and
* doesn't fit your needs. For example, it could be useful if you need to * SDL_CaptureMouse() doesn't fit your needs. For example, it could be
* track the mouse while dragging a window, where coordinates relative to a * useful if you need to track the mouse while dragging a window, where
* window might not be in sync at all times. * coordinates relative to a window might not be in sync at all times.
* *
* Note: SDL_GetMouseState() returns the mouse position as SDL understands it * \note SDL_GetMouseState() returns the mouse position as SDL understands
* from the last pump of the event queue. This function, however, queries the * it from the last pump of the event queue. This function, however,
* OS for the current mouse position, and as such, might be a slightly less * queries the OS for the current mouse position, and as such, might
* efficient function. Unless you know what you're doing and have a good * be a slightly less efficient function. Unless you know what you're
* reason to use this function, you probably want SDL_GetMouseState() instead. * 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 * \param x Returns the current X coord, relative to the desktop. Can be NULL.
* NULL * \param y Returns the current Y coord, relative to the desktop. Can be NULL.
* \param y filled in with the current Y coord relative to the desktop; can be * \return The current button state as a bitmask, which can be tested using the SDL_BUTTON(X) macros.
* NULL
* \returns 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_GetMouseState
*
* \sa SDL_CaptureMouse
*/ */
extern DECLSPEC Uint32 SDLCALL SDL_GetGlobalMouseState(int *x, int *y); 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 * The current button state is returned as a button bitmask, which can
* tested using the `SDL_BUTTON(X)` macros (where `X` is generally 1 for the * be tested using the SDL_BUTTON(X) macros, and x and y are set to 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().
* 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
*/ */
extern DECLSPEC Uint32 SDLCALL SDL_GetRelativeMouseState(int *x, int *y); 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 * \note This function generates a mouse motion event
* 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
*/ */
extern DECLSPEC void SDLCALL SDL_WarpMouseInWindow(SDL_Window * window, extern DECLSPEC void SDLCALL SDL_WarpMouseInWindow(SDL_Window * window,
int x, int y); 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 * \note This function generates a mouse motion event
* 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
*/ */
extern DECLSPEC int SDLCALL SDL_WarpMouseGlobal(int x, int y); 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 * \param enabled Whether or not to enable relative mode
* will try to report continuous motion in the current window. Only relative
* motion events will be delivered, the mouse position will not change.
* *
* Note that this function will not be able to provide continuous relative * \return 0 on success, or -1 if relative mode is not supported.
* motion when used over Microsoft Remote Desktop, instead motion is limited
* to the bounds of the screen.
* *
* 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. * \note This function will flush any pending mouse motion.
* \returns 0 on success or a negative error code on failure; call
* SDL_GetError() for more information.
* *
* If relative mode is not supported, this returns -1. * \sa SDL_GetRelativeMouseMode()
*
* \sa SDL_GetRelativeMouseMode
*/ */
extern DECLSPEC int SDLCALL SDL_SetRelativeMouseMode(SDL_bool enabled); 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 * \param enabled Whether or not to enable capturing
* 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.
* *
* This function may also deny mouse input to other windows--both those in * Capturing enables your app to obtain mouse events globally, instead of
* your application and others on the system--so you should use this function * just within your window. Not all video targets support this function.
* sparingly, and in small bursts. For example, you might want to track the * When capturing is enabled, the current window will get all mouse events,
* mouse while the user is dragging something, until the user releases a mouse * but unlike relative mode, no change is made to the cursor and it is
* button. It is not recommended that you capture the mouse for long periods * not restrained to your window.
* 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.
* *
* While captured, mouse events still report coordinates relative to the * This function may also deny mouse input to other windows--both those in
* current (foreground) window, but those coordinates may be outside the * your application and others on the system--so you should use this
* bounds of the window (including negative values). Capturing is only allowed * function sparingly, and in small bursts. For example, you might want to
* for the foreground window. If the window loses focus while capturing, the * track the mouse while the user is dragging something, until the user
* capture will be disabled automatically. * 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 * While captured, mouse events still report coordinates relative to the
* `SDL_WINDOW_MOUSE_CAPTURE` flag set. * 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. * While capturing is enabled, the current window will have the
* \returns 0 on success or -1 if not supported; call SDL_GetError() for more * SDL_WINDOW_MOUSE_CAPTURE flag set.
* information.
* *
* \since This function is available since SDL 2.0.4. * \return 0 on success, or -1 if not supported.
*
* \sa SDL_GetGlobalMouseState
*/ */
extern DECLSPEC int SDLCALL SDL_CaptureMouse(SDL_bool enabled); 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); 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:
* <table>
* <tr><td> data </td><td> mask </td><td> resulting pixel on screen </td></tr>
* <tr><td> 0 </td><td> 1 </td><td> White </td></tr>
* <tr><td> 1 </td><td> 1 </td><td> Black </td></tr>
* <tr><td> 0 </td><td> 0 </td><td> Transparent </td></tr>
* <tr><td> 1 </td><td> 0 </td><td> Inverted color if possible, black
* if not. </td></tr>
* </table>
* *
* The cursor is created in black and white according to the following: * \sa SDL_FreeCursor()
*
* - 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
*/ */
extern DECLSPEC SDL_Cursor *SDLCALL SDL_CreateCursor(const Uint8 * data, extern DECLSPEC SDL_Cursor *SDLCALL SDL_CreateCursor(const Uint8 * data,
const Uint8 * mask, const Uint8 * mask,
@ -299,115 +223,60 @@ extern DECLSPEC SDL_Cursor *SDLCALL SDL_CreateCursor(const Uint8 * data,
int hot_y); int hot_y);
/** /**
* Create a color cursor. * \brief Create a color cursor.
* *
* \param surface an SDL_Surface structure representing the cursor image * \sa SDL_FreeCursor()
* \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
*/ */
extern DECLSPEC SDL_Cursor *SDLCALL SDL_CreateColorCursor(SDL_Surface *surface, extern DECLSPEC SDL_Cursor *SDLCALL SDL_CreateColorCursor(SDL_Surface *surface,
int hot_x, int hot_x,
int hot_y); int hot_y);
/** /**
* Create a system cursor. * \brief Create a system cursor.
* *
* \param id an SDL_SystemCursor enum value * \sa SDL_FreeCursor()
* \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
*/ */
extern DECLSPEC SDL_Cursor *SDLCALL SDL_CreateSystemCursor(SDL_SystemCursor id); extern DECLSPEC SDL_Cursor *SDLCALL SDL_CreateSystemCursor(SDL_SystemCursor id);
/** /**
* Set the active cursor. * \brief 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
*/ */
extern DECLSPEC void SDLCALL SDL_SetCursor(SDL_Cursor * cursor); extern DECLSPEC void SDLCALL SDL_SetCursor(SDL_Cursor * cursor);
/** /**
* Get the active cursor. * \brief Return 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
*/ */
extern DECLSPEC SDL_Cursor *SDLCALL SDL_GetCursor(void); extern DECLSPEC SDL_Cursor *SDLCALL SDL_GetCursor(void);
/** /**
* Get the default cursor. * \brief Return 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
*/ */
extern DECLSPEC SDL_Cursor *SDLCALL SDL_GetDefaultCursor(void); 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(), * \sa SDL_CreateCursor()
* SDL_CreateColorCursor() or SDL_CreateSystemCursor(). * \sa SDL_CreateColorCursor()
* * \sa SDL_CreateSystemCursor()
* \param cursor the cursor to free
*
* \sa SDL_CreateColorCursor
* \sa SDL_CreateCursor
* \sa SDL_CreateSystemCursor
*/ */
extern DECLSPEC void SDLCALL SDL_FreeCursor(SDL_Cursor * cursor); 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` * \param toggle 1 to show the cursor, 0 to hide it, -1 to query the current
* displays the cursor and passing `SDL_DISABLE` hides it. * state.
* *
* The current state of the mouse cursor can be queried by passing * \return 1 if the cursor is shown, or 0 if the cursor is hidden.
* `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
*/ */
extern DECLSPEC int SDLCALL SDL_ShowCursor(int toggle); extern DECLSPEC int SDLCALL SDL_ShowCursor(int toggle);
/** /**
* Used as a mask when testing buttons in buttonstate. * Used as a mask when testing buttons in buttonstate.
* * - Button 1: Left mouse button
* - Button 1: Left mouse button * - Button 2: Middle mouse button
* - Button 2: Middle mouse button * - Button 3: Right mouse button
* - Button 3: Right mouse button
*/ */
#define SDL_BUTTON(X) (1 << ((X)-1)) #define SDL_BUTTON(X) (1 << ((X)-1))
#define SDL_BUTTON_LEFT 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_X1MASK SDL_BUTTON(SDL_BUTTON_X1)
#define SDL_BUTTON_X2MASK SDL_BUTTON(SDL_BUTTON_X2) #define SDL_BUTTON_X2MASK SDL_BUTTON(SDL_BUTTON_X2)
/* Ends C function definitions when using C++ */ /* Ends C function definitions when using C++ */
#ifdef __cplusplus #ifdef __cplusplus
} }

View file

@ -1,6 +1,6 @@
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages

View file

@ -1,6 +1,6 @@
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages

View file

@ -1,6 +1,6 @@
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages

View file

@ -1,6 +1,6 @@
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages

View file

@ -1,6 +1,6 @@
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages
@ -345,29 +345,16 @@ typedef struct SDL_PixelFormat
} SDL_PixelFormat; } SDL_PixelFormat;
/** /**
* Get the human readable name of a pixel format. * \brief 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.
*/ */
extern DECLSPEC const char* SDLCALL SDL_GetPixelFormatName(Uint32 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 * \return SDL_TRUE, or SDL_FALSE if the conversion wasn't possible.
* \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.
* *
* \sa SDL_MasksToPixelFormatEnum * \sa SDL_MasksToPixelFormatEnum()
*/ */
extern DECLSPEC SDL_bool SDLCALL SDL_PixelFormatEnumToMasks(Uint32 format, extern DECLSPEC SDL_bool SDLCALL SDL_PixelFormatEnumToMasks(Uint32 format,
int *bpp, int *bpp,
@ -377,19 +364,12 @@ extern DECLSPEC SDL_bool SDLCALL SDL_PixelFormatEnumToMasks(Uint32 format,
Uint32 * Amask); 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 * \return The pixel format, or ::SDL_PIXELFORMAT_UNKNOWN if the conversion
* possible. * wasn't possible.
* *
* \param bpp a bits per pixel value; usually 15, 16, or 32 * \sa SDL_PixelFormatEnumToMasks()
* \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
*/ */
extern DECLSPEC Uint32 SDLCALL SDL_MasksToPixelFormatEnum(int bpp, extern DECLSPEC Uint32 SDLCALL SDL_MasksToPixelFormatEnum(int bpp,
Uint32 Rmask, Uint32 Rmask,
@ -398,193 +378,84 @@ extern DECLSPEC Uint32 SDLCALL SDL_MasksToPixelFormatEnum(int bpp,
Uint32 Amask); Uint32 Amask);
/** /**
* Create an SDL_PixelFormat structure corresponding to a pixel format. * \brief Create an SDL_PixelFormat structure from a pixel format enum.
*
* 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
*/ */
extern DECLSPEC SDL_PixelFormat * SDLCALL SDL_AllocFormat(Uint32 pixel_format); extern DECLSPEC SDL_PixelFormat * SDLCALL SDL_AllocFormat(Uint32 pixel_format);
/** /**
* Free an SDL_PixelFormat structure allocated by SDL_AllocFormat(). * \brief Free an SDL_PixelFormat structure.
*
* \param format the SDL_PixelFormat structure to free
*
* \sa SDL_AllocFormat
*/ */
extern DECLSPEC void SDLCALL SDL_FreeFormat(SDL_PixelFormat *format); 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 * \note The palette entries are initialized to white.
* \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.
* *
* \sa SDL_FreePalette * \sa SDL_FreePalette()
*/ */
extern DECLSPEC SDL_Palette *SDLCALL SDL_AllocPalette(int ncolors); extern DECLSPEC SDL_Palette *SDLCALL SDL_AllocPalette(int ncolors);
/** /**
* Set the palette for a pixel format structure. * \brief 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
*/ */
extern DECLSPEC int SDLCALL SDL_SetPixelFormatPalette(SDL_PixelFormat * format, extern DECLSPEC int SDLCALL SDL_SetPixelFormatPalette(SDL_PixelFormat * format,
SDL_Palette *palette); 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 palette The palette to modify.
* \param colors an array of SDL_Color structures to copy into the palette * \param colors An array of colors to copy into the palette.
* \param firstcolor the index of the first palette entry to modify * \param firstcolor The index of the first palette entry to modify.
* \param ncolors the number of entries 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.
* *
* \sa SDL_AllocPalette * \return 0 on success, or -1 if not all of the colors could be set.
* \sa SDL_CreateRGBSurface
*/ */
extern DECLSPEC int SDLCALL SDL_SetPaletteColors(SDL_Palette * palette, extern DECLSPEC int SDLCALL SDL_SetPaletteColors(SDL_Palette * palette,
const SDL_Color * colors, const SDL_Color * colors,
int firstcolor, int ncolors); 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); 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 * \sa SDL_MapRGBA
* 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
*/ */
extern DECLSPEC Uint32 SDLCALL SDL_MapRGB(const SDL_PixelFormat * format, extern DECLSPEC Uint32 SDLCALL SDL_MapRGB(const SDL_PixelFormat * format,
Uint8 r, Uint8 g, Uint8 b); 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 * \sa SDL_MapRGB
* 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
*/ */
extern DECLSPEC Uint32 SDLCALL SDL_MapRGBA(const SDL_PixelFormat * format, extern DECLSPEC Uint32 SDLCALL SDL_MapRGBA(const SDL_PixelFormat * format,
Uint8 r, Uint8 g, Uint8 b, Uint8 r, Uint8 g, Uint8 b,
Uint8 a); 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 * \sa SDL_GetRGBA
* 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
*/ */
extern DECLSPEC void SDLCALL SDL_GetRGB(Uint32 pixel, extern DECLSPEC void SDLCALL SDL_GetRGB(Uint32 pixel,
const SDL_PixelFormat * format, const SDL_PixelFormat * format,
Uint8 * r, Uint8 * g, Uint8 * b); 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 * \sa SDL_GetRGB
* 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
*/ */
extern DECLSPEC void SDLCALL SDL_GetRGBA(Uint32 pixel, extern DECLSPEC void SDLCALL SDL_GetRGBA(Uint32 pixel,
const SDL_PixelFormat * format, const SDL_PixelFormat * format,
@ -592,12 +463,7 @@ extern DECLSPEC void SDLCALL SDL_GetRGBA(Uint32 pixel,
Uint8 * a); Uint8 * a);
/** /**
* Calculate a 256 entry gamma ramp for a gamma value. * \brief 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
*/ */
extern DECLSPEC void SDLCALL SDL_CalculateGammaRamp(float gamma, Uint16 * ramp); extern DECLSPEC void SDLCALL SDL_CalculateGammaRamp(float gamma, Uint16 * ramp);

View file

@ -1,6 +1,6 @@
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages
@ -37,7 +37,7 @@ extern "C" {
#endif #endif
/** /**
* The basic state for the system's power supply. * \brief The basic state for the system's power supply.
*/ */
typedef enum 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 * \param secs Seconds of battery life left. You can pass a NULL here if
* (especially failing batteries) are delicate hardware, and the values * you don't care. Will return -1 if we can't determine a
* reported here are best estimates based on what that hardware reports. It's * value, or we're not running on a battery.
* 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.
* *
* Battery status can change at any time; if you are concerned with power * \param pct Percentage of battery life left, between 0 and 100. You can
* state, you should call this function frequently, and perhaps ignore changes * pass a NULL here if you don't care. Will return -1 if we
* until they seem to be stable for a few seconds. * 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 * \return The state of the battery (if any).
* 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.
*/ */
extern DECLSPEC SDL_PowerState SDLCALL SDL_GetPowerInfo(int *secs, int *pct); extern DECLSPEC SDL_PowerState SDLCALL SDL_GetPowerInfo(int *secs, int *pct);

View file

@ -1,6 +1,6 @@
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages

View file

@ -1,6 +1,6 @@
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages
@ -40,10 +40,10 @@ extern "C" {
#endif #endif
/** /**
* The structure that defines a point (integer) * \brief The structure that defines a point (integer)
* *
* \sa SDL_EnclosePoints * \sa SDL_EnclosePoints
* \sa SDL_PointInRect * \sa SDL_PointInRect
*/ */
typedef struct SDL_Point typedef struct SDL_Point
{ {
@ -52,10 +52,10 @@ typedef struct SDL_Point
} 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_EnclosePoints
* \sa SDL_PointInRect * \sa SDL_PointInRect
*/ */
typedef struct SDL_FPoint 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_RectEmpty
* \sa SDL_RectEquals * \sa SDL_RectEquals
* \sa SDL_HasIntersection * \sa SDL_HasIntersection
* \sa SDL_IntersectRect * \sa SDL_IntersectRect
* \sa SDL_UnionRect * \sa SDL_UnionRect
* \sa SDL_EnclosePoints * \sa SDL_EnclosePoints
*/ */
typedef struct SDL_Rect 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 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) 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) 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) 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. * \return SDL_TRUE if there is an intersection, SDL_FALSE otherwise.
*
* \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
*/ */
extern DECLSPEC SDL_bool SDLCALL SDL_HasIntersection(const SDL_Rect * A, extern DECLSPEC SDL_bool SDLCALL SDL_HasIntersection(const SDL_Rect * A,
const SDL_Rect * B); 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. * \return SDL_TRUE if there is an intersection, SDL_FALSE otherwise.
*
* \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
*/ */
extern DECLSPEC SDL_bool SDLCALL SDL_IntersectRect(const SDL_Rect * A, extern DECLSPEC SDL_bool SDLCALL SDL_IntersectRect(const SDL_Rect * A,
const SDL_Rect * B, const SDL_Rect * B,
SDL_Rect * result); SDL_Rect * result);
/** /**
* Calculate the union of two rectangles. * \brief 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`
*/ */
extern DECLSPEC void SDLCALL SDL_UnionRect(const SDL_Rect * A, extern DECLSPEC void SDLCALL SDL_UnionRect(const SDL_Rect * A,
const SDL_Rect * B, const SDL_Rect * B,
SDL_Rect * result); 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 * \return SDL_TRUE if any points were within the clipping rect
* 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.
*/ */
extern DECLSPEC SDL_bool SDLCALL SDL_EnclosePoints(const SDL_Point * points, extern DECLSPEC SDL_bool SDLCALL SDL_EnclosePoints(const SDL_Point * points,
int count, int count,
@ -187,20 +154,9 @@ extern DECLSPEC SDL_bool SDLCALL SDL_EnclosePoints(const SDL_Point * points,
SDL_Rect * result); 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 * \return SDL_TRUE if there is an intersection, SDL_FALSE otherwise.
* 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.
*/ */
extern DECLSPEC SDL_bool SDLCALL SDL_IntersectRectAndLine(const SDL_Rect * extern DECLSPEC SDL_bool SDLCALL SDL_IntersectRectAndLine(const SDL_Rect *
rect, int *X1, rect, int *X1,

View file

@ -1,6 +1,6 @@
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages
@ -38,7 +38,7 @@
* SDL_Event structure. * SDL_Event structure.
* *
* The values in this enumeration are based on the USB usage page standard: * 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 typedef enum
{ {

View file

@ -1,6 +1,6 @@
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages 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 * 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. * 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 * In particular, you are guaranteed that the sensor list won't change, so
* API functions that take a sensor index will be valid, and sensor events * the API functions that take a sensor index will be valid, and sensor
* will not be delivered. * events will not be delivered.
*/ */
extern DECLSPEC void SDLCALL SDL_LockSensors(void); extern DECLSPEC void SDLCALL SDL_LockSensors(void);
extern DECLSPEC void SDLCALL SDL_UnlockSensors(void); extern DECLSPEC void SDLCALL SDL_UnlockSensors(void);
/** /**
* Count the number of sensors attached to the system right now. * \brief Count the number of sensors attached to the system right now
*
* \returns the number of sensors detected.
*/ */
extern DECLSPEC int SDLCALL SDL_NumSensors(void); 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 * This can be called before any sensors are opened.
* \returns the sensor name, or NULL if `device_index` is out of range. *
* \return The sensor name, or NULL if device_index is out of range.
*/ */
extern DECLSPEC const char *SDLCALL SDL_SensorGetDeviceName(int device_index); 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 * This can be called before any sensors are opened.
* \returns the SDL_SensorType, or `SDL_SENSOR_INVALID` if `device_index` is *
* out of range. * \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); 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 * This can be called before any sensors are opened.
* \returns the sensor platform dependent type, or -1 if `device_index` is out *
* of range. * \return The sensor platform dependent type, or -1 if device_index is out of range.
*/ */
extern DECLSPEC int SDLCALL SDL_SensorGetDeviceNonPortableType(int device_index); 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 * This can be called before any sensors are opened.
* \returns the sensor instance ID, or -1 if `device_index` is out of range. *
* \return The sensor instance ID, or -1 if device_index is out of range.
*/ */
extern DECLSPEC SDL_SensorID SDLCALL SDL_SensorGetDeviceInstanceID(int device_index); 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 * The index passed as an argument refers to the N'th sensor on the system.
* \returns an SDL_Sensor sensor object, or NULL if an error occurred. *
* \return A sensor identifier, or NULL if an error occurred.
*/ */
extern DECLSPEC SDL_Sensor *SDLCALL SDL_SensorOpen(int device_index); extern DECLSPEC SDL_Sensor *SDLCALL SDL_SensorOpen(int device_index);
/** /**
* Return the SDL_Sensor associated with an instance id. * 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); 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 * \return The sensor name, or NULL if the sensor is NULL.
* \returns the sensor name, or NULL if `sensor` is NULL.
*/ */
extern DECLSPEC const char *SDLCALL SDL_SensorGetName(SDL_Sensor *sensor); 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 * This can be called before any sensors are opened.
* \returns the SDL_SensorType type, or `SDL_SENSOR_INVALID` if `sensor` is *
* NULL. * \return The sensor type, or SDL_SENSOR_INVALID if the sensor is NULL.
*/ */
extern DECLSPEC SDL_SensorType SDLCALL SDL_SensorGetType(SDL_Sensor *sensor); 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 * This can be called before any sensors are opened.
* \returns the sensor platform dependent type, or -1 if `sensor` is NULL. *
* \return The sensor platform dependent type, or -1 if the sensor is NULL.
*/ */
extern DECLSPEC int SDLCALL SDL_SensorGetNonPortableType(SDL_Sensor *sensor); 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 * This can be called before any sensors are opened.
* \returns the sensor instance ID, or -1 if `sensor` is NULL. *
* \return The sensor instance ID, or -1 if the sensor is NULL.
*/ */
extern DECLSPEC SDL_SensorID SDLCALL SDL_SensorGetInstanceID(SDL_Sensor *sensor); 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 sensor The sensor to query
* \param data A pointer filled with the current sensor state * \param data A pointer filled with the current sensor state
* \param num_values The number of values to write to data * \param num_values The number of values to write to data
* \returns 0 or -1 if an error occurred. *
* \return 0 or -1 if an error occurred.
*/ */
extern DECLSPEC int SDLCALL SDL_SensorGetData(SDL_Sensor * sensor, float *data, int num_values); extern DECLSPEC int SDLCALL SDL_SensorGetData(SDL_Sensor * sensor, float *data, int num_values);
/** /**
* Close a sensor previously opened with SDL_SensorOpen(). * Close a sensor previously opened with SDL_SensorOpen()
*
* \param sensor The SDL_Sensor object to close
*/ */
extern DECLSPEC void SDLCALL SDL_SensorClose(SDL_Sensor * sensor); 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 * This is called automatically by the event loop if sensor events are enabled.
* enabled.
* *
* This needs to be called from the thread that initialized the sensor * This needs to be called from the thread that initialized the sensor subsystem.
* subsystem.
*/ */
extern DECLSPEC void SDLCALL SDL_SensorUpdate(void); extern DECLSPEC void SDLCALL SDL_SensorUpdate(void);

View file

@ -1,6 +1,6 @@
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages 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 #define SDL_WINDOW_LACKS_SHAPE -3
/** /**
* Create a window that can be shaped with the specified position, dimensions, * \brief Create a window that can be shaped with the specified position, dimensions, and flags.
* and flags.
* *
* \param title The title of the window, in UTF-8 encoding. * \param title The title of the window, in UTF-8 encoding.
* \param x The x position of the window, ::SDL_WINDOWPOS_CENTERED, or * \param x The x position of the window, ::SDL_WINDOWPOS_CENTERED, or
* ::SDL_WINDOWPOS_UNDEFINED. * ::SDL_WINDOWPOS_UNDEFINED.
* \param y The y position of the window, ::SDL_WINDOWPOS_CENTERED, or * \param y The y position of the window, ::SDL_WINDOWPOS_CENTERED, or
* ::SDL_WINDOWPOS_UNDEFINED. * ::SDL_WINDOWPOS_UNDEFINED.
* \param w The width of the window. * \param w The width of the window.
* \param h The height of the window. * \param h The height of the window.
* \param flags The flags for the window, a mask of SDL_WINDOW_BORDERLESS with * \param flags The flags for the window, a mask of SDL_WINDOW_BORDERLESS with any of the following:
* any of the following: ::SDL_WINDOW_OPENGL, * ::SDL_WINDOW_OPENGL, ::SDL_WINDOW_INPUT_GRABBED,
* ::SDL_WINDOW_INPUT_GRABBED, ::SDL_WINDOW_HIDDEN, * ::SDL_WINDOW_HIDDEN, ::SDL_WINDOW_RESIZABLE,
* ::SDL_WINDOW_RESIZABLE, ::SDL_WINDOW_MAXIMIZED, * ::SDL_WINDOW_MAXIMIZED, ::SDL_WINDOW_MINIMIZED,
* ::SDL_WINDOW_MINIMIZED, ::SDL_WINDOW_BORDERLESS is always set, * ::SDL_WINDOW_BORDERLESS is always set, and ::SDL_WINDOW_FULLSCREEN is always unset.
* and ::SDL_WINDOW_FULLSCREEN is always unset.
* \return the window created, or NULL if window creation failed.
* *
* \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); 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. * \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 * \sa SDL_CreateShapedWindow
*/ */
@ -107,31 +106,29 @@ typedef struct SDL_WindowShapeMode {
} 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 window The shaped window whose parameters should be set.
* \param shape A surface encoding the desired shape for the window. * \param shape A surface encoding the desired shape for the window.
* \param shape_mode The parameters to set for the shaped 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 * \return 0 on success, SDL_INVALID_SHAPE_ARGUMENT on an invalid shape argument, or SDL_NONSHAPEABLE_WINDOW
* not reference a valid shaped window. * if the SDL_Window given does not reference a valid shaped window.
* *
* \sa SDL_WindowShapeMode * \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); 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 window The shaped window whose parameters should be retrieved.
* \param shape_mode An empty shape-mode structure to fill, or NULL to check * \param shape_mode An empty shape-mode structure to fill, or NULL to check whether the window has a shape.
* whether the window has a shape. *
* \return 0 if the window has a shape and, provided shape_mode was not NULL, * \return 0 if the window has a shape and, provided shape_mode was not NULL, shape_mode has been filled with the mode
* shape_mode has been filled with the mode data, * data, SDL_NONSHAPEABLE_WINDOW if the SDL_Window given is not a shaped window, or SDL_WINDOW_LACKS_SHAPE if
* SDL_NONSHAPEABLE_WINDOW if the SDL_Window given is not a shaped * the SDL_Window given is a shapeable window currently lacking a shape.
* window, or SDL_WINDOW_LACKS_SHAPE if the SDL_Window given is a
* shapeable window currently lacking a shape.
* *
* \sa SDL_WindowShapeMode * \sa SDL_WindowShapeMode
* \sa SDL_SetWindowShape * \sa SDL_SetWindowShape

View file

@ -1,6 +1,6 @@
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages

View file

@ -1,6 +1,6 @@
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages 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 assertCondition Evaluated condition or variable to assert; fail (==0) or pass (!=0).
* \param assertDescription Message to log with the assert describing it. * \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); int SDLTest_AssertCheck(int assertCondition, SDL_PRINTF_FORMAT_STRING const char *assertDescription, ...) SDL_PRINTF_VARARG_FUNC(2);

View file

@ -1,6 +1,6 @@
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages

View file

@ -1,6 +1,6 @@
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages

View file

@ -1,6 +1,6 @@
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages 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 y The Y coordinate of the upper left corner of the character.
* \param c The character to draw. * \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); 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 y The Y coordinate of the upper left corner of the string.
* \param s The string to draw. * \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); int SDLTest_DrawString(SDL_Renderer *renderer, int x, int y, const char *s);

View file

@ -1,6 +1,6 @@
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages 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 random Uint8
* *
* \returns a generated integer * \returns Generated integer
*/ */
Uint8 SDLTest_RandomUint8(void); Uint8 SDLTest_RandomUint8(void);
/** /**
* Returns a random Sint8 * Returns a random Sint8
* *
* \returns a generated signed integer * \returns Generated signed integer
*/ */
Sint8 SDLTest_RandomSint8(void); Sint8 SDLTest_RandomSint8(void);
@ -81,14 +81,14 @@ Sint8 SDLTest_RandomSint8(void);
/** /**
* Returns a random Uint16 * Returns a random Uint16
* *
* \returns a generated integer * \returns Generated integer
*/ */
Uint16 SDLTest_RandomUint16(void); Uint16 SDLTest_RandomUint16(void);
/** /**
* Returns a random Sint16 * Returns a random Sint16
* *
* \returns a generated signed integer * \returns Generated signed integer
*/ */
Sint16 SDLTest_RandomSint16(void); Sint16 SDLTest_RandomSint16(void);
@ -96,7 +96,7 @@ Sint16 SDLTest_RandomSint16(void);
/** /**
* Returns a random integer * Returns a random integer
* *
* \returns a generated integer * \returns Generated integer
*/ */
Sint32 SDLTest_RandomSint32(void); Sint32 SDLTest_RandomSint32(void);
@ -104,14 +104,14 @@ Sint32 SDLTest_RandomSint32(void);
/** /**
* Returns a random positive integer * Returns a random positive integer
* *
* \returns a generated integer * \returns Generated integer
*/ */
Uint32 SDLTest_RandomUint32(void); Uint32 SDLTest_RandomUint32(void);
/** /**
* Returns random Uint64. * Returns random Uint64.
* *
* \returns a generated integer * \returns Generated integer
*/ */
Uint64 SDLTest_RandomUint64(void); Uint64 SDLTest_RandomUint64(void);
@ -119,28 +119,28 @@ Uint64 SDLTest_RandomUint64(void);
/** /**
* Returns random Sint64. * Returns random Sint64.
* *
* \returns a generated signed integer * \returns Generated signed integer
*/ */
Sint64 SDLTest_RandomSint64(void); 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); 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); double SDLTest_RandomUnitDouble(void);
/** /**
* \returns a random float. * \returns random float.
* *
*/ */
float SDLTest_RandomFloat(void); float SDLTest_RandomFloat(void);
/** /**
* \returns a random double. * \returns random double.
* *
*/ */
double SDLTest_RandomDouble(void); double SDLTest_RandomDouble(void);
@ -162,7 +162,7 @@ double SDLTest_RandomDouble(void);
* \param boundary2 Upper boundary limit * \param boundary2 Upper boundary limit
* \param validDomain Should the generated boundary be valid (=within the bounds) or not? * \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); 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 boundary2 Upper boundary limit
* \param validDomain Should the generated boundary be valid (=within the bounds) or not? * \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); 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 boundary2 Upper boundary limit
* \param validDomain Should the generated boundary be valid (=within the bounds) or not? * \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); 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 boundary2 Upper boundary limit
* \param validDomain Should the generated boundary be valid (=within the bounds) or not? * \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); 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 boundary2 Upper boundary limit
* \param validDomain Should the generated boundary be valid (=within the bounds) or not? * \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); 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 boundary2 Upper boundary limit
* \param validDomain Should the generated boundary be valid (=within the bounds) or not? * \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); 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 boundary2 Upper boundary limit
* \param validDomain Should the generated boundary be valid (=within the bounds) or not? * \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); 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 boundary2 Upper boundary limit
* \param validDomain Should the generated boundary be valid (=within the bounds) or not? * \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); 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 min Minimum inclusive value of returned random number
* \param max Maximum 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); 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. * 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); char * SDLTest_RandomAsciiString(void);
@ -350,7 +350,7 @@ char * SDLTest_RandomAsciiString(void);
* *
* \param maxLength The maximum length of the generated string. * \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); char * SDLTest_RandomAsciiStringWithMaximumLength(int maxLength);
@ -364,14 +364,12 @@ char * SDLTest_RandomAsciiStringWithMaximumLength(int maxLength);
* *
* \param size The length of the generated string * \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); char * SDLTest_RandomAsciiStringOfSize(int size);
/** /**
* Get the invocation count for the fuzzer since last ...FuzzerInit. * Returns the invocation count for the fuzzer since last ...FuzzerInit.
*
* \returns the invocation count.
*/ */
int SDLTest_GetFuzzerInvocationCount(void); int SDLTest_GetFuzzerInvocationCount(void);

View file

@ -1,6 +1,6 @@
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages 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 * \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); 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 filter Filter specification. NULL disables. Case sensitive.
* \param testIterations Number of iterations to run each test case. * \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); int SDLTest_RunSuites(SDLTest_TestSuiteReference *testSuites[], const char *userRunSeed, Uint64 userExecKey, const char *filter, int testIterations);

View file

@ -1,6 +1,6 @@
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages

View file

@ -1,6 +1,6 @@
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages

View file

@ -1,6 +1,6 @@
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages

View file

@ -1,6 +1,6 @@
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages

View file

@ -1,6 +1,6 @@
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages 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 * \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); unsigned int SDLTest_Random(SDLTest_RandomContext *rndContext);

View file

@ -1,6 +1,6 @@
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages
@ -38,75 +38,45 @@ extern "C" {
#endif #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. * \note 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
*/ */
extern DECLSPEC Uint32 SDLCALL SDL_GetTicks(void); 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: * e.g. if you want to wait 100 ms, you could do this:
* * Uint32 timeout = SDL_GetTicks() + 100;
* ```c++ * while (!SDL_TICKS_PASSED(SDL_GetTicks(), timeout)) {
* Uint32 timeout = SDL_GetTicks() + 100; * ... do work until timeout has elapsed
* while (!SDL_TICKS_PASSED(SDL_GetTicks(), timeout)) { * }
* // ... do work until timeout has elapsed
* }
* ```
*/ */
#define SDL_TICKS_PASSED(A, B) ((Sint32)((B) - (A)) <= 0) #define SDL_TICKS_PASSED(A, B) ((Sint32)((B) - (A)) <= 0)
/** /**
* Get the current value of the high resolution counter. * \brief 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
*/ */
extern DECLSPEC Uint64 SDLCALL SDL_GetPerformanceCounter(void); extern DECLSPEC Uint64 SDLCALL SDL_GetPerformanceCounter(void);
/** /**
* Get the count per second of the high resolution counter. * \brief 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
*/ */
extern DECLSPEC Uint64 SDLCALL SDL_GetPerformanceFrequency(void); extern DECLSPEC Uint64 SDLCALL SDL_GetPerformanceFrequency(void);
/** /**
* Wait a specified number of milliseconds before returning. * \brief 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
*/ */
extern DECLSPEC void SDLCALL SDL_Delay(Uint32 ms); 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 callback function is passed the current timer interval and returns
* the next timer interval. If the returned value is the same as the one * 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 * passed in, the periodic alarm continues, otherwise a new alarm is
* scheduled. If the callback returns 0, the periodic alarm is cancelled. * scheduled. If the callback returns 0, the periodic alarm is cancelled.
*/ */
typedef Uint32 (SDLCALL * SDL_TimerCallback) (Uint32 interval, void *param); 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; 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(). * \return A timer ID, or 0 when an error occurs.
*
* 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
*/ */
extern DECLSPEC SDL_TimerID SDLCALL SDL_AddTimer(Uint32 interval, extern DECLSPEC SDL_TimerID SDLCALL SDL_AddTimer(Uint32 interval,
SDL_TimerCallback callback, SDL_TimerCallback callback,
void *param); 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 * \return A boolean value indicating success or failure.
* \returns SDL_TRUE if the timer is removed or SDL_FALSE if the timer wasn't
* found.
* *
* \sa SDL_AddTimer * \warning It is not safe to remove a timer multiple times.
*/ */
extern DECLSPEC SDL_bool SDLCALL SDL_RemoveTimer(SDL_TimerID id); extern DECLSPEC SDL_bool SDLCALL SDL_RemoveTimer(SDL_TimerID id);

View file

@ -1,6 +1,6 @@
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages 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) #define SDL_MOUSE_TOUCHID ((Sint64)-1)
/* Function prototypes */
/** /**
* Get the number of registered touch devices. * \brief 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
*/ */
extern DECLSPEC int SDLCALL SDL_GetNumTouchDevices(void); extern DECLSPEC int SDLCALL SDL_GetNumTouchDevices(void);
/** /**
* Get the touch ID with the given index. * \brief Get the touch ID with the given index, or 0 if the index is invalid.
*
* \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
*/ */
extern DECLSPEC SDL_TouchID SDLCALL SDL_GetTouchDevice(int index); 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); extern DECLSPEC SDL_TouchDeviceType SDLCALL SDL_GetTouchDeviceType(SDL_TouchID touchID);
/** /**
* Get the number of active fingers for a given touch device. * \brief 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
*/ */
extern DECLSPEC int SDLCALL SDL_GetNumTouchFingers(SDL_TouchID touchID); extern DECLSPEC int SDLCALL SDL_GetNumTouchFingers(SDL_TouchID touchID);
/** /**
* Get the finger object for specified touch device ID and finger index. * \brief Get the finger object of the given touch, with the given 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
*/ */
extern DECLSPEC SDL_Finger * SDLCALL SDL_GetTouchFinger(SDL_TouchID touchID, int index); extern DECLSPEC SDL_Finger * SDLCALL SDL_GetTouchFinger(SDL_TouchID touchID, int index);

View file

@ -1,6 +1,6 @@
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages

View file

@ -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 * \param [in] path The platform dependent Vulkan loader library name, or
* creating any Vulkan windows. If no Vulkan loader library is loaded, the * \c NULL.
* default library will be loaded upon creation of the first Vulkan window.
* *
* It is fairly common for Vulkan applications to link with libvulkan instead * \return \c 0 on success, or \c -1 if the library couldn't be loaded.
* 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.
* *
* If you specify a non-NULL `path`, an application should retrieve all of the * If \a path is NULL SDL will use the value of the environment variable
* Vulkan functions it uses from the dynamic library using * \c SDL_VULKAN_LIBRARY, if set, otherwise it loads the default Vulkan
* SDL_Vulkan_GetVkGetInstanceProcAddr unless you can guarantee `path` points * loader library.
* to the same vulkan loader library the application linked to.
* *
* On Apple devices, if `path` is NULL, SDL will attempt to find the * This should be called after initializing the video driver, but before
* `vkGetInstanceProcAddr` address within all the Mach-O images of the current * creating any Vulkan windows. If no Vulkan loader library is loaded, the
* process. This is because it is fairly common for Vulkan applications to * default library will be loaded upon creation of the first Vulkan window.
* 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.
* *
* On non-Apple devices, application linking with a static libvulkan is not * \note It is fairly common for Vulkan applications to link with \a libvulkan
* supported. Either do not link to the Vulkan loader or link to a dynamic * instead of explicitly loading it at run time. This will work with
* library version. * 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 * \note If you specify a non-NULL \c path, an application should retrieve all
* \returns 0 on success or -1 if the library couldn't be loaded; call * of the Vulkan functions it uses from the dynamic library using
* SDL_GetError() for more information. * \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 * \note On non-Apple devices, application linking with a static libvulkan is
* \sa SDL_Vulkan_UnloadLibrary * 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); 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 * \note This should be called after either calling SDL_Vulkan_LoadLibrary
* creating an SDL_Window with the `SDL_WINDOW_VULKAN` flag. * or creating an SDL_Window with the SDL_WINDOW_VULKAN flag.
*
* \returns the function pointer for `vkGetInstanceProcAddr` or NULL on error.
*/ */
extern DECLSPEC void *SDLCALL SDL_Vulkan_GetVkGetInstanceProcAddr(void); 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); extern DECLSPEC void SDLCALL SDL_Vulkan_UnloadLibrary(void);
/** /**
* Get the names of the Vulkan instance extensions needed to create a surface * \brief Get the names of the Vulkan instance extensions needed to create
* with SDL_Vulkan_CreateSurface. * a surface with \c SDL_Vulkan_CreateSurface().
* *
* If `pNames` is NULL, then the number of required Vulkan instance extensions * \param [in] \c NULL or window Window for which the required Vulkan instance
* is returned in `pCount`. Otherwise, `pCount` must point to a variable set * extensions should be retrieved
* to the number of elements in the `pNames` array, and on return the variable * \param [in,out] pCount pointer to an \c unsigned related to the number of
* is overwritten with the number of names actually written to `pNames`. If * required Vulkan instance extensions
* `pCount` is less than the number of required extensions, at most `pCount` * \param [out] pNames \c NULL or a pointer to an array to be filled with the
* structures will be written. If `pCount` is smaller than the number of * required Vulkan instance extensions
* required extensions, SDL_FALSE will be returned instead of SDL_TRUE, to
* indicate that not all the required extensions were returned.
* *
* The `window` parameter is currently needed to be valid as of SDL 2.0.8, * \return \c SDL_TRUE on success, \c SDL_FALSE on error.
* however, this parameter will likely be removed in future releases
* *
* \param window A window for which the required Vulkan instance extensions * If \a pNames is \c NULL, then the number of required Vulkan instance
* should be retrieved (will be deprecated in a future release) * extensions is returned in pCount. Otherwise, \a pCount must point to a
* \param pCount A pointer to an unsigned int corresponding to the number of * variable set to the number of elements in the \a pNames array, and on
* extensions to be returned * return the variable is overwritten with the number of names actually
* \param pNames NULL or a pointer to an array to be filled with required * written to \a pNames. If \a pCount is less than the number of required
* Vulkan instance extensions * extensions, at most \a pCount structures will be written. If \a pCount
* \returns SDL_TRUE on success, SDL_FALSE on error. * 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, extern DECLSPEC SDL_bool SDLCALL SDL_Vulkan_GetInstanceExtensions(SDL_Window *window,
unsigned int *pCount, unsigned int *pCount,
const char **pNames); 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 * \param [in] window SDL_Window to which to attach the rendering surface.
* `instance` must have been created with extensions returned by * \param [in] instance handle to the Vulkan instance to use.
* SDL_Vulkan_GetInstanceExtensions() enabled. * \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 * \return \c SDL_TRUE on success, \c SDL_FALSE on error.
* \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.
* *
* \since This function is available in SDL 2.0.8 * \code
* VkInstance instance;
* SDL_Window *window;
* *
* \sa SDL_Vulkan_GetInstanceExtensions * // create instance and window
* \sa SDL_Vulkan_GetDrawableSize *
* // 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, extern DECLSPEC SDL_bool SDLCALL SDL_Vulkan_CreateSurface(SDL_Window *window,
VkInstance instance, VkInstance instance,
VkSurfaceKHR* surface); 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 * 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 * 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 * platform with high-DPI support (Apple calls this "Retina"), and not disabled
* disabled by the `SDL_HINT_VIDEO_HIGHDPI_DISABLED` hint. * by the \c SDL_HINT_VIDEO_HIGHDPI_DISABLED hint.
* *
* \param window an SDL_Window for which the size is to be queried * \note On macOS high-DPI support must be enabled for an application by
* \param w Pointer to the variable to write the width to or NULL * setting NSHighResolutionCapable to true in its Info.plist.
* \param h Pointer to the variable to write the height to or NULL
* *
* \since This function is available in SDL 2.0.8 * \sa SDL_GetWindowSize()
* * \sa SDL_CreateWindow()
* \sa SDL_GetWindowSize
* \sa SDL_CreateWindow
* \sa SDL_Vulkan_CreateSurface
*/ */
extern DECLSPEC void SDLCALL SDL_Vulkan_GetDrawableSize(SDL_Window * window, extern DECLSPEC void SDLCALL SDL_Vulkan_GetDrawableSize(SDL_Window * window,
int *w, int *h); int *w, int *h);

View file

@ -1,6 +1,6 @@
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages

View file

@ -1,6 +1,6 @@
/* /*
Simple DirectMedia Layer Simple DirectMedia Layer
Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages

Binary file not shown.

Binary file not shown.