charcoal/OpenGLEngine/ShaderProgram.h

31 lines
494 B
C++

#pragma once
#include "stdafx.h"
#include "Exception.h"
#include "Shader.h"
class ShaderProgram
{
public:
ShaderProgram();
virtual ~ShaderProgram();
void init();
void use();
GLuint get_program() const;
GLuint get_vao() const;
protected:
void attach_shader(const Shader& shader);
void link();
// Should return the Vertex Attribute Object for this shader. Called once by the constructor.
virtual GLuint gen_vao() const = 0;
private:
GLuint m_program = 0;
GLuint m_vao = 0;
};