diff options
| author | Dan Goodliffe <dan@randomdan.homeip.net> | 2026-03-07 11:50:47 +0000 |
|---|---|---|
| committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2026-03-07 11:50:47 +0000 |
| commit | adb0096046d357a6463ae2ce66c182546c8de9c2 (patch) | |
| tree | 0e06a281efc2da637ebc19dca38f160e86516d9f /gfx/models/mesh.h | |
| parent | Update stencils and billboards less often (diff) | |
| parent | Replace glContainer with glAllocator (diff) | |
| download | ilt-adb0096046d357a6463ae2ce66c182546c8de9c2.tar.bz2 ilt-adb0096046d357a6463ae2ce66c182546c8de9c2.tar.xz ilt-adb0096046d357a6463ae2ce66c182546c8de9c2.zip | |
Merge branch 'glalloc'
Diffstat (limited to 'gfx/models/mesh.h')
| -rw-r--r-- | gfx/models/mesh.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/gfx/models/mesh.h b/gfx/models/mesh.h index 8791aed..e78d27e 100644 --- a/gfx/models/mesh.h +++ b/gfx/models/mesh.h @@ -1,8 +1,8 @@ #pragma once #include "config/types.h" -#include "gfx/gl/vertexArrayObject.h" -#include <glArrays.h> +#include "gfx/gl/glBuffer.h" +#include <gfx/gl/glVertexArray.h> #include <glad/gl.h> #include <ranges> #include <span> @@ -53,15 +53,15 @@ public: return static_cast<RelativePosition3D>(v.pos); }))} { - VertexArrayObject::data(vertices, m_vertexArrayBuffers[0], GL_ARRAY_BUFFER); - VertexArrayObject::data(indices, m_vertexArrayBuffers[1], GL_ARRAY_BUFFER); - configureVAO(m_vertexArrayObject); + m_vertexArrayBuffers[0].storage(vertices, 0); + m_vertexArrayBuffers[1].storage(indices, 0); + configureVAO(m_vertexArrayObject, 0); } - VertexArrayObject & - configureVAO(VertexArrayObject && vao) const + auto + configureVAO(glVertexArray & vao, GLuint divisor) const { - return vao.addAttribsFor<V>(m_vertexArrayBuffers[0]).addIndices(m_vertexArrayBuffers[1]); + return vao.configure().addAttribsFor<V>(divisor, m_vertexArrayBuffers[0]).addIndices(m_vertexArrayBuffers[1]); } }; |
