1 #ifndef BLANK_GRAPHICS_VERTEXARRAY_HPP_
2 #define BLANK_GRAPHICS_VERTEXARRAY_HPP_
10 template<std::size_t N>
14 static constexpr std::size_t NUM_ATTRS = N;
17 VertexArray() noexcept;
18 ~VertexArray() noexcept;
20 VertexArray(const VertexArray<N> &) = delete;
21 VertexArray<N> &operator =(const VertexArray<N> &) = delete;
23 VertexArray(VertexArray<N> &&) noexcept;
24 VertexArray<N> &operator =(VertexArray<N> &&) noexcept;
27 bool Empty() const noexcept { return idx_count == 0; }
29 void Bind() const noexcept;
32 void PushAttribute(std::size_t which, const std::vector<T> &data, bool normalized = false) noexcept;
35 void PushIndices(std::size_t which, const std::vector<T> &indices) noexcept;
37 void DrawLineElements() const noexcept;
38 void DrawTriangleElements() const noexcept;
41 void BindAttribute(std::size_t which) const noexcept;
42 void EnableAttribute(std::size_t which) noexcept;
44 void AttributeData(const std::vector<T> &) noexcept;
46 void AttributePointer(std::size_t which, bool normalized = false) noexcept;
48 void BindIndex(std::size_t which) const noexcept;
50 void IndexData(const std::vector<T> &) noexcept;
54 GLuint attr_id[NUM_ATTRS];
56 std::size_t idx_count;
63 #include "VertexArray.inl"