SuperTuxKart
Loading...
Searching...
No Matches
Public Member Functions | Static Public Attributes | Private Attributes | List of all members
SP::SPShader Class Reference
Inheritance diagram for SP::SPShader:
Inheritance graph
[legend]

Public Member Functions

 SPShader (const std::string &name, const std::function< void(SPShader *)> &init_func, bool transparent_shader=false, int drawing_priority=0, bool use_alpha_channel=false, bool use_tangents=false, const std::array< bool, 6 > &srgb={{ true, true, false, false, false, false }})
 
bool hasShader (RenderPass rp)
 
GLuint getShaderProgram (RenderPass rp)
 
void use (RenderPass rp=RP_1ST)
 
void unuse (RenderPass rp=RP_1ST)
 
void addShaderFile (const std::string &name, GLint shader_type, RenderPass rp=RP_1ST)
 
void linkShaderFiles (RenderPass rp=RP_1ST)
 
void addAllTextures (RenderPass rp=RP_1ST)
 
void addAllUniforms (RenderPass rp=RP_1ST)
 
void addCustomPrefilledTextures (SamplerType st, GLuint texture_type, const std::string &name, std::function< GLuint()> func, RenderPass rp=RP_1ST)
 
void bindPrefilledTextures (RenderPass rp=RP_1ST) const
 
void bindTextures (const std::array< GLuint, 6 > &tex, RenderPass rp=RP_1ST) const
 
void addBasicUniforms (RenderPass rp=RP_1ST)
 
const std::string & getName () const
 
SPUniformAssignergetUniformAssigner (const std::string &name, RenderPass rp=RP_1ST) const
 
void setUniformsPerObject (SPPerObjectUniform *sppou, std::vector< SPUniformAssigner * > *ua_used, RenderPass rp=RP_1ST)
 
void setUseFunction (std::function< void()> func, RenderPass rp=RP_1ST)
 
void setUnuseFunction (std::function< void()> func, RenderPass rp=RP_1ST)
 
bool isTransparent () const
 
bool useAlphaChannel () const
 
int getDrawingPriority () const
 
bool samplerLess (RenderPass rp=RP_1ST) const
 
void unload ()
 
void init ()
 
bool isSrgbForTextureLayer (unsigned layer) const
 
bool useTangents () const
 
bool hasTextureLayer (unsigned layer)
 
- Public Member Functions inherited from SP::SPPerObjectUniform
void addAssignerFunction (const std::string &name, std::function< void(SPUniformAssigner *)> func)
 
void removeAssignerFunction (const std::string &name)
 
bool hasUniform (const std::string &name) const
 
bool assignUniform (const std::string &name, SPUniformAssigner *ua) const
 
bool isEmpty () const
 

Static Public Attributes

static bool m_sp_shader_debug = false
 
static std::map< std::string, std::pair< unsigned, SamplerType > > m_prefilled_names
 

Private Attributes

std::string m_name
 
std::vector< std::shared_ptr< GLuint > > m_shader_files
 
GLuint m_program [RP_COUNT]
 
std::map< unsigned, unsigned > m_samplers [RP_COUNT]
 
std::vector< std::tuple< unsigned, std::string, SamplerType, GLuint > > m_prefilled_samplers [RP_COUNT]
 
std::unordered_map< std::string, SPUniformAssigner * > m_uniforms [RP_COUNT]
 
std::unordered_map< std::string, std::function< GLuint()> > m_custom_prefilled_getter [RP_COUNT]
 
std::function< void()> m_use_function [RP_COUNT]
 
std::function< void()> m_unuse_function [RP_COUNT]
 
const std::function< void(SPShader *)> m_init_function
 
const int m_drawing_priority
 
const bool m_transparent_shader
 
const bool m_use_alpha_channel
 
const bool m_use_tangents
 
const std::array< bool, 6 > m_srgb
 

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