35 ID GetID()
const override {
return m_id; }
51 void Record(
IntRect rect,
bool resizing);
53 bool EnsureTargets(uint32_t width, uint32_t height);
66 std::shared_ptr<bool> m_alive = std::make_shared<bool>(
true);
70 bool m_claimed =
false;
74 std::vector<uint8_t> m_layeredPixels;
75 uint2 m_layeredSize{ 0, 0 };
76 bool m_layeredPending =
false;
78 SDL_GPUTexture* m_drawTexture =
nullptr;
79 SDL_GPUTexture* m_depthTexture =
nullptr;
80 uint32_t m_width = 0, m_height = 0;
84 std::vector<SDL_GPUFence*> m_fences;
85 static constexpr size_t kFramesInFlight = 2;
87 void ReleaseSignaledFences();
89 std::optional<double> m_acquireSeconds;
93 std::vector<std::byte> m_staging;
94 SDL_GPUBuffer* m_arena =
nullptr;
95 SDL_GPUTransferBuffer* m_arenaUpload =
nullptr;
96 uint32_t m_arenaSize = 0;
97 uint32_t m_arenaEntry = 0;
102 SDL_GPUTransferBuffer* m_download =
nullptr;
103 uint32_t m_downloadSize = 0;
A graphics backend: the device, the window contexts that render the GUI's windows,...
Definition gui_graphics_context.h:53
A window's rendering state: made by GraphicsContext::CreateWindowContext for each OS window,...
Definition gui_window_backend.h:72
Definition sdlgpu_rhi.h:20
Definition sdlgpu_graphics_context.h:55
void RecordWindowFrame(GraphicsContext *graphicsContext, IntRect rect) override
Records and submits a frame without presenting it; PresentWindowFrame presents.
OSWindowHandle GetWindowHandle() const override
The window it was created for.
Definition sdlgpu_window_context.h:36
std::optional< double > PresentWindowFrame() override
The frame was presented when it was submitted: the seconds the swapchain's image took to come (the vs...
bool ReadPixels(std::span< uint8_t > bgra) override
The last rendered frame, BGRA8 with tightly packed rows; bgra holds width x height x 4 bytes of the w...
static SDLGPUWindowContext * Create(SDLGPUGraphicsContext &graphics, SDL_Window *window, void *nativeWindow, OSWindowHandle osHandle, ID id, int2 size, WindowFlags flags, OnGuiFunc onGui)
Null, with the reason logged, when the window can't be claimed.
~SDLGPUWindowContext() override
bool IsTransparent() const override
Whether the window has WindowFlags::Transparent.
ID GetID() const override
The GUI window's ID; the backend passes it with the window's input.
Definition sdlgpu_window_context.h:35
void RenderWindowFrame(GraphicsContext *graphicsContext, IntRect rect, bool resizing) override
resizing: a live resize's redraw, which lays the window out again (its onGui) before it's drawn at th...
std::function< void()> OnGuiFunc
Definition gui_base_types.h:13
WindowFlags
How an OS window is made and behaves (IWindowBackend::CreateWindow); flags combine with |.
Definition gui_window_flags.h:14
void * OSWindowHandle
An OS window, opaque; what it points to is up to the window backend.
Definition gui_window_backend.h:37
Definition sdlgpu_device.h:37
A 64-bit element ID whose bit layout depends on its IDMode.
Definition gui_id.h:23
Definition gui_base_types.h:406
Integer 2D vector.
Definition gui_base_types.h:18
Definition sdlgpu_device.h:93
Definition gui_base_types.h:74