Workspace 6.21.5
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | List of all members
TypedShaderImplementation< S, R, Derived > Class Template Reference

Templated base-class for shader implementations that are specific to a particular renderer type and specific to a single shader type. Uses the curiously recurring template pattern to manage the factories associated with the derived implementation class.

#include <Rendering/SceneComponents/Shaders/typedshaderimplementation.h>

Inheritance diagram for TypedShaderImplementation< S, R, Derived >:
[legend]

Public Types

using renderer_type = R
 
typedef S shader_type
 

Public Member Functions

 TypedShaderImplementation (S &shader)
 
virtual ~TypedShaderImplementation ()=default
 
const ShaderImplementationFactorygetFactory () const override
 
virtual const SceneRendererTypeIdgetSceneRendererType () const
 
- Public Member Functions inherited from ShaderImplementation
virtual ~ShaderImplementation ()=default
 
virtual bool activate (SceneRenderer &renderer)=0
 Activates the shader on the target renderer. Subclasses must override this function with an implementation to contains the renderer-specific activation code they need.
 
virtual bool deactivate (SceneRenderer &renderer)=0
 Dectivates the shader on the target renderer. Subclasses must override this function with an implementation to contains the renderer-specific activation code they need.
 
virtual const ShaderImplementationFactorygetFactory () const =0
 
virtual bool renderCurrentModel (SceneRenderer &renderer)=0
 Using the target renderer, render the current model.
 
virtual bool renderCurrentModelGlyphs (SceneRenderer &renderer)=0
 Using the target renderer, render the current model's glyphs.
 

Static Public Member Functions

static void registerImplementation ()
 

Protected Member Functions

S & getShader ()
 
const S & getShader () const
 
- Protected Member Functions inherited from ShaderImplementation
 ShaderImplementation ()=default
 

Static Protected Member Functions

static R & getTypedRenderer (SceneRenderer &renderer)
 

Member Typedef Documentation

◆ renderer_type

using renderer_type = R

◆ shader_type

typedef S shader_type

Constructor & Destructor Documentation

◆ TypedShaderImplementation()

TypedShaderImplementation ( S &  shader)
inline

◆ ~TypedShaderImplementation()

virtual ~TypedShaderImplementation ( )
virtualdefault

Member Function Documentation

◆ getFactory()

const ShaderImplementationFactory & getFactory ( ) const
inlineoverridevirtual
Returns
The factory associated with the ShaderImplementation.

Implements ShaderImplementation.

◆ getSceneRendererType()

virtual const SceneRendererTypeId & getSceneRendererType ( ) const
inlinevirtual
Returns
The renderer type associated with the ShaderImplementation.

◆ getShader() [1/2]

S & getShader ( )
inlineprotected

◆ getShader() [2/2]

const S & getShader ( ) const
inlineprotected

◆ getTypedRenderer()

static R & getTypedRenderer ( SceneRenderer renderer)
inlinestaticprotected
Returns
The renderer, but cast to the specific type associated with this implementation

◆ registerImplementation()

static void registerImplementation ( )
inlinestatic

Registers the shader implementation type with its parent shader type so that it can be used during rendering if needed.