sdlSetNumberProperty function

bool sdlSetNumberProperty(
  1. int props,
  2. String? name,
  3. int value
)

Set an integer 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_GetNumberProperty

extern SDL_DECLSPEC bool SDLCALL SDL_SetNumberProperty(SDL_PropertiesID props, const char *name, Sint64 value)

Implementation

bool sdlSetNumberProperty(int props, String? name, int value) {
  final sdlSetNumberPropertyLookupFunction = libSdl3.lookupFunction<
      Uint8 Function(Uint32 props, Pointer<Utf8> name, Int64 value),
      int Function(
          int props, Pointer<Utf8> name, int value)>('SDL_SetNumberProperty');
  final namePointer = name != null ? name.toNativeUtf8() : nullptr;
  final result =
      sdlSetNumberPropertyLookupFunction(props, namePointer, value) == 1;
  calloc.free(namePointer);
  return result;
}