CAST II Game Engine |
||||||||
![]() |
MAIN | FEATURES | SCREENSHOTS | FORUMS | MANUAL | DOWNLOADS | CONTACTS | |
(C) 2006 George "Mirage" Bakhtadze. www.casteng.com
The source code may be used under either MPL 1.1 or LGPL 2.1 license. See included license.txt file
Unit contains API-independent basic renderer classes
| Name | Description |
|---|---|
Class TAPIBuffers | |
Class TAPIStateWrapper | |
Class TBuffers | |
Class TRenderer | Renderer class |
Class TTextures |
TAppRequirements = record Flags: set of TAppRequirementsFlag; MinYResolution: Cardinal; HWAccelerationLevel: THWAccelLevel; TotalBackBuffers: Cardinal; end; |
TBuffer = record Index, Size: Integer; Position: Integer; ResetCounter: Integer; end; |
TGammaRamp = record R, G, B: array[0..255] of Word; end; |
TLockedRectData = record Data: Pointer; Pitch: Integer; end; |
TRenderTarget = record ColorBuffer, DepthBuffer, ColorTexture, DepthTexture: Pointer; ColorFormat, DepthFormat, ActualColorFormat, ActualDepthFormat: Integer; Width, Height: Integer; LastUpdateFrame, LastUseFrame: Integer; IsDepthTexture: Boolean; end; |
TRenderTargets = array of TRenderTarget; |
TShader = record Shader: Integer; LastUseFrame: Integer; Resource: TShaderResource; end; |
TShaders = array of TShader; |
TTexture = record Texture: Pointer; Format : Cardinal; Options: TTextureOptions; Width, Height, Depth, Levels: Integer; LastUseFrame: Integer; Resource: TImageResource; end; |
TTextureArray = array of TTexture; |
TTextureOptions = set of TTextureOptionFlag; |
TVideoMode = packed record Width, Height: Integer; RefreshRate : Integer; Format : Integer; end; |
TVideoModes = array of TVideoMode; |
TViewPort = packed record X, Y, Width, Height: Longword; MinZ, MaxZ: Single; end; |
TAppRequirements = record Flags: set of TAppRequirementsFlag; MinYResolution: Cardinal; HWAccelerationLevel: THWAccelLevel; TotalBackBuffers: Cardinal; end; |
Application requirements record. These values can be changed before renderer initialization to change its behaviour.
Flags - [arUseStencil, arUseZBuffer] by default.
MinYResolution - minimal vertical resolution of modes to iclude in available video modes list. 480 by default.
HWAccelerationLevel - level of hardware acceleration required. haMixedVP by default.
TotalBackBuffers - number of back buffers required. 1 by default.
TBuffer = record Index, Size: Integer; Position: Integer; ResetCounter: Integer; end; |
API-independent buffer structure
TGammaRamp = record R, G, B: array[0..255] of Word; end; |
Gamma ramp
TLockedRectData = record Data: Pointer; Pitch: Integer; end; |
Data structure used to represent a locked rectangular area of some data Data - pointer to actual data Pitch - offset in bytes between two rows of data
Render target
TRenderTargets = array of TRenderTarget; |
TShader = record Shader: Integer; LastUseFrame: Integer; Resource: TShaderResource; end; |
Shader
TShaders = array of TShader; |
TTexture = record Texture: Pointer; Format : Cardinal; Options: TTextureOptions; Width, Height, Depth, Levels: Integer; LastUseFrame: Integer; Resource: TImageResource; end; |
Texture
TTextureArray = array of TTexture; |
TTextureOptions = set of TTextureOptionFlag; |
Texture option set
TVideoMode = packed record Width, Height: Integer; RefreshRate : Integer; Format : Integer; end; |
Video mode data structure.
Width, Height - horizontal and vertical resolution.
RefreshRate - refresh rate.
Format - pixel format.
TVideoModes = array of TVideoMode; |
Array of video modes
TViewPort = packed record X, Y, Width, Height: Longword; MinZ, MaxZ: Single; end; |
Viewport
TAppRequirementsFlag | ||
arUseStencil | Use stencil buffering | |
arUseZBuffer | Use Z-buffering | |
arForceVSync | Forces vertcial syncronization on | |
arForceNoVSync | Forces vertcial syncronization off | |
arMultithreadedRender | Tells API that it will be used from several threads | |
arPreserveFPU | Tells API to not change FPU state within its routines | |
arModesUseRefresh | Includes modes with all refresh rates in available video modes list | |
arPreserveBackBuffer | Tells API that backbuffer contents should not be changed or discarded between frames. May be slow on some configurations. | |
arLockableBackBuffer | Tells API that backbuffer should be lockable | |
THWAccelLevel | ||
| Hardware acceleration level (DirectX only) | ||
haSoftwareVP | Software vertex processing | |
haMixedVP | Mixed vertex processing | |
haHardwareVP | Hardware vertex processing | |
haPureDevice | Pure device | |
TRendererError | ||
| Renderer errors enumeration type | ||
reNone | No error | |
reTooManyStages | Number of texture stages in a pass exceeding renderer capabilities (see MaxTextureStages) | |
reTooManyTextures | Number of textures used in a pass exceeding renderer capabilities (see MaxTexturesPerPass) | |
reVertexShaderAssembleFail | Vertex shader compilation failed | |
reVertexShaderCreateFail | Vertex shader creation failed | |
rePixelShaderAssembleFail | Pixel shader compilation failed | |
rePixelShaderCreateFail | Pixel shader creation failed | |
reNoDepthTextures | Depth textures unsupported | |
TRendererState | ||
| Renderer states | ||
rsOK | Renderer is ready | |
rsNotReady | Renderer is in process of initialization | |
rsLost | Renderer has lost device and will try to restore it (DirectX-specific) | |
rsNotInitialized | Renderer has not been initialized | |
TTextureOptionFlag | ||
| Texture option flags | ||
toImmediateLoad | Texture should be immediately loaded | |
toNonAPIManaged | Texture is not managed by an API [b](currently unsupported)[/b] | |
toCubeMap | Texture is a cube map [b](currently unsupported)[/b] | |
toProcedural | Texture is procedurally generated at runtime | |
IndicesSize = 2; |
MaxVertexBuffers = 64; |
OffScreenX = -10000; |
OffScreenY = -10000; |
IndicesSize = 2; |
Size of indices
MaxVertexBuffers = 64; |
Maximum number of vertex buffer with different vertex sizes
OffScreenX = -10000; |
max X coordinate of window to consider it off-screen
OffScreenY = -10000; |
max Y coordinate of window to consider it off-screen
|
Last modified: Jan 6, 2010 |