sdlSetCurrentThreadPriority function

bool sdlSetCurrentThreadPriority(
  1. int priority
)

Set the priority for the current thread.

Note that some platforms will not let you alter the priority (or at least, promote the thread to a higher priority) at all, and some require you to be an administrator account. Be prepared for this to fail.

\param priority the SDL_ThreadPriority to set. \returns true on success or false on failure; call SDL_GetError() for more information.

\since This function is available since SDL 3.1.3.

extern SDL_DECLSPEC bool SDLCALL SDL_SetCurrentThreadPriority(SDL_ThreadPriority priority)

Implementation

bool sdlSetCurrentThreadPriority(int priority) {
  final sdlSetCurrentThreadPriorityLookupFunction = libSdl3.lookupFunction<
      Uint8 Function(Int32 priority),
      int Function(int priority)>('SDL_SetCurrentThreadPriority');
  return sdlSetCurrentThreadPriorityLookupFunction(priority) == 1;
}