4#include <SDL3/SDL_gpu.h>
6#include <backends/imgui_impl_sdlgpu3.h>
14 const char*
path =
nullptr;
15 SDL_GPUShaderStage
stage = SDL_GPU_SHADERSTAGE_VERTEX;
31 const void*
data =
nullptr;
35ImGui_ImplSDLGPU3_InitInfo
createImGuiInfo(SDL_GPUDevice* device, SDL_Window* window);
38makeAttribute(Uint32 location, SDL_GPUVertexElementFormat format, Uint32 offset, Uint32 bufferSlot = 0);
40SDL_GPUColorTargetInfo
makeColorTarget(SDL_GPUTexture* texture, SDL_FColor clearColor);
48SDL_GPUShader*
loadShader(SDL_GPUDevice* device,
50 SDL_GPUShaderFormat format,
51 SDL_GPUShaderStage stage,
53 Uint32 uniformBufferCount,
54 Uint32 storageBufferCount,
55 Uint32 storageTextureCount);
57SDL_GPUShader*
loadShader(SDL_GPUDevice* device,
const ShaderInfo& shaderInfo, SDL_GPUShaderFormat format);
61 SDL_GPUShaderFormat shaderFormat,
65 bool enableDepth =
true);
67SDL_GPUBuffer*
createBuffer(SDL_GPUDevice* device,
size_t bufferSize, SDL_GPUBufferUsageFlags usage);
69SDL_GPUTransferBuffer*
createTransferBuffer(SDL_GPUDevice* device,
size_t transferBufferSize,
bool upload);
71SDL_GPUTransferBuffer*
createUploadBuffer(SDL_GPUDevice* device,
size_t transferBufferSize);
73void uploadBuffers(SDL_GPUDevice* device, SDL_GPUCommandBuffer* cmd,
const std::vector<BufferUpload>& uploads);
75SDL_GPUTexture*
createTextureRGBA8(SDL_GPUDevice* device, Uint32 width, Uint32 height,
const void* data);
77SDL_GPUTexture*
loadTexture(SDL_GPUDevice* device,
const char* path);
Definition Boilerplate.cpp:7
SDL_GPUColorTargetInfo makeColorTarget(SDL_GPUTexture *texture, SDL_FColor clearColor)
Definition Boilerplate.cpp:28
SDL_GPUTexture * createTextureRGBA8(SDL_GPUDevice *device, Uint32 width, Uint32 height, const void *data)
Definition Boilerplate.cpp:263
SDL_GPUShader * loadShader(SDL_GPUDevice *device, const char *path, SDL_GPUShaderFormat format, SDL_GPUShaderStage stage, Uint32 samplerCount, Uint32 uniformBufferCount, Uint32 storageBufferCount, Uint32 storageTextureCount)
Definition Boilerplate.cpp:75
void uploadBuffers(SDL_GPUDevice *device, SDL_GPUCommandBuffer *cmd, const std::vector< BufferUpload > &uploads)
Definition Boilerplate.cpp:212
SDL_GPUTransferBuffer * createUploadBuffer(SDL_GPUDevice *device, size_t transferBufferSize)
Definition Boilerplate.cpp:207
SDL_GPUSampler * createLinearRepeatSampler(SDL_GPUDevice *device)
Definition Boilerplate.cpp:364
SDL_GPUGraphicsPipeline * createGraphicsPipeline(SDL_GPUDevice *device, SDL_Window *window, SDL_GPUShaderFormat shaderFormat, const ShaderInfo &vertexShaderInfo, const ShaderInfo &fragmentShaderInfo, const VertexInputLayout &vertexInputLayout, bool enableDepth)
Definition Boilerplate.cpp:132
SDL_GPUVertexAttribute makeAttribute(Uint32 location, SDL_GPUVertexElementFormat format, Uint32 offset, Uint32 bufferSlot)
Definition Boilerplate.cpp:18
SDL_GPUBuffer * createBuffer(SDL_GPUDevice *device, size_t bufferSize, SDL_GPUBufferUsageFlags usage)
Definition Boilerplate.cpp:189
SDL_GPUTexture * loadTexture(SDL_GPUDevice *device, const char *path)
Definition Boilerplate.cpp:323
SDL_GPUTransferBuffer * createTransferBuffer(SDL_GPUDevice *device, size_t transferBufferSize, bool upload)
Definition Boilerplate.cpp:198
SDL_GPUDepthStencilTargetInfo makeDepthTarget(SDL_GPUTexture *texture)
Definition Boilerplate.cpp:38
SDL_GPUTextureSamplerBinding makeTextureSamplerBinding(SDL_GPUTexture *texture, SDL_GPUSampler *sampler)
Definition Boilerplate.cpp:52
ImGui_ImplSDLGPU3_InitInfo createImGuiInfo(SDL_GPUDevice *device, SDL_Window *window)
Definition Boilerplate.cpp:8
SDL_GPUShaderFormat selectShaderFormat(SDL_GPUDevice *device)
Definition Boilerplate.cpp:60
SDL_GPUTexture * createDepthTexture(SDL_GPUDevice *device, Uint32 width, Uint32 height)
Definition Boilerplate.cpp:345
Definition Boilerplate.hpp:29
SDL_GPUBuffer * buffer
Definition Boilerplate.hpp:30
const void * data
Definition Boilerplate.hpp:31
size_t size
Definition Boilerplate.hpp:32
Definition Boilerplate.hpp:13
SDL_GPUShaderStage stage
Definition Boilerplate.hpp:15
Uint32 uniformBufferCount
Definition Boilerplate.hpp:17
Uint32 storageBufferCount
Definition Boilerplate.hpp:18
const char * path
Definition Boilerplate.hpp:14
Uint32 storageTextureCount
Definition Boilerplate.hpp:19
Uint32 samplerCount
Definition Boilerplate.hpp:16