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 ()=default
 
virtual ~C4FoWDrawStrategy ()=default
 
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 P_None
 

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 68 of file C4FoWDrawStrategy.h.

Member Enumeration Documentation

Enumerator
P_None 
P_Fan 
P_FanMaxed 
P_Fade 
P_Intermediate 

Definition at line 75 of file C4FoWDrawStrategy.h.

Constructor & Destructor Documentation

C4FoWDrawStrategy::C4FoWDrawStrategy ( )
default
virtual C4FoWDrawStrategy::~C4FoWDrawStrategy ( )
virtualdefault

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 102 of file C4FoWDrawStrategy.h.

References P_Fade, C4FoWDrawTriangulator::Quads(), and 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 92 of file C4FoWDrawStrategy.h.

References C4FoWDrawTriangulator::Fan(), P_Fan, and 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 97 of file C4FoWDrawStrategy.h.

References P_FanMaxed, C4FoWDrawTriangulator::Quads(), and 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 107 of file C4FoWDrawStrategy.h.

References C4FoWDrawTriangulator::Fan(), P_Intermediate, 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 89 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 88 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 86 of file C4FoWDrawStrategy.h.

References C4FoWDrawTriangulator::Reset(), and triangulator.

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

86 { 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 104 of file C4FoWDrawStrategy.h.

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

Called after rendering the inner triangle fan

Definition at line 94 of file C4FoWDrawStrategy.h.

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

Called after rendering the inner triangle fan

Definition at line 99 of file C4FoWDrawStrategy.h.

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

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

Definition at line 109 of file C4FoWDrawStrategy.h.

109 { };

Member Data Documentation


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