14 #include <unordered_map> 60 unsigned int type,
const std::string& shaderCode,
101 std::vector<Shader>& shaders,
bool hasAttribute(const char *name) const
Shader & operator=(const Shader &)=delete
std::optional< std::reference_wrapper< T > > optional_ref
Shorter name for std::optional<std::reference_wrapper<T>>
bool compile(unsigned int type, const std::string &shaderCode, mrpt::optional_ref< std::string > outErrorMessages=std::nullopt)
Build a shader from source code.
std::vector< shader_id_t > shader_list_t
A list of shader IDs.
void declareAttribute(const std::string &name)
void declareUniform(const std::string &name)
int attributeId(const char *name) const
unsigned int programId() const
#define ASSERT_(f)
Defines an assertion mechanism.
std::unordered_map< std::string, int > m_attribs
uint8_t shader_id_t
Type for IDs of shaders.
A resource handling helper for OpenGL "Shader" compiled code fragment.
bool hasUniform(const char *name) const
void clear()
Frees the shader program in OpenGL.
void clear()
Frees the shader program in OpenGL.
bool linkProgram(std::vector< Shader > &shaders, mrpt::optional_ref< std::string > outErrorMessages=std::nullopt)
Links an OpenGL program with all shader code fragments previously inserted into shaders.
unsigned int handle() const
void dumpProgramDescription(std::ostream &o) const
Prints a textual summary of the program.
std::vector< Shader > m_shaders
The namespace for 3D scene representation and rendering.
int uniformId(const char *name) const
A resource handling helper for OpenGL Shader "programs".
std::unordered_map< std::string, int > m_uniforms
OpenGL Uniforms/attribs defined by the user as inputs/outputs in shader code.