CAST II Game Engine |
|||||||||||||||
![]() |
DESCRIPTION | ![]() |
FEATURES | ![]() |
SCREENSHOTS | ![]() |
FORUMS | ![]() |
DOCUMENTATION | ![]() |
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; 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 | |
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; |
reNone = 0; |
rePixelShaderAssembleFail = 5; |
rePixelShaderCreateFail = 6; |
reTooManyStages = 1; |
reTooManyTextures = 2; |
reVertexShaderAssembleFail = 3; |
reVertexShaderCreateFail = 4; |
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
reNone = 0; |
No error
rePixelShaderAssembleFail = 5; |
Pixel shader compilation failed
rePixelShaderCreateFail = 6; |
Pixel shader creation failed
reTooManyStages = 1; |
Number of texture stages in a pass exceeding renderer capabilities (see MaxTextureStages)
reTooManyTextures = 2; |
Number of textures used in a pass exceeding renderer capabilities (see MaxTexturesPerPass)
reVertexShaderAssembleFail = 3; |
Vertex shader compilation failed
reVertexShaderCreateFail = 4; |
Vertex shader creation failed
|
Last modified: 4 Jul, 2008 |