72#define C_VB_INDEX_BUFFER 0
73#define C_VB_POSITION 1
75#define C_VB_TEXCOORD 3
78#define C_VB_BITANGENT 6
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
Implements mathematical constants.
Implements option settings for CHAI3D.
Implements utility functions for manipulating strings.
This class implements a shader primitive.
Definition CShader.h:127
cShaderType getType() const
This method returns the type of the shader.
Definition CShader.h:175
GLuint m_id
Handle ID for the shader.
Definition CShader.h:198
bool compile()
This method compiles a shader and display any problems if compilation fails.
Definition CShader.cpp:157
bool m_compiled
If true then shader was compiled successfully, false otherwise.
Definition CShader.h:207
virtual ~cShader()
Destructor of cShader.
Definition CShader.h:138
std::string m_log
Log message following compilation.
Definition CShader.h:204
bool loadSourceCode(const char *a_source)
This method loads the shader content from a char array.
Definition CShader.cpp:88
std::string m_source
The shader source code (i.e. the GLSL code itself).
Definition CShader.h:201
std::string getSource()
This method returns the source code of the shader.
Definition CShader.h:172
std::string getLog() const
This method returns the log file generated from compilation.
Definition CShader.h:166
bool loadSourceFile(const std::string &a_fileName)
This method loads the shader content from a file.
Definition CShader.cpp:123
GLuint getId() const
This method returns the shader OpenGL ID.
Definition CShader.h:169
bool isCompiled() const
This method returns true if shader has been compiled successfully, false otherwise.
Definition CShader.h:163
cShaderType m_type
Shader type (C_VERTEX_SHADER, C_FRAGMENT_SHADER, or C_GEOMETRY_SHADER).
Definition CShader.h:195
static cShaderPtr create(cShaderType a_type)
Shared cShader allocator.
Definition CShader.h:141
static bool hasOpenGLShaders(cShaderType a_type)
This method returns true if shaders are supported on this computer, false otherwise.
Definition CAudioBuffer.cpp:57
std::shared_ptr< cShader > cShaderPtr
Definition CShader.h:110
cShaderType
Definition CShader.h:101
@ C_FRAGMENT_SHADER
Definition CShader.h:103
@ C_VERTEX_SHADER
Definition CShader.h:102
@ C_GEOMETRY_SHADER
Definition CShader.h:104