Unit CastleRenderContext

Description

Rendering context state.

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.

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

This item has no description.

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

This item has no description.

Types

TClearBuffer = (...);

This item has no description.

Values
  • cbColor
  • cbDepth
  • cbStencil
TClearBuffers = set of TClearBuffer;

This item has no description.

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
TBufferTarget = (...);

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

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

Constants

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

This item has no description.

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.


Generated by PasDoc 0.16.0-snapshot.