//////////////////////////////////////////////////////////////////////////
//                                                                      //
//  This file contains the declaration of the CShaderProgram2_0 class.  //
//                                                                      //
//////////////////////////////////////////////////////////////////////////
#ifndef __CSHADERPROGRAM2_0_HPP__
#define __CSHADERPROGRAM2_0_HPP__


#include "portable_gl.h"
#include <vector>
#include "CShaderProgram.hpp"


// This class is a concrete CShaderProgram class that implements the
// shader handling behavior with OpenGL 2.0 API.
class CShaderProgram2_0 : public CShaderProgram
{
public:
  CShaderProgram2_0();
  ~CShaderProgram2_0();

  bool addShader(EShaderType shaderType, const std::string& shader);
  bool link();
  void use();
  void unuse();

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

  static bool isSupported();

private:
  void printShaderInfoLog(GLuint obj);
  void printProgramInfoLog(GLuint obj);

  typedef std::vector<GLuint> shaders_type;
  shaders_type m_vShaders;
  GLuint m_shaderProgramId;
};


#endif // __CSHADERPROGRAM2_0_HPP__
