#ifndef GLPROGRAM_H #define GLPROGRAM_H #include #include "GLShader.h" #include #include #include class GLProgram { public: GLProgram(); ~GLProgram(); bool create(const char *v_source, const char *f_source, ...); bool create(const uint8_t *v_source, const uint8_t *f_source, ...); bool createv(const char *v_source, const char *f_source, va_list va); GLuint get_id() { return m_id; } void use() { glUseProgram(m_id); } GLint uniform(int i) { return m_uniform_locations[i]; } GLint uniform(const std::string & s) { return m_uniform_location_names[s]; } protected: GLuint m_id; GLShader m_v_shader; GLShader m_f_shader; std::vector m_uniform_locations; std::map m_uniform_location_names; }; #endif