Something went wrong. Try again.
art software for the rest of us
drawing paint image sdl art
Something went wrong. Try again.
C
1234567891011121314151617181920212223242526272829303132333435363738#pragma once#include <SDL3/SDL.h>#include <list>#include <stack>#include <string>
// and so begins the sdl gpu refactor hehclass GPU { static SDL_GPUDevice* device; static SDL_Window* window;
static std::stack<SDL_GPUCommandBuffer*> commandbuffers; static SDL_GPUTexture* swapchain; static SDL_GPURenderPass* renderPass; static SDL_GPUCopyPass* copyPass;public: static std::string GetDetails(); static bool Init(); static void Shutdown(); static SDL_GPUDevice* GetDevice(); static SDL_Window* GetWindow(); static SDL_GPUCommandBuffer* GetCommandBuffer(); static SDL_GPURenderPass* GetRenderPass(); static SDL_GPUCopyPass* GetCopyPass(); static bool ClaimWindow(SDL_Window* window);
static bool AquirePushCommandBuffer(); static bool WaitAquireSwapchainWithCommandBuffer();
static SDL_GPUTexture* GetSwapchain(); static SDL_GPUTextureFormat GetSwapchainFormat(); static void BeginRendering(std::list<SDL_GPUColorTargetInfo*> colorTargetInfos, SDL_GPUDepthStencilTargetInfo* depthStencilTargetInfo); static void EndRendering(); static void BeginCopying(); static void EndCopying(); static void SubmitCommandsPopCommandBuffer(); static void SubmitCommandsPopCommandBufferAwaitFence();};