fix breaking cpp2beef changes

This commit is contained in:
Rune
2026-03-15 16:48:20 +01:00
parent f41a145b67
commit 3e8ce40cc3
33 changed files with 605 additions and 167 deletions

View File

@@ -350,7 +350,7 @@ class Program
"-DSDL_oldnames_h_", "-DSDL_platform_defines_h_", "-DSDL_endian_h_",
"-DCrcUint32=Uint32", "-DCrcUint8=Uint8",
"-DSDL_SLOW_MEMCPY", "-DSDL_SLOW_MEMMOVE", "-DSDL_SLOW_MEMSET", "-DSDL_DISABLE_ALLOCA", "-DSDL_DISABLE_ANALYZE_MACROS"));
generator.Generate("SDL3_all.h", null);
generator.Generate("SDL3_all.h");
return 0;
}

View File

@@ -170,7 +170,7 @@ public const let ASSERT_LEVEL = 1;
/**
* A macro that reports the current function being compiled.
* A constant that contains the current function being compiled.
*
* If SDL can't figure how the compiler reports this, it will use "???".
*
@@ -178,6 +178,7 @@ public const let ASSERT_LEVEL = 1;
*/
/* C99 supports __func__ as a standard. */
@@ -188,6 +189,7 @@ public const let ASSERT_LEVEL = 1;
/**
* A macro that reports the current file being compiled.
*

View File

@@ -223,6 +223,8 @@ extension SDL
* \returns a pointer to the SDL_AsyncIO structure that is created 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.2.0.
*
* \sa SDL_CloseAsyncIO
@@ -541,6 +543,8 @@ extension SDL
* \returns true on success or false 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.2.0.
*
* \sa SDL_LoadFile_IO

View File

@@ -496,7 +496,7 @@ public typealias CameraID = Uint32;
/**
* Release a frame of video acquired from a camera.
*
* Let the back-end re-use the internal buffer for camera.
* Let the back-end reuse the internal buffer for camera.
*
* This function _must_ be called only on surface objects returned by
* SDL_AcquireCameraFrame(). This function should be called as quickly as

View File

@@ -216,7 +216,7 @@ namespace SDL3;
/* By default, assume that floats words follow the memory system mode. */
/* __FLOAT_WORD_ORDER__ */
/* SDL_WIKI_DOCUMENTATION_SECTION */
/* !SDL_FLOATWORDORDER */

View File

