sdlGpuTextureSupportsFormat function gpu

bool sdlGpuTextureSupportsFormat(
  1. Pointer<SdlGpuDevice> device,
  2. int format,
  3. int type,
  4. int usage,
)

Determines whether a texture format is supported for a given type and usage.

\param device a GPU context. \param format the texture format to check. \param type the type of texture (2D, 3D, Cube). \param usage a bitmask of all usage scenarios to check. \returns whether the texture format is supported for this type and usage.

\since This function is available since SDL 3.2.0.

extern SDL_DECLSPEC bool SDLCALL SDL_GPUTextureSupportsFormat( SDL_GPUDevice *device, SDL_GPUTextureFormat format, SDL_GPUTextureType type, SDL_GPUTextureUsageFlags usage)

Implementation

bool sdlGpuTextureSupportsFormat(
  Pointer<SdlGpuDevice> device,
  int format,
  int type,
  int usage,
) {
  final sdlGpuTextureSupportsFormatLookupFunction = _libSdl
      .lookupFunction<
        Uint8 Function(
          Pointer<SdlGpuDevice> device,
          Int32 format,
          Int32 type,
          Uint32 usage,
        ),
        int Function(
          Pointer<SdlGpuDevice> device,
          int format,
          int type,
          int usage,
        )
      >('SDL_GPUTextureSupportsFormat');
  return sdlGpuTextureSupportsFormatLookupFunction(
        device,
        format,
        type,
        usage,
      ) ==
      1;
}