OpenClonk
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
C4FoWDrawStrategy Class Referenceabstract

#include <C4FoWDrawStrategy.h>

Inheritance diagram for C4FoWDrawStrategy:
[legend]
Collaboration diagram for C4FoWDrawStrategy:
[legend]

Public Types

enum  DrawPhase {
  P_None, P_Fan, P_FanMaxed, P_Fade,
  P_Intermediate
}
 

Public Member Functions

 C4FoWDrawStrategy ()
 
virtual ~C4FoWDrawStrategy ()
 
virtual void Begin (const C4FoWRegion *region)=0
 
virtual void End (C4ShaderCall &call)
 
virtual void DrawLightVertex (float x, float y)
 
virtual void DrawDarkVertex (float x, float y)
 
virtual void BeginFan ()
 
virtual void EndFan ()
 
virtual void BeginFanMaxed ()
 
virtual void EndFanMaxed ()
 
virtual void BeginFade ()
 
virtual void EndFade ()
 
virtual void BeginIntermediateFade ()
 
virtual void EndIntermediateFade ()
 

Public Attributes

enum C4FoWDrawStrategy::DrawPhase phase
 

Protected Attributes

C4FoWDrawTriangulator triangulator
 

Detailed Description

A C4FoWDrawStrategy is a connector to OpenGL calls used to draw the light. C4FoWLight tells this class which part of the light should be drawn now and subsequently pushes the vertices with the information whether a vertex is light or dark.

This class is an abstract base class, it is up to the implementing classes to actually draw anything here.

Definition at line 69 of file C4FoWDrawStrategy.h.

Member Enumeration Documentation

Enumerator
P_None 
P_Fan 
P_FanMaxed 
P_Fade 
P_Intermediate 

Definition at line 76 of file C4FoWDrawStrategy.h.

Constructor & Destructor Documentation

C4FoWDrawStrategy::C4FoWDrawStrategy ( )
inline

Definition at line 72 of file C4FoWDrawStrategy.h.

72 : phase(P_None) {}
enum C4FoWDrawStrategy::DrawPhase phase
virtual C4FoWDrawStrategy::~C4FoWDrawStrategy ( )
inlinevirtual

Definition at line 73 of file C4FoWDrawStrategy.h.

73 {}

Member Function Documentation

virtual void C4FoWDrawStrategy::Begin ( const C4FoWRegion region)
pure virtual

Called before each rendering pass

Implemented in C4FoWDrawWireframeStrategy, and C4FoWDrawLightTextureStrategy.

virtual void C4FoWDrawStrategy::BeginFade ( )
inlinevirtual

Called before rendering the quads in which the light fades out

Definition at line 103 of file C4FoWDrawStrategy.h.

References P_Fade, phase, C4FoWDrawTriangulator::Quads(), and triangulator.

103 { triangulator.Quads(); phase = P_Fade; };
enum C4FoWDrawStrategy::DrawPhase phase
C4FoWDrawTriangulator triangulator

Here is the call graph for this function:

virtual void C4FoWDrawStrategy::BeginFan ( )
inlinevirtual

Called before rendering the inner triangle fan (the area with 100% light)

Definition at line 93 of file C4FoWDrawStrategy.h.

References C4FoWDrawTriangulator::Fan(), P_Fan, phase, and triangulator.

93 { triangulator.Fan(); phase = P_Fan; };
enum C4FoWDrawStrategy::DrawPhase phase
C4FoWDrawTriangulator triangulator

Here is the call graph for this function:

virtual void C4FoWDrawStrategy::BeginFanMaxed ( )
inlinevirtual

Called before rendering the triangle fan existnsion (100% light, maxed out normals)

Definition at line 98 of file C4FoWDrawStrategy.h.

References P_FanMaxed, phase, C4FoWDrawTriangulator::Quads(), and triangulator.

enum C4FoWDrawStrategy::DrawPhase phase
C4FoWDrawTriangulator triangulator

Here is the call graph for this function:

virtual void C4FoWDrawStrategy::BeginIntermediateFade ( )
inlinevirtual

Called before rendering the triangles that fill the space between the fadeout quads

Definition at line 108 of file C4FoWDrawStrategy.h.

References C4FoWDrawTriangulator::Fan(), P_Intermediate, phase, and triangulator.

Here is the call graph for this function:

virtual void C4FoWDrawStrategy::DrawDarkVertex ( float  x,
float  y 
)
inlinevirtual

Reimplemented in C4FoWDrawWireframeStrategy, and C4FoWDrawLightTextureStrategy.

Definition at line 90 of file C4FoWDrawStrategy.h.

References C4FoWDrawTriangulator::AddVertex(), and triangulator.

Referenced by C4FoWDrawLightTextureStrategy::DrawDarkVertex(), and C4FoWDrawWireframeStrategy::DrawDarkVertex().

C4FoWDrawTriangulator triangulator

Here is the call graph for this function:

Here is the caller graph for this function:

virtual void C4FoWDrawStrategy::DrawLightVertex ( float  x,
float  y 
)
inlinevirtual

Reimplemented in C4FoWDrawWireframeStrategy, and C4FoWDrawLightTextureStrategy.

Definition at line 89 of file C4FoWDrawStrategy.h.

References C4FoWDrawTriangulator::AddVertex(), and triangulator.

Referenced by C4FoWDrawLightTextureStrategy::DrawLightVertex(), and C4FoWDrawWireframeStrategy::DrawLightVertex().

C4FoWDrawTriangulator triangulator

Here is the call graph for this function:

Here is the caller graph for this function:

virtual void C4FoWDrawStrategy::End ( C4ShaderCall call)
inlinevirtual

Called after each rendering pass

Reimplemented in C4FoWDrawWireframeStrategy, and C4FoWDrawLightTextureStrategy.

Definition at line 87 of file C4FoWDrawStrategy.h.

References C4FoWDrawTriangulator::Reset(), and triangulator.

Referenced by C4FoWDrawLightTextureStrategy::End(), and C4FoWDrawWireframeStrategy::End().

87 { triangulator.Reset(); }
C4FoWDrawTriangulator triangulator

Here is the call graph for this function:

Here is the caller graph for this function:

virtual void C4FoWDrawStrategy::EndFade ( )
inlinevirtual

Called after rendering the quads in which the light fades out

Definition at line 105 of file C4FoWDrawStrategy.h.

105 { };
virtual void C4FoWDrawStrategy::EndFan ( )
inlinevirtual

Called after rendering the inner triangle fan

Definition at line 95 of file C4FoWDrawStrategy.h.

95 { };
virtual void C4FoWDrawStrategy::EndFanMaxed ( )
inlinevirtual

Called after rendering the inner triangle fan

Definition at line 100 of file C4FoWDrawStrategy.h.

100 { };
virtual void C4FoWDrawStrategy::EndIntermediateFade ( )
inlinevirtual

Called after rendering the triangles that fill the space between the fadeout quads

Definition at line 110 of file C4FoWDrawStrategy.h.

110 { };

Member Data Documentation


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