#ifndef GLPROGRAM_H #define GLPROGRAM_H #include "Ref.h" #include "GLShader.h" #include #include #include class GLProgram { public: GLProgram(); ~GLProgram(); GLProgram & attach_shader(GLShaderRef shader); GLProgram & bind_attribute(const char * attribute, GLuint index); bool link(); GLuint get_id() { return m_id; } void use() { glUseProgram(m_id); } GLint get_uniform(const std::string & uniform_name); protected: GLuint m_id; std::map m_uniforms; }; typedef Ref GLProgramRef; #endif