vkmEngine 1.0.0
A C++ game engine · vkmengine.com
Loading...
Searching...
No Matches
Vkm::Engine::HostChrome Class Reference

What an authoring host tells the engine about the frame it draws over. More...

#include <host_chrome.h>

Classes

struct  ViewportRect
 A rect in framebuffer pixels: the unit glViewport takes. More...

Public Member Functions

void setViewport (uint32_t x, uint32_t y, uint32_t width, uint32_t height)
 Declare the rect inside the window the 3D scene renders into.
ViewportRect viewport (const WindowManager &window) const
 The declared rect, resolved against the window it sits in.
void setCapture (bool pointer, bool keyboard)
 Declare that the host's own UI, not the scene, has the devices.
bool capturesPointer () const
 Whether the host's UI owns the pointer this frame.
bool capturesKeyboard () const
 Whether the host's UI owns the keyboard this frame.

Detailed Description

What an authoring host tells the engine about the frame it draws over.

The host frames the engine's output: panels around a scene rect, taking the pointer over them. Readers take it off the frame context; unset, it is the whole window with nothing captured.

Written in the Editor stage, so earlier stages see the previous frame's rect.

Member Function Documentation

◆ setViewport()

void Vkm::Engine::HostChrome::setViewport ( uint32_t x,
uint32_t y,
uint32_t width,
uint32_t height )
inline

Declare the rect inside the window the 3D scene renders into.

Parameters
xLeft edge in framebuffer pixels; scale screen coordinates by WindowManager::framebufferScale first.
yTop edge, same units.
widthZero means the whole window.
heightZero means the whole window.

◆ viewport()

ViewportRect Vkm::Engine::HostChrome::viewport ( const WindowManager & window) const

The declared rect, resolved against the window it sits in.

Parameters
windowWindow the scene is drawn into; fills a zero extent.
Returns
Rect in framebuffer pixels, zero-sized only if the window is.

◆ setCapture()

void Vkm::Engine::HostChrome::setCapture ( bool pointer,
bool keyboard )
inline

Declare that the host's own UI, not the scene, has the devices.

Separate, since a focused text field takes the keyboard while the pointer is over the viewport, and a panel takes the pointer unfocused.

Parameters
pointerHost UI is under the cursor or dragging, or the host has taken the view from the game (an ejected session).
keyboardA field is typed into, a popup or rebind waits for a key, or the host has taken the view from the game.

◆ capturesPointer()

bool Vkm::Engine::HostChrome::capturesPointer ( ) const
inline

Whether the host's UI owns the pointer this frame.

Returns
The last setCapture() pointer flag.

◆ capturesKeyboard()

bool Vkm::Engine::HostChrome::capturesKeyboard ( ) const
inline

Whether the host's UI owns the keyboard this frame.

Returns
The last setCapture() keyboard flag.

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