Open 3D Engine AzFramework API Reference
24.09
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
|
#include <NativeWindow.h>
Inherits WindowRequestBus::Handler.
Classes | |
class | Implementation |
class | ImplementationFactory |
The factory class to create a custom implementation for this native window. More... | |
Public Member Functions | |
AZ_CLASS_ALLOCATOR (NativeWindow, AZ::SystemAllocator) | |
NativeWindow (const AZStd::string &title, const WindowGeometry &geometry, const WindowStyleMasks styleMasks={}) | |
void | Activate () |
void | Deactivate () |
bool | IsActive () const |
NativeWindowHandle | GetWindowHandle () const |
Get the native window handle. This is used as the bus id for the WindowRequestBus and WindowNotificationBus. | |
void | SetWindowTitle (const AZStd::string &title) override |
WindowSize | GetClientAreaSize () const override |
WindowSize | GetMaximumClientAreaSize () const override |
void | ResizeClientArea (WindowSize clientAreaSize, const WindowPosOptions &options) override |
bool | SupportsClientAreaResize () const override |
WindowSize | GetRenderResolution () const override |
void | SetRenderResolution (WindowSize resolution) override |
bool | GetFullScreenState () const override |
void | SetFullScreenState (bool fullScreenState) override |
bool | CanToggleFullScreenState () const override |
void | ToggleFullScreenState () override |
float | GetDpiScaleFactor () const override |
uint32_t | GetSyncInterval () const override |
bool | SetSyncInterval (uint32_t newSyncInterval) override |
uint32_t | GetDisplayRefreshRate () const override |
Static Public Member Functions | |
static bool | SupportsClientAreaResizeOfDefaultWindow () |
Get whether the default window supports client area resizing. | |
static bool | GetFullScreenStateOfDefaultWindow () |
static void | SetFullScreenStateOfDefaultWindow (bool fullScreenState) |
static bool | CanToggleFullScreenStateOfDefaultWindow () |
static void | ToggleFullScreenStateOfDefaultWindow () |
Toggle the full screen state of the default window. | |
Provides a basic window.
This is mainly designed to be used as a base window for rendering. The window provides just a simple surface and handles implementation details for each platform.
Window events are pumped via the AzFramework's application. No event messaging or message translation/dispatch needs to be handled by the underlying implementation.
Multiple NativeWindows are supported by this system. This is impractical for most standalone game applications, and unnecessary for some platforms, but still possible.
The Window implementation will be created when the NativeWindow is constructed and the platform specific native window will be created (if it doesn't already exist). On platforms that support it, the window will become visible when Activate is called and hidden when Deactivate is called. On other platforms the window becomes visible on construction and hidden on destruction. To provide a consistent API to the client across platforms:
AzFramework::NativeWindow::NativeWindow | ( | const AZStd::string & | title, |
const WindowGeometry & | geometry, | ||
const WindowStyleMasks | styleMasks = {} |
||
) |
Constructor
[in] | title | The title of the window (may or may not be displayed depending on the platform). |
[in] | geometry | The geometry used to set the initial position and size of the window. |
[in] | styleMasks | The style masks applied to the window on creation. If none are specified, the default window style of the underlying platform will be used instead. |
void AzFramework::NativeWindow::Activate | ( | ) |
Activate the window. The window will be visible after this call (on some platforms it will be also visible before activation).
|
static |
Can the full screen state of the default window be changed/toggled?
void AzFramework::NativeWindow::Deactivate | ( | ) |
Deactivate the window. This will result in the OnWindowClosed notification being sent. On some platforms this will hide the window. On others the window will remain visible.
|
static |
Get the full screen state of the default window.
|
static |
Set the full screen state of the default window.
[in] | fullScreenState | The full screen state to set. |