20 #ifndef ANTKEEPER_GL_VERTEX_BUFFER_HPP
21 #define ANTKEEPER_GL_VERTEX_BUFFER_HPP
123 inline void resize(std::size_t
size, std::span<const std::byte> data = {})
128 inline void resize(std::span<const std::byte> data)
143 void write(std::size_t
offset, std::span<const std::byte> data);
145 inline void write(std::span<const std::byte> data)
160 void read(std::size_t
offset, std::span<std::byte> data)
const;
162 inline void read(std::span<std::byte> data)
const
179 void copy(
const vertex_buffer& read_buffer, std::size_t copy_size, std::size_t read_offset = 0, std::size_t write_offset = 0);
182 [[nodiscard]]
inline constexpr std::size_t
size() const noexcept
196 unsigned int m_gl_named_buffer{0};
198 std::size_t m_size{0};
Graphics pipeline interface.
Vertex buffer object (VBO).
void repurpose(buffer_usage usage, std::size_t size, std::span< const std::byte > data={})
Repurposes the vertex buffer, changing its usage hint, size, and updating its data.
void write(std::span< const std::byte > data)
Writes data into the vertex buffer.
vertex_buffer()
Constructs a vertex buffer.
void copy(const vertex_buffer &read_buffer, std::size_t copy_size, std::size_t read_offset=0, std::size_t write_offset=0)
Copies a subset of another vertex buffer's data into this vertex buffer.
vertex_buffer & operator=(const vertex_buffer &buffer)
Copies another vertex buffer.
vertex_buffer(buffer_usage usage, std::span< const std::byte > data={})
Constructs a vertex buffer.
void write(std::size_t offset, std::span< const std::byte > data)
Writes data into the vertex buffer.
constexpr std::size_t size() const noexcept
Returns the size of the buffer's data, in bytes.
void read(std::size_t offset, std::span< std::byte > data) const
Reads a subset of the buffer's data from the GL and returns it to the application.
void repurpose(buffer_usage usage, std::span< const std::byte > data)
Repurposes the vertex buffer, changing its usage hint, size, and updating its data.
void resize(std::span< const std::byte > data)
Resizes the vertex buffer.
~vertex_buffer()
Destroys a vertex buffer.
void resize(std::size_t size, std::span< const std::byte > data={})
Resizes the vertex buffer.
void repurpose(buffer_usage usage)
Repurposes the vertex buffer, changing its usage hint, size, and updating its data.
constexpr buffer_usage usage() const noexcept
Return's the buffer's usage hint.
void read(std::span< std::byte > data) const
Reads a subset of the buffer's data from the GL and returns it to the application.
Graphics library interface.
buffer_usage
Usage hints for vertex buffers.
@ static_draw
Data will be modified once, by the application, and used many times, for drawing commands.
T offset(T longitude)
Calculates the UTC offset at a given longitude.