40617c8953
to specify the batch pipeline specified at StackOverflow See https://stackoverflow.com/questions/8923174/opengl-vao-best-practices#8923298
31 lines
494 B
C++
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;
|
|
}; |