72 #define C_VB_INDEX_BUFFER 0 73 #define C_VB_POSITION 1 75 #define C_VB_TEXCOORD 3 77 #define C_VB_TANGENT 5 78 #define C_VB_BITANGENT 6 81 #define C_TU_TEXTURE 0 82 #define C_TU_SHADOWMAP 1 83 #define C_TU_NORMALMAP 2 84 #define C_TU_SPECULARMAP 3 86 #define C_TU_IMAGEBUFFER 2 87 #define C_TU_DEPTHBUFFER 3 89 #define C_TU_IBL_ENVIRONMENT 4 90 #define C_TU_IBL_FILTERED 5 91 #define C_TU_IBL_BRDF 6 95 #define C_TU_UNALLOCATED 7 Definition: CShader.h:103
cShaderType m_type
Shader type (C_VERTEX_SHADER, C_FRAGMENT_SHADER, or C_GEOMETRY_SHADER).
Definition: CShader.h:195
std::string m_source
The shader source code (i.e. the GLSL code itself).
Definition: CShader.h:201
Definition: CShader.h:104
std::shared_ptr< cShader > cShaderPtr
Definition: CShader.h:109
std::string getLog() const
This method returns the log file generated from compilation.
Definition: CShader.h:166
Definition: CShader.h:102
Implements mathematical constants.
Implements option settings for CHAI3D.
std::string m_log
Log message following compilation.
Definition: CShader.h:204
This class implements a shader primitive.
Definition: CShader.h:126
Implements utility functions for manipulating strings.
GLuint getId() const
This method returns the shader OpenGL ID.
Definition: CShader.h:169
cShaderType getType() const
This method returns the type of the shader.
Definition: CShader.h:175
bool m_compiled
If true then shader was compiled successfully, false otherwise.
Definition: CShader.h:207
static bool hasOpenGLShaders(cShaderType a_type)
This method returns true if shaders are supported on this computer, false otherwise.
bool compile()
This method compiles a shader and display any problems if compilation fails.
Definition: CShader.cpp:157
static cShaderPtr create(cShaderType a_type)
Shared cShader allocator.
Definition: CShader.h:141
bool loadSourceFile(const std::string &a_fileName)
This method loads the shader content from a file.
Definition: CShader.cpp:123
virtual ~cShader()
Destructor of cShader.
Definition: CShader.h:138
Definition: CAudioBuffer.cpp:56
cShaderType
Definition: CShader.h:100
bool isCompiled() const
This method returns true if shader has been compiled successfully, false otherwise.
Definition: CShader.h:163
std::string getSource()
This method returns the source code of the shader.
Definition: CShader.h:172
GLuint m_id
Handle ID for the shader.
Definition: CShader.h:198
bool loadSourceCode(const char *a_source)
This method loads the shader content from a char array.
Definition: CShader.cpp:88
cShader(cShaderType a_type)
Constructor of cShader.
Definition: CShader.cpp:68