refactor opengl shader and add shader builder

This commit is contained in:
2021-10-17 16:40:18 +02:00
parent 5ee0b7017f
commit 8e74256670
5 changed files with 213 additions and 7 deletions

View File

@@ -38,6 +38,11 @@ namespace MM::OpenGL {
glBindBuffer(target, 0);
}
// for transform feedback
void bindBase(GLuint index, GLenum target = GL_TRANSFORM_FEEDBACK_BUFFER) const {
glBindBufferBase(target, index, _handle);
}
void resize(size_t size, GLenum usage) {
glBindBuffer(GL_ARRAY_BUFFER, _handle);
glBufferData(GL_ARRAY_BUFFER, size * sizeof(TInstance), nullptr, usage);