Class TCustomSwapChainDevice

DescriptionHierarchyFieldsMethodsProperties

Unit

Declaration

type TCustomSwapChainDevice = class(TCustomStateDevice)

Description

Hardware device wrapper that supports rendering to multiple swap chains, which can be located on one or several windows.

Hierarchy

Overview

Methods

Public function BeginScene(const SwapChainIndex: Integer = 0): Boolean; virtual; abstract;
Public function EndScene: Boolean; virtual; abstract;
Public function Resize(const SwapChainIndex: Integer; const NewSize: TPoint2i): Boolean;
Protected function MayRender(const SwapChainIndex: Integer): Boolean; virtual;
Protected function ResizeSwapChain(const SwapChainIndex: Integer; const NewSwapChainInfo: PSwapChainInfo): Boolean; virtual;
Public procedure Reset; virtual;

Properties

Public property SwapChains: TSwapChains read FSwapChains;

Description

Methods

Public function BeginScene(const SwapChainIndex: Integer = 0): Boolean; virtual; abstract;

Activates the specified swap chain and begins rendering to it. The rendering should end with call to EndScene. Note that multiple cascade calls to BeginScene and EndScene are not allowed, so a next call to BeginScene without corresponding EndScene will fail. This function returns True if the rendering started successfully and False otherwise. If returned value is False, there is no need to call EndScene.

Public function EndScene: Boolean; virtual; abstract;

Finishes rendering to the swap chain that was started with BeginScene. If the swap chain is located on a window, then this will present the contents.

Public function Resize(const SwapChainIndex: Integer; const NewSize: TPoint2i): Boolean;

Changes size of the back-buffer tied to swap chain identified by the given index. The first swap chain has index of zero. If the index is outside of valid range or the swap chain cannot be resized, the returned value is False and the size of swap chain remains unchanged. If this method succeeds, the swap chain will have its size updated and True will be returned. In some providers this may cause device to be reset and some resources to be recreated, so any resources that are not handled internally should be released before calling this; the best way to handle this scenario is to subscribe in TCustomDevice.OnRelease and TCustomDevice.OnRestore events.

Protected function MayRender(const SwapChainIndex: Integer): Boolean; virtual;

Returns True when device is ready to render on the given swap chain and False otherwise.

Protected function ResizeSwapChain(const SwapChainIndex: Integer; const NewSwapChainInfo: PSwapChainInfo): Boolean; virtual;

Updates swap chain implementation-specific resources and resizes any related surfaces.

Public procedure Reset; virtual;

Clears all textures, shaders and states currently bound to the device. This method works only on some modern providers.

Properties

Public property SwapChains: TSwapChains read FSwapChains;

The list of swap chains that will be used for rendering into. In a typical scenario at least one swap chain must be added to this list for device initialization to succeed. In FireMonkey applications the swap chains are not used and will be ignored by the device.


Copyright © 2000 - 2017 Yuriy Kotsarenko. Help files generated by PasDoc.