Castle Game Engine: CastleRenderer: Class TGLRendererContextCache

# Class TGLRendererContextCache
Description | Hierarchy | Fields | Methods | Properties
## Unit CastleRenderer ## Declaration `type TGLRendererContextCache = class(TObject)` ## Description Cache used by TGLRenderer instances to share OpenGL resources, like textures. This may save a lot of OpenGL memory when you use multiple renderers (for example, multiple TCastleScene instances). The cache can only be shared by renderers in the same OpenGL context, or in shared OpenGL contexts. It cannot be reused in totally alien OpenGL contexts, as the OpenGL identifiers will simply not exist there. In practice, this should not be a problem, as our OpenGL contexts always share resources, and you will almost always just use a single instance of this cache inside GLContextCache. ## Hierarchy TObject TGLRendererContextCache ## Overview ### Methods
| `constructor Create;`
| `destructor Destroy; override;`
| `function Shape_IncReference(Shape: TX3DRendererShape; Fog: IAbstractFogObject; ARenderer: TGLRenderer): TShapeCache;`
| `procedure Shape_DecReference(var ShapeCache: TShapeCache);`
| `function Program_IncReference(ARenderer: TGLRenderer; Shader: TShader; const ShapeNiceName: string): TShaderProgramCache;`
| `procedure Program_DecReference(var ProgramCache: TShaderProgramCache);`
## Description ### Methods
| `constructor Create;`
| `destructor Destroy; override;`
| `function Shape_IncReference(Shape: TX3DRendererShape; Fog: IAbstractFogObject; ARenderer: TGLRenderer): TShapeCache;`
Shape cache. We return TShapeCache, either taking an existing instance from cache or creating and adding a new one. Caller is responsible for checking are Arrays / Vbo zero and eventually initializing and setting.
| `procedure Shape_DecReference(var ShapeCache: TShapeCache);`
| `function Program_IncReference(ARenderer: TGLRenderer; Shader: TShader; const ShapeNiceName: string): TShaderProgramCache;`
Shader program cache. We return TShaderProgramCache, either taking an existing instance from cache or creating and adding a new one. If we create a new one, we will use Shader to initialize program hash and to create and link actual TX3DGLSLProgram instance.
| `procedure Program_DecReference(var ProgramCache: TShaderProgramCache);`
Generated by PasDoc 0.13.0 on 2015-06-15 04:43:11