|
CeresEngine 0.2.0
A game development framework
|
A UIWindowDevice implementation that offers graphics accelerated rendering of the UI.
More...
#include <CeresEngine/UI/UIWindowDevice.hpp>
Classes | |
| struct | WindowInformation |
| A structure that describes information about each window registered with the device. More... | |
Public Member Functions | |
| UIWindowSurfaceDevice (Platform &platform, Renderer &renderer) | |
| Creates a new window surface device. | |
| UIBackingStorePtr | createBackingStore (UIWindow &window) override |
| void | flush (UIWindow &window, UIBackingStore &backingStore) override |
| double | getBackingScaleFactor (const UIWindow &window) const override |
| The backing scale factor. | |
| UIBackingStorePtr | registerWindow (UIWindow &window) override |
| Registers a window with this device. | |
| void | unregisterWindow (UIWindow &window) override |
| Unregisters the window from this device. | |
Public Member Functions inherited from CeresEngine::UIWindowFramebufferDevice | |
| UIWindowFramebufferDevice (Renderer &renderer) | |
| void | draw (UIBackingStore &backingStore, UIDrawCommandBuffer &drawCommandBuffer) override |
| Draws the UI command buffer into the backing store. | |
Public Member Functions inherited from CeresEngine::UIWindowDevice | |
| UIWindowDevice () noexcept=default | |
| virtual | ~UIWindowDevice () noexcept=default |
Public Member Functions inherited from CeresEngine::RefCounted< UIWindowDevice > | |
| RefCounted (Args &&... args) | |
Creates a new RefCounted object and constructs a new Deleter by forwarding Args to it. | |
| void | retain () noexcept |
| Retains the object by increment it's reference count by one. | |
| bool | release () noexcept |
| Relases the object by decrementing it's reference count by one. | |
Private Types | |
| using | super = UIWindowFramebufferDevice |
Private Member Functions | |
| void | onSurfaceEvent (UIWindow &window, const AnyInputEvent &) |
| void | onSurfaceResize (UIWindow &window, const Vector2 &newSize) |
| void | onSurfaceClose () |
Private Attributes | |
| Platform & | mPlatform |
The platform object that will be used to create the window surfaces that will back each UIWindow registered. | |
| HashMap< UIWindow *, WindowInformation > | mWindows |
| A map of all registered windows. | |
| Vector< UIWindowPtr > | mDirtyWindows |
| A set of dirty windows. | |
Additional Inherited Members | |
Protected Member Functions inherited from CeresEngine::UIWindowDevice | |
| void | notifyFrameChanged (UIWindow &window, const UIRect &newFrame) |
| Utility method that must be called by device implementations when the window frame changes. | |
| void | notifyBackingScaleFactorChange (UIWindow &window, double newBackingScalingFactor) |
| Utility method that must be called by device implementations when the window scaling factor changes. | |
Protected Attributes inherited from CeresEngine::UIWindowFramebufferDevice | |
| Renderer & | mRenderer |
| UIRenderer | mUIRenderer |
| The renderer that will render the UI elements on a texture. | |
A UIWindowDevice implementation that offers graphics accelerated rendering of the UI.
Windows are backed by an operating-system provided window surface. Events from this window surface are directly proxied to the UIWindow.
This device also automatically flushes the window contents to the GPU swapchain whenever they are flushed.
|
explicit |
Creates a new window surface device.
|
overridevirtual |
Reimplemented from CeresEngine::UIWindowFramebufferDevice.
|
overridevirtual |
Reimplemented from CeresEngine::UIWindowFramebufferDevice.
|
overridevirtual |
The backing scale factor.
The value of this property is 2.0 for high-resolution scaled display modes, and 1.0 for all other cases.
There are some scenarios where an application that is resolution-aware may want to reason on its own about the display environment it is running in. It is important to note that the value of this property does not represent anything concrete, such as pixel density or physical size, because it can vary based on the configured display mode. For example, the display may be in a mirrored configuration that is still high-resolution scaled, resulting in pixel geometry that may not match the native resolution of the display device.
getBackingScaleFactor() as an input to layout or drawing calculations. Developers should instead use the backing coordinate space conversion methods, because the resulting code will more likely work consistently and correctly under both standard and high-resolution operation. Reimplemented from CeresEngine::UIWindowDevice.
|
private |
|
private |
|
private |
|
overridevirtual |
Registers a window with this device.
The registration can return a valid UIBackingStore that the window can use as a rendering target for it's contents. If no backing store is returned, drawing the UIWindow is unavailable.
Reimplemented from CeresEngine::UIWindowDevice.
Unregisters the window from this device.
Reimplemented from CeresEngine::UIWindowDevice.
|
private |
A set of dirty windows.
Those windows are pending flushes and will be flushed the next time the main thread becomes idle.
|
private |
The platform object that will be used to create the window surfaces that will back each UIWindow registered.
|
private |
A map of all registered windows.