Removed temporary memory from the API
It was intended to make the API easier to use, but various automatic garbage collection all had flaws, and making the application periodically clean up temporary memory added cognitive load to using the API, and in many cases was it was difficult to restructure threaded code to handle this. So, we're largely going back to the original system, where the API returns allocated results and you free them. In addition, to solve the problems we originally wanted temporary memory for: * Short strings with a finite count, like device names, get stored in a per-thread string pool. * Events continue to use temporary memory internally, which is cleaned up on the next event processing cycle.
This commit is contained in:
@@ -411,7 +411,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetNumAudioDrivers(void);
|
||||
*
|
||||
* \sa SDL_GetNumAudioDrivers
|
||||
*/
|
||||
extern SDL_DECLSPEC_TEMP const char * SDLCALL SDL_GetAudioDriver(int index);
|
||||
extern SDL_DECLSPEC const char * SDLCALL SDL_GetAudioDriver(int index);
|
||||
/* @} */
|
||||
|
||||
/**
|
||||
@@ -428,7 +428,7 @@ extern SDL_DECLSPEC_TEMP const char * SDLCALL SDL_GetAudioDriver(int index);
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC_TEMP const char * SDLCALL SDL_GetCurrentAudioDriver(void);
|
||||
extern SDL_DECLSPEC const char * SDLCALL SDL_GetCurrentAudioDriver(void);
|
||||
|
||||
/**
|
||||
* Get a list of currently-connected audio playback devices.
|
||||
@@ -447,7 +447,7 @@ extern SDL_DECLSPEC_TEMP const char * SDLCALL SDL_GetCurrentAudioDriver(void);
|
||||
* \param count a pointer filled in with the number of devices returned, may
|
||||
* be NULL.
|
||||
* \returns a 0 terminated array of device instance IDs or NULL on error; call
|
||||
* SDL_GetError() for more information.
|
||||
* SDL_GetError() for more information. This should be freed with SDL_free() when it is no longer needed.
|
||||
*
|
||||
* \threadsafety It is safe to call this function from any thread.
|
||||
*
|
||||
@@ -456,7 +456,7 @@ extern SDL_DECLSPEC_TEMP const char * SDLCALL SDL_GetCurrentAudioDriver(void);
|
||||
* \sa SDL_OpenAudioDevice
|
||||
* \sa SDL_GetAudioRecordingDevices
|
||||
*/
|
||||
extern SDL_DECLSPEC_TEMP const SDL_AudioDeviceID * SDLCALL SDL_GetAudioPlaybackDevices(int *count);
|
||||
extern SDL_DECLSPEC_FREE SDL_AudioDeviceID * SDLCALL SDL_GetAudioPlaybackDevices(int *count);
|
||||
|
||||
/**
|
||||
* Get a list of currently-connected audio recording devices.
|
||||
@@ -475,7 +475,7 @@ extern SDL_DECLSPEC_TEMP const SDL_AudioDeviceID * SDLCALL SDL_GetAudioPlaybackD
|
||||
* \param count a pointer filled in with the number of devices returned, may
|
||||
* be NULL.
|
||||
* \returns a 0 terminated array of device instance IDs, or NULL on failure;
|
||||
* call SDL_GetError() for more information.
|
||||
* call SDL_GetError() for more information. This should be freed with SDL_free() when it is no longer needed.
|
||||
*
|
||||
* \threadsafety It is safe to call this function from any thread.
|
||||
*
|
||||
@@ -484,7 +484,7 @@ extern SDL_DECLSPEC_TEMP const SDL_AudioDeviceID * SDLCALL SDL_GetAudioPlaybackD
|
||||
* \sa SDL_OpenAudioDevice
|
||||
* \sa SDL_GetAudioPlaybackDevices
|
||||
*/
|
||||
extern SDL_DECLSPEC_TEMP const SDL_AudioDeviceID * SDLCALL SDL_GetAudioRecordingDevices(int *count);
|
||||
extern SDL_DECLSPEC_FREE SDL_AudioDeviceID * SDLCALL SDL_GetAudioRecordingDevices(int *count);
|
||||
|
||||
/**
|
||||
* Get the human-readable name of a specific audio device.
|
||||
@@ -501,7 +501,7 @@ extern SDL_DECLSPEC_TEMP const SDL_AudioDeviceID * SDLCALL SDL_GetAudioRecording
|
||||
* \sa SDL_GetAudioRecordingDevices
|
||||
* \sa SDL_GetDefaultAudioInfo
|
||||
*/
|
||||
extern SDL_DECLSPEC_TEMP const char * SDLCALL SDL_GetAudioDeviceName(SDL_AudioDeviceID devid);
|
||||
extern SDL_DECLSPEC const char * SDLCALL SDL_GetAudioDeviceName(SDL_AudioDeviceID devid);
|
||||
|
||||
/**
|
||||
* Get the current audio format of a specific audio device.
|
||||
@@ -550,7 +550,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetAudioDeviceFormat(SDL_AudioDeviceID devid
|
||||
* \param devid the instance ID of the device to query.
|
||||
* \param count On output, set to number of channels in the map. Can be NULL.
|
||||
* \returns an array of the current channel mapping, with as many elements as
|
||||
* the current output spec's channels, or NULL if default.
|
||||
* the current output spec's channels, or NULL if default. This should be freed with SDL_free() when it is no longer needed.
|
||||
*
|
||||
* \threadsafety It is safe to call this function from any thread.
|
||||
*
|
||||
@@ -558,7 +558,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetAudioDeviceFormat(SDL_AudioDeviceID devid
|
||||
*
|
||||
* \sa SDL_SetAudioStreamInputChannelMap
|
||||
*/
|
||||
extern SDL_DECLSPEC_TEMP const int * SDLCALL SDL_GetAudioDeviceChannelMap(SDL_AudioDeviceID devid, int *count);
|
||||
extern SDL_DECLSPEC_FREE int * SDLCALL SDL_GetAudioDeviceChannelMap(SDL_AudioDeviceID devid, int *count);
|
||||
|
||||
/**
|
||||
* Open a specific audio device.
|
||||
@@ -1098,7 +1098,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetAudioStreamGain(SDL_AudioStream *stream,
|
||||
* \param stream the SDL_AudioStream to query.
|
||||
* \param count On output, set to number of channels in the map. Can be NULL.
|
||||
* \returns an array of the current channel mapping, with as many elements as
|
||||
* the current output spec's channels, or NULL if default.
|
||||
* the current output spec's channels, or NULL if default. This should be freed with SDL_free() when it is no longer needed.
|
||||
*
|
||||
* \threadsafety It is safe to call this function from any thread, as it holds
|
||||
* a stream-specific mutex while running.
|
||||
@@ -1107,7 +1107,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetAudioStreamGain(SDL_AudioStream *stream,
|
||||
*
|
||||
* \sa SDL_SetAudioStreamInputChannelMap
|
||||
*/
|
||||
extern SDL_DECLSPEC_TEMP const int * SDLCALL SDL_GetAudioStreamInputChannelMap(SDL_AudioStream *stream, int *count);
|
||||
extern SDL_DECLSPEC_FREE int * SDLCALL SDL_GetAudioStreamInputChannelMap(SDL_AudioStream *stream, int *count);
|
||||
|
||||
/**
|
||||
* Get the current output channel map of an audio stream.
|
||||
@@ -1121,7 +1121,7 @@ extern SDL_DECLSPEC_TEMP const int * SDLCALL SDL_GetAudioStreamInputChannelMap(S
|
||||
* \param stream the SDL_AudioStream to query.
|
||||
* \param count On output, set to number of channels in the map. Can be NULL.
|
||||
* \returns an array of the current channel mapping, with as many elements as
|
||||
* the current output spec's channels, or NULL if default.
|
||||
* the current output spec's channels, or NULL if default. This should be freed with SDL_free() when it is no longer needed.
|
||||
*
|
||||
* \threadsafety It is safe to call this function from any thread, as it holds
|
||||
* a stream-specific mutex while running.
|
||||
@@ -1130,7 +1130,7 @@ extern SDL_DECLSPEC_TEMP const int * SDLCALL SDL_GetAudioStreamInputChannelMap(S
|
||||
*
|
||||
* \sa SDL_SetAudioStreamInputChannelMap
|
||||
*/
|
||||
extern SDL_DECLSPEC_TEMP const int * SDLCALL SDL_GetAudioStreamOutputChannelMap(SDL_AudioStream *stream, int *count);
|
||||
extern SDL_DECLSPEC_FREE int * SDLCALL SDL_GetAudioStreamOutputChannelMap(SDL_AudioStream *stream, int *count);
|
||||
|
||||
/**
|
||||
* Set the current input channel map of an audio stream.
|
||||
|
||||
@@ -67,8 +67,11 @@
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
/* This is used to mark functions that return temporary memory */
|
||||
#define SDL_DECLSPEC_TEMP SDL_DECLSPEC
|
||||
|
||||
/* This is used to mark functions that return memory that need to be freed with SDL_free() */
|
||||
#ifndef SDL_DECLSPEC_FREE
|
||||
#define SDL_DECLSPEC_FREE SDL_DECLSPEC
|
||||
#endif
|
||||
|
||||
/* By default SDL uses the C calling convention */
|
||||
#ifndef SDLCALL
|
||||
|
||||
@@ -145,7 +145,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetNumCameraDrivers(void);
|
||||
*
|
||||
* \sa SDL_GetNumCameraDrivers
|
||||
*/
|
||||
extern SDL_DECLSPEC_TEMP const char * SDLCALL SDL_GetCameraDriver(int index);
|
||||
extern SDL_DECLSPEC const char * SDLCALL SDL_GetCameraDriver(int index);
|
||||
|
||||
/**
|
||||
* Get the name of the current camera driver.
|
||||
@@ -161,7 +161,7 @@ extern SDL_DECLSPEC_TEMP const char * SDLCALL SDL_GetCameraDriver(int index);
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC_TEMP const char * SDLCALL SDL_GetCurrentCameraDriver(void);
|
||||
extern SDL_DECLSPEC const char * SDLCALL SDL_GetCurrentCameraDriver(void);
|
||||
|
||||
/**
|
||||
* Get a list of currently connected camera devices.
|
||||
@@ -169,7 +169,7 @@ extern SDL_DECLSPEC_TEMP const char * SDLCALL SDL_GetCurrentCameraDriver(void);
|
||||
* \param count a pointer filled in with the number of cameras returned, may
|
||||
* be NULL.
|
||||
* \returns a 0 terminated array of camera instance IDs or NULL on failure;
|
||||
* call SDL_GetError() for more information.
|
||||
* call SDL_GetError() for more information. This should be freed with SDL_free() when it is no longer needed.
|
||||
*
|
||||
* \threadsafety It is safe to call this function from any thread.
|
||||
*
|
||||
@@ -177,7 +177,7 @@ extern SDL_DECLSPEC_TEMP const char * SDLCALL SDL_GetCurrentCameraDriver(void);
|
||||
*
|
||||
* \sa SDL_OpenCamera
|
||||
*/
|
||||
extern SDL_DECLSPEC_TEMP const SDL_CameraID * SDLCALL SDL_GetCameras(int *count);
|
||||
extern SDL_DECLSPEC_FREE SDL_CameraID * SDLCALL SDL_GetCameras(int *count);
|
||||
|
||||
/**
|
||||
* Get the list of native formats/sizes a camera supports.
|
||||
@@ -205,7 +205,7 @@ extern SDL_DECLSPEC_TEMP const SDL_CameraID * SDLCALL SDL_GetCameras(int *count)
|
||||
* \param count a pointer filled in with the number of elements in the list,
|
||||
* may be NULL.
|
||||
* \returns a NULL terminated array of pointers to SDL_CameraSpec or NULL on
|
||||
* failure; call SDL_GetError() for more information.
|
||||
* failure; call SDL_GetError() for more information. This is a single allocation that should be freed with SDL_free() when it is no longer needed.
|
||||
*
|
||||
* \threadsafety It is safe to call this function from any thread.
|
||||
*
|
||||
@@ -214,7 +214,7 @@ extern SDL_DECLSPEC_TEMP const SDL_CameraID * SDLCALL SDL_GetCameras(int *count)
|
||||
* \sa SDL_GetCameras
|
||||
* \sa SDL_OpenCamera
|
||||
*/
|
||||
extern SDL_DECLSPEC_TEMP const SDL_CameraSpec * const * SDLCALL SDL_GetCameraSupportedFormats(SDL_CameraID devid, int *count);
|
||||
extern SDL_DECLSPEC_FREE SDL_CameraSpec ** SDLCALL SDL_GetCameraSupportedFormats(SDL_CameraID devid, int *count);
|
||||
|
||||
/**
|
||||
* Get the human-readable device name for a camera.
|
||||
@@ -229,7 +229,7 @@ extern SDL_DECLSPEC_TEMP const SDL_CameraSpec * const * SDLCALL SDL_GetCameraSup
|
||||
*
|
||||
* \sa SDL_GetCameras
|
||||
*/
|
||||
extern SDL_DECLSPEC_TEMP const char * SDLCALL SDL_GetCameraName(SDL_CameraID instance_id);
|
||||
extern SDL_DECLSPEC const char * SDLCALL SDL_GetCameraName(SDL_CameraID instance_id);
|
||||
|
||||
/**
|
||||
* Get the position of the camera in relation to the system.
|
||||
|
||||
@@ -63,14 +63,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetClipboardText(const char *text);
|
||||
* a copy of the clipboard's content.
|
||||
*
|
||||
* \returns the clipboard text on success or an empty string on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
* SDL_GetError() for more information. This should be freed with SDL_free() when it is no longer needed.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_HasClipboardText
|
||||
* \sa SDL_SetClipboardText
|
||||
*/
|
||||
extern SDL_DECLSPEC_TEMP const char * SDLCALL SDL_GetClipboardText(void);
|
||||
extern SDL_DECLSPEC_FREE char * SDLCALL SDL_GetClipboardText(void);
|
||||
|
||||
/**
|
||||
* Query whether the clipboard exists and contains a non-empty text string.
|
||||
@@ -105,14 +105,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetPrimarySelectionText(const char *text);
|
||||
* a copy of the primary selection's content.
|
||||
*
|
||||
* \returns the primary selection text on success or an empty string on
|
||||
* failure; call SDL_GetError() for more information.
|
||||
* failure; call SDL_GetError() for more information. This should be freed with SDL_free() when it is no longer needed.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_HasPrimarySelectionText
|
||||
* \sa SDL_SetPrimarySelectionText
|
||||
*/
|
||||
extern SDL_DECLSPEC_TEMP const char * SDLCALL SDL_GetPrimarySelectionText(void);
|
||||
extern SDL_DECLSPEC_FREE char * SDLCALL SDL_GetPrimarySelectionText(void);
|
||||
|
||||
/**
|
||||
* Query whether the primary selection exists and contains a non-empty text
|
||||
@@ -215,14 +215,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_ClearClipboardData(void);
|
||||
* \param mime_type the mime type to read from the clipboard.
|
||||
* \param size a pointer filled in with the length of the returned data.
|
||||
* \returns the retrieved data buffer or NULL on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
* for more information. This should be freed with SDL_free() when it is no longer needed.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_HasClipboardData
|
||||
* \sa SDL_SetClipboardData
|
||||
*/
|
||||
extern SDL_DECLSPEC_TEMP const void * SDLCALL SDL_GetClipboardData(const char *mime_type, size_t *size);
|
||||
extern SDL_DECLSPEC_FREE void * SDLCALL SDL_GetClipboardData(const char *mime_type, size_t *size);
|
||||
|
||||
/**
|
||||
* Query whether there is data in the clipboard for the provided mime type.
|
||||
|
||||
@@ -352,10 +352,6 @@ typedef struct SDL_KeyboardEvent
|
||||
* will be inserted into the editing text. The length is the number of UTF-8
|
||||
* characters that will be replaced by new typing.
|
||||
*
|
||||
* The text string is temporary memory which will be freed in
|
||||
* SDL_FreeTemporaryMemory() and can be claimed with
|
||||
* SDL_ClaimTemporaryMemory().
|
||||
*
|
||||
* \since This struct is available since SDL 3.0.0.
|
||||
*/
|
||||
typedef struct SDL_TextEditingEvent
|
||||
@@ -372,10 +368,6 @@ typedef struct SDL_TextEditingEvent
|
||||
/**
|
||||
* Keyboard IME candidates event structure (event.edit_candidates.*)
|
||||
*
|
||||
* The candidates are a single allocation of temporary memory which will be
|
||||
* freed in SDL_FreeTemporaryMemory() and can be claimed with
|
||||
* SDL_ClaimTemporaryMemory().
|
||||
*
|
||||
* \since This struct is available since SDL 3.0.0.
|
||||
*/
|
||||
typedef struct SDL_TextEditingCandidatesEvent
|
||||
@@ -393,10 +385,6 @@ typedef struct SDL_TextEditingCandidatesEvent
|
||||
/**
|
||||
* Keyboard text input event structure (event.text.*)
|
||||
*
|
||||
* The text string is temporary memory which will be freed in
|
||||
* SDL_FreeTemporaryMemory() and can be claimed with
|
||||
* SDL_ClaimTemporaryMemory().
|
||||
*
|
||||
* This event will never be delivered unless text input is enabled by calling
|
||||
* SDL_StartTextInput(). Text input is disabled by default!
|
||||
*
|
||||
@@ -792,10 +780,6 @@ typedef struct SDL_PenButtonEvent
|
||||
* An event used to drop text or request a file open by the system
|
||||
* (event.drop.*)
|
||||
*
|
||||
* The source and data strings are temporary memory which will be freed in
|
||||
* SDL_FreeTemporaryMemory() and can be claimed with
|
||||
* SDL_ClaimTemporaryMemory().
|
||||
*
|
||||
* \since This struct is available since SDL 3.0.0.
|
||||
*/
|
||||
typedef struct SDL_DropEvent
|
||||
@@ -859,10 +843,6 @@ typedef struct SDL_QuitEvent
|
||||
* the programmer; the only requirement is that '''type''' is a value obtained
|
||||
* from SDL_RegisterEvents().
|
||||
*
|
||||
* If the data pointers are temporary memory, they will be automatically
|
||||
* transfered to the thread that pulls the event from the queue, or freed if
|
||||
* the event is flushed.
|
||||
*
|
||||
* \since This struct is available since SDL 3.0.0.
|
||||
*/
|
||||
typedef struct SDL_UserEvent
|
||||
@@ -1420,65 +1400,6 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_EventEnabled(Uint32 type);
|
||||
*/
|
||||
extern SDL_DECLSPEC Uint32 SDLCALL SDL_RegisterEvents(int numevents);
|
||||
|
||||
/**
|
||||
* Allocate temporary memory.
|
||||
*
|
||||
* You can use this to allocate memory from the temporary memory pool for the
|
||||
* current thread.
|
||||
*
|
||||
* \param size the amount of memory to allocate.
|
||||
* \returns a pointer to the memory allocated or NULL on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
* \threadsafety It is safe to call this function from any thread.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_ClaimTemporaryMemory
|
||||
* \sa SDL_FreeTemporaryMemory
|
||||
*/
|
||||
extern SDL_DECLSPEC void * SDLCALL SDL_AllocateTemporaryMemory(size_t size);
|
||||
|
||||
/**
|
||||
* Claim ownership of temporary memory.
|
||||
*
|
||||
* This function removes memory from the temporary memory pool for the current
|
||||
* thread and gives ownership to the application. The application should use
|
||||
* SDL_free() to free it when it is done using it.
|
||||
*
|
||||
* \param mem a pointer allocated with SDL_AllocateTemporaryMemory().
|
||||
* \returns a pointer to the memory now owned by the application, which must
|
||||
* be freed using SDL_free(), or NULL if the memory is not in the
|
||||
* temporary memory pool for the current thread.
|
||||
*
|
||||
* \threadsafety It is safe to call this function from any thread.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_AllocateTemporaryMemory
|
||||
* \sa SDL_free
|
||||
*/
|
||||
extern SDL_DECLSPEC void * SDLCALL SDL_ClaimTemporaryMemory(const void *mem);
|
||||
|
||||
/**
|
||||
* Free temporary memory for the current thread.
|
||||
*
|
||||
* This function frees all temporary memory for the current thread. If you
|
||||
* would like to hold onto a specific pointer beyond this call, you should
|
||||
* call SDL_ClaimTemporaryMemory() to move it out of the temporary memory
|
||||
* pool.
|
||||
*
|
||||
* This function is automatically called in SDL_Quit() on the main thread and
|
||||
* in SDL_CleanupTLS() when other threads complete.
|
||||
*
|
||||
* \threadsafety It is safe to call this function from any thread.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_AllocateTemporaryMemory
|
||||
* \sa SDL_ClaimTemporaryMemory
|
||||
*/
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_FreeTemporaryMemory(void);
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -77,7 +77,7 @@ extern "C" {
|
||||
*
|
||||
* \sa SDL_GetPrefPath
|
||||
*/
|
||||
extern SDL_DECLSPEC_TEMP const char * SDLCALL SDL_GetBasePath(void);
|
||||
extern SDL_DECLSPEC const char * SDLCALL SDL_GetBasePath(void);
|
||||
|
||||
/**
|
||||
* Get the user-and-app-specific path where files can be written.
|
||||
@@ -125,13 +125,13 @@ extern SDL_DECLSPEC_TEMP const char * SDLCALL SDL_GetBasePath(void);
|
||||
* \param app the name of your application.
|
||||
* \returns a UTF-8 string of the user directory in platform-dependent
|
||||
* notation. NULL if there's a problem (creating directory failed,
|
||||
* etc.).
|
||||
* etc.). This should be freed with SDL_free() when it is no longer needed.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetBasePath
|
||||
*/
|
||||
extern SDL_DECLSPEC_TEMP const char * SDLCALL SDL_GetPrefPath(const char *org, const char *app);
|
||||
extern SDL_DECLSPEC_FREE char * SDLCALL SDL_GetPrefPath(const char *org, const char *app);
|
||||
|
||||
/**
|
||||
* The type of the OS-provided default folder for a specific purpose.
|
||||
@@ -227,7 +227,7 @@ typedef enum SDL_Folder
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC_TEMP const char * SDLCALL SDL_GetUserFolder(SDL_Folder folder);
|
||||
extern SDL_DECLSPEC const char * SDLCALL SDL_GetUserFolder(SDL_Folder folder);
|
||||
|
||||
|
||||
/* Abstract filesystem interface */
|
||||
@@ -367,13 +367,13 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetPathInfo(const char *path, SDL_PathInfo *
|
||||
* \param count on return, will be set to the number of items in the returned
|
||||
* array. Can be NULL.
|
||||
* \returns an array of strings on success or NULL on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
* SDL_GetError() for more information. This is a single allocation that should be freed with SDL_free() when it is no longer needed.
|
||||
*
|
||||
* \threadsafety It is safe to call this function from any thread.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC_TEMP const char * const * SDLCALL SDL_GlobDirectory(const char *path, const char *pattern, SDL_GlobFlags flags, int *count);
|
||||
extern SDL_DECLSPEC_FREE char ** SDLCALL SDL_GlobDirectory(const char *path, const char *pattern, SDL_GlobFlags flags, int *count);
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -392,25 +392,25 @@ extern SDL_DECLSPEC int SDLCALL SDL_ReloadGamepadMappings(void);
|
||||
* \param count a pointer filled in with the number of mappings returned, can
|
||||
* be NULL.
|
||||
* \returns an array of the mapping strings, NULL-terminated, or NULL on
|
||||
* failure; call SDL_GetError() for more information.
|
||||
* failure; call SDL_GetError() for more information. This is a single allocation that should be freed with SDL_free() when it is no longer needed.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC_TEMP const char * const * SDLCALL SDL_GetGamepadMappings(int *count);
|
||||
extern SDL_DECLSPEC_FREE char ** SDLCALL SDL_GetGamepadMappings(int *count);
|
||||
|
||||
/**
|
||||
* Get the gamepad mapping string for a given GUID.
|
||||
*
|
||||
* \param guid a structure containing the GUID for which a mapping is desired.
|
||||
* \returns a mapping string or NULL on failure; call SDL_GetError() for more
|
||||
* information.
|
||||
* information. This should be freed with SDL_free() when it is no longer needed.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetJoystickGUIDForID
|
||||
* \sa SDL_GetJoystickGUID
|
||||
*/
|
||||
extern SDL_DECLSPEC_TEMP const char * SDLCALL SDL_GetGamepadMappingForGUID(SDL_GUID guid);
|
||||
extern SDL_DECLSPEC_FREE char * SDLCALL SDL_GetGamepadMappingForGUID(SDL_GUID guid);
|
||||
|
||||
/**
|
||||
* Get the current mapping of a gamepad.
|
||||
@@ -419,7 +419,7 @@ extern SDL_DECLSPEC_TEMP const char * SDLCALL SDL_GetGamepadMappingForGUID(SDL_G
|
||||
*
|
||||
* \param gamepad the gamepad you want to get the current mapping for.
|
||||
* \returns a string that has the gamepad's mapping or NULL if no mapping is
|
||||
* available; call SDL_GetError() for more information.
|
||||
* available; call SDL_GetError() for more information. This should be freed with SDL_free() when it is no longer needed.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
@@ -428,7 +428,7 @@ extern SDL_DECLSPEC_TEMP const char * SDLCALL SDL_GetGamepadMappingForGUID(SDL_G
|
||||
* \sa SDL_GetGamepadMappingForGUID
|
||||
* \sa SDL_SetGamepadMapping
|
||||
*/
|
||||
extern SDL_DECLSPEC_TEMP const char * SDLCALL SDL_GetGamepadMapping(SDL_Gamepad *gamepad);
|
||||
extern SDL_DECLSPEC_FREE char * SDLCALL SDL_GetGamepadMapping(SDL_Gamepad *gamepad);
|
||||
|
||||
/**
|
||||
* Set the current mapping of a joystick or gamepad.
|
||||
@@ -465,14 +465,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasGamepad(void);
|
||||
* \param count a pointer filled in with the number of gamepads returned, may
|
||||
* be NULL.
|
||||
* \returns a 0 terminated array of joystick instance IDs or NULL on failure;
|
||||
* call SDL_GetError() for more information.
|
||||
* call SDL_GetError() for more information. This should be freed with SDL_free() when it is no longer needed.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_HasGamepad
|
||||
* \sa SDL_OpenGamepad
|
||||
*/
|
||||
extern SDL_DECLSPEC_TEMP const SDL_JoystickID * SDLCALL SDL_GetGamepads(int *count);
|
||||
extern SDL_DECLSPEC_FREE SDL_JoystickID * SDLCALL SDL_GetGamepads(int *count);
|
||||
|
||||
/**
|
||||
* Check if the given joystick is supported by the gamepad interface.
|
||||
@@ -502,7 +502,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_IsGamepad(SDL_JoystickID instance_id);
|
||||
* \sa SDL_GetGamepadName
|
||||
* \sa SDL_GetGamepads
|
||||
*/
|
||||
extern SDL_DECLSPEC_TEMP const char * SDLCALL SDL_GetGamepadNameForID(SDL_JoystickID instance_id);
|
||||
extern SDL_DECLSPEC const char * SDLCALL SDL_GetGamepadNameForID(SDL_JoystickID instance_id);
|
||||
|
||||
/**
|
||||
* Get the implementation dependent path of a gamepad.
|
||||
@@ -518,7 +518,7 @@ extern SDL_DECLSPEC_TEMP const char * SDLCALL SDL_GetGamepadNameForID(SDL_Joysti
|
||||
* \sa SDL_GetGamepadPath
|
||||
* \sa SDL_GetGamepads
|
||||
*/
|
||||
extern SDL_DECLSPEC_TEMP const char * SDLCALL SDL_GetGamepadPathForID(SDL_JoystickID instance_id);
|
||||
extern SDL_DECLSPEC const char * SDLCALL SDL_GetGamepadPathForID(SDL_JoystickID instance_id);
|
||||
|
||||
/**
|
||||
* Get the player index of a gamepad.
|
||||
@@ -640,14 +640,14 @@ extern SDL_DECLSPEC SDL_GamepadType SDLCALL SDL_GetRealGamepadTypeForID(SDL_Joys
|
||||
* This can be called before any gamepads are opened.
|
||||
*
|
||||
* \param instance_id the joystick instance ID.
|
||||
* \returns the mapping string. Returns NULL if no mapping is available.
|
||||
* \returns the mapping string. Returns NULL if no mapping is available. This should be freed with SDL_free() when it is no longer needed.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetGamepads
|
||||
* \sa SDL_GetGamepadMapping
|
||||
*/
|
||||
extern SDL_DECLSPEC_TEMP const char * SDLCALL SDL_GetGamepadMappingForID(SDL_JoystickID instance_id);
|
||||
extern SDL_DECLSPEC_FREE char * SDLCALL SDL_GetGamepadMappingForID(SDL_JoystickID instance_id);
|
||||
|
||||
/**
|
||||
* Open a gamepad for use.
|
||||
@@ -745,7 +745,7 @@ extern SDL_DECLSPEC SDL_JoystickID SDLCALL SDL_GetGamepadID(SDL_Gamepad *gamepad
|
||||
*
|
||||
* \sa SDL_GetGamepadNameForID
|
||||
*/
|
||||
extern SDL_DECLSPEC_TEMP const char * SDLCALL SDL_GetGamepadName(SDL_Gamepad *gamepad);
|
||||
extern SDL_DECLSPEC const char * SDLCALL SDL_GetGamepadName(SDL_Gamepad *gamepad);
|
||||
|
||||
/**
|
||||
* Get the implementation-dependent path for an opened gamepad.
|
||||
@@ -759,7 +759,7 @@ extern SDL_DECLSPEC_TEMP const char * SDLCALL SDL_GetGamepadName(SDL_Gamepad *ga
|
||||
*
|
||||
* \sa SDL_GetGamepadPathForID
|
||||
*/
|
||||
extern SDL_DECLSPEC_TEMP const char * SDLCALL SDL_GetGamepadPath(SDL_Gamepad *gamepad);
|
||||
extern SDL_DECLSPEC const char * SDLCALL SDL_GetGamepadPath(SDL_Gamepad *gamepad);
|
||||
|
||||
/**
|
||||
* Get the type of an opened gamepad.
|
||||
@@ -880,7 +880,7 @@ extern SDL_DECLSPEC Uint16 SDLCALL SDL_GetGamepadFirmwareVersion(SDL_Gamepad *ga
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC_TEMP const char * SDLCALL SDL_GetGamepadSerial(SDL_Gamepad *gamepad);
|
||||
extern SDL_DECLSPEC const char * SDLCALL SDL_GetGamepadSerial(SDL_Gamepad *gamepad);
|
||||
|
||||
/**
|
||||
* Get the Steam Input handle of an opened gamepad, if available.
|
||||
@@ -995,11 +995,11 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GamepadEventsEnabled(void);
|
||||
* \param gamepad a gamepad.
|
||||
* \param count a pointer filled in with the number of bindings returned.
|
||||
* \returns a NULL terminated array of pointers to bindings or NULL on
|
||||
* failure; call SDL_GetError() for more information.
|
||||
* failure; call SDL_GetError() for more information. This is a single allocation that should be freed with SDL_free() when it is no longer needed.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC_TEMP const SDL_GamepadBinding * const * SDLCALL SDL_GetGamepadBindings(SDL_Gamepad *gamepad, int *count);
|
||||
extern SDL_DECLSPEC_FREE SDL_GamepadBinding ** SDLCALL SDL_GetGamepadBindings(SDL_Gamepad *gamepad, int *count);
|
||||
|
||||
/**
|
||||
* Manually pump gamepad updates if not using the loop.
|
||||
@@ -1042,7 +1042,7 @@ extern SDL_DECLSPEC SDL_GamepadType SDLCALL SDL_GetGamepadTypeFromString(const c
|
||||
*
|
||||
* \sa SDL_GetGamepadTypeFromString
|
||||
*/
|
||||
extern SDL_DECLSPEC_TEMP const char * SDLCALL SDL_GetGamepadStringForType(SDL_GamepadType type);
|
||||
extern SDL_DECLSPEC const char * SDLCALL SDL_GetGamepadStringForType(SDL_GamepadType type);
|
||||
|
||||
/**
|
||||
* Convert a string into SDL_GamepadAxis enum.
|
||||
@@ -1078,7 +1078,7 @@ extern SDL_DECLSPEC SDL_GamepadAxis SDLCALL SDL_GetGamepadAxisFromString(const c
|
||||
*
|
||||
* \sa SDL_GetGamepadAxisFromString
|
||||
*/
|
||||
extern SDL_DECLSPEC_TEMP const char * SDLCALL SDL_GetGamepadStringForAxis(SDL_GamepadAxis axis);
|
||||
extern SDL_DECLSPEC const char * SDLCALL SDL_GetGamepadStringForAxis(SDL_GamepadAxis axis);
|
||||
|
||||
/**
|
||||
* Query whether a gamepad has a given axis.
|
||||
@@ -1151,7 +1151,7 @@ extern SDL_DECLSPEC SDL_GamepadButton SDLCALL SDL_GetGamepadButtonFromString(con
|
||||
*
|
||||
* \sa SDL_GetGamepadButtonFromString
|
||||
*/
|
||||
extern SDL_DECLSPEC_TEMP const char * SDLCALL SDL_GetGamepadStringForButton(SDL_GamepadButton button);
|
||||
extern SDL_DECLSPEC const char * SDLCALL SDL_GetGamepadStringForButton(SDL_GamepadButton button);
|
||||
|
||||
/**
|
||||
* Query whether a gamepad has a given button.
|
||||
@@ -1436,7 +1436,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_CloseGamepad(SDL_Gamepad *gamepad);
|
||||
*
|
||||
* \sa SDL_GetGamepadAppleSFSymbolsNameForAxis
|
||||
*/
|
||||
extern SDL_DECLSPEC_TEMP const char * SDLCALL SDL_GetGamepadAppleSFSymbolsNameForButton(SDL_Gamepad *gamepad, SDL_GamepadButton button);
|
||||
extern SDL_DECLSPEC const char * SDLCALL SDL_GetGamepadAppleSFSymbolsNameForButton(SDL_Gamepad *gamepad, SDL_GamepadButton button);
|
||||
|
||||
/**
|
||||
* Return the sfSymbolsName for a given axis on a gamepad on Apple platforms.
|
||||
@@ -1449,7 +1449,7 @@ extern SDL_DECLSPEC_TEMP const char * SDLCALL SDL_GetGamepadAppleSFSymbolsNameFo
|
||||
*
|
||||
* \sa SDL_GetGamepadAppleSFSymbolsNameForButton
|
||||
*/
|
||||
extern SDL_DECLSPEC_TEMP const char * SDLCALL SDL_GetGamepadAppleSFSymbolsNameForAxis(SDL_Gamepad *gamepad, SDL_GamepadAxis axis);
|
||||
extern SDL_DECLSPEC const char * SDLCALL SDL_GetGamepadAppleSFSymbolsNameForAxis(SDL_Gamepad *gamepad, SDL_GamepadAxis axis);
|
||||
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
|
||||
@@ -67,14 +67,14 @@ typedef struct SDL_GUID {
|
||||
* Get an ASCII string representation for a given SDL_GUID.
|
||||
*
|
||||
* \param guid the SDL_GUID you wish to convert to string.
|
||||
* \returns the string representation of the GUID or NULL on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
* \param pszGUID buffer in which to write the ASCII string.
|
||||
* \param cbGUID the size of pszGUID, should be at least 33 bytes.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_StringToGUID
|
||||
*/
|
||||
extern SDL_DECLSPEC_TEMP const char * SDLCALL SDL_GUIDToString(SDL_GUID guid);
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_GUIDToString(SDL_GUID guid, char *pszGUID, int cbGUID);
|
||||
|
||||
/**
|
||||
* Convert a GUID string into a SDL_GUID structure.
|
||||
|
||||
@@ -45,6 +45,7 @@
|
||||
* SDL_HapticID *haptics = SDL_GetHaptics(NULL);
|
||||
* if (haptics) {
|
||||
* haptic = SDL_OpenHaptic(haptics[0]);
|
||||
* SDL_free(haptics);
|
||||
* }
|
||||
* if (haptic == NULL)
|
||||
* return -1;
|
||||
@@ -934,13 +935,13 @@ typedef Uint32 SDL_HapticID;
|
||||
* \param count a pointer filled in with the number of haptic devices
|
||||
* returned, may be NULL.
|
||||
* \returns a 0 terminated array of haptic device instance IDs or NULL on
|
||||
* failure; call SDL_GetError() for more information.
|
||||
* failure; call SDL_GetError() for more information. This should be freed with SDL_free() when it is no longer needed.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_OpenHaptic
|
||||
*/
|
||||
extern SDL_DECLSPEC_TEMP const SDL_HapticID * SDLCALL SDL_GetHaptics(int *count);
|
||||
extern SDL_DECLSPEC_FREE SDL_HapticID * SDLCALL SDL_GetHaptics(int *count);
|
||||
|
||||
/**
|
||||
* Get the implementation dependent name of a haptic device.
|
||||
@@ -957,7 +958,7 @@ extern SDL_DECLSPEC_TEMP const SDL_HapticID * SDLCALL SDL_GetHaptics(int *count)
|
||||
* \sa SDL_GetHapticName
|
||||
* \sa SDL_OpenHaptic
|
||||
*/
|
||||
extern SDL_DECLSPEC_TEMP const char * SDLCALL SDL_GetHapticNameForID(SDL_HapticID instance_id);
|
||||
extern SDL_DECLSPEC const char * SDLCALL SDL_GetHapticNameForID(SDL_HapticID instance_id);
|
||||
|
||||
/**
|
||||
* Open a haptic device for use.
|
||||
@@ -1019,7 +1020,7 @@ extern SDL_DECLSPEC SDL_HapticID SDLCALL SDL_GetHapticID(SDL_Haptic *haptic);
|
||||
*
|
||||
* \sa SDL_GetHapticNameForID
|
||||
*/
|
||||
extern SDL_DECLSPEC_TEMP const char * SDLCALL SDL_GetHapticName(SDL_Haptic *haptic);
|
||||
extern SDL_DECLSPEC const char * SDLCALL SDL_GetHapticName(SDL_Haptic *haptic);
|
||||
|
||||
/**
|
||||
* Query whether or not the current mouse has haptic capabilities.
|
||||
|
||||
@@ -3880,7 +3880,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_ResetHints(void);
|
||||
* \sa SDL_SetHint
|
||||
* \sa SDL_SetHintWithPriority
|
||||
*/
|
||||
extern SDL_DECLSPEC_TEMP const char * SDLCALL SDL_GetHint(const char *name);
|
||||
extern SDL_DECLSPEC const char * SDLCALL SDL_GetHint(const char *name);
|
||||
|
||||
/**
|
||||
* Get the boolean value of a hint variable.
|
||||
|
||||
@@ -204,14 +204,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasJoystick(void);
|
||||
* \param count a pointer filled in with the number of joysticks returned, may
|
||||
* be NULL.
|
||||
* \returns a 0 terminated array of joystick instance IDs or NULL on failure;
|
||||
* call SDL_GetError() for more information.
|
||||
* call SDL_GetError() for more information. This should be freed with SDL_free() when it is no longer needed.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_HasJoystick
|
||||
* \sa SDL_OpenJoystick
|
||||
*/
|
||||
extern SDL_DECLSPEC_TEMP const SDL_JoystickID * SDLCALL SDL_GetJoysticks(int *count);
|
||||
extern SDL_DECLSPEC_FREE SDL_JoystickID * SDLCALL SDL_GetJoysticks(int *count);
|
||||
|
||||
/**
|
||||
* Get the implementation dependent name of a joystick.
|
||||
@@ -227,7 +227,7 @@ extern SDL_DECLSPEC_TEMP const SDL_JoystickID * SDLCALL SDL_GetJoysticks(int *co
|
||||
* \sa SDL_GetJoystickName
|
||||
* \sa SDL_GetJoysticks
|
||||
*/
|
||||
extern SDL_DECLSPEC_TEMP const char * SDLCALL SDL_GetJoystickNameForID(SDL_JoystickID instance_id);
|
||||
extern SDL_DECLSPEC const char * SDLCALL SDL_GetJoystickNameForID(SDL_JoystickID instance_id);
|
||||
|
||||
/**
|
||||
* Get the implementation dependent path of a joystick.
|
||||
@@ -243,7 +243,7 @@ extern SDL_DECLSPEC_TEMP const char * SDLCALL SDL_GetJoystickNameForID(SDL_Joyst
|
||||
* \sa SDL_GetJoystickPath
|
||||
* \sa SDL_GetJoysticks
|
||||
*/
|
||||
extern SDL_DECLSPEC_TEMP const char * SDLCALL SDL_GetJoystickPathForID(SDL_JoystickID instance_id);
|
||||
extern SDL_DECLSPEC const char * SDLCALL SDL_GetJoystickPathForID(SDL_JoystickID instance_id);
|
||||
|
||||
/**
|
||||
* Get the player index of a joystick.
|
||||
@@ -661,7 +661,7 @@ extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetJoystickProperties(SDL_Joyst
|
||||
*
|
||||
* \sa SDL_GetJoystickNameForID
|
||||
*/
|
||||
extern SDL_DECLSPEC_TEMP const char * SDLCALL SDL_GetJoystickName(SDL_Joystick *joystick);
|
||||
extern SDL_DECLSPEC const char * SDLCALL SDL_GetJoystickName(SDL_Joystick *joystick);
|
||||
|
||||
/**
|
||||
* Get the implementation dependent path of a joystick.
|
||||
@@ -674,7 +674,7 @@ extern SDL_DECLSPEC_TEMP const char * SDLCALL SDL_GetJoystickName(SDL_Joystick *
|
||||
*
|
||||
* \sa SDL_GetJoystickPathForID
|
||||
*/
|
||||
extern SDL_DECLSPEC_TEMP const char * SDLCALL SDL_GetJoystickPath(SDL_Joystick *joystick);
|
||||
extern SDL_DECLSPEC const char * SDLCALL SDL_GetJoystickPath(SDL_Joystick *joystick);
|
||||
|
||||
/**
|
||||
* Get the player index of an opened joystick.
|
||||
@@ -789,7 +789,7 @@ extern SDL_DECLSPEC Uint16 SDLCALL SDL_GetJoystickFirmwareVersion(SDL_Joystick *
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC_TEMP const char * SDLCALL SDL_GetJoystickSerial(SDL_Joystick *joystick);
|
||||
extern SDL_DECLSPEC const char * SDLCALL SDL_GetJoystickSerial(SDL_Joystick *joystick);
|
||||
|
||||
/**
|
||||
* Get the type of an opened joystick.
|
||||
|
||||
@@ -76,14 +76,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasKeyboard(void);
|
||||
* \param count a pointer filled in with the number of keyboards returned, may
|
||||
* be NULL.
|
||||
* \returns a 0 terminated array of keyboards instance IDs or NULL on failure;
|
||||
* call SDL_GetError() for more information.
|
||||
* call SDL_GetError() for more information. This should be freed with SDL_free() when it is no longer needed.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetKeyboardNameForID
|
||||
* \sa SDL_HasKeyboard
|
||||
*/
|
||||
extern SDL_DECLSPEC_TEMP const SDL_KeyboardID * SDLCALL SDL_GetKeyboards(int *count);
|
||||
extern SDL_DECLSPEC_FREE SDL_KeyboardID * SDLCALL SDL_GetKeyboards(int *count);
|
||||
|
||||
/**
|
||||
* Get the name of a keyboard.
|
||||
@@ -98,7 +98,7 @@ extern SDL_DECLSPEC_TEMP const SDL_KeyboardID * SDLCALL SDL_GetKeyboards(int *co
|
||||
*
|
||||
* \sa SDL_GetKeyboards
|
||||
*/
|
||||
extern SDL_DECLSPEC_TEMP const char * SDLCALL SDL_GetKeyboardNameForID(SDL_KeyboardID instance_id);
|
||||
extern SDL_DECLSPEC const char * SDLCALL SDL_GetKeyboardNameForID(SDL_KeyboardID instance_id);
|
||||
|
||||
/**
|
||||
* Query the window which currently has keyboard focus.
|
||||
@@ -297,7 +297,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetScancodeName(SDL_Scancode scancode, const
|
||||
* \sa SDL_GetScancodeFromName
|
||||
* \sa SDL_SetScancodeName
|
||||
*/
|
||||
extern SDL_DECLSPEC_TEMP const char * SDLCALL SDL_GetScancodeName(SDL_Scancode scancode);
|
||||
extern SDL_DECLSPEC const char * SDLCALL SDL_GetScancodeName(SDL_Scancode scancode);
|
||||
|
||||
/**
|
||||
* Get a scancode from a human-readable name.
|
||||
@@ -331,7 +331,7 @@ extern SDL_DECLSPEC SDL_Scancode SDLCALL SDL_GetScancodeFromName(const char *nam
|
||||
* \sa SDL_GetKeyFromScancode
|
||||
* \sa SDL_GetScancodeFromKey
|
||||
*/
|
||||
extern SDL_DECLSPEC_TEMP const char * SDLCALL SDL_GetKeyName(SDL_Keycode key);
|
||||
extern SDL_DECLSPEC const char * SDLCALL SDL_GetKeyName(SDL_Keycode key);
|
||||
|
||||
/**
|
||||
* Get a key code from a human-readable name.
|
||||
|
||||
@@ -92,11 +92,11 @@ typedef struct SDL_Locale
|
||||
* \param count a pointer filled in with the number of locales returned, may
|
||||
* be NULL.
|
||||
* \returns a NULL terminated array of locale pointers, or NULL on failure;
|
||||
* call SDL_GetError() for more information.
|
||||
* call SDL_GetError() for more information. This is a single allocation that should be freed with SDL_free() when it is no longer needed.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC_TEMP const SDL_Locale * const * SDLCALL SDL_GetPreferredLocales(int *count);
|
||||
extern SDL_DECLSPEC_FREE SDL_Locale ** SDLCALL SDL_GetPreferredLocales(int *count);
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -138,14 +138,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasMouse(void);
|
||||
* \param count a pointer filled in with the number of mice returned, may be
|
||||
* NULL.
|
||||
* \returns a 0 terminated array of mouse instance IDs or NULL on failure;
|
||||
* call SDL_GetError() for more information.
|
||||
* call SDL_GetError() for more information. This should be freed with SDL_free() when it is no longer needed.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetMouseNameForID
|
||||
* \sa SDL_HasMouse
|
||||
*/
|
||||
extern SDL_DECLSPEC_TEMP const SDL_MouseID * SDLCALL SDL_GetMice(int *count);
|
||||
extern SDL_DECLSPEC_FREE SDL_MouseID * SDLCALL SDL_GetMice(int *count);
|
||||
|
||||
/**
|
||||
* Get the name of a mouse.
|
||||
@@ -160,7 +160,7 @@ extern SDL_DECLSPEC_TEMP const SDL_MouseID * SDLCALL SDL_GetMice(int *count);
|
||||
*
|
||||
* \sa SDL_GetMice
|
||||
*/
|
||||
extern SDL_DECLSPEC_TEMP const char * SDLCALL SDL_GetMouseNameForID(SDL_MouseID instance_id);
|
||||
extern SDL_DECLSPEC const char * SDLCALL SDL_GetMouseNameForID(SDL_MouseID instance_id);
|
||||
|
||||
/**
|
||||
* Get the window which currently has mouse focus.
|
||||
|
||||
@@ -235,7 +235,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_PenConnected(SDL_PenID instance_id);
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC_TEMP const char * SDLCALL SDL_GetPenName(SDL_PenID instance_id);
|
||||
extern SDL_DECLSPEC const char * SDLCALL SDL_GetPenName(SDL_PenID instance_id);
|
||||
|
||||
/**
|
||||
* Pen capabilities, as reported by SDL_GetPenCapabilities()
|
||||
|
||||
@@ -384,7 +384,12 @@ extern SDL_DECLSPEC void * SDLCALL SDL_GetPointerProperty(SDL_PropertiesID props
|
||||
* \returns the value of the property, or `default_value` if it is not set or
|
||||
* not a string property.
|
||||
*
|
||||
* \threadsafety It is safe to call this function from any thread.
|
||||
* \threadsafety It is safe to call this function from any thread, although
|
||||
* the data returned is not protected and could potentially be
|
||||
* freed if you call SDL_SetStringProperty() or
|
||||
* SDL_ClearProperty() on these properties from another thread.
|
||||
* If you need to avoid this, use SDL_LockProperties() and
|
||||
* SDL_UnlockProperties().
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
@@ -392,7 +397,7 @@ extern SDL_DECLSPEC void * SDLCALL SDL_GetPointerProperty(SDL_PropertiesID props
|
||||
* \sa SDL_HasProperty
|
||||
* \sa SDL_SetStringProperty
|
||||
*/
|
||||
extern SDL_DECLSPEC_TEMP const char * SDLCALL SDL_GetStringProperty(SDL_PropertiesID props, const char *name, const char *default_value);
|
||||
extern SDL_DECLSPEC const char * SDLCALL SDL_GetStringProperty(SDL_PropertiesID props, const char *name, const char *default_value);
|
||||
|
||||
/**
|
||||
* Get a number property from a group of properties.
|
||||
|
||||
@@ -163,7 +163,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetNumRenderDrivers(void);
|
||||
*
|
||||
* \sa SDL_GetNumRenderDrivers
|
||||
*/
|
||||
extern SDL_DECLSPEC_TEMP const char * SDLCALL SDL_GetRenderDriver(int index);
|
||||
extern SDL_DECLSPEC const char * SDLCALL SDL_GetRenderDriver(int index);
|
||||
|
||||
/**
|
||||
* Create a window and default renderer.
|
||||
@@ -331,7 +331,7 @@ extern SDL_DECLSPEC SDL_Window * SDLCALL SDL_GetRenderWindow(SDL_Renderer *rende
|
||||
* \sa SDL_CreateRenderer
|
||||
* \sa SDL_CreateRendererWithProperties
|
||||
*/
|
||||
extern SDL_DECLSPEC_TEMP const char * SDLCALL SDL_GetRendererName(SDL_Renderer *renderer);
|
||||
extern SDL_DECLSPEC const char * SDLCALL SDL_GetRendererName(SDL_Renderer *renderer);
|
||||
|
||||
/**
|
||||
* Get the properties associated with a renderer.
|
||||
|
||||
@@ -149,11 +149,11 @@ typedef enum SDL_SensorType
|
||||
* \param count a pointer filled in with the number of sensors returned, may
|
||||
* be NULL.
|
||||
* \returns a 0 terminated array of sensor instance IDs or NULL on failure;
|
||||
* call SDL_GetError() for more information.
|
||||
* call SDL_GetError() for more information. This should be freed with SDL_free() when it is no longer needed.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC const SDL_SensorID * SDLCALL SDL_GetSensors(int *count);
|
||||
extern SDL_DECLSPEC SDL_SensorID * SDLCALL SDL_GetSensors(int *count);
|
||||
|
||||
/**
|
||||
* Get the implementation dependent name of a sensor.
|
||||
@@ -165,7 +165,7 @@ extern SDL_DECLSPEC const SDL_SensorID * SDLCALL SDL_GetSensors(int *count);
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC_TEMP const char * SDLCALL SDL_GetSensorNameForID(SDL_SensorID instance_id);
|
||||
extern SDL_DECLSPEC const char * SDLCALL SDL_GetSensorNameForID(SDL_SensorID instance_id);
|
||||
|
||||
/**
|
||||
* Get the type of a sensor.
|
||||
@@ -235,7 +235,7 @@ extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetSensorProperties(SDL_Sensor
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC_TEMP const char * SDLCALL SDL_GetSensorName(SDL_Sensor *sensor);
|
||||
extern SDL_DECLSPEC const char * SDLCALL SDL_GetSensorName(SDL_Sensor *sensor);
|
||||
|
||||
/**
|
||||
* Get the type of a sensor.
|
||||
|
||||
@@ -527,9 +527,9 @@ extern "C" {
|
||||
#define SDL_stack_free(data) SDL_free(data)
|
||||
#endif
|
||||
|
||||
extern SDL_DECLSPEC SDL_MALLOC void * SDLCALL SDL_malloc(size_t size);
|
||||
extern SDL_DECLSPEC SDL_MALLOC SDL_ALLOC_SIZE2(1, 2) void * SDLCALL SDL_calloc(size_t nmemb, size_t size);
|
||||
extern SDL_DECLSPEC SDL_ALLOC_SIZE(2) void * SDLCALL SDL_realloc(void *mem, size_t size);
|
||||
extern SDL_DECLSPEC_FREE SDL_MALLOC void * SDLCALL SDL_malloc(size_t size);
|
||||
extern SDL_DECLSPEC_FREE SDL_MALLOC SDL_ALLOC_SIZE2(1, 2) void * SDLCALL SDL_calloc(size_t nmemb, size_t size);
|
||||
extern SDL_DECLSPEC_FREE SDL_ALLOC_SIZE(2) void * SDLCALL SDL_realloc(void *mem, size_t size);
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_free(void *mem);
|
||||
|
||||
typedef void *(SDLCALL *SDL_malloc_func)(size_t size);
|
||||
|
||||
@@ -410,14 +410,14 @@ extern SDL_DECLSPEC Uint64 SDLCALL SDL_GetStorageSpaceRemaining(SDL_Storage *sto
|
||||
* array. Can be NULL.
|
||||
* \returns an array of strings on success or NULL on failure; call
|
||||
* SDL_GetError() for more information. The caller should pass the
|
||||
* returned pointer to SDL_free when done with it.
|
||||
* returned pointer to SDL_free when done with it. This is a single allocation that should be freed with SDL_free() when it is no longer needed.
|
||||
*
|
||||
* \threadsafety It is safe to call this function from any thread, assuming
|
||||
* the `storage` object is thread-safe.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC_TEMP const char * const * SDLCALL SDL_GlobStorageDirectory(SDL_Storage *storage, const char *path, const char *pattern, SDL_GlobFlags flags, int *count);
|
||||
extern SDL_DECLSPEC_FREE char ** SDLCALL SDL_GlobStorageDirectory(SDL_Storage *storage, const char *path, const char *pattern, SDL_GlobFlags flags, int *count);
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -418,7 +418,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_SendAndroidBackButton(void);
|
||||
*
|
||||
* \sa SDL_GetAndroidExternalStorageState
|
||||
*/
|
||||
extern SDL_DECLSPEC_TEMP const char * SDLCALL SDL_GetAndroidInternalStoragePath(void);
|
||||
extern SDL_DECLSPEC const char * SDLCALL SDL_GetAndroidInternalStoragePath(void);
|
||||
|
||||
/**
|
||||
* Get the current state of external storage for this Android application.
|
||||
@@ -457,7 +457,7 @@ extern SDL_DECLSPEC Uint32 SDLCALL SDL_GetAndroidExternalStorageState(void);
|
||||
*
|
||||
* \sa SDL_GetAndroidExternalStorageState
|
||||
*/
|
||||
extern SDL_DECLSPEC_TEMP const char * SDLCALL SDL_GetAndroidExternalStoragePath(void);
|
||||
extern SDL_DECLSPEC const char * SDLCALL SDL_GetAndroidExternalStoragePath(void);
|
||||
|
||||
/**
|
||||
* Get the path used for caching data for this Android application.
|
||||
@@ -476,7 +476,7 @@ extern SDL_DECLSPEC_TEMP const char * SDLCALL SDL_GetAndroidExternalStoragePath(
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC_TEMP const char * SDLCALL SDL_GetAndroidCachePath(void);
|
||||
extern SDL_DECLSPEC const char * SDLCALL SDL_GetAndroidCachePath(void);
|
||||
|
||||
|
||||
typedef void (SDLCALL *SDL_RequestAndroidPermissionCallback)(void *userdata, const char *permission, SDL_bool granted);
|
||||
@@ -630,7 +630,7 @@ typedef enum SDL_WinRT_DeviceFamily
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC_TEMP const char * SDLCALL SDL_GetWinRTFSPath(SDL_WinRT_Path pathType);
|
||||
extern SDL_DECLSPEC const char * SDLCALL SDL_GetWinRTFSPath(SDL_WinRT_Path pathType);
|
||||
|
||||
/**
|
||||
* Detects the device family of WinRT platform at runtime.
|
||||
|
||||
@@ -336,7 +336,7 @@ extern SDL_DECLSPEC SDL_Thread * SDLCALL SDL_CreateThreadWithPropertiesRuntime(S
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC_TEMP const char * SDLCALL SDL_GetThreadName(SDL_Thread *thread);
|
||||
extern SDL_DECLSPEC const char * SDLCALL SDL_GetThreadName(SDL_Thread *thread);
|
||||
|
||||
/**
|
||||
* Get the thread identifier for the current thread.
|
||||
|
||||
@@ -86,11 +86,11 @@ typedef struct SDL_Finger
|
||||
* \param count a pointer filled in with the number of devices returned, may
|
||||
* be NULL.
|
||||
* \returns a 0 terminated array of touch device IDs or NULL on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
* SDL_GetError() for more information. This should be freed with SDL_free() when it is no longer needed.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC_TEMP const SDL_TouchID * SDLCALL SDL_GetTouchDevices(int *count);
|
||||
extern SDL_DECLSPEC_FREE SDL_TouchID * SDLCALL SDL_GetTouchDevices(int *count);
|
||||
|
||||
/**
|
||||
* Get the touch device name as reported from the driver.
|
||||
@@ -101,7 +101,7 @@ extern SDL_DECLSPEC_TEMP const SDL_TouchID * SDLCALL SDL_GetTouchDevices(int *co
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC_TEMP const char * SDLCALL SDL_GetTouchDeviceName(SDL_TouchID touchID);
|
||||
extern SDL_DECLSPEC const char * SDLCALL SDL_GetTouchDeviceName(SDL_TouchID touchID);
|
||||
|
||||
/**
|
||||
* Get the type of the given touch device.
|
||||
@@ -120,11 +120,11 @@ extern SDL_DECLSPEC SDL_TouchDeviceType SDLCALL SDL_GetTouchDeviceType(SDL_Touch
|
||||
* \param count a pointer filled in with the number of fingers returned, can
|
||||
* be NULL.
|
||||
* \returns a NULL terminated array of SDL_Finger pointers or NULL on failure;
|
||||
* call SDL_GetError() for more information.
|
||||
* call SDL_GetError() for more information. This is a single allocation that should be freed with SDL_free() when it is no longer needed.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC_TEMP const SDL_Finger * const * SDLCALL SDL_GetTouchFingers(SDL_TouchID touchID, int *count);
|
||||
extern SDL_DECLSPEC_FREE SDL_Finger ** SDLCALL SDL_GetTouchFingers(SDL_TouchID touchID, int *count);
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -356,7 +356,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetNumVideoDrivers(void);
|
||||
*
|
||||
* \sa SDL_GetNumVideoDrivers
|
||||
*/
|
||||
extern SDL_DECLSPEC_TEMP const char * SDLCALL SDL_GetVideoDriver(int index);
|
||||
extern SDL_DECLSPEC const char * SDLCALL SDL_GetVideoDriver(int index);
|
||||
|
||||
/**
|
||||
* Get the name of the currently initialized video driver.
|
||||
@@ -373,7 +373,7 @@ extern SDL_DECLSPEC_TEMP const char * SDLCALL SDL_GetVideoDriver(int index);
|
||||
* \sa SDL_GetNumVideoDrivers
|
||||
* \sa SDL_GetVideoDriver
|
||||
*/
|
||||
extern SDL_DECLSPEC_TEMP const char * SDLCALL SDL_GetCurrentVideoDriver(void);
|
||||
extern SDL_DECLSPEC const char * SDLCALL SDL_GetCurrentVideoDriver(void);
|
||||
|
||||
/**
|
||||
* Get the current system theme.
|
||||
@@ -390,11 +390,11 @@ extern SDL_DECLSPEC SDL_SystemTheme SDLCALL SDL_GetSystemTheme(void);
|
||||
* \param count a pointer filled in with the number of displays returned, may
|
||||
* be NULL.
|
||||
* \returns a 0 terminated array of display instance IDs or NULL on failure;
|
||||
* call SDL_GetError() for more information.
|
||||
* call SDL_GetError() for more information. This should be freed with SDL_free() when it is no longer needed.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC_TEMP const SDL_DisplayID * SDLCALL SDL_GetDisplays(int *count);
|
||||
extern SDL_DECLSPEC_FREE SDL_DisplayID * SDLCALL SDL_GetDisplays(int *count);
|
||||
|
||||
/**
|
||||
* Return the primary display.
|
||||
@@ -448,7 +448,7 @@ extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetDisplayProperties(SDL_Displa
|
||||
*
|
||||
* \sa SDL_GetDisplays
|
||||
*/
|
||||
extern SDL_DECLSPEC_TEMP const char * SDLCALL SDL_GetDisplayName(SDL_DisplayID displayID);
|
||||
extern SDL_DECLSPEC const char * SDLCALL SDL_GetDisplayName(SDL_DisplayID displayID);
|
||||
|
||||
/**
|
||||
* Get the desktop area represented by a display.
|
||||
@@ -551,13 +551,13 @@ extern SDL_DECLSPEC float SDLCALL SDL_GetDisplayContentScale(SDL_DisplayID displ
|
||||
* \param count a pointer filled in with the number of display modes returned,
|
||||
* may be NULL.
|
||||
* \returns a NULL terminated array of display mode pointers or NULL on
|
||||
* failure; call SDL_GetError() for more information.
|
||||
* failure; call SDL_GetError() for more information. This is a single allocation that should be freed with SDL_free() when it is no longer needed.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetDisplays
|
||||
*/
|
||||
extern SDL_DECLSPEC_TEMP const SDL_DisplayMode * const * SDLCALL SDL_GetFullscreenDisplayModes(SDL_DisplayID displayID, int *count);
|
||||
extern SDL_DECLSPEC_FREE SDL_DisplayMode ** SDLCALL SDL_GetFullscreenDisplayModes(SDL_DisplayID displayID, int *count);
|
||||
|
||||
/**
|
||||
* Get the closest match to the requested display mode.
|
||||
@@ -576,16 +576,17 @@ extern SDL_DECLSPEC_TEMP const SDL_DisplayMode * const * SDLCALL SDL_GetFullscre
|
||||
* for the desktop refresh rate.
|
||||
* \param include_high_density_modes boolean to include high density modes in
|
||||
* the search.
|
||||
* \returns a pointer to the closest display mode equal to or larger than the
|
||||
* desired mode, or NULL on failure; call SDL_GetError() for more
|
||||
* information.
|
||||
* \param mode a pointer filled in with the closest display mode equal to or larger than the
|
||||
* desired mode.
|
||||
* \returns 0 on success or a negative error code on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetDisplays
|
||||
* \sa SDL_GetFullscreenDisplayModes
|
||||
*/
|
||||
extern SDL_DECLSPEC_TEMP const SDL_DisplayMode * SDLCALL SDL_GetClosestFullscreenDisplayMode(SDL_DisplayID displayID, int w, int h, float refresh_rate, SDL_bool include_high_density_modes);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_GetClosestFullscreenDisplayMode(SDL_DisplayID displayID, int w, int h, float refresh_rate, SDL_bool include_high_density_modes, SDL_DisplayMode *mode);
|
||||
|
||||
/**
|
||||
* Get information about the desktop's display mode.
|
||||
@@ -604,7 +605,7 @@ extern SDL_DECLSPEC_TEMP const SDL_DisplayMode * SDLCALL SDL_GetClosestFullscree
|
||||
* \sa SDL_GetCurrentDisplayMode
|
||||
* \sa SDL_GetDisplays
|
||||
*/
|
||||
extern SDL_DECLSPEC_TEMP const SDL_DisplayMode * SDLCALL SDL_GetDesktopDisplayMode(SDL_DisplayID displayID);
|
||||
extern SDL_DECLSPEC const SDL_DisplayMode * SDLCALL SDL_GetDesktopDisplayMode(SDL_DisplayID displayID);
|
||||
|
||||
/**
|
||||
* Get information about the current display mode.
|
||||
@@ -623,7 +624,7 @@ extern SDL_DECLSPEC_TEMP const SDL_DisplayMode * SDLCALL SDL_GetDesktopDisplayMo
|
||||
* \sa SDL_GetDesktopDisplayMode
|
||||
* \sa SDL_GetDisplays
|
||||
*/
|
||||
extern SDL_DECLSPEC_TEMP const SDL_DisplayMode * SDLCALL SDL_GetCurrentDisplayMode(SDL_DisplayID displayID);
|
||||
extern SDL_DECLSPEC const SDL_DisplayMode * SDLCALL SDL_GetCurrentDisplayMode(SDL_DisplayID displayID);
|
||||
|
||||
/**
|
||||
* Get the display containing a point.
|
||||
@@ -753,7 +754,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetWindowFullscreenMode(SDL_Window *window,
|
||||
* \sa SDL_SetWindowFullscreenMode
|
||||
* \sa SDL_SetWindowFullscreen
|
||||
*/
|
||||
extern SDL_DECLSPEC_TEMP const SDL_DisplayMode * SDLCALL SDL_GetWindowFullscreenMode(SDL_Window *window);
|
||||
extern SDL_DECLSPEC const SDL_DisplayMode * SDLCALL SDL_GetWindowFullscreenMode(SDL_Window *window);
|
||||
|
||||
/**
|
||||
* Get the raw ICC profile data for the screen the window is currently on.
|
||||
@@ -761,11 +762,11 @@ extern SDL_DECLSPEC_TEMP const SDL_DisplayMode * SDLCALL SDL_GetWindowFullscreen
|
||||
* \param window the window to query.
|
||||
* \param size the size of the ICC profile.
|
||||
* \returns the raw ICC profile data on success or NULL on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
* SDL_GetError() for more information. This should be freed with SDL_free() when it is no longer needed.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC_TEMP const void * SDLCALL SDL_GetWindowICCProfile(SDL_Window *window, size_t *size);
|
||||
extern SDL_DECLSPEC_FREE void * SDLCALL SDL_GetWindowICCProfile(SDL_Window *window, size_t *size);
|
||||
|
||||
/**
|
||||
* Get the pixel format associated with the window.
|
||||
@@ -785,11 +786,11 @@ extern SDL_DECLSPEC SDL_PixelFormat SDLCALL SDL_GetWindowPixelFormat(SDL_Window
|
||||
* \param count a pointer filled in with the number of windows returned, may
|
||||
* be NULL.
|
||||
* \returns a NULL terminated array of SDL_Window pointers or NULL on failure;
|
||||
* call SDL_GetError() for more information.
|
||||
* call SDL_GetError() for more information. This is a single allocation that should be freed with SDL_free() when it is no longer needed.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC_TEMP SDL_Window * const * SDLCALL SDL_GetWindows(int *count);
|
||||
extern SDL_DECLSPEC_FREE SDL_Window ** SDLCALL SDL_GetWindows(int *count);
|
||||
|
||||
/**
|
||||
* Create a window with the specified dimensions and flags.
|
||||
@@ -1322,7 +1323,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetWindowTitle(SDL_Window *window, const cha
|
||||
*
|
||||
* \sa SDL_SetWindowTitle
|
||||
*/
|
||||
extern SDL_DECLSPEC_TEMP const char * SDLCALL SDL_GetWindowTitle(SDL_Window *window);
|
||||
extern SDL_DECLSPEC const char * SDLCALL SDL_GetWindowTitle(SDL_Window *window);
|
||||
|
||||
/**
|
||||
* Set the icon for a window.
|
||||
|
||||
Reference in New Issue
Block a user