sdlGetPixelFormatDetails function

Pointer<SdlPixelFormatDetails> sdlGetPixelFormatDetails(
  1. int format
)

Create an SDL_PixelFormatDetails structure corresponding to a pixel format.

Returned structure may come from a shared global cache (i.e. not newly allocated), and hence should not be modified, especially the palette. Weird errors such as Blit combination not supported may occur.

\param format one of the SDL_PixelFormat values. \returns a pointer to a SDL_PixelFormatDetails structure 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.1.3.

extern SDL_DECLSPEC const SDL_PixelFormatDetails * SDLCALL SDL_GetPixelFormatDetails(SDL_PixelFormat format)

Implementation

Pointer<SdlPixelFormatDetails> sdlGetPixelFormatDetails(int format) {
  final sdlGetPixelFormatDetailsLookupFunction = libSdl3.lookupFunction<
      Pointer<SdlPixelFormatDetails> Function(Int32 format),
      Pointer<SdlPixelFormatDetails> Function(
          int format)>('SDL_GetPixelFormatDetails');
  return sdlGetPixelFormatDetailsLookupFunction(format);
}