Module properties

Available on crate feature dep_sdl3 only.
Expand description

A property is a variable that can be created and retrieved by name at runtime.

All properties are part of a property group (SDL_PropertiesID). A property group can be created with the SDL_CreateProperties function and destroyed with the SDL_DestroyProperties function.

Properties can be added to and retrieved from a property group through the following functions:

Properties can be removed from a group by using SDL_ClearProperty.

Structs§

SDL_PropertyType
SDL property type

Constants§

SDL_PROPERTY_TYPE_BOOLEAN
SDL_PROPERTY_TYPE_FLOAT
SDL_PROPERTY_TYPE_INVALID
SDL_PROPERTY_TYPE_NUMBER
SDL_PROPERTY_TYPE_POINTER
SDL_PROPERTY_TYPE_STRING

Functions§

SDL_ClearProperty
Clear a property from a group of properties.
SDL_CopyProperties
Copy a group of properties.
SDL_CreateProperties
Create a group of properties.
SDL_DestroyProperties
Destroy a group of properties.
SDL_EnumerateProperties
Enumerate the properties contained in a group of properties.
SDL_GetBooleanProperty
Get a boolean property from a group of properties.
SDL_GetFloatProperty
Get a floating point property from a group of properties.
SDL_GetGlobalProperties
Get the global SDL properties.
SDL_GetNumberProperty
Get a number property from a group of properties.
SDL_GetPointerProperty
Get a pointer property from a group of properties.
SDL_GetPropertyType
Get the type of a property in a group of properties.
SDL_GetStringProperty
Get a string property from a group of properties.
SDL_HasProperty
Return whether a property exists in a group of properties.
SDL_LockProperties
Lock a group of properties.
SDL_SetBooleanProperty
Set a boolean property in a group of properties.
SDL_SetFloatProperty
Set a floating point property in a group of properties.
SDL_SetNumberProperty
Set an integer property in a group of properties.
SDL_SetPointerProperty
Set a pointer property in a group of properties.
SDL_SetPointerPropertyWithCleanup
Set a pointer property in a group of properties with a cleanup function that is called when the property is deleted.
SDL_SetStringProperty
Set a string property in a group of properties.
SDL_UnlockProperties
Unlock a group of properties.

Type Aliases§

SDL_CleanupPropertyCallback
A callback used to free resources when a property is deleted.
SDL_EnumeratePropertiesCallback
A callback used to enumerate all the properties in a group of properties.
SDL_PropertiesID
SDL properties ID