Pyrogenesis  13997
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | List of all members
OverlayRenderer Class Reference

Class OverlayRenderer: Render various bits of data that overlay the game world (selection circles, health bars, etc). More...

#include <OverlayRenderer.h>

Public Member Functions

 OverlayRenderer ()
 
 ~OverlayRenderer ()
 
void Initialize ()
 Performs one-time initialization. More...
 
void Submit (SOverlayLine *overlay)
 Add a line overlay for rendering in this frame. More...
 
void Submit (SOverlayTexturedLine *overlay)
 Add a textured line overlay for rendering in this frame. More...
 
void Submit (SOverlaySprite *overlay)
 Add a sprite overlay for rendering in this frame. More...
 
void Submit (SOverlayQuad *overlay)
 Add a textured quad overlay for rendering in this frame. More...
 
void PrepareForRendering ()
 Prepare internal data structures for rendering. More...
 
void EndFrame ()
 Reset the list of submitted overlays. More...
 
void RenderOverlaysBeforeWater ()
 Render all the submitted overlays that are embedded in the world (i.e. More...
 
void RenderOverlaysAfterWater ()
 Render all the submitted overlays that are embedded in the world (i.e. More...
 
void RenderForegroundOverlays (const CCamera &viewCamera)
 Render all the submitted overlays that should appear on top of everything in the world. More...
 

Static Public Attributes

static const float OVERLAY_VOFFSET = 0.2f
 Small vertical offset of overlays from terrain to prevent visual glitches. More...
 

Private Member Functions

 NONCOPYABLE (OverlayRenderer)
 
void RenderTexturedOverlayLines ()
 Helper method; renders all overlay lines currently registered in the internals. More...
 
void RenderTexturedOverlayLines (CShaderProgramPtr shader, bool alwaysVisible)
 Helper method; renders those overlay lines currently registered in the internals (i.e. More...
 
void RenderQuadOverlays ()
 Helper method; batch-renders all registered quad overlays, batched by their texture for effiency. More...
 

Private Attributes

OverlayRendererInternalsm
 

Detailed Description

Class OverlayRenderer: Render various bits of data that overlay the game world (selection circles, health bars, etc).

Definition at line 35 of file OverlayRenderer.h.

Constructor & Destructor Documentation

OverlayRenderer::OverlayRenderer ( )

Definition at line 183 of file OverlayRenderer.cpp.

OverlayRenderer::~OverlayRenderer ( )

Definition at line 188 of file OverlayRenderer.cpp.

Member Function Documentation

void OverlayRenderer::EndFrame ( )

Reset the list of submitted overlays.

Definition at line 226 of file OverlayRenderer.cpp.

void OverlayRenderer::Initialize ( )

Performs one-time initialization.

Called by CRenderer::Open after graphics capabilities and the shader path have been determined (notably VBO support).

Definition at line 193 of file OverlayRenderer.cpp.

OverlayRenderer::NONCOPYABLE ( OverlayRenderer  )
private
void OverlayRenderer::PrepareForRendering ( )

Prepare internal data structures for rendering.

Must be called after all Submit calls for a frame, and before any rendering calls.

Definition at line 245 of file OverlayRenderer.cpp.

void OverlayRenderer::RenderForegroundOverlays ( const CCamera viewCamera)

Render all the submitted overlays that should appear on top of everything in the world.

Parameters
viewCameracamera to be used for billboard computations

Definition at line 558 of file OverlayRenderer.cpp.

void OverlayRenderer::RenderOverlaysAfterWater ( )

Render all the submitted overlays that are embedded in the world (i.e.

rendered behind other objects in the normal 3D way) and should be drawn after water (i.e. may be visible on top of the water)

Definition at line 381 of file OverlayRenderer.cpp.

void OverlayRenderer::RenderOverlaysBeforeWater ( )

Render all the submitted overlays that are embedded in the world (i.e.

rendered behind other objects in the normal 3D way) and should be drawn before water (i.e. may be visible under the water)

Definition at line 343 of file OverlayRenderer.cpp.

void OverlayRenderer::RenderQuadOverlays ( )
private

Helper method; batch-renders all registered quad overlays, batched by their texture for effiency.

Definition at line 472 of file OverlayRenderer.cpp.

void OverlayRenderer::RenderTexturedOverlayLines ( )
private

Helper method; renders all overlay lines currently registered in the internals.

Batch- renders textured overlay lines batched according to their visibility status by delegating to RenderTexturedOverlayLines(CShaderProgramPtr, bool).

Definition at line 389 of file OverlayRenderer.cpp.

void OverlayRenderer::RenderTexturedOverlayLines ( CShaderProgramPtr  shader,
bool  alwaysVisible 
)
private

Helper method; renders those overlay lines currently registered in the internals (i.e.

in m->texlines) for which the 'always visible' flag equals alwaysVisible. Used for batch rendering the overlay lines according to their alwaysVisible status, as this requires a separate shader to be used.

Definition at line 457 of file OverlayRenderer.cpp.

void OverlayRenderer::Submit ( SOverlayLine overlay)

Add a line overlay for rendering in this frame.

Parameters
overlayMust be non-null. The pointed-to object must remain valid at least until the end of the frame.

Definition at line 198 of file OverlayRenderer.cpp.

void OverlayRenderer::Submit ( SOverlayTexturedLine overlay)

Add a textured line overlay for rendering in this frame.

Parameters
overlayMust be non-null. The pointed-to object must remain valid at least until the end of the frame.

Definition at line 205 of file OverlayRenderer.cpp.

void OverlayRenderer::Submit ( SOverlaySprite overlay)

Add a sprite overlay for rendering in this frame.

Parameters
overlayMust be non-null. The pointed-to object must remain valid at least until the end of the frame.

Definition at line 216 of file OverlayRenderer.cpp.

void OverlayRenderer::Submit ( SOverlayQuad overlay)

Add a textured quad overlay for rendering in this frame.

Parameters
overlayMust be non-null. The pointed-to object must remain valid at least until the end of the frame.

Definition at line 221 of file OverlayRenderer.cpp.

Member Data Documentation

OverlayRendererInternals* OverlayRenderer::m
private

Definition at line 136 of file OverlayRenderer.h.

const float OverlayRenderer::OVERLAY_VOFFSET = 0.2f
static

Small vertical offset of overlays from terrain to prevent visual glitches.

Definition at line 111 of file OverlayRenderer.h.


The documentation for this class was generated from the following files: