X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fgraphics%2FSimpleVAO.hpp;h=c809f7fb72ff4b1863f295d5191037abaa3865cc;hb=2025d49798b93180237b6ce62d3ff5d6ee8ebc6e;hp=963c0157ae3e608c59023eaa636fce1c088fa363;hpb=be413456f57da06e918ae7bf4c4f35e5198ff7ce;p=blobs.git diff --git a/src/graphics/SimpleVAO.hpp b/src/graphics/SimpleVAO.hpp index 963c015..c809f7f 100644 --- a/src/graphics/SimpleVAO.hpp +++ b/src/graphics/SimpleVAO.hpp @@ -72,8 +72,17 @@ public: MappedBuffer MapElements(GLenum access) { return MappedBuffer(GL_ELEMENT_ARRAY_BUFFER, access); } + void Draw(GLenum mode, std::size_t size, std::size_t offset = 0) const noexcept { + glDrawElements(mode, size, gl_traits::type, ((Element *) nullptr) + offset); + } void DrawTriangles(std::size_t size, std::size_t offset = 0) const noexcept { - glDrawElements(GL_TRIANGLES, size, gl_traits::type, ((Element *) nullptr) + offset); + Draw(GL_TRIANGLES, size, offset); + } + void DrawTriangleStrip(std::size_t size, std::size_t offset = 0) const noexcept { + Draw(GL_TRIANGLE_STRIP, size, offset); + } + void DrawLineLoop(std::size_t size, std::size_t offset = 0) const noexcept { + Draw(GL_LINE_LOOP, size, offset); } private: