TachyonUI 1.1.0
High-performance UI for building tools.
Loading...
Searching...
No Matches
tachyon::sdlgpu::SDLGPUWindowContext Class Referencefinal

#include <gui_core/graphics/sdlgpu/sdlgpu_window_context.h>

Inheritance diagram for tachyon::sdlgpu::SDLGPUWindowContext:

Public Member Functions

 ~SDLGPUWindowContext () override
ID GetID () const override
 The GUI window's ID; the backend passes it with the window's input.
OSWindowHandle GetWindowHandle () const override
 The window it was created for.
bool IsTransparent () const override
 Whether the window has WindowFlags::Transparent.
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 the new size.
void RecordWindowFrame (GraphicsContext *graphicsContext, IntRect rect) override
 Records and submits a frame without presenting it; PresentWindowFrame presents.
std::optional< double > PresentWindowFrame () override
 The frame was presented when it was submitted: the seconds the swapchain's image took to come (the vsync wait).
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 window's pixel size.
Public Member Functions inherited from tachyon::IWindowContext
virtual ~IWindowContext ()=default
virtual bool NeedsRecord () const
 True when the window must be recorded this frame even though its draws didn't change (its swapchain is out of date).
virtual void UpdateTransparentWindow ()
 A transparent window the OS composites from a CPU copy (a layered window on Windows): shows its last frame again, where the window is.

Static Public Member Functions

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.

Constructor & Destructor Documentation

◆ ~SDLGPUWindowContext()

tachyon::sdlgpu::SDLGPUWindowContext::~SDLGPUWindowContext ( )
override

Member Function Documentation

◆ Create()

SDLGPUWindowContext * tachyon::sdlgpu::SDLGPUWindowContext::Create ( SDLGPUGraphicsContext & graphics,
SDL_Window * window,
void * nativeWindow,
OSWindowHandle osHandle,
ID id,
int2 size,
WindowFlags flags,
OnGuiFunc onGui )
static

Null, with the reason logged, when the window can't be claimed.

nativeWindow is the OS's window (an HWND on Windows), which says whether it's layered. window and nativeWindow are null for a render-to-image window.

◆ GetID()

ID tachyon::sdlgpu::SDLGPUWindowContext::GetID ( ) const
inlineoverridevirtual

The GUI window's ID; the backend passes it with the window's input.

Implements tachyon::IWindowContext.

◆ GetWindowHandle()

OSWindowHandle tachyon::sdlgpu::SDLGPUWindowContext::GetWindowHandle ( ) const
inlineoverridevirtual

The window it was created for.

Implements tachyon::IWindowContext.

◆ IsTransparent()

bool tachyon::sdlgpu::SDLGPUWindowContext::IsTransparent ( ) const
overridevirtual

Whether the window has WindowFlags::Transparent.

Implements tachyon::IWindowContext.

◆ RenderWindowFrame()

void tachyon::sdlgpu::SDLGPUWindowContext::RenderWindowFrame ( GraphicsContext * graphicsContext,
IntRect rect,
bool resizing )
overridevirtual

resizing: a live resize's redraw, which lays the window out again (its onGui) before it's drawn at the new size.

Implements tachyon::IWindowContext.

◆ RecordWindowFrame()

void tachyon::sdlgpu::SDLGPUWindowContext::RecordWindowFrame ( GraphicsContext * graphicsContext,
IntRect rect )
overridevirtual

Records and submits a frame without presenting it; PresentWindowFrame presents.

The default does both, through RenderWindowFrame.

Reimplemented from tachyon::IWindowContext.

◆ PresentWindowFrame()

std::optional< double > tachyon::sdlgpu::SDLGPUWindowContext::PresentWindowFrame ( )
overridevirtual

The frame was presented when it was submitted: the seconds the swapchain's image took to come (the vsync wait).

A layered window's frame is read back and shown here instead.

Reimplemented from tachyon::IWindowContext.

◆ ReadPixels()

bool tachyon::sdlgpu::SDLGPUWindowContext::ReadPixels ( std::span< uint8_t > bgra)
overridevirtual

The last rendered frame, BGRA8 with tightly packed rows; bgra holds width x height x 4 bytes of the window's pixel size.

False when it can't be read.

Reimplemented from tachyon::IWindowContext.


The documentation for this class was generated from the following file: