sdlSetBooleanProperty function
Set a boolean property in a group of properties.
\param props the properties to modify. \param name the name of the property to modify. \param value the new value of the property. \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.1.3.
\sa SDL_GetBooleanProperty
extern SDL_DECLSPEC bool SDLCALL SDL_SetBooleanProperty(SDL_PropertiesID props, const char *name, bool value)
Implementation
bool sdlSetBooleanProperty(int props, String? name, bool value) {
final sdlSetBooleanPropertyLookupFunction = libSdl3.lookupFunction<
Uint8 Function(Uint32 props, Pointer<Utf8> name, Uint8 value),
int Function(
int props, Pointer<Utf8> name, int value)>('SDL_SetBooleanProperty');
final namePointer = name != null ? name.toNativeUtf8() : nullptr;
final result =
sdlSetBooleanPropertyLookupFunction(props, namePointer, value ? 1 : 0) ==
1;
calloc.free(namePointer);
return result;
}