Castle Game Engine: CastleRenderer: Class TGLRenderer

# Class TGLRenderer
Description | Hierarchy | Fields | Methods | Properties
## Unit CastleRenderer ## Declaration `type TGLRenderer = class(TObject)` ## Description ## Hierarchy TObject TGLRenderer ## Overview ### Fields
| `PrepareRenderShape: Cardinal;`
### Methods
| `constructor Create(AttributesClass: TRenderingAttributesClass; ACache: TGLRendererContextCache);`
| `destructor Destroy; override;`
| `procedure Prepare(State: TX3DGraphTraverseState);`
| `procedure UnprepareTexture(Node: TAbstractTextureNode);`
| `procedure UnprepareAll;`
| `procedure RenderBegin(ABaseLights: TLightInstancesList; LightRenderEvent: TVRMLLightRenderEvent; const APass: TRenderingPass);`
| `procedure RenderEnd;`
| `procedure RenderShape(Shape: TX3DRendererShape; Fog: IAbstractFogObject);`
| `procedure UpdateGeneratedTextures(Shape: TShape; TextureNode: TAbstractTextureNode; const Render: TRenderFromViewFunction; const ProjectionNear, ProjectionFar: Single; var NeedsRestoreViewport: boolean; CurrentViewpoint: TAbstractViewpointNode; CameraViewKnown: boolean; const CameraPosition, CameraDirection, CameraUp: TVector3Single);`
| `procedure PrepareScreenEffect(Node: TScreenEffectNode);`
### Properties
| `property Attributes: TRenderingAttributes read FAttributes;`
| `property Cache: TGLRendererContextCache read FCache;`
## Description ### Fields
| `PrepareRenderShape: Cardinal;`
If > 0, RenderShape will not actually render, only prepare per-shape resources for fast rendering (arrays and vbos).
### Methods
| `constructor Create(AttributesClass: TRenderingAttributesClass; ACache: TGLRendererContextCache);`
Constructor. Always pass a cache instance — preferably, something created and used by many scenes.
| `destructor Destroy; override;`
| `procedure Prepare(State: TX3DGraphTraverseState);`
Prepare given State, to be able to render shapes with it. Between preparing and unpreparing, nodes passed here are "frozen": do not change, do not free them.
| `procedure UnprepareTexture(Node: TAbstractTextureNode);`
Release resources for this texture.
| `procedure UnprepareAll;`
Release every OpenGL and VRML resource. That is release any knowledge connecting us to the current OpenGL context and any knowledge about your prepared VRML nodes, states etc. Calling `UnprepareAll` is valid (and ignored) call if everything is already released. Destructor callls `UnprepareAll` automatically. So be sure to either call `UnprepareAll` or destroy this renderer when your OpenGL context is still active.
| `procedure RenderBegin(ABaseLights: TLightInstancesList; LightRenderEvent: TVRMLLightRenderEvent; const APass: TRenderingPass);`
| `procedure RenderEnd;`
| `procedure RenderShape(Shape: TX3DRendererShape; Fog: IAbstractFogObject);`
| `procedure UpdateGeneratedTextures(Shape: TShape; TextureNode: TAbstractTextureNode; const Render: TRenderFromViewFunction; const ProjectionNear, ProjectionFar: Single; var NeedsRestoreViewport: boolean; CurrentViewpoint: TAbstractViewpointNode; CameraViewKnown: boolean; const CameraPosition, CameraDirection, CameraUp: TVector3Single);`
Update generated texture for this shape. NeedsRestoreViewport will be set to `True` if viewport was (possibly) changed by this procedure (otherwise, NeedsRestoreViewport will not be modified).
| `procedure PrepareScreenEffect(Node: TScreenEffectNode);`
Load GLSL shader for the ScreenEffect node. Makes sure that Node.ShaderLoaded is true. When changing Node.ShaderLoaded false to true tries to initialize the shader, setting Node.Shader if some GLSL program was successfully loaded. The GLSL program (TGLSLProgram) will be stored here, and will be automatically freed during UnprepareAll call.
### Properties
| `property Attributes: TRenderingAttributes read FAttributes;`
Rendering attributes. You can change them only when renderer is not tied to the current OpenGL context, so only after construction or after UnprepareAll call (before any Prepare or Render* calls).
| `property Cache: TGLRendererContextCache read FCache;`
Generated by PasDoc 0.13.0 on 2013-08-17 21:27:13