Go to the documentation of this file.
14 #include <unordered_map>
60 unsigned int type,
const std::string& shaderCode,
83 using Ptr = std::shared_ptr<Program>;
101 std::vector<Shader>& shaders,
A resource handling helper for OpenGL Shader "programs".
A resource handling helper for OpenGL "Shader" compiled code fragment.
unsigned int handle() const
bool hasAttribute(const char *name) const
uint8_t shader_id_t
Type for IDs of shaders.
void declareUniform(const std::string &name)
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.
Shader & operator=(const Shader &)=delete
void declareAttribute(const std::string &name)
std::shared_ptr< Program > Ptr
#define ASSERT_(f)
Defines an assertion mechanism.
void clear()
Frees the shader program in OpenGL.
std::unordered_map< std::string, int > m_attribs
std::vector< Shader > m_shaders
std::unordered_map< std::string, int > m_uniforms
OpenGL Uniforms/attribs defined by the user as inputs/outputs in shader code.
int attributeId(const char *name) const
int uniformId(const char *name) const
unsigned int programId() const
void dumpProgramDescription(std::ostream &o) const
Prints a textual summary of the program.
void clear()
Frees the shader program in OpenGL.
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.
bool hasUniform(const char *name) const
The namespace for 3D scene representation and rendering.
std::optional< std::reference_wrapper< T > > optional_ref
Shorter name for std::optional<std::reference_wrapper<T>>
Page generated by Doxygen 1.8.17 for MRPT 2.0.3 at Fri May 29 13:06:46 UTC 2020 | |