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

#include <gui_core/graphics/d3d12/d3d12_window_context.h>

Inheritance diagram for tachyon::d3d12::D3D12WindowContext:

Public Member Functions

 ~D3D12WindowContext () 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
 May wait for vsync; nothing to do for a render-to-image window.
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 D3D12WindowContext * Create (D3D12GraphicsContext &graphics, HWND window, OSWindowHandle osHandle, ID id, int2 size, WindowFlags flags, OnGuiFunc onGui)
 window is null for a render-to-image window.

Constructor & Destructor Documentation

◆ ~D3D12WindowContext()

tachyon::d3d12::D3D12WindowContext::~D3D12WindowContext ( )
override

Member Function Documentation

◆ Create()

D3D12WindowContext * tachyon::d3d12::D3D12WindowContext::Create ( D3D12GraphicsContext & graphics,
HWND window,
OSWindowHandle osHandle,
ID id,
int2 size,
WindowFlags flags,
OnGuiFunc onGui )
static

window is null for a render-to-image window.

Null, with the reason logged, when the swapchain can't be made.

◆ GetID()

ID tachyon::d3d12::D3D12WindowContext::GetID ( ) const
inlineoverridevirtual

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

Implements tachyon::IWindowContext.

◆ GetWindowHandle()

OSWindowHandle tachyon::d3d12::D3D12WindowContext::GetWindowHandle ( ) const
inlineoverridevirtual

The window it was created for.

Implements tachyon::IWindowContext.

◆ IsTransparent()

bool tachyon::d3d12::D3D12WindowContext::IsTransparent ( ) const
overridevirtual

Whether the window has WindowFlags::Transparent.

Implements tachyon::IWindowContext.

◆ RenderWindowFrame()

void tachyon::d3d12::D3D12WindowContext::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::d3d12::D3D12WindowContext::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::d3d12::D3D12WindowContext::PresentWindowFrame ( )
overridevirtual

May wait for vsync; nothing to do for a render-to-image window.

Returns the seconds the frame waited on the OS to show it: getting its image and presenting it, since a driver may hold the vsync wait in either. Nothing when no frame was presented to it (a render-to-image window, a window not recorded this frame).

Reimplemented from tachyon::IWindowContext.

◆ ReadPixels()

bool tachyon::d3d12::D3D12WindowContext::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: