SuperTuxKart
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
ShaderBase Class Reference

A simple non-templated base class. More...

#include <shader.hpp>

Inherited by Shader< AlphaTestParticleRenderer, tp... >, Shader< BloomBlendShader, tp... >, Shader< BloomShader, tp... >, Shader< ColoredRectShader, core::vector2df, core::vector2df, video::SColor >, Shader< ColoredTextureRectShader, tp... >, Shader< CombineDiffuseColor, tp... >, Shader< ComputeGaussian17TapHShader, tp... >, Shader< ComputeGaussian17TapVShader, tp... >, Shader< ComputeGaussian6HBlurShader, tp... >, Shader< ComputeGaussian6VBlurShader, tp... >, Shader< ComputeShadowBlurHShader, tp... >, Shader< ComputeShadowBlurVShader, tp... >, Shader< DegradedIBLShader, tp... >, Shader< DepthOfFieldShader, tp... >, Shader< FontDrawerShader, tp... >, Shader< Gaussian17TapHShader, tp... >, Shader< Gaussian17TapVShader, tp... >, Shader< Gaussian3HBlurShader, tp... >, Shader< Gaussian3VBlurShader, tp... >, Shader< Gaussian6HBlurShader, tp... >, Shader< Gaussian6VBlurShader, tp... >, Shader< GlowShader, tp... >, Shader< GodFadeShader, tp... >, Shader< GodRayShader, tp... >, Shader< IBLShader, tp... >, Shader< LayerPassThroughShader, int >, Shader< LensBlendShader, tp... >, Shader< LightningShader, tp... >, Shader< LinearizeDepthShader, tp... >, Shader< MLAABlendWeightSHader, tp... >, Shader< MLAAColorEdgeDetectionSHader, tp... >, Shader< MLAAGatherSHader, tp... >, Shader< MotionBlurShader, tp... >, Shader< ParticleRenderer, tp... >, Shader< PassThroughShader, tp... >, Shader< PointLightScatterShader, tp... >, Shader< PointLightShader, tp... >, Shader< Primitive2DList, tp... >, Shader< SSAOShader, tp... >, Shader< ColoredLine, irr::video::SColor >, Shader< ShadowedSunLightShaderPCF, tp... >, Shader< SkyboxShader, tp... >, Shader< SpecularIBLGenerator, tp... >, Shader< SunLightShader, tp... >, Shader< TBRenderer, tp... >, Shader< TextureRectShader, tp... >, Shader< C, tp... >, Shader< ToneMapShader, tp... >, Shader< UniformColoredTextureRectShader, tp... >, Shader< ViewFrustrumShader, video::SColor, int >, and Shader< T, Args >.

Public Member Functions

 ShaderBase ()
 Constructor, which adds the shader to all instantiated shaders (for the reload-all-shaders debug option).
 
int loadTFBProgram (const std::string &vertex_file_path, const char **varyings, unsigned varyingscount)
 Loads a transform feedback buffer shader with a given number of varying parameters.
 
GLuint createVAO ()
 
void use ()
 Activates the shader calling glUseProgram.
 
GLuint getUniformLocation (const char *name)
 

Static Public Member Functions

static void killShaders ()
 

Protected Types

enum  AttributeType { OBJECT , PARTICLES_SIM , PARTICLES_RENDERING , SKINNED_MESH }
 

Protected Member Functions

template<typename ... Types>
void loadAndAttachShader ()
 Ends recursion.
 
template<typename ... Types>
void loadAndAttachShader (GLint shader_type, const std::string &name, Types ... args)
 
template<typename ... Types>
void loadAndAttachShader (GLint shader_type, const char *name, Types ... args)
 Convenience interface using const char.
 

Protected Attributes

GLuint m_program
 OpenGL's program id.
 
std::vector< std::shared_ptr< GLuint > > m_shaders
 

Static Protected Attributes

static std::vector< void(*)()> m_all_kill_functions
 Maintains a list of all shaders.
 

Detailed Description

A simple non-templated base class.

It is used to store some enums used in templates, the actual header for a shader, and a statis list of all kill functions (which delete all singletons, and therefore forces a reload of all shaders). It has some conventient templated functions to load a set of shaders.


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