Class TAPIStateWrapper
Unit
C2Render
Declaration
type TAPIStateWrapper = class
Description
API-dependent class which wraps render stateFields
Methods
Overview
 | constructor Create; |
 | destructor Destroy; override; |
 | function APICreateRenderTarget(Index, Width, Height: Integer; AColorFormat, ADepthFormat: Cardinal): Boolean; virtual; abstract; |
 | procedure APISetShaderConstant(const Constant: TShaderConstant); overload; virtual; abstract; |
 | procedure APISetShaderConstant(ShaderKind: TShaderKind; ShaderRegister: Integer; const Vector: TShaderRegisterType); overload; virtual; abstract; |
 | function APIValidatePass(const Pass: TRenderPass; out ResultStr: string): Boolean; virtual; abstract; |
 | procedure ApplyClipPlanes; |
 | procedure ApplyCustomTextureMatrices(const Pass: TRenderPass; Item: TVisible); virtual; abstract; |
 | procedure ApplyPass(const Pass: TRenderPass); virtual; abstract; |
 | procedure ApplyTextureMatrices(const Pass: TRenderPass); virtual; abstract; |
 | function CreatePixelShader(Item: TShaderResource): Integer; virtual; |
 | function CreateRenderTarget(Index, Width, Height: Integer; AColorFormat, ADepthFormat: Cardinal): Boolean; |
 | function CreateVertexShader(Item: TShaderResource; Declaration: TVertexDeclaration): Integer; virtual; |
 | procedure DestroyRenderTarget(Index: Integer); virtual; abstract; |
 | function FindRenderTarget(const ACamera: TCamera): Integer; |
 | procedure HandleDataChange(Data: Pointer); virtual; |
 | procedure HandleItemReplace(OldItem, NewItem: TItem); virtual; |
 | procedure HandleMessage(const Msg: TMessage); |
 | function IsRenderTargetEmpty(const Element: TRenderTarget): Boolean; |
 | function IsRenderTargetUptoDate(const ACamera: TCamera): Boolean; |
 | function IsShaderEmpty(const Element: TShader): Boolean; |
 | function ResolvePixelShader(Pass: TRenderPass): Boolean; |
 | function ResolveVertexShader(Pass: TRenderPass): Boolean; |
 | procedure SetBlending(Enabled: Boolean; SrcBlend, DestBlend, AlphaRef, ATestFunc, Operation: Integer); virtual; abstract; |
 | procedure SetClipPlane(Index: Cardinal; Plane: PPlane); virtual; abstract; |
 | procedure SetCullAndFillMode(FillMode, ShadeMode, CullMode: Integer; ColorMask: Cardinal); virtual; abstract; |
 | procedure SetEdgePoint(PointSprite, PointScale, EdgeAntialias: Boolean); virtual; abstract; |
 | procedure SetFog(Kind: Cardinal; Color: BaseTypes.TColor; AFogStart, AFogEnd, ADensity: Single); virtual; abstract; |
 | procedure SetLighting(Enable: Boolean; AAmbient: BaseTypes.TColor; SpecularMode: Integer; NormalizeNormals: Boolean); virtual; abstract; |
 | procedure SetLinePattern(ALinePattern: Longword); virtual; abstract; |
 | procedure SetMaterial(const AAmbient, ADiffuse, ASpecular, AEmissive: BaseTypes.TColor4S; APower: Single); virtual; abstract; |
 | procedure SetPointValues(APointSize, AMinPointSize, AMaxPointSize, APointScaleA, APointScaleB, APointScaleC: Single); virtual; abstract; |
 | function SetRenderTarget(const ACamera: TCamera; TextureTarget: Boolean): Boolean; virtual; abstract; |
 | procedure SetShaderConstant(ShaderKind: TShaderKind; ShaderRegister: Integer; const Vector: TShaderRegisterType); overload; |
 | procedure SetShaderConstant(const Constant: TShaderConstant); overload; |
 | procedure SetStencilState(SFailOp, ZFailOp, PassOp, STestFunc: Integer); virtual; abstract; |
 | procedure SetStencilValues(SRef, SMask, SWriteMask: Integer); virtual; abstract; |
 | procedure SetTextureFactor(ATextureFactor: BaseTypes.TColor); virtual; abstract; |
 | procedure SetTextureWrap(const CoordSet: TTWrapCoordSet); virtual; abstract; |
 | procedure SetZBuffer(ZTestFunc, ZBias: Integer; ZWrite: Boolean); virtual; abstract; |
 | function ValidatePass(const Pass: TRenderPass): Boolean; |
Description
Calls an API to create a render target with given parameters. DepthStencil surface will be created if ADepthFormat is other than pfUndefined. Returns True if success.
Calls an API to set a shader constant
Calls an API to set a shader constant. ShaderKind - kind of shader, ShaderRegister - index of 4-component vector register to set, Vector - new value of the register.
Calls an API to validate the specified pass. Returns True if the pass is can be handled by current hardware. Otherwise returns False and fills ResultStr a text representation of the error occured.
Applies current clipping planes
Applies item-specific custom texture matrix of each texture stage of the specified render pass
Applies the specified render pass
Applies texture matrix of each texture stage of the specified render pass
Creates a pixel shader from the resource
Ensures that all parameters are correct and supported and calls APICreateRenderTarget. Returns True if a render target been created.
Creates a vertex shader from the resource with the given vertex declaration
Destroys the specified by index render target
Return a render target for the given camera. If render target does not exists the function creates it.
Handle data change of renderer-related items
Handle removal or replace of some item from scene
Handles some related messages
Returns True if the specified render target is not initialized
Returns True if there is no need to update render target texture associated with Camera
Returns True if the specified shader is not initialized
Resolves a pixel shader for the given pass. Used internally.
Resolves a vertex shader for the given pass. Used internally.
Sets alpha blending mode and alpha test settings
Applies a clipping plane
Sets culling, shading and filling modes as well as color write mask
Sets edge and points settings
Sets fog kind, color, start/end and density
Set lighting settings
Sets line pattern
Sets API-level material (ambient, diffuse, specular and emissive colors and specular power)
Sets points size parameters
Sets current render target to the one associated with Camera. Returns True if actual change was made.
Sets a shader constant. ShaderKind - kind of shader, ShaderRegister - index of 4-component vector register to set, Vector - new value of the register.
Sets a shader constant
Sets stencil state
Sets stencil reference value and masks
Sets texture factor color
Sets texture wrapping mode
Sets Z-buffer related values
Validate the specified pass. Returns True if the pass is valid
|
Last modified: 4 Jul, 2008
Copyright (C) 2006-2008, casteng.com
|