SuperTuxKart
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>

Inheritance diagram for ShaderBase:
Inheritance graph
[legend]

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: