Class TRenderContext
Unit
Declaration
type TRenderContext = class(TComponent)
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 does not change during a single TCastleUserInterface.OnRender method (with all 2D and 3D stuff rendered inside), but 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. So do not use the instance of RenderContext to store anything you rely on being stored. Instead, use your own variables for this, and only synchronize RenderContext with your variables.
Source: base_rendering/castlerendercontext.pas (line 101).
Hierarchy
- TObject
- TPersistent
- TComponent
- TRenderContext
Generated by PasDoc 0.17.0.snapshot.