Class TRenderContext
Unit
CastleGLUtils
Declaration
type TRenderContext = class(TObject)
Description
The OpenGL / OpenGLES context state. We try hard to make this a very, very small class, because usually it's better to introduce a clean higher-level API than to track the OpenGL context state in a simple global RenderContext instance.
Use the methods and properties of this class only when this context is current, which means it's set as RenderContext value.
Do not depend on the context state being persistent. The RenderContext is constant during a single TUIControl.OnRender method, and that's all we guarantee. On desktops, you control the context creation / destruction explicitly (by opening / closing the TCastleWindow), but on mobile devices – the context may get destroyed and created at almost any moment.
Hierarchy
Overview
Methods
Properties
Description
Methods
 |
constructor Create; |
|
|
 |
destructor Destroy; override; |
|
|
 |
procedure Clear(const Buffers: TClearBuffers; const ClearColor: TCastleColor); |
|
Clear the whole buffer contents.
Never call OpenGL glClear or glClearColor, always use this method.
|
 |
procedure ScissorEnable(const Rect: TRectangle); |
|
Enable or disable scissor.
Never call OpenGL glScissor or glEnable(GL_SCISSOR_TEST) / glDisable(GL_SCISSOR_TEST) directly, or push/pop the related attrib (in case of fixed-function pipeline).
|
 |
procedure ScissorDisable; |
|
|
Properties
 |
property LineWidth: Single read FLineWidth write SetLineWidth default 1; |
|
The rendered line width. Never call OpenGL glLineWidth directly.
Do not access this property directly, unless you make direct OpenGL/OpenGLES calls. In normal circumstances, engine API (like DrawPrimitive2D or TCastleScene) set this automatically.
|
 |
property PointSize: Single read FPointSize write SetPointSize default 1; |
|
The rendered point size. Never call OpenGL glPointSize directly.
Do not access this property directly, unless you make direct OpenGL/OpenGLES calls. In normal circumstances, engine API (like DrawPrimitive2D or TCastleScene) set this automatically.
|
 |
property GlobalAmbient: TCastleColorRGB read FGlobalAmbient write SetGlobalAmbient; |
|
Global ambient lighting. This is added to every 3D object color, multiplied by material ambient.
The default value is (0.2, 0.2, 0.2). It matches default GL_LIGHT_MODEL_AMBIENT in fixed-function OpenGL. It also matches the required value of VRML 1.0 specification. For VRML 2.0 / X3D, lighting equations suggest that it should be zero.
|
Generated by PasDoc 0.14.0.
|