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
VertexBatch.hpp
Go to the documentation of this file.
1
7
8#ifndef GALAXY_GRAPHICS_SPRITEBATCH_HPP_
9#define GALAXY_GRAPHICS_SPRITEBATCH_HPP_
10
12
13namespace galaxy
14{
15 namespace graphics
16 {
22 class VertexBatch final
23 {
24 public:
29
34
39
44
50 void init(const int max_quads);
51
59 [[maybe_unused]]
60 int push(std::span<Vertex> vertices);
61
68 void sub_buffer(const unsigned int index, std::span<Vertex> vertices);
69
73 void clear();
74
80 [[nodiscard]]
82
83 private:
87 VertexBatch(const VertexBatch&) = delete;
88
93
94 private:
99
104
109 };
110 } // namespace graphics
111} // namespace galaxy
112
113#endif
thread_local const float vertices[]
Video.cpp galaxy.
Definition Video.cpp:19
Abstraction for OpenGL vertex array objects.
Batches together vertex data to reduce draw calls.
VertexArray & vao()
Get vertex array object.
void clear()
Clears out vertex buffer.
int m_max_quads
Maximum quads allowed.
int push(std::span< Vertex > vertices)
Buffer some vertices into the spritebatch.
VertexBatch & operator=(const VertexBatch &)=delete
Copy assignment operator.
VertexBatch & operator=(VertexBatch &&)
Move assignment operator.
VertexBatch(const VertexBatch &)=delete
Copy constructor.
void sub_buffer(const unsigned int index, std::span< Vertex > vertices)
Sub-buffer vertex object.
VertexArray m_vao
Vertex data.
void init(const int max_quads)
Initialize vertex batch data.
Animated.cpp galaxy.
Definition Animated.cpp:16