27 std::vector<Shader *> _shaders;
30 std::map<std::string, int> _samplerLocations;
33 enum class Policy { Strict, Relaxed };
66 template<
typename T>
bool SetUniform(
const std::string &name,
const T &value)
const;
69 void SetUniform(
int location,
const glm::vec2 &value)
const;
70 void SetUniform(
int location,
const glm::vec3 &value)
const;
71 void SetUniform(
int location,
const glm::vec4 &value)
const;
72 void SetUniform(
int location,
const glm::mat4 &value)
const;
73 void SetUniform(
int location,
const glm::ivec2 &value)
const;
74 void SetUniform(
int location,
const glm::ivec3 &value)
const;
75 void SetUniform(
int location,
const std::vector<float> &value)
const;
77 template<
typename T>
void SetUniformArray(
const std::string &name,
int count,
const T *values)
const;
90 template<
typename T>
bool SetSampler(
const std::string &name,
const T &texture)
const;
Resource management class for shaders.
Provides a C++ interface to the OpenGL shader program construct.
static const char * GLTypeToString(const unsigned int type)
void SetUniform(int location, const glm::mat4 &value) const
void SetUniform(int location, const glm::vec2 &value) const
void SetUniform(int location, const glm::vec3 &value) const
void SetUniform(int location, const float &value) const
void SetUniform(int location, const std::vector< float > &value) const
void SetUniformArray(int location, int count, const glm::vec4 *values) const
int GetUniformLocation(const std::string &name) const
bool SetSampler(const std::string &name, const T &texture) const
void SetUniformArray(int location, int count, const int *values) const
void SetUniformArray(int location, int count, const float *values) const
void SetUniformArray(const std::string &name, int count, const T *values) const
void SetUniform(int location, const glm::ivec3 &value) const
void SetUniformArray(int location, int count, const glm::vec3 *values) const
std::string GetLog() const
unsigned int WasLinkingSuccessful() const
static Policy UniformNotFoundPolicy
void AddShader(Shader *s)
int AddShaderFromSource(unsigned int type, const char *source)
static int GetBoundProgramID()
bool SetUniform(const std::string &name, const T &value) const
int GetAttributeLocation(const std::string &name) const
void ComputeSamplerLocations()
void SetUniform(int location, const glm::vec4 &value) const
void SetUniform(int location, const glm::ivec2 &value) const
void PrintUniforms() const
unsigned int GetID() const
bool HasUniform(const std::string &name) const
void SetUniform(int location, const int &value) const
static bool IsGLTypeSampler(const unsigned int type)
Provides a C++ interface to the OpenGL shader construct.
Provides a C++ interface to the OpenGL shader program construct.
SmartShaderProgram(ShaderProgram *program)
ShaderProgram * operator->()