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.
AzFramework::NativeWindow Class Referencefinal

#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.
 

Detailed Description

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:

  • Calling Activate (when not active) will result in the OnWindowResized notification
  • Calling Deactivate (when active) will result in the OnWindowClosed notification
  • destroying the NativeWindow when active will result in Deactivate being called

Constructor & Destructor Documentation

◆ NativeWindow()

AzFramework::NativeWindow::NativeWindow ( const AZStd::string &  title,
const WindowGeometry geometry,
const WindowStyleMasks  styleMasks = {} 
)

Constructor

Parameters
[in]titleThe title of the window (may or may not be displayed depending on the platform).
[in]geometryThe geometry used to set the initial position and size of the window.
[in]styleMasksThe style masks applied to the window on creation. If none are specified, the default window style of the underlying platform will be used instead.

Member Function Documentation

◆ Activate()

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).

◆ CanToggleFullScreenStateOfDefaultWindow()

static bool AzFramework::NativeWindow::CanToggleFullScreenStateOfDefaultWindow ( )
static

Can the full screen state of the default window be changed/toggled?

Returns
True if the default window can enter/exit full screen, false otherwise.

◆ Deactivate()

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.

◆ GetFullScreenStateOfDefaultWindow()

static bool AzFramework::NativeWindow::GetFullScreenStateOfDefaultWindow ( )
static

Get the full screen state of the default window.

Returns
True if the default window is currently in full screen, false otherwise.

◆ SetFullScreenStateOfDefaultWindow()

static void AzFramework::NativeWindow::SetFullScreenStateOfDefaultWindow ( bool  fullScreenState)
static

Set the full screen state of the default window.

Parameters
[in]fullScreenStateThe full screen state to set.

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