28 lines
585 B
C++
28 lines
585 B
C++
#ifndef GLPROGRAM_H
|
|
#define GLPROGRAM_H
|
|
|
|
#include "Ref.h"
|
|
#include "GLShader.h"
|
|
#include <map>
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
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<std::string, GLint> m_uniforms;
|
|
};
|
|
typedef Ref<GLProgram> GLProgramRef;
|
|
|
|
#endif
|