This class implements a shader primitive. More...
#include <CShader.h>
Public Member Functions | |
| cShader (cShaderType a_type) | |
| Constructor of cShader.  More... | |
| virtual | ~cShader () | 
| Destructor of cShader.  More... | |
| bool | loadSourceCode (const char *a_source) | 
| This method loads the shader content from a char array.  More... | |
| bool | loadSourceCode (const std::string &a_source) | 
| This method loads the shader content from a string.  More... | |
| bool | loadSourceFile (const std::string &a_fileName) | 
| This method loads the shader content from a file.  More... | |
| bool | compile () | 
| This method compiles a shader and display any problems if compilation fails.  More... | |
| bool | isCompiled () const | 
| This method returns true if shader has been compiled successfully, false otherwise.  More... | |
| std::string | getLog () const | 
| This method returns the log file generated from compilation.  More... | |
| GLuint | getId () const | 
| This method returns the shader OpenGL ID.  More... | |
| std::string | getSource () | 
| This method returns the source code of the shader.  More... | |
| cShaderType | getType () const | 
| This method returns the type of the shader.  More... | |
Static Public Member Functions | |
| static cShaderPtr | create (cShaderType a_type) | 
| Shared cShader allocator.  More... | |
| static bool | hasOpenGLShaders (cShaderType a_type) | 
| This method returns true if shaders are supported on this computer, false otherwise.  More... | |
Protected Attributes | |
| cShaderType | m_type | 
| Shader type (C_VERTEX_SHADER, C_FRAGMENT_SHADER, or C_GEOMETRY_SHADER).  More... | |
| GLuint | m_id | 
| Handle ID for the shader.  More... | |
| std::string | m_source | 
| The shader source code (i.e. the GLSL code itself).  More... | |
| std::string | m_log | 
| Log message following compilation.  More... | |
| bool | m_compiled | 
| If true then shader was compiled successfully, false otherwise.  More... | |
This class implements the basic capabilities to load and control an OpenGL shader.
| chai3d::cShader::cShader | ( | cShaderType | a_type | ) | 
Constructor of cShader.
      
  | 
  inlinevirtual | 
      
  | 
  inlinestatic | 
| bool chai3d::cShader::loadSourceCode | ( | const char * | a_source | ) | 
This method loads the shader content from a char array.
| a_source | Source code. | 
| bool chai3d::cShader::loadSourceCode | ( | const std::string & | a_source | ) | 
This method loads the shader content from a string.
| a_source | Source code. | 
| bool chai3d::cShader::loadSourceFile | ( | const std::string & | a_fileName | ) | 
This method loads the shader content from a file.
| a_fileName | Filename containing source code. | 
| bool chai3d::cShader::compile | ( | ) | 
This method compile a shader and displays any problems if compilation fails.
      
  | 
  inline | 
      
  | 
  inline | 
      
  | 
  inline | 
      
  | 
  inline | 
      
  | 
  inline | 
      
  | 
  static | 
      
  | 
  protected | 
      
  | 
  protected | 
      
  | 
  protected | 
      
  | 
  protected | 
      
  | 
  protected |