TachyonUI 0.1.0
High-performance UI for building tools.
Loading...
Searching...
No Matches
tachyon::IWindowContext Class Referenceabstract

A window's rendering state: made by GraphicsContext::CreateWindowContext for each OS window, attached to it with IWindowBackend::AttachContextToWindow, and destroyed by GraphicsContext::DestroyWindowContext. More...

#include <gui_core/windows/gui_window_backend.h>

Inheritance diagram for tachyon::IWindowContext:

Public Member Functions

virtual ~IWindowContext ()=default
virtual ID GetID () const =0
 The GUI window's ID; the backend passes it with the window's input.
virtual OSWindowHandle GetWindowHandle () const =0
 The window it was created for.
virtual bool IsTransparent () const =0
 Whether the window has WindowFlags::Transparent.
virtual void RenderWindowFrame (tachyon::GraphicsContext *graphicsContext, tachyon::IntRect rect, bool resizing)=0
 A frame is recorded (drawn and submitted), then presented.
virtual void RecordWindowFrame (tachyon::GraphicsContext *graphicsContext, tachyon::IntRect rect)
 Records and submits a frame without presenting it; PresentWindowFrame presents.
virtual void PresentWindowFrame ()
 May wait for vsync; nothing to do for a render-to-image window.
virtual void UpdateTransparentWindow (int2)
 A transparent window the OS composites from a CPU copy (a layered window on Windows): shows its last frame again at screenPos (screen pixels).
virtual bool ReadPixels (std::span< uint8_t >)
 The last rendered frame, BGRA8 with tightly packed rows; bgra holds width x height x 4 bytes of the window's pixel size.

Detailed Description

A window's rendering state: made by GraphicsContext::CreateWindowContext for each OS window, attached to it with IWindowBackend::AttachContextToWindow, and destroyed by GraphicsContext::DestroyWindowContext.

The backend doesn't own it.

Constructor & Destructor Documentation

◆ ~IWindowContext()

virtual tachyon::IWindowContext::~IWindowContext ( )
virtualdefault

Member Function Documentation

◆ GetID()

virtual ID tachyon::IWindowContext::GetID ( ) const
pure virtual

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

Implemented in tachyon::vulkan::VulkanWindowContext.

◆ GetWindowHandle()

virtual OSWindowHandle tachyon::IWindowContext::GetWindowHandle ( ) const
pure virtual

The window it was created for.

Implemented in tachyon::vulkan::VulkanWindowContext.

◆ IsTransparent()

virtual bool tachyon::IWindowContext::IsTransparent ( ) const
pure virtual

Whether the window has WindowFlags::Transparent.

Implemented in tachyon::vulkan::VulkanWindowContext.

◆ RenderWindowFrame()

virtual void tachyon::IWindowContext::RenderWindowFrame ( tachyon::GraphicsContext * graphicsContext,
tachyon::IntRect rect,
bool resizing )
pure virtual

A frame is recorded (drawn and submitted), then presented.

RenderWindowFrame does both; a host loop records every window before presenting any.

Implemented in tachyon::vulkan::VulkanWindowContext.

◆ RecordWindowFrame()

virtual void tachyon::IWindowContext::RecordWindowFrame ( tachyon::GraphicsContext * graphicsContext,
tachyon::IntRect rect )
inlinevirtual

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

The default does both, through RenderWindowFrame.

Reimplemented in tachyon::vulkan::VulkanWindowContext.

◆ PresentWindowFrame()

virtual void tachyon::IWindowContext::PresentWindowFrame ( )
inlinevirtual

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

Reimplemented in tachyon::vulkan::VulkanWindowContext.

◆ UpdateTransparentWindow()

virtual void tachyon::IWindowContext::UpdateTransparentWindow ( int2 )
inlinevirtual

A transparent window the OS composites from a CPU copy (a layered window on Windows): shows its last frame again at screenPos (screen pixels).

The default does nothing.

Reimplemented in tachyon::vulkan::VulkanWindowContext.

◆ ReadPixels()

virtual bool tachyon::IWindowContext::ReadPixels ( std::span< uint8_t > )
inlinevirtual

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 in tachyon::vulkan::VulkanWindowContext.


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