Open 3D Engine Atom Gem API Reference 23.10.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
AZ::RPI::WindowContext Class Referencefinal

#include <WindowContext.h>

Inherits AzFramework::WindowNotificationBus::Handler, and AzFramework::ExclusiveFullScreenRequestBus::Handler.

Public Member Functions

 AZ_CLASS_ALLOCATOR (WindowContext, AZ::SystemAllocator)
 
void Initialize (RHI::Device &device, AzFramework::NativeWindowHandle windowHandle)
 
AZStd::vector< ViewportContextPtrGetAssociatedViewportContexts ()
 
void RegisterAssociatedViewportContext (ViewportContextPtr viewportContext)
 Registers a ViewportContext as associated with this WindowContext.
 
void Shutdown ()
 Shuts down the WindowContext and destroys the underlying SwapChain.
 
const RHI::AttachmentId & GetSwapChainAttachmentId (ViewType viewType=ViewType::Default) const
 Returns a unique attachment id associated with the swap chain.
 
const RHI::Ptr< RHI::SwapChain > & GetSwapChain (ViewType viewType=ViewType::Default) const
 Retrieves the underlying SwapChain created by this WindowContext.
 
const RHI::ViewportGetViewport (ViewType viewType=ViewType::Default) const
 Retrieves the default ViewportState for the WindowContext.
 
const RHI::ScissorGetScissor (ViewType viewType=ViewType::Default) const
 Retrieves the default ScissorState for the WindowContext.
 
AzFramework::NativeWindowHandle GetWindowHandle () const
 Get the window ID for the WindowContext.
 
uint32_t GetSwapChainsSize () const
 Get the number of active swapchains.
 
RHI::Scaling GetSwapChainScalingMode () const
 Get swapchain scaling mode.
 

Detailed Description

An RPI-level understanding of a Window and its relevant SwapChain This is how the RPI creates a SwapChain from an AzFramework's Window and passes it down throughout the RPI. This is a convenient way to package the SwapChain, Window size, Attachment info and other window information needed to present to a surface.

Member Function Documentation

◆ GetAssociatedViewportContexts()

AZStd::vector< ViewportContextPtr > AZ::RPI::WindowContext::GetAssociatedViewportContexts ( )

Gets the ViewportContexts associated with this WindowContext, if any. Associated ViewportContexts can be enumerated to find the active rendered scene.

◆ Initialize()

void AZ::RPI::WindowContext::Initialize ( RHI::Device device,
AzFramework::NativeWindowHandle  windowHandle 
)

Initializes the WindowContext from the given AzFramework's window param[in] windowHandle The native window handle of the Window we want to construct an RPI WindowContext for param[in] masterPassName The name of the pass that supplies input to the window's swapchain pass


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