@@ -251,9 +251,8 @@ extension SDL
/**
* Types of filesystem entries.
*
* Note that there may be other sorts of items on a filesystem: devices,
* symlinks, named pipes, etc. They are currently reported as
* SDL_PATHTYPE_OTHER.
* Note that there may be other sorts of items on a filesystem: devices, named
* pipes, etc. They are currently reported as SDL_PATHTYPE_OTHER.
*
* \since This enum is available since SDL 3.2.0.
*
@@ -272,6 +271,7 @@ extension SDL
*
* \since This datatype is available since SDL 3.2.0.
*
* \sa SDL_PathType
* \sa SDL_GetPathInfo
* \sa SDL_GetStoragePathInfo
*/
@@ -485,6 +485,10 @@ public function EnumerationResult EnumerateDirectoryCallback(void* userdata, c_c
/**
* Get information about a filesystem path.
*
* Symlinks, on filesystems that support them, are always followed, so you
* will always get information on what the symlink eventually points to, and
* not the symlink itself.
*
* \param path the path to query.
* \param info a pointer filled in with information about the path, or NULL to
* check for the existence of a file.

View File

@@ -2315,6 +2315,21 @@ public enum GPUColorComponentFlags : Uint8
* useful for targeting Intel Haswell and Broadwell GPUs; other hardware
* either supports Tier 2 Resource Binding or does not support D3D12 in any
* capacity. Defaults to false.
* - `SDL_PROP_GPU_DEVICE_CREATE_D3D12_AGILITY_SDK_VERSION_NUMBER`: Certain
* feature checks are only possible on Windows 11 by default. By setting
* this alongside `SDL_PROP_GPU_DEVICE_CREATE_D3D12_AGILITY_SDK_PATH_STRING`
* and vendoring D3D12Core.dll from the D3D12 Agility SDK, you can make
* those feature checks possible on older platforms. The version you provide
* must match the one given in the DLL.
* - `SDL_PROP_GPU_DEVICE_CREATE_D3D12_AGILITY_SDK_PATH_STRING`: Certain
* feature checks are only possible on Windows 11 by default. By setting
* this alongside
* `SDL_PROP_GPU_DEVICE_CREATE_D3D12_AGILITY_SDK_VERSION_NUMBER` and
* vendoring D3D12Core.dll from the D3D12 Agility SDK, you can make those
* feature checks possible on older platforms. The path you provide must be
* relative to the executable path of your app. Be sure not to put the DLL
* in the same directory as the exe; Microsoft strongly advises against
* this!
*
* With the Vulkan backend:
*
@@ -2368,6 +2383,8 @@ public const let PROP_GPU_DEVICE_CREATE_SHADERS_MSL_BOOLEAN
public const let PROP_GPU_DEVICE_CREATE_SHADERS_METALLIB_BOOLEAN = "SDL.gpu.device.create.shaders.metallib";
public const let PROP_GPU_DEVICE_CREATE_D3D12_ALLOW_FEWER_RESOURCE_SLOTS_BOOLEAN = "SDL.gpu.device.create.d3d12.allowtier1resourcebinding";
public const let PROP_GPU_DEVICE_CREATE_D3D12_SEMANTIC_NAME_STRING = "SDL.gpu.device.create.d3d12.semantic";
public const let PROP_GPU_DEVICE_CREATE_D3D12_AGILITY_SDK_VERSION_NUMBER = "SDL.gpu.device.create.d3d12.agility_sdk_version";
public const let PROP_GPU_DEVICE_CREATE_D3D12_AGILITY_SDK_PATH_STRING = "SDL.gpu.device.create.d3d12.agility_sdk_path";
public const let PROP_GPU_DEVICE_CREATE_VULKAN_REQUIRE_HARDWARE_ACCELERATION_BOOLEAN = "SDL.gpu.device.create.vulkan.requirehardwareacceleration";
public const let PROP_GPU_DEVICE_CREATE_VULKAN_OPTIONS_POINTER = "SDL.gpu.device.create.vulkan.options";
public const let PROP_GPU_DEVICE_CREATE_METAL_ALLOW_MACFAMILY1_BOOLEAN = "SDL.gpu.device.create.metal.allowmacfamily1";

View File

@@ -1402,7 +1402,7 @@ public typealias HapticID = Uint32;
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_RunHapticEffect
* \sa SDL_StopHapticEffects
* \sa SDL_StopHapticEffect
*/
[LinkName("SDL_StopHapticEffects")] public static extern bool StopHapticEffects(Haptic* haptic);

View File

@@ -1903,6 +1903,23 @@ public const let HINT_JOYSTICK_HIDAPI_ZUIKI = "SDL_JOYSTICK_HIDAPI_ZUIKI";
*/
public const let HINT_JOYSTICK_HIDAPI_FLYDIGI = "SDL_JOYSTICK_HIDAPI_FLYDIGI";
/**
* A variable controlling whether the HIDAPI driver for GameSir controllers
* should be used.
*
* The variable can be set to the following values:
*
* - "0": HIDAPI driver is not used.
* - "1": HIDAPI driver is used.
*
* The default is the value of SDL_HINT_JOYSTICK_HIDAPI.
*
* This hint should be set before initializing joysticks and gamepads.
*
* \since This hint is available since SDL 3.5.0.
*/
public const let HINT_JOYSTICK_HIDAPI_GAMESIR = "SDL_JOYSTICK_HIDAPI_GAMESIR";
/**
* A variable controlling whether the HIDAPI driver for Nintendo Switch
* controllers should be used.
@@ -3007,11 +3024,13 @@ public const let HINT_EGL_LIBRARY = "SDL_EGL_LIBRARY";
* whether SDL follows this default behaviour or will always load an OpenGL ES
* library.
*
* Circumstances where this is useful include - Testing an app with a
* particular OpenGL ES implementation, e.g ANGLE, or emulator, e.g. those
* from ARM, Imagination or Qualcomm. - Resolving OpenGL ES function addresses
* at link time by linking with the OpenGL ES library instead of querying them
* at run time with SDL_GL_GetProcAddress().
* Circumstances where this is useful include:
*
* - Testing an app with a particular OpenGL ES implementation, e.g ANGLE, or
* emulator, e.g. those from ARM, Imagination or Qualcomm.
* - Resolving OpenGL ES function addresses at link time by linking with the
* OpenGL ES library instead of querying them at run time with
* SDL_GL_GetProcAddress().
*
* Caution: for an application to work with the default behaviour across
* different OpenGL drivers it must query the OpenGL ES function addresses at
@@ -3031,6 +3050,46 @@ public const let HINT_EGL_LIBRARY = "SDL_EGL_LIBRARY";
*/
public const let HINT_OPENGL_ES_DRIVER = "SDL_OPENGL_ES_DRIVER";
/**
* A variable controlling whether to force an sRGB-capable OpenGL context.
*
* At OpenGL context creation time, some platforms can request an sRGB-capable
* context. However, sometimes any form of the request can cause surprising
* results on some drivers, platforms, and hardware. Usually the surprise is
* in the form of rendering that is either a little darker or a little
* brighter than intended.
*
* This hint allows the user to override the app's sRGB requests and either
* force a specific value, or avoid requesting anything at all, depending on
* what makes things work correctly for their system.
*
* This is meant as a fail-safe; apps should probably not explicitly set this,
* and most users should not, either.
*
* Note that some platforms cannot make this request at all, and on all
* platforms this request can be denied by the operating system.
*
* In addition to attempting to obtain the type of sRGB-capable OpenGL context
* requested by this hint, SDL will try to force the state of
* GL_FRAMEBUFFER_SRGB on the new context, if appropriate.
*
* The variable can be set to the following values:
*
* - "0": Force a request for an OpenGL context that is _not_ sRGB-capable.
* - "1": Force a request for an OpenGL context that _is_ sRGB-capable.
* - "skip": Don't make any request for an sRGB-capable context (don't specify
* the attribute at all during context creation time).
* - any other string is undefined behavior.
*
* If unset, or set to an empty string, SDL will make a request using the
* value the app specified with the SDL_GL_FRAMEBUFFER_SRGB_CAPABLE attribute.
*
* This hint should be set before an OpenGL context is created.
*
* \since This hint is available since SDL 3.4.2.
*/
public const let HINT_OPENGL_FORCE_SRGB_FRAMEBUFFER = "SDL_OPENGL_FORCE_SRGB_FRAMEBUFFER";
/**
* Mechanism to specify openvr_api library location
*

View File

@@ -235,6 +235,8 @@ public function void AppQuit_func(void* appstate, AppResult result);
* \returns true on success or false on failure; call SDL_GetError() for more
* information.
*
* \threadsafety This function should only be called on the main thread.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_SetAppMetadata
@@ -255,6 +257,8 @@ public function void AppQuit_func(void* appstate, AppResult result);
* \returns true on success or false on failure; call SDL_GetError() for more
* information.
*
* \threadsafety This function should only be called on the main thread.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_Init
@@ -271,6 +275,8 @@ public function void AppQuit_func(void* appstate, AppResult result);
*
* \param flags any of the flags used by SDL_Init(); see SDL_Init for details.
*
* \threadsafety This function is not thread safe.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_InitSubSystem
@@ -285,6 +291,8 @@ public function void AppQuit_func(void* appstate, AppResult result);
* \returns a mask of all initialized subsystems if `flags` is 0, otherwise it
* returns the initialization status of the specified subsystems.
*
* \threadsafety This function is not thread safe.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_Init
@@ -303,6 +311,8 @@ public function void AppQuit_func(void* appstate, AppResult result);
* application is shutdown, but it is not wise to do this from a library or
* other dynamically loaded code.
*
* \threadsafety This function should only be called on the main thread.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_Init

View File

@@ -56,8 +56,8 @@ extension SDL
* and load appropriate drivers.
*
* If you would like to receive joystick updates while the application is in
* the background, you should set the following hint before calling
* SDL_Init(): SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS
* the background, you should set the
* SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS hint.
*
* SDL can provide virtual joysticks as well: the app defines an imaginary
* controller with SDL_AttachVirtualJoystick(), and then can provide inputs
@@ -1142,7 +1142,7 @@ public const let PROP_JOYSTICK_CAP_TRIGGER_RUMBLE_BOOLEAN = "SDL.joystick.cap
* Update the current state of the open joysticks.
*
* This is called automatically by the event loop if any joystick events are
* enabled.
* enabled and SDL_HINT_AUTO_UPDATE_JOYSTICKS hasn't been set to "0".
*
* \threadsafety It is safe to call this function from any thread.
*

View File

@@ -112,6 +112,8 @@ extension SDL
* allocation that should be freed with SDL_free() when it is no
* longer needed.
*
* \threadsafety This function is not thread safe.
*
* \since This function is available since SDL 3.2.0.
*/
[LinkName("SDL_GetPreferredLocales")] public static extern Locale** GetPreferredLocales(out c_int count);

View File

@@ -493,7 +493,8 @@ public function void LogOutputFunction(void* userdata, c_int category, LogPriori
/**
* Get the default log output function.
*
* \returns the default log output callback.
* \returns the default log output callback. It should be called with NULL for
* the userdata argument.
*
* \threadsafety It is safe to call this function from any thread.
*

View File

@@ -267,7 +267,7 @@ extension SDL
/* usually this is empty */
/* SDL_MAIN_EXPORTED */
/* SDL_WIKI_DOCUMENTATION_SECTION */
@@ -343,6 +343,9 @@ extension SDL
* \returns SDL_APP_FAILURE to terminate with an error, SDL_APP_SUCCESS to
* terminate with success, SDL_APP_CONTINUE to continue.
*
* \threadsafety This function is called once by SDL, at startup, on a single
* thread.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_AppIterate
@@ -547,6 +550,8 @@ public function c_int main_func(c_int argc, c_char**);
* will not be changed it is necessary to define SDL_MAIN_HANDLED before
* including SDL.h.
*
* \threadsafety This function is not thread safe.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_Init
@@ -639,6 +644,8 @@ public function c_int main_func(c_int argc, c_char**);
* \returns true on success or false on failure; call SDL_GetError() for more
* information.
*
* \threadsafety This function is not thread safe.
*
* \since This function is available since SDL 3.2.0.
*/
@@ -656,6 +663,8 @@ public function c_int main_func(c_int argc, c_char**);
* deregistered when the registration counter in SDL_RegisterApp decrements to
* zero through calls to this function.
*
* \threadsafety This function is not thread safe.
*
* \since This function is available since SDL 3.2.0.
*/
@@ -665,10 +674,26 @@ public function c_int main_func(c_int argc, c_char**);
/**
* Callback from the application to let the suspend continue.
*
* This should be called from an event watch in response to an
* `SDL_EVENT_DID_ENTER_BACKGROUND` event.
*
* When using SDL_Render, your event watch should be added _after_ creating
* the `SDL_Renderer`; this allows the timing of the D3D12 command queue
* suspension to execute in the correct order.
*
* When using SDL_GPU, this should be called after calling SDL_GDKSuspendGPU.
*
* If you're writing your own D3D12 renderer, this should be called after
* calling `ID3D12CommandQueue::SuspendX`.
*
* This function is only needed for Xbox GDK support; all other platforms will
* do nothing and set an "unsupported" error message.
*
* \threadsafety This function is not thread safe.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_AddEventWatch
*/
[LinkName("SDL_GDKSuspendComplete")] public static extern void GDKSuspendComplete();
}

View File

@@ -180,6 +180,8 @@ public const let MESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT = 0x00000002u;/**< Marks th
* \returns true on success or false on failure; call SDL_GetError() for more
* information.
*
* \threadsafety This function should only be called on the main thread.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_ShowSimpleMessageBox
@@ -222,6 +224,8 @@ public const let MESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT = 0x00000002u;/**< Marks th
* \returns true on success or false on failure; call SDL_GetError() for more
* information.
*
* \threadsafety This function should only be called on the main thread.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_ShowMessageBox

View File

@@ -75,6 +75,8 @@ public typealias MetalView = void*;
* \param window the window.
* \returns handle NSView or UIView.
*
* \threadsafety This function should only be called on the main thread.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_Metal_DestroyView
@@ -90,6 +92,8 @@ public typealias MetalView = void*;
*
* \param view the SDL_MetalView object.
*
* \threadsafety This function should only be called on the main thread.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_Metal_CreateView
@@ -102,6 +106,8 @@ public typealias MetalView = void*;
* \param view the SDL_MetalView object.
* \returns a pointer.
*
* \threadsafety This function should only be called on the main thread.
*
* \since This function is available since SDL 3.2.0.
*/
[LinkName("SDL_Metal_GetLayer")] public static extern void* Metal_GetLayer(MetalView view);

View File

@@ -75,6 +75,8 @@ extension SDL
* \returns true on success or false on failure; call SDL_GetError() for more
* information.
*
* \threadsafety This function should only be called on the main thread.
*
* \since This function is available since SDL 3.2.0.
*/
[LinkName("SDL_OpenURL")] public static extern bool OpenURL(c_char* url);

View File

@@ -318,6 +318,8 @@ extension SDL
* \returns the initialized and unlocked mutex 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.2.0.
*
* \sa SDL_DestroyMutex
@@ -344,6 +346,8 @@ extension SDL
*
* \param mutex the mutex to lock.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_TryLockMutex
@@ -365,6 +369,8 @@ extension SDL
* \param mutex the mutex to try to lock.
* \returns true on success, false if the mutex would block.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_LockMutex
@@ -384,6 +390,9 @@ extension SDL
*
* \param mutex the mutex to unlock.
*
* \threadsafety This call must be paired with a previous locking call on the
* same thread.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_LockMutex
@@ -402,6 +411,8 @@ extension SDL
*
* \param mutex the mutex to destroy.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_CreateMutex
@@ -467,6 +478,8 @@ extension SDL
* \returns the initialized and unlocked read/write lock 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.2.0.
*
* \sa SDL_DestroyRWLock
@@ -507,6 +520,8 @@ extension SDL
*
* \param rwlock the read/write lock to lock.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_LockRWLockForWriting
@@ -538,6 +553,8 @@ extension SDL
*
* \param rwlock the read/write lock to lock.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_LockRWLockForReading
@@ -563,6 +580,8 @@ extension SDL
* \param rwlock the rwlock to try to lock.
* \returns true on success, false if the lock would block.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_LockRWLockForReading
@@ -593,6 +612,8 @@ extension SDL
* \param rwlock the rwlock to try to lock.
* \returns true on success, false if the lock would block.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_LockRWLockForWriting
@@ -617,6 +638,9 @@ extension SDL
*
* \param rwlock the rwlock to unlock.
*
* \threadsafety This call must be paired with a previous locking call on the
* same thread.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_LockRWLockForReading
@@ -637,6 +661,8 @@ extension SDL
*
* \param rwlock the rwlock to destroy.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_CreateRWLock
@@ -680,6 +706,8 @@ extension SDL
* \returns a new semaphore 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.2.0.
*
* \sa SDL_DestroySemaphore
@@ -699,6 +727,8 @@ extension SDL
*
* \param sem the semaphore to destroy.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_CreateSemaphore
@@ -717,6 +747,8 @@ extension SDL
*
* \param sem the semaphore wait on.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_SignalSemaphore
@@ -736,6 +768,8 @@ extension SDL
* \param sem the semaphore to wait on.
* \returns true if the wait succeeds, false if the wait would block.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_SignalSemaphore
@@ -756,6 +790,8 @@ extension SDL
* indefinitely.
* \returns true if the wait succeeds or false if the wait times out.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_SignalSemaphore
@@ -769,6 +805,8 @@ extension SDL
*
* \param sem the semaphore to increment.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_TryWaitSemaphore
@@ -783,6 +821,8 @@ extension SDL
* \param sem the semaphore to query.
* \returns the current value of the semaphore.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*/
[LinkName("SDL_GetSemaphoreValue")] public static extern Uint32 GetSemaphoreValue(Semaphore* sem);
@@ -816,6 +856,8 @@ extension SDL
* \returns a new condition variable 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.2.0.
*
* \sa SDL_BroadcastCondition
@@ -831,6 +873,8 @@ extension SDL
*
* \param cond the condition variable to destroy.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_CreateCondition

View File

@@ -821,6 +821,7 @@ namespace SDL3;
/* ##SDL_gamecontroller.h */
@@ -922,6 +923,7 @@ namespace SDL3;
/* ##SDL_guid.h */
@@ -966,6 +968,9 @@ namespace SDL3;
/* ##SDL_joystick.h */
@@ -1006,6 +1011,7 @@ namespace SDL3;
/* ##SDL_keyboard.h */
@@ -1190,6 +1196,8 @@ namespace SDL3;
@@ -1304,6 +1312,7 @@ namespace SDL3;
/* ##SDL_timer.h */
@@ -1329,6 +1338,9 @@ namespace SDL3;
/* SDL_ENABLE_OLD_NAMES */

View File

@@ -63,12 +63,12 @@ extension SDL
* doesn't seem to, it might actually be the operating system's fault. For
* example, some platforms can manage multiple devices at the same time, but
* others will make any connected pens look like a single logical device, much
* how all USB mice connected to a computer will move the same system cursor.
* Other platforms might not support pen buttons, or the distance axis, etc.
* Very few platforms can even report _what_ functionality the pen supports in
* the first place, so best practices is to either build UI to let the user
* configure their pens, or be prepared to handle new functionality for a pen
* the first time an event is reported.
* like how all USB mice connected to a computer will move the same system
* cursor. Other platforms might not support pen buttons, or the distance
* axis, etc. Very few platforms can even report _what_ functionality the pen
* supports in the first place, so best practices is to either build UI to let
* the user configure their pens, or be prepared to handle new functionality
* for a pen the first time an event is reported.
*/

View File

@@ -61,6 +61,8 @@ extension SDL
* \returns the name of the platform. If the correct platform name is not
* available, returns a string beginning with the text "Unknown".
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*/
[LinkName("SDL_GetPlatform")] public static extern c_char* GetPlatform();

View File

@@ -103,6 +103,8 @@ extension SDL
* \returns the current battery state or `SDL_POWERSTATE_ERROR` on failure;
* call SDL_GetError() for more information.
*
* \threadsafety This function is not thread safe.
*
* \since This function is available since SDL 3.2.0.
*/
[LinkName("SDL_GetPowerInfo")] public static extern PowerState GetPowerInfo(out c_int seconds, out c_int percent);

View File

@@ -121,6 +121,8 @@ public const let PROP_NAME_STRING = "SDL.name";
* \returns a valid property ID on success or 0 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.2.0.
*/
[LinkName("SDL_GetGlobalProperties")] public static extern PropertiesID GetGlobalProperties();

View File

@@ -247,6 +247,8 @@ extension SDL
* rectangles `A` and `B`.
* \returns true if there is an intersection, false otherwise.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_HasRectIntersection
@@ -263,6 +265,8 @@ extension SDL
* \returns true on success or false 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.2.0.
*/
[LinkName("SDL_GetRectUnion")] public static extern bool GetRectUnion(Rect* A, Rect* B, Rect* result);
@@ -282,6 +286,8 @@ extension SDL
* \returns true if any points were enclosed or false if all the points were
* outside of the clipping rectangle.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*/
[LinkName("SDL_GetRectEnclosingPoints")] public static extern bool GetRectEnclosingPoints(Point* points, c_int count, Rect* clip, Rect* result);
@@ -302,6 +308,8 @@ extension SDL
* \param Y2 a pointer to the ending Y-coordinate of the line.
* \returns true if there is an intersection, false otherwise.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*/
[LinkName("SDL_GetRectAndLineIntersection")] public static extern bool GetRectAndLineIntersection(Rect* rect, c_int* X1, c_int* Y1, c_int* X2, c_int* Y2);
@@ -433,6 +441,8 @@ extension SDL
* \param B an SDL_FRect structure representing the second rectangle.
* \returns true if there is an intersection, false otherwise.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_GetRectIntersectionFloat
@@ -450,6 +460,8 @@ extension SDL
* rectangles `A` and `B`.
* \returns true if there is an intersection, false otherwise.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_HasRectIntersectionFloat
@@ -466,6 +478,8 @@ extension SDL
* \returns true on success or false 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.2.0.
*/
[LinkName("SDL_GetRectUnionFloat")] public static extern bool GetRectUnionFloat(FRect* A, FRect* B, FRect* result);
@@ -486,6 +500,8 @@ extension SDL
* \returns true if any points were enclosed or false if all the points were
* outside of the clipping rectangle.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*/
[LinkName("SDL_GetRectEnclosingPointsFloat")] public static extern bool GetRectEnclosingPointsFloat(FPoint* points, c_int count, FRect* clip, FRect* result);
@@ -507,6 +523,8 @@ extension SDL
* \param Y2 a pointer to the ending Y-coordinate of the line.
* \returns true if there is an intersection, false otherwise.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*/
[LinkName("SDL_GetRectAndLineIntersectionFloat")] public static extern bool GetRectAndLineIntersectionFloat(FRect* rect, float* X1, float* Y1, float* X2, float* Y2);

View File

@@ -764,8 +764,6 @@ public const let PROP_RENDERER_GPU_DEVICE_POINTER = "SDL.
*
* - `SDL_PROP_TEXTURE_CREATE_OPENGLES2_TEXTURE_NUMBER`: the GLuint texture
* associated with the texture, if you want to wrap an existing texture.
* - `SDL_PROP_TEXTURE_CREATE_OPENGLES2_TEXTURE_NUMBER`: the GLuint texture
* associated with the texture, if you want to wrap an existing texture.
* - `SDL_PROP_TEXTURE_CREATE_OPENGLES2_TEXTURE_UV_NUMBER`: the GLuint texture
* associated with the UV plane of an NV12 texture, if you want to wrap an
* existing texture.
@@ -2496,6 +2494,8 @@ public const let PROP_TEXTURE_GPU_TEXTURE_V_POINTER = "SDL.texture.
* \returns true on success or false on failure; call SDL_GetError() for more
* information.
*
* \threadsafety This function should only be called on the main thread.
*
* \since This function is available since SDL 3.4.0.
*
* \sa SDL_RenderGeometry
@@ -2517,6 +2517,8 @@ public const let PROP_TEXTURE_GPU_TEXTURE_V_POINTER = "SDL.texture.
* \returns true on success or false on failure; call SDL_GetError() for more
* information.
*
* \threadsafety This function should only be called on the main thread.
*
* \since This function is available since SDL 3.4.0.
*
* \sa SDL_SetRenderTextureAddressMode
@@ -2952,6 +2954,64 @@ public const let DEBUG_TEXT_FONT_CHARACTER_SIZE = 8;
*/
[LinkName("SDL_CreateGPURenderState")] public static extern GPURenderState* CreateGPURenderState(Renderer* renderer, GPURenderStateCreateInfo* createinfo);
/**
* Set sampler bindings variables in a custom GPU render state.
*
* The data is copied and will be binded using SDL_BindGPUFragmentSamplers()
* during draw call execution.
*
* \param state the state to modify.
* \param num_sampler_bindings The number of additional fragment samplers to
* bind.
* \param sampler_bindings Additional fragment samplers to bind.
* \returns true on success or false on failure; call SDL_GetError() for more
* information.
*
* \threadsafety This function should be called on the thread that created the
* renderer.
*
* \since This function is available since SDL 3.6.0.
*/
[LinkName("SDL_SetGPURenderStateSamplerBindings")] public static extern bool SetGPURenderStateSamplerBindings(GPURenderState* state, c_int num_sampler_bindings, GPUTextureSamplerBinding* sampler_bindings);
/**
* Set storage textures variables in a custom GPU render state.
*
* The data is copied and will be binded using
* SDL_BindGPUFragmentStorageTextures() during draw call execution.
*
* \param state the state to modify.
* \param num_storage_textures The number of storage textures to bind.
* \param storage_textures Storage textures to bind.
* \returns true on success or false on failure; call SDL_GetError() for more
* information.
*
* \threadsafety This function should be called on the thread that created the
* renderer.
*
* \since This function is available since SDL 3.6.0.
*/
[LinkName("SDL_SetGPURenderStateStorageTextures")] public static extern bool SetGPURenderStateStorageTextures(GPURenderState* state, c_int num_storage_textures, GPUTexture** storage_textures);
/**
* Set storage buffers variables in a custom GPU render state.
*
* The data is copied and will be binded using
* SDL_BindGPUFragmentStorageBuffers() during draw call execution.
*
* \param state the state to modify.
* \param num_storage_buffers The number of storage buffers to bind.
* \param storage_buffers Storage buffers to bind.
* \returns true on success or false on failure; call SDL_GetError() for more
* information.
*
* \threadsafety This function should be called on the thread that created the
* renderer.
*
* \since This function is available since SDL 3.6.0.
*/
[LinkName("SDL_SetGPURenderStateStorageBuffers")] public static extern bool SetGPURenderStateStorageBuffers(GPURenderState* state, c_int num_storage_buffers, GPUBuffer** storage_buffers);
/**
* Set fragment shader uniform variables in a custom GPU render state.
*

View File

@@ -135,7 +135,7 @@ extension SDL
Nonushash = 50, /**< ISO USB keyboards actually use this code
* instead of 49 for the same key, but all
* OSes I've seen treat the two codes
* identically. So, as an implementor, unless
* identically. So, as an implementer, unless
* your keyboard generates both of those
* codes and your OS treats them differently,
* you should generate SDL_SCANCODE_BACKSLASH
@@ -432,11 +432,10 @@ extension SDL
Reserved = 400, /**< 400-500 reserved for dynamic keycodes */
Count = 512,
}
/**< not a key, just marks the number of scancodes for array bounds */
Count = 512, /**< not a key, just marks the number of scancodes for array bounds */
}
/* SDL_scancode_h_ */
}

