OpenClonk
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

◆ DrawPhase

Enumerator
P_None 
P_Fan 
P_FanMaxed 
P_Fade 
P_Intermediate 

Definition at line 75 of file C4FoWDrawStrategy.h.

75  {
76  P_None,
77  P_Fan,
78  P_FanMaxed,
79  P_Fade,
81  } phase{P_None};
enum C4FoWDrawStrategy::DrawPhase P_None

Constructor & Destructor Documentation

◆ C4FoWDrawStrategy()

C4FoWDrawStrategy::C4FoWDrawStrategy ( )
default

◆ ~C4FoWDrawStrategy()

virtual C4FoWDrawStrategy::~C4FoWDrawStrategy ( )
virtualdefault

Member Function Documentation

◆ Begin()

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

Called before each rendering pass

Implemented in C4FoWDrawWireframeStrategy, and C4FoWDrawLightTextureStrategy.

◆ BeginFade()

virtual void C4FoWDrawStrategy::BeginFade ( )
inlinevirtual

Called before rendering the quads in which the light fades out

Definition at line 102 of file C4FoWDrawStrategy.h.

102 { triangulator.Quads(); phase = P_Fade; };
C4FoWDrawTriangulator triangulator

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

Here is the call graph for this function:

◆ BeginFan()

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.

92 { triangulator.Fan(); phase = P_Fan; };

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

Here is the call graph for this function:

◆ BeginFanMaxed()

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.

97 { triangulator.Quads(); phase = P_FanMaxed; };

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

Here is the call graph for this function:

◆ BeginIntermediateFade()

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.

107 { triangulator.Fan(); phase = P_Intermediate; };

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

Here is the call graph for this function:

◆ DrawDarkVertex()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DrawLightVertex()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ End()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ EndFade()

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 { };

◆ EndFan()

virtual void C4FoWDrawStrategy::EndFan ( )
inlinevirtual

Called after rendering the inner triangle fan

Definition at line 94 of file C4FoWDrawStrategy.h.

94 { };

◆ EndFanMaxed()

virtual void C4FoWDrawStrategy::EndFanMaxed ( )
inlinevirtual

Called after rendering the inner triangle fan

Definition at line 99 of file C4FoWDrawStrategy.h.

99 { };

◆ EndIntermediateFade()

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

◆ P_None

◆ triangulator


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