]> git.localhorst.tv Git - blobs.git/blobdiff - src/graphics/SimpleVAO.hpp
basic info box
[blobs.git] / src / graphics / SimpleVAO.hpp
index 963c0157ae3e608c59023eaa636fce1c088fa363..c809f7fb72ff4b1863f295d5191037abaa3865cc 100644 (file)
@@ -72,8 +72,17 @@ public:
        MappedBuffer<Element> MapElements(GLenum access) {
                return MappedBuffer<Element>(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<Element>::type, ((Element *) nullptr) + offset);
+       }
        void DrawTriangles(std::size_t size, std::size_t offset = 0) const noexcept {
-               glDrawElements(GL_TRIANGLES, size, gl_traits<Element>::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: