Class TGLRendererContextCache

DescriptionHierarchyFieldsMethodsProperties

Unit

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

Public constructor Create;
Public destructor Destroy; override;
Public function Shape_IncReference(Shape: TX3DRendererShape; Fog: IAbstractFogObject; ARenderer: TGLRenderer): TShapeCache;
Public procedure Shape_DecReference(var ShapeCache: TShapeCache);
Public function Program_IncReference(ARenderer: TGLRenderer; Shader: TShader; const ShapeNiceName: string): TShaderProgramCache;
Public procedure Program_DecReference(var ProgramCache: TShaderProgramCache);

Description

Methods

Public constructor Create;
 
Public destructor Destroy; override;
 
Public 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.

Public procedure Shape_DecReference(var ShapeCache: TShapeCache);
 
Public 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.

Public procedure Program_DecReference(var ProgramCache: TShaderProgramCache);
 

Generated by PasDoc 0.14.0.