//////////////////////////////////////////////////////////////////////////
//                                                                      //
//  This file contains the declaration of the CShaderProgramARB class.  //
//                                                                      //
//////////////////////////////////////////////////////////////////////////
#ifndef __CSHADERPROGRAMARB_HPP__
#define __CSHADERPROGRAMARB_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 CShaderProgramARB : public CShaderProgram
{
public:
  CShaderProgramARB();
  ~CShaderProgramARB();

  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 printInfoLog(GLhandleARB obj);
  void printProgramInfoLog(GLuint obj);

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


#endif // __CSHADERPROGRAMARB_HPP__
