Antkeeper  0.0.1
vertex-array.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2023 Christopher J. Howard
3  *
4  * This file is part of Antkeeper source code.
5  *
6  * Antkeeper source code is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * Antkeeper source code is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with Antkeeper source code. If not, see <http://www.gnu.org/licenses/>.
18  */
19 
20 #ifndef ANTKEEPER_GL_VERTEX_ARRAY_HPP
21 #define ANTKEEPER_GL_VERTEX_ARRAY_HPP
22 
24 #include <span>
25 #include <vector>
26 
27 namespace gl {
28 
33 {
34 public:
43  explicit vertex_array(std::span<const vertex_input_attribute> attributes);
44  vertex_array();
46 
48  ~vertex_array();
49 
51  [[nodiscard]] inline constexpr const std::vector<vertex_input_attribute>& attributes() const noexcept
52  {
53  return m_attributes;
54  }
55 
56  vertex_array(const vertex_array&) = delete;
58  vertex_array& operator=(const vertex_array&) = delete;
60 
61 private:
62  friend class pipeline;
63 
64  std::vector<vertex_input_attribute> m_attributes;
65  unsigned int m_gl_named_array{0};
66 };
67 
68 } // namespace gl
69 
70 #endif // ANTKEEPER_GL_VERTEX_ARRAY_HPP
Graphics pipeline interface.
Definition: pipeline.hpp:48
Vertex arrays describes how vertex input attributes are stored in vertex buffers.
~vertex_array()
Destructs a vertex array.
vertex_array(vertex_array &&)=delete
vertex_array(const vertex_array &)=delete
constexpr const std::vector< vertex_input_attribute > & attributes() const noexcept
Returns the vertex array's vertex input attributes.
vertex_array & operator=(const vertex_array &)=delete
vertex_array & operator=(vertex_array &&)=delete
vertex_array()
Constructs a vertex array.
Graphics library interface.
Definition: window.hpp:28