17 #ifndef INSTANCEDSHADERBASE_H
18 #define INSTANCEDSHADERBASE_H
20 #include "InstancedShader.h"
22 #include "ShaderBase.h"
43 template<
typename TShaderImpl>
62 static ShaderPtr* sSharedShader =
nullptr;
64 sSharedShader =
new ShaderPtr(TShaderImpl::createSharedShader());
66 return *sSharedShader;
77 std::string vertexShaderCode(TShaderImpl::getVertexShaderCode());
78 std::string fragmentShaderCode(TShaderImpl::getFragmentShaderCode());
80 std::vector<std::string> uniformNames(TShaderImpl::getUniformNames());
82 attributeSet, uniformNames));
88 #endif // INSTANCEDSHADERBASE_H
Header declaring and including types common to renderer classes such as Vector2. Also includes GL hea...
Implementation of Shader which compiles itself from shader code.
Definition: ShaderBase.h:37
Shader which has instanced values for uniforms and other GL state.
Definition: InstancedShader.h:46
static ShaderPtr createSharedShader()
The default implementation of createSharedShader().
Definition: InstancedShaderBase.h:76
std::shared_ptr< AttributeSet > AttributeSetPtr
Shared pointer typedef for AttributeSet.
Definition: PointerDeclarations.h:63
std::shared_ptr< Shader > ShaderPtr
Shared pointer typedef for Shader.
Definition: PointerDeclarations.h:143
InstancedShaderBase()
Construct this InstancedShader, creating the shared Shader if necessary.
Definition: InstancedShaderBase.h:49
static const ShaderPtr & getSharedShader()
Returns the shared Shader singleton, creating it if necessary.
Definition: InstancedShaderBase.h:58
Helper class to implement InstancedShader subclasses, by managing a shared Shader.
Definition: InstancedShaderBase.h:44