Added basic object wrapper for VAOs

This commit is contained in:
Robert 2021-01-20 16:51:55 +01:00
parent c3e49cd78e
commit 8921957161
7 changed files with 162 additions and 17 deletions

View file

@ -22,9 +22,17 @@ namespace oglu
Object(const GLfloat* vertices, size_t verticesSize, const GLuint* indices, size_t indicesSize, const VertexAttribute* topology, size_t topologySize);
GLuint GetVAO() { return VAO; }
void Bind();
void Unbind();
void Draw();
void BindAndDraw();
private:
inline void RegisterVertexAttribPointer(GLuint index, const VertexAttribute& topology);
GLuint VAO;
GLsizei count;
};
}

View file

@ -10,12 +10,15 @@ namespace oglu
{
public:
Shader(const char* vertexShaderFile, const char* fragmentShaderFile);
~Shader();
void Use();
private:
void LoadShaderSource(const char* filename, char** buffer);
private:
GLuint vertexShader, fragmentShader;
GLuint vertexShader, fragmentShader, program;
};
}