View File

@@ -264,12 +264,6 @@ extension SDL
/**
* Macro useful for building other macros with strings in them.
*
* For example:
*
* ```c
* #define LOG_ERROR(X) OutputDebugString(SDL_STRINGIFY_ARG(__FUNCTION__) ": " X "\n")`
* ```
*
* \param arg the text to turn into a string literal.
*
* \since This macro is available since SDL 3.2.0.
@@ -1803,6 +1797,8 @@ public function void free_func(void* mem);
/**
* Get the value of a variable in the environment.
*
* The name of the variable is case sensitive on all platforms.
*
* This function uses SDL's cached copy of the environment and is thread-safe.
*
* \param name the name of the variable to get.
@@ -1821,6 +1817,11 @@ public function void free_func(void* mem);
* This function bypasses SDL's cached copy of the environment and is not
* thread-safe.
*
* On some platforms, this may make case-insensitive matches, while other
* platforms are case-sensitive. It is best to be precise with strings used
* for queries through this interface. SDL_getenv is always case-sensitive,
* however.
*
* \param name the name of the variable to get.
* \returns a pointer to the value of the variable or NULL if it can't be
* found.
@@ -4360,7 +4361,7 @@ public const let INVALID_UNICODE_CODEPOINT = 0xFFFD;
/**
* Generate 32 pseudo-random bits.
*
* You likely want to use SDL_rand() to get a psuedo-random number instead.
* You likely want to use SDL_rand() to get a pseudo-random number instead.
*
* There are no guarantees as to the quality of the random sequence produced,
* and this should not be used for security (cryptography, passwords) or where
@@ -4445,7 +4446,7 @@ public const let INVALID_UNICODE_CODEPOINT = 0xFFFD;
/**
* Generate 32 pseudo-random bits.
*
* You likely want to use SDL_rand_r() to get a psuedo-random number instead.
* You likely want to use SDL_rand_r() to get a pseudo-random number instead.
*
* There are no guarantees as to the quality of the random sequence produced,
* and this should not be used for security (cryptography, passwords) or where
@@ -4684,7 +4685,7 @@ public const let PI_F = 3.141592653589793238462643383279502884F;/**< pi (float
*
* Domain: `-INF <= x <= INF`, `-INF <= y <= INF`
*
* Range: `-Pi <= y <= Pi`
* Range: `-Pi <= z <= Pi`
*
* This function operates on double-precision floating point values, use
* SDL_atan2f for single-precision floats.
@@ -4698,8 +4699,8 @@ public const let PI_F = 3.141592653589793238462643383279502884F;/**< pi (float
*
* \param y floating point value of the numerator (y coordinate).
* \param x floating point value of the denominator (x coordinate).
* \returns arc tangent of of `y / x` in radians, or, if `x = 0`, either
* `-Pi/2`, `0`, or `Pi/2`, depending on the value of `y`.
* \returns arc tangent of `y / x` in radians, or, if `x = 0`, either `-Pi/2`,
* `0`, or `Pi/2`, depending on the value of `y`.
*
* \threadsafety It is safe to call this function from any thread.
*
@@ -5822,6 +5823,8 @@ public const let PI_F = 3.141592653589793238462643383279502884F;/**< pi (float
* \returns a handle that must be freed with SDL_iconv_close, or
* SDL_ICONV_ERROR on failure.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_iconv
@@ -5836,6 +5839,8 @@ public const let PI_F = 3.141592653589793238462643383279502884F;/**< pi (float
* \param cd The character set conversion handle.
* \returns 0 on success, or -1 on failure.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_iconv
@@ -5874,6 +5879,8 @@ public const let PI_F = 3.141592653589793238462643383279502884F;/**< pi (float
* \param outbytesleft The number of bytes in the output buffer.
* \returns the number of conversions on success, or a negative error code.
*
* \threadsafety Do not use the same SDL_iconv_t from two threads at once.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_iconv_open
@@ -5907,6 +5914,8 @@ public const let ICONV_EINVAL = (c_size)-4;/**< Incomplete input sequence was
* \param inbytesleft the size of the input string _in bytes_.
* \returns a new string, converted to the new encoding, or NULL on error.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_iconv_open
@@ -5927,6 +5936,8 @@ public const let ICONV_EINVAL = (c_size)-4;/**< Incomplete input sequence was
* \param S the string to convert.
* \returns a new string, converted to the new encoding, or NULL on error.
*
* \threadsafety It is safe to call this macro from any thread.
*
* \since This macro is available since SDL 3.2.0.
*/
@@ -5941,6 +5952,8 @@ public const let ICONV_EINVAL = (c_size)-4;/**< Incomplete input sequence was
* \param S the string to convert.
* \returns a new string, converted to the new encoding, or NULL on error.
*
* \threadsafety It is safe to call this macro from any thread.
*
* \since This macro is available since SDL 3.2.0.
*/
@@ -5955,6 +5968,8 @@ public const let ICONV_EINVAL = (c_size)-4;/**< Incomplete input sequence was
* \param S the string to convert.
* \returns a new string, converted to the new encoding, or NULL on error.
*
* \threadsafety It is safe to call this macro from any thread.
*
* \since This macro is available since SDL 3.2.0.
*/
@@ -5969,6 +5984,8 @@ public const let ICONV_EINVAL = (c_size)-4;/**< Incomplete input sequence was
* \param S the string to convert.
* \returns a new string, converted to the new encoding, or NULL on error.
*
* \threadsafety It is safe to call this macro from any thread.
*
* \since This macro is available since SDL 3.2.0.
*/

View File

@@ -96,6 +96,8 @@ extension SDL
* \param callback the SDL_WindowsMessageHook function to call.
* \param userdata a pointer to pass to every iteration of `callback`.
*
* \threadsafety This function should only be called on the main thread.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_WindowsMessageHook
@@ -179,6 +181,8 @@ public function bool X11EventHook(void* userdata, XEvent* xevent);
* \param callback the SDL_X11EventHook function to call.
* \param userdata a pointer to pass to every iteration of `callback`.
*
* \threadsafety This function should only be called on the main thread.
*
* \since This function is available since SDL 3.2.0.
*/
[LinkName("SDL_SetX11EventHook")] public static extern void SetX11EventHook(X11EventHook callback, void* userdata);
@@ -196,6 +200,8 @@ public function bool X11EventHook(void* userdata, XEvent* xevent);
* \returns true on success or false 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.2.0.
*/
@@ -212,6 +218,8 @@ public function bool X11EventHook(void* userdata, XEvent* xevent);
* \returns true on success or false 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.2.0.
*/
@@ -274,6 +282,8 @@ public function bool X11EventHook(void* userdata, XEvent* xevent);
* \returns true on success or false on failure; call SDL_GetError() for more
* information.
*
* \threadsafety This function should only be called on the main thread.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_SetiOSEventPump
@@ -287,6 +297,8 @@ public function bool X11EventHook(void* userdata, XEvent* xevent);
*
* \param enabled true to enable the event pump, false to disable it.
*
* \threadsafety This function should only be called on the main thread.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_SetiOSAnimationCallback
@@ -380,6 +392,8 @@ public function bool X11EventHook(void* userdata, XEvent* xevent);
*
* \returns the Android API level.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*/
@@ -389,6 +403,8 @@ public function bool X11EventHook(void* userdata, XEvent* xevent);
*
* \returns true if this is a Chromebook, false otherwise.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*/
@@ -398,6 +414,8 @@ public function bool X11EventHook(void* userdata, XEvent* xevent);
*
* \returns true if this is a DeX docking station, false otherwise.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*/
@@ -540,10 +558,10 @@ public function bool X11EventHook(void* userdata, XEvent* xevent);
* specific entitlement, the callback will still fire, probably on the current
* thread and before this function returns.
*
* If the request submission fails, this function returns -1 and the callback
* will NOT be called, but this should only happen in catastrophic conditions,
* like memory running out. Normally there will be a yes or no to the request
* through the callback.
* If the request submission fails, this function returns false and the
* callback will NOT be called, but this should only happen in catastrophic
* conditions, like memory running out. Normally there will be a yes or no to
* the request through the callback.
*
* For the `permission` parameter, choose a value from here:
*
@@ -615,6 +633,8 @@ public function bool X11EventHook(void* userdata, XEvent* xevent);
*
* \returns true if the device is a tablet, false otherwise.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*/
[LinkName("SDL_IsTablet")] public static extern bool IsTablet();
@@ -626,6 +646,8 @@ public function bool X11EventHook(void* userdata, XEvent* xevent);
*
* \returns true if the device is a TV, false otherwise.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*/
[LinkName("SDL_IsTV")] public static extern bool IsTV();

View File

@@ -218,6 +218,8 @@ public function c_int ThreadFunction(void* data);
* new thread could not be created; 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.2.0.
*
* \sa SDL_CreateThreadWithProperties
@@ -284,6 +286,8 @@ public function c_int ThreadFunction(void* data);
* new thread could not be created; 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.2.0.
*
* \sa SDL_CreateThread
@@ -339,6 +343,8 @@ public const let EndThreadFunction = null;
* new thread could not be created; 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.2.0.
*/
[LinkName("SDL_CreateThreadRuntime")] public static extern Thread* CreateThreadRuntime(ThreadFunction fn, c_char* name, void* data, FunctionPointer pfnBeginThread, FunctionPointer pfnEndThread);
@@ -353,6 +359,8 @@ public const let EndThreadFunction = null;
* new thread could not be created; 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.2.0.
*/
[LinkName("SDL_CreateThreadWithPropertiesRuntime")] public static extern Thread* CreateThreadWithPropertiesRuntime(PropertiesID props, FunctionPointer pfnBeginThread, FunctionPointer pfnEndThread);
@@ -373,6 +381,8 @@ public const let PROP_THREAD_CREATE_STACKSIZE_NUMBER = "S
* \returns a pointer to a UTF-8 string that names the specified thread, or
* NULL if it doesn't have a name.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*/
[LinkName("SDL_GetThreadName")] public static extern c_char* GetThreadName(Thread* thread);
@@ -389,6 +399,8 @@ public const let PROP_THREAD_CREATE_STACKSIZE_NUMBER = "S
*
* \returns the ID of the current thread.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_GetThreadID
@@ -406,6 +418,8 @@ public const let PROP_THREAD_CREATE_STACKSIZE_NUMBER = "S
* \returns the ID of the specified thread, or the ID of the current thread if
* `thread` is NULL.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_GetCurrentThreadID
@@ -423,6 +437,8 @@ public const let PROP_THREAD_CREATE_STACKSIZE_NUMBER = "S
* \returns true on success or false 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.2.0.
*/
[LinkName("SDL_SetCurrentThreadPriority")] public static extern bool SetCurrentThreadPriority(ThreadPriority priority);
@@ -455,6 +471,9 @@ public const let PROP_THREAD_CREATE_STACKSIZE_NUMBER = "S
* function by its 'return', or -1 if the thread has been
* detached or isn't valid, may be NULL.
*
* \threadsafety It is safe to call this function from any thread, but only a
* single thread can wait any specific thread to finish.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_CreateThread
@@ -469,6 +488,8 @@ public const let PROP_THREAD_CREATE_STACKSIZE_NUMBER = "S
* \returns the current state of a thread, or SDL_THREAD_UNKNOWN if the thread
* isn't valid.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_ThreadState
@@ -504,6 +525,8 @@ public const let PROP_THREAD_CREATE_STACKSIZE_NUMBER = "S
* \param thread the SDL_Thread pointer that was returned from the
* SDL_CreateThread() call that started this thread.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_CreateThread

View File

@@ -116,6 +116,8 @@ freely, subject to the following restrictions:
* \returns true on success or false on failure; call SDL_GetError() for more
* information.
*
* \threadsafety This function is not thread safe.
*
* \since This function is available since SDL 3.2.0.
*/
[LinkName("SDL_GetDateTimeLocalePreferences")] public static extern bool GetDateTimeLocalePreferences(DateFormat* dateFormat, TimeFormat* timeFormat);
@@ -128,6 +130,8 @@ freely, subject to the following restrictions:
* \returns true on success or false 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.2.0.
*/
[LinkName("SDL_GetCurrentTime")] public static extern bool GetCurrentTime(Time* ticks);
@@ -144,6 +148,8 @@ freely, subject to the following restrictions:
* \returns true on success or false 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.2.0.
*/
[LinkName("SDL_TimeToDateTime")] public static extern bool TimeToDateTime(Time ticks, DateTime* dt, bool localTime);
@@ -159,6 +165,8 @@ freely, subject to the following restrictions:
* \returns true on success or false 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.2.0.
*/
[LinkName("SDL_DateTimeToTime")] public static extern bool DateTimeToTime(DateTime* dt, Time* ticks);
@@ -175,6 +183,8 @@ freely, subject to the following restrictions:
* \param dwHighDateTime a pointer filled in with the high portion of the
* Windows FILETIME value.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*/
[LinkName("SDL_TimeToWindows")] public static extern void TimeToWindows(Time ticks, out Uint32 dwLowDateTime, out Uint32 dwHighDateTime);
@@ -190,6 +200,8 @@ freely, subject to the following restrictions:
* \param dwHighDateTime the high portion of the Windows FILETIME value.
* \returns the converted SDL time.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*/
[LinkName("SDL_TimeFromWindows")] public static extern Time TimeFromWindows(Uint32 dwLowDateTime, Uint32 dwHighDateTime);
@@ -202,6 +214,8 @@ freely, subject to the following restrictions:
* \returns the number of days in the requested month or -1 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.2.0.
*/
[LinkName("SDL_GetDaysInMonth")] public static extern c_int GetDaysInMonth(c_int year, c_int month);
@@ -215,6 +229,8 @@ freely, subject to the following restrictions:
* \returns the day of year [0-365] if the date is valid or -1 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.2.0.
*/
[LinkName("SDL_GetDayOfYear")] public static extern c_int GetDayOfYear(c_int year, c_int month, c_int day);
@@ -228,6 +244,8 @@ freely, subject to the following restrictions:
* \returns a value between 0 and 6 (0 being Sunday) if the date is valid or
* -1 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.2.0.
*/
[LinkName("SDL_GetDayOfWeek")] public static extern c_int GetDayOfWeek(c_int year, c_int month, c_int day);

View File

@@ -48,6 +48,7 @@ extension SDL
/* Set up for C function definitions, even when using C++ */
@@ -107,6 +108,22 @@ public enum TrayEntryFlags : Uint32
*/
public function void TrayCallback(void* userdata, TrayEntry* entry);
/**
* A callback that is invoked when the tray icon is clicked.
*
* \param userdata an optional pointer to pass extra data to the callback when
* it will be invoked. May be NULL.
* \param tray the tray that was clicked.
* \returns true to show the tray menu after the callback returns, false to
* skip showing the menu. This return value is only used for left and
* right click callbacks; other mouse events ignore the return value.
*
* \since This datatype is available since SDL 3.6.0.
*
* \sa SDL_CreateTrayWithProperties
*/
public function bool TrayClickCallback(void* userdata, Tray* tray);
/**
* Create an icon to be placed in the operating system's tray, or equivalent.
*
@@ -125,12 +142,64 @@ public function void TrayCallback(void* userdata, TrayEntry* entry);
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_CreateTrayWithProperties
* \sa SDL_CreateTrayMenu
* \sa SDL_GetTrayMenu
* \sa SDL_DestroyTray
*/
[LinkName("SDL_CreateTray")] public static extern Tray* CreateTray(Surface* icon, c_char* tooltip);
/**
* Create an icon to be placed in the operating system's tray, or equivalent.
*
* Many platforms advise not using a system tray unless persistence is a
* necessary feature. Avoid needlessly creating a tray icon, as the user may
* feel like it clutters their interface.
*
* Using tray icons require the video subsystem.
*
* These are the supported properties:
*
* - `SDL_PROP_TRAY_CREATE_ICON_POINTER`: an SDL_Surface to be used as the
* tray icon. May be NULL.
* - `SDL_PROP_TRAY_CREATE_TOOLTIP_STRING`: a tooltip to be displayed when the
* mouse hovers the icon in UTF-8 encoding. Not supported on all platforms.
* May be NULL.
* - `SDL_PROP_TRAY_CREATE_USERDATA_POINTER`: an optional pointer to associate
* with the tray, which will be passed to click callbacks. May be NULL.
* - `SDL_PROP_TRAY_CREATE_LEFTCLICK_CALLBACK_POINTER`: an
* SDL_TrayClickCallback to be invoked when the tray icon is left-clicked.
* Not supported on all platforms. The callback should return true to show
* the default menu, or false to skip showing it. May be NULL.
* - `SDL_PROP_TRAY_CREATE_RIGHTCLICK_CALLBACK_POINTER`: an
* SDL_TrayClickCallback to be invoked when the tray icon is right-clicked.
* Not supported on all platforms. The callback should return true to show
* the default menu, or false to skip showing it. May be NULL.
* - `SDL_PROP_TRAY_CREATE_MIDDLECLICK_CALLBACK_POINTER`: an
* SDL_TrayClickCallback to be invoked when the tray icon is middle-clicked.
* Not supported on all platforms. May be NULL.
*
* \param props the properties to use.
* \returns The newly created system tray icon.
*
* \threadsafety This function should only be called on the main thread.
*
* \since This function is available since SDL 3.6.0.
*
* \sa SDL_CreateTray
* \sa SDL_CreateTrayMenu
* \sa SDL_GetTrayMenu
* \sa SDL_DestroyTray
*/
[LinkName("SDL_CreateTrayWithProperties")] public static extern Tray* CreateTrayWithProperties(PropertiesID props);
public const let PROP_TRAY_CREATE_ICON_POINTER = "SDL.tray.create.icon";
public const let PROP_TRAY_CREATE_TOOLTIP_STRING = "SDL.tray.create.tooltip";
public const let PROP_TRAY_CREATE_USERDATA_POINTER = "SDL.tray.create.userdata";
public const let PROP_TRAY_CREATE_LEFTCLICK_CALLBACK_POINTER = "SDL.tray.create.leftclick_callback";
public const let PROP_TRAY_CREATE_RIGHTCLICK_CALLBACK_POINTER = "SDL.tray.create.rightclick_callback";
public const let PROP_TRAY_CREATE_MIDDLECLICK_CALLBACK_POINTER = "SDL.tray.create.middleclick_callback";
/**
* Updates the system tray icon's icon.
*

View File

@@ -95,6 +95,8 @@ public static c_int VERSIONNUM(c_int major, c_int minor, c_int patch) => ((major
*
* \param version the version number.
*
* \threadsafety It is safe to call this macro from any thread.
*
* \since This macro is available since SDL 3.2.0.
*/
public static c_int VERSIONNUM_MAJOR(c_int version) => ((version)/1000000);
@@ -106,6 +108,8 @@ public static c_int VERSIONNUM_MAJOR(c_int version) => ((version)/1000000);
*
* \param version the version number.
*
* \threadsafety It is safe to call this macro from any thread.
*
* \since This macro is available since SDL 3.2.0.
*/
public static c_int VERSIONNUM_MINOR(c_int version) => (((version)/1000)%1000);
@@ -117,6 +121,8 @@ public static c_int VERSIONNUM_MINOR(c_int version) => (((version)/1000)%1000);
*
* \param version the version number.
*
* \threadsafety It is safe to call this macro from any thread.
*
* \since This macro is available since SDL 3.2.0.
*/
public static c_int VERSIONNUM_MICRO(c_int version) => ((version)%1000);
@@ -124,6 +130,8 @@ public static c_int VERSIONNUM_MICRO(c_int version) => ((version)%1000);
/**
* This is the version number macro for the current SDL version.
*
* \threadsafety It is safe to call this macro from any thread.
*
* \since This macro is available since SDL 3.2.0.
*
* \sa SDL_GetVersion
@@ -135,6 +143,8 @@ public const let VERSION
/**
* This macro will evaluate to true if compiled with SDL at least X.Y.Z.
*
* \threadsafety It is safe to call this macro from any thread.
*
* \since This macro is available since SDL 3.2.0.
*/
public static bool VERSION_ATLEAST(c_int X, c_int Y, c_int Z) => (VERSION>=VERSIONNUM(X,Y,Z));
@@ -152,6 +162,8 @@ public static bool VERSION_ATLEAST(c_int X, c_int Y, c_int Z) => (VERSION>=VERSI
*
* \returns the version of the linked library.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_GetRevision
@@ -179,6 +191,8 @@ public static bool VERSION_ATLEAST(c_int X, c_int Y, c_int Z) => (VERSION>=VERSI
* \returns an arbitrary string, uniquely identifying the exact revision of
* the SDL library in use.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_GetVersion

View File

@@ -414,7 +414,7 @@ public function EGLint* EGLIntArrayCallback(void* userdata, EGLDisplay display,
ContextFlags, /**< some combination of 0 or more of elements of the SDL_GLContextFlag enumeration; defaults to 0. */
ContextProfileMask, /**< type of GL context (Core, Compatibility, ES). See SDL_GLProfile; default value depends on platform. */
ShareWithCurrentContext, /**< OpenGL context sharing; defaults to 0. */
FramebufferSrgbCapable, /**< requests sRGB-capable visual if 1. Defaults to -1 ("don't care"). This is a request; GL drivers might not comply! */
FramebufferSrgbCapable, /**< requests sRGB capable visual; defaults to 0. */
ContextReleaseBehavior, /**< sets context the release behavior. See SDL_GLContextReleaseFlag; defaults to FLUSH. */
ContextResetNotification, /**< set context reset notification. See SDL_GLContextResetNotification; defaults to NO_NOTIFICATION. */
ContextNoError,