5#include <SDL3/SDL_gpu.h>
20 explicit Device(SDL_GPUShaderFormat format_flags,
bool debug_mode =
false);
23 _device = other._device;
24 other._device =
nullptr;
31 _device = other._device;
32 other._device =
nullptr;
37 void create(SDL_GPUShaderFormat format_flags,
bool debug_mode =
false);
39 operator SDL_GPUDevice *()
const {
return _device; }
40 operator bool()
const {
return _device; }
45 return SDL_GetGPUShaderFormats(_device);
56 bool operator==(const
Device &other)
const {
57 return _device && (_device == other._device);
61 SDL_GPUDevice *_device;
SDL_GPUShaderFormat auto_detect_shader_format_subset(const char *name=nullptr)
Automatically detect which subset of shader formats (MSL, SPIR-V) are compatible with the device.
Device & operator=(const Device &)=delete
const char * driverName() const noexcept
SDL_GPUShaderFormat shaderFormats() const
Definition Device.h:44
Device(Device &&other) noexcept
Definition Device.h:22
Device(const Device &)=delete
Device(NoInitT) noexcept
Definition Device.h:64
SDL_GPUDevice * release() noexcept
Release ownership of and return the SDL_GPUDevice handle.
Definition Device.h:49
Device & operator=(Device &&other) noexcept
Definition Device.h:28
void create(SDL_GPUShaderFormat format_flags, bool debug_mode=false)
Device(SDL_GPUShaderFormat format_flags, bool debug_mode=false)
Tag type for non-initializing constructors (for e.g. RAII classes)
Definition Tags.h:6