class render::RenderWindow

Inherits: RenderTarget

Render thread counterpart of RenderWindow.

Public

Constructors

RenderWindow

RenderWindow(const RenderWindowCreateInformation &createInformation, u32 windowId, u64 platformWindowHandle, const SPtr<RenderWindow> &parentWindow)

Methods

~RenderWindow

~RenderWindow() noexcept override = default

Initialize

void Initialize() override

Called on the render thread when the object is first created.

Destroy

void Destroy() override

Called on the render thread before the object is destroyed.

ReadAsync

TAsyncOp<SPtr<PixelData>> ReadAsync(GpuCommandBuffer &commandBuffer, u32 colorSurfaceIndex = 0, u32 mipLevel = 0, u32 arrayLayer = 0) override

Reads the contents of this render target.

Issues a copy command into the command buffer and returns an async operation that triggers when the data has been read.

commandBuffer
Command buffer to issue copy commands into.
colorSurfaceIndex
Which color surface to read (default 0).
mipLevel
Mip level to read (default 0).
arrayLayer
Array layer to read (default 0).

Returns: Async operation that triggers when the read operation is complete. May retun null PixelData if reading is not supported.

NotifySwapBuffersRequested

virtual void NotifySwapBuffersRequested()

Called by the GPU backend after it requests swap chain back buffer to be presented.

RebuildSwapChain

virtual void RebuildSwapChain()

Rebuilds the swap chain according to the currently set properties.

IsRedrawRequested

bool IsRedrawRequested() const

Returns true if the operating system has requested the window to be redrawn.

This state is cleared when NotifySwapBuffersRequested() is called.

GetRenderWindowProperties

const RenderWindowProperties &GetRenderWindowProperties() const

Returns properties that describe the render window.

GetRenderWindowSurface

const SPtr<IRenderWindowSurface> &GetRenderWindowSurface() const

Returns the internal render window surface, if any.

DoOnSwapChainPropertiesModified

virtual void DoOnSwapChainPropertiesModified()

Triggers whenever the window changes properties that are relevant for the swap chain.

Fields

OnSwapChainDidRebuild

Event<void ()> OnSwapChainDidRebuild

Triggered when the window swap chain has been recreated.

Protected

Methods

SyncFromCoreObject

void SyncFromCoreObject(const CoreSyncData &data, FrameAllocator &allocator) override

Update internal data from provided memory buffer that was populated with data from the owning CoreObject.

Fields

mCreateInformation

mRenderWindowProperties

RenderWindowProperties mRenderWindowProperties

mParentWindow

WeakSPtr<RenderWindow> mParentWindow

mWindowId

u32 mWindowId

mPlatformWindowHandle

u64 mPlatformWindowHandle

mShowOnSwap

bool mShowOnSwap

mIsRedrawRequested

bool mIsRedrawRequested

mRenderWindowSurface

SPtr<IRenderWindowSurface> mRenderWindowSurface