|
TachyonUI 1.1.0
High-performance UI for building tools.
|
#include <gui_core/graphics/metal/metal_window_context.h>
Public Member Functions | |
| ~MetalWindowContext () 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 MetalWindowContext * | Create (MetalGraphicsContext &graphics, void *window, OSWindowHandle osHandle, ID id, int2 size, WindowFlags flags, OnGuiFunc onGui) |
| window is the NSWindow, null for a render-to-image window. | |
|
override |
|
static |
window is the NSWindow, null for a render-to-image window.
Null, with the reason logged, when its layer can't be made.
|
inlineoverridevirtual |
The GUI window's ID; the backend passes it with the window's input.
Implements tachyon::IWindowContext.
|
inlineoverridevirtual |
The window it was created for.
Implements tachyon::IWindowContext.
|
overridevirtual |
Whether the window has WindowFlags::Transparent.
Implements tachyon::IWindowContext.
|
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.
|
overridevirtual |
Records and submits a frame without presenting it; PresentWindowFrame presents.
The default does both, through RenderWindowFrame.
Reimplemented from tachyon::IWindowContext.
|
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.
|
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.