sdlGetGpuTextureFormatFromPixelFormat function gpu

int sdlGetGpuTextureFormatFromPixelFormat(
  1. int format
)

Get the GPU texture format corresponding to an SDL pixel format.

\param format a pixel format. \returns the corresponding GPU texture format, or SDL_GPU_TEXTUREFORMAT_INVALID if there is no corresponding GPU texture format.

\since This function is available since SDL 3.4.0.

extern SDL_DECLSPEC SDL_GPUTextureFormat SDLCALL SDL_GetGPUTextureFormatFromPixelFormat(SDL_PixelFormat format)

Implementation

int sdlGetGpuTextureFormatFromPixelFormat(int format) {
  final sdlGetGpuTextureFormatFromPixelFormatLookupFunction = _libSdl
      .lookupFunction<Int32 Function(Int32 format), int Function(int format)>(
        'SDL_GetGPUTextureFormatFromPixelFormat',
      );
  return sdlGetGpuTextureFormatFromPixelFormatLookupFunction(format);
}