//////////////////////////////////////////////////////////////////////////
//                                                                      //
//  This file contains the declaration of the CShaderProgram class.     //
//                                                                      //
//////////////////////////////////////////////////////////////////////////
#ifndef __CSHADERPROGRAM_HPP__
#define __CSHADERPROGRAM_HPP__


#include <string>


// This class is the abstract interface used to compile and link
// shader programs.  Using it abstracts the fact that OpenGL 2.0
// includes the shader language, but previous implementations provides
// extensions to use shaders.
class CShaderProgram
{
public:
  static CShaderProgram* getInstance();

  enum EShaderType { VERTEX_SHADER, FRAGMENT_SHADER };

  bool addShaderFile(EShaderType shaderType, const std::string& shader);

  virtual ~CShaderProgram() = 0;
  virtual bool addShader(EShaderType shaderType, const std::string& shader) = 0;
  virtual bool link() = 0;
  virtual void use() = 0;
  virtual void unuse() = 0;

  virtual void setUniform1f(const std::string& name, float v0) = 0;
  virtual void setUniform3f(const std::string& name,
                            float v0, float v1, float v2) = 0;

protected:
  CShaderProgram();

private:
  // These are declared but never defined
  CShaderProgram(const CShaderProgram&);
  CShaderProgram& operator=(const CShaderProgram&);

  static bool s_isGlewInitialized;
};


#endif // __CSHADERPROGRAM_HPP__
