Unit CastleRenderContext

Description

Rendering context state.

Source: base_rendering/castlerendercontext.pas (line 17).

Uses

Overview

Classes, Interfaces, Objects and Records

Name Description
Class TScissor Scissor to clip displayed things, in addition to the global scissor affected by TRenderContext.ScissorEnable / TRenderContext.ScissorDisable.
Record TPolygonOffset  
Class TRenderContext The OpenGL / OpenGLES context state.

Functions and Procedures

function PerspectiveProjection(const fovy, aspect, ZNear, ZFar: Single): TMatrix4;
function OrthoProjection(const Dimensions: TFloatRectangle; const ZNear: Single = -1; const ZFar: Single = 1): TMatrix4;
function FrustumProjection(const Dimensions: TFloatRectangle; const ZNear, ZFar: Single): TMatrix4;

Types

TClearBuffer = (...);
TClearBuffers = set of TClearBuffer;
TDepthFunction = (...);
TBufferTarget = (...);

Constants

BufferTargetGL: array [TBufferTarget] of TGLenum = ( GL_ARRAY_BUFFER, GL_ELEMENT_ARRAY_BUFFER );

Variables

RenderContext: TRenderContext;

Description

Functions and Procedures

function PerspectiveProjection(const fovy, aspect, ZNear, ZFar: Single): TMatrix4;

Calculate projection matrix, and set RenderContext.ProjectionMatrix to given value.

For PerspectiveProjection, ZFar may have special ZFarInfinity value to create a perspective projection with far plane set at infinity. Useful e.g. for z-fail shadow volumes.

Source: base_rendering/castlerendercontext.pas (line 364).

function OrthoProjection(const Dimensions: TFloatRectangle; const ZNear: Single = -1; const ZFar: Single = 1): TMatrix4;

This item has no description.

Source: base_rendering/castlerendercontext.pas (line 365).

function FrustumProjection(const Dimensions: TFloatRectangle; const ZNear, ZFar: Single): TMatrix4;

This item has no description.

Source: base_rendering/castlerendercontext.pas (line 367).

Types

TClearBuffer = (...);

This item has no description.

Values
  • cbColor
  • cbDepth
  • cbStencil

Source: base_rendering/castlerendercontext.pas (line 29).

TClearBuffers = set of TClearBuffer;

This item has no description.

Source: base_rendering/castlerendercontext.pas (line 31).

TDepthFunction = (...);

Possible values of TRenderContext.DepthFunc. Note: For now, the values of this enum correspond to OpenGL(ES) constants, but do not depend on this outside (and it may change in the future). Treat it like opaque enum.

Values
  • dfNever = $0200
  • dfLess = $0201
  • dfEqual = $0202
  • dfLessEqual = $0203
  • dfGreater = $0204
  • dfNotEqual = $0205
  • dfGreaterEqual = $0206
  • dfAlways = $0207

Source: base_rendering/castlerendercontext.pas (line 57).

TBufferTarget = (...);

Target of bound buffer, see https://registry.khronos.org/OpenGL-Refpages/gl4/html/glBindBuffer.xhtml .

Values
  • btArray: Vertex attributes.
  • btElementArray: Indexes.

Source: base_rendering/castlerendercontext.pas (line 74).

Constants

BufferTargetGL: array [TBufferTarget] of TGLenum = ( GL_ARRAY_BUFFER, GL_ELEMENT_ARRAY_BUFFER );

This item has no description.

Source: base_rendering/castlerendercontext.pas (line 371).

Variables

RenderContext: TRenderContext;

Current OpenGL / OpenGLES context state. Only access it during the rendering, i.e. in TCastleUserInterface.Render.

TODO: In the future, this global singleton may be removed, and this may be accessible instead through a new TCastleUserInterface.Render parameter.

Source: base_rendering/castlerendercontext.pas (line 351).


Generated by PasDoc 0.17.0.snapshot.