|
Avara3D 0.2.0
C++ API reference
|
RenderContext for interactive desktop and web rendering. More...
#include <a3d/render/context/Window.h>
Public Member Functions | |
| Window (const math::uvec2 &size, bool fullScreen, bool enableHighDPI=true, Antialiasing antialiasing=Antialiasing::None) | |
| Creates a rendering window and its rendering resources. More... | |
| void | open () |
| Shows the window and begins accepting normal window callbacks. More... | |
| void | close () |
| Closes the window and releases pointer capture. More... | |
| bool | isOpen () const |
| Returns whether the Window has been opened and not subsequently closed. More... | |
| std::string | title () const |
| Returns the window title; web builds currently return an empty string. More... | |
| void | title (const std::string &title) |
| Sets the window title. More... | |
| math::uvec2 | size () const |
| Returns the window size in platform window coordinates. More... | |
| void | size (const math::uvec2 &size) |
| Sets the window size in platform window coordinates. More... | |
| math::uvec2 | position () const |
| Returns the window position in screen coordinates. More... | |
| void | position (const math::uvec2 &pos) |
| Sets the window position in screen coordinates. More... | |
| void | center () |
| Centers the window on its current monitor when supported by the platform. More... | |
| bool | hidden () const |
| Returns whether the window is explicitly hidden. More... | |
| void | hidden (bool hidden) |
| Shows or hides the window. More... | |
| bool | cursorCaptured () const |
| Returns whether pointer input is captured by the window. More... | |
| void | cursorCaptured (bool captured) |
| Captures or releases pointer input. More... | |
| bool | cursorHidden () const |
| Returns whether the pointer is requested to be hidden when not captured. More... | |
| void | cursorHidden (bool hidden) |
| Shows or hides the pointer when pointer capture is disabled. More... | |
| bool | highDPIEnabled () const |
| Returns whether high-DPI rendering was requested when the Window was created. More... | |
| bool | vSyncEnabled () const override |
| Returns whether vertical synchronization is enabled. More... | |
| void | vSyncEnabled (bool enabled) override |
| Enables or disables vertical synchronization when supported. More... | |
Public Member Functions inherited from a3d::RenderContext | |
| virtual bool | vSyncEnabled () const =0 |
| Returns whether presentation synchronization is enabled for this context. More... | |
| virtual void | vSyncEnabled (bool enabled)=0 |
| Enables or disables presentation synchronization when supported by the concrete context. More... | |
| Antialiasing | antialiasing () const |
| Returns the antialiasing mode selected when the rendering target was created. More... | |
| std::unique_ptr< Image > | snapshot () const |
| Captures the current framebuffer into a new Image at framebuffer resolution. More... | |
| VisualWorld * | visualWorld () const |
| Returns the attached VisualWorld, or nullptr if none is attached. More... | |
Static Public Member Functions | |
| static std::unique_ptr< DesktopInputContext > | InputContext () |
| Creates the DesktopInputContext implementation used by Window. More... | |
Additional Inherited Members | |
Public Types inherited from a3d::RenderContext | |
| enum class | Antialiasing : uint8_t { None = 0 , Msaa2X = 2 , Msaa4X = 4 , Msaa8X = 8 , Msaa16X = 16 } |
| Selects multisample antialiasing requested for the rendering target. More... | |
RenderContext for interactive desktop and web rendering.
On desktop, Window represents a native application window. On web builds, it represents an HTML canvas backed by WebGL. A3D uses the page's "#canvas" element for browser-specific rendering and input integration.
| a3d::Window::Window | ( | const math::uvec2 & | size, |
| bool | fullScreen, | ||
| bool | enableHighDPI = true, |
||
| Antialiasing | antialiasing = Antialiasing::None |
||
| ) |
Creates a rendering window and its rendering resources.
For a windowed context, size specifies the initial window size. Full-screen windows use the primary monitor's current video mode. High-DPI and antialiasing requests are applied when supported by the platform.
| std::runtime_error | if the window/context initialization fails. |
| void a3d::Window::center | ( | ) |
Centers the window on its current monitor when supported by the platform.
| void a3d::Window::close | ( | ) |
Closes the window and releases pointer capture.
| bool a3d::Window::cursorCaptured | ( | ) | const |
Returns whether pointer input is captured by the window.
| void a3d::Window::cursorCaptured | ( | bool | captured | ) |
Captures or releases pointer input.
Capturing locks pointer motion to the window and hides the pointer. Releasing capture restores the state requested by cursorHidden().
| bool a3d::Window::cursorHidden | ( | ) | const |
Returns whether the pointer is requested to be hidden when not captured.
| void a3d::Window::cursorHidden | ( | bool | hidden | ) |
Shows or hides the pointer when pointer capture is disabled.
| bool a3d::Window::hidden | ( | ) | const |
Returns whether the window is explicitly hidden.
| void a3d::Window::hidden | ( | bool | hidden | ) |
Shows or hides the window.
| bool a3d::Window::highDPIEnabled | ( | ) | const |
Returns whether high-DPI rendering was requested when the Window was created.
|
static |
Creates the DesktopInputContext implementation used by Window.
| bool a3d::Window::isOpen | ( | ) | const |
Returns whether the Window has been opened and not subsequently closed.
| void a3d::Window::open | ( | ) |
Shows the window and begins accepting normal window callbacks.
| std::runtime_error | if the Window has no VisualWorld attached to a Scene. |
| math::uvec2 a3d::Window::position | ( | ) | const |
Returns the window position in screen coordinates.
| void a3d::Window::position | ( | const math::uvec2 & | pos | ) |
Sets the window position in screen coordinates.
| math::uvec2 a3d::Window::size | ( | ) | const |
Returns the window size in platform window coordinates.
| void a3d::Window::size | ( | const math::uvec2 & | size | ) |
Sets the window size in platform window coordinates.
| std::string a3d::Window::title | ( | ) | const |
Returns the window title; web builds currently return an empty string.
| void a3d::Window::title | ( | const std::string & | title | ) |
Sets the window title.
|
overridevirtual |
Returns whether vertical synchronization is enabled.
Implements a3d::RenderContext.
|
overridevirtual |
Enables or disables vertical synchronization when supported.
Browser presentation timing is controlled by the browser main loop; web builds report VSync enabled and do not support disabling it.
Implements a3d::RenderContext.