galaxy 1.0.0
Real-Time C++23 Game Programming Framework. Built on data-driven design principles and agile software engineering.
Loading...
Searching...
No Matches
VertexArray.hpp
Go to the documentation of this file.
1
7
8#ifndef GALAXY_GRAPHICS_GL_VERTEXARRAY_HPP_
9#define GALAXY_GRAPHICS_GL_VERTEXARRAY_HPP_
10
12
13namespace galaxy
14{
18 class VertexArray final
19 {
20 public:
25
29 VertexArray(VertexArray&&) noexcept;
30
35
40
47 void buffer(std::span<Vertex> vertices, std::span<unsigned int> indicies);
48
55 void buffer(const int vertex_count, std::span<unsigned int> indicies);
56
63 void sub_buffer(const unsigned int index, std::span<Vertex> vertices);
64
68 void bind() const;
69
73 void unbind() const;
74
80 [[nodiscard]]
81 int count() const noexcept;
82
88 [[nodiscard]]
89 void* offset() noexcept;
90
96 [[nodiscard]]
97 VertexBuffer& vbo() noexcept;
98
104 [[nodiscard]]
105 unsigned int id() const noexcept;
106
107 private:
111 VertexArray(const VertexArray&) = delete;
112
117
118 private:
122 unsigned int m_id;
123
128 };
129} // namespace galaxy
130
131#endif
thread_local const float vertices[]
Video.cpp galaxy.
Definition Video.cpp:19
Abstraction for OpenGL vertex array objects.
VertexArray()
Constructor.
void sub_buffer(const unsigned int index, std::span< Vertex > vertices)
Sub-buffer vertex array.
void bind() const
Bind this vertex array.
~VertexArray()
Destructor.
VertexBuffer m_vbo
Vertex buffer.
VertexArray(const VertexArray &)=delete
Copy constructor.
VertexBuffer & vbo() noexcept
Get vertex buffer.
int count() const noexcept
Get the index count.
void buffer(std::span< Vertex > vertices, std::span< unsigned int > indicies)
Create vertex array object.
VertexArray & operator=(VertexArray &&) noexcept
Move assignment operator.
void unbind() const
Unbind this vertex array.
unsigned int m_id
VAO object.
unsigned int id() const noexcept
Get vertex array handle.
void * offset() noexcept
Gets index offset.
VertexArray & operator=(const VertexArray &)=delete
Copy assignment operator.
Abstraction for OpenGL vertex buffer objects.
Animated.cpp galaxy.
Definition Animated.cpp:16