|
Brenta Engine 1.2
|
Buffer wrapper around OpenGL buffer objects. More...
#include <buffer.hpp>
Public Member Functions | |
| buffer () | |
| Default constructor, does nothing. | |
| buffer (GLenum input_target) | |
| constexpr | buffer (const buffer &)=delete |
| constexpr buffer & | operator= (const buffer &)=delete |
| constexpr | buffer (buffer &&other) noexcept |
| constexpr buffer & | operator= (buffer &&other) noexcept |
| void | init (GLenum input_target) |
| void | destroy () |
| void | bind () |
| void | unbind () |
| int | get_id () |
| GLenum | get_target () |
| void | set_id (unsigned int id) |
| void | set_target (GLenum target) |
| void | copy_data (GLsizeiptr size, const void *data, GLenum usage) |
| Copy data to the buffer object. | |
| void | copy_vertices (GLsizeiptr size, const void *data, GLenum usage) |
| Copy data to the buffer object. | |
| void | copy_indices (GLsizeiptr size, const void *data, GLenum usage) |
| Copy data to the buffer object. | |
Data Fields | |
| unsigned int | id |
| Buffer object id, generated by OpenGL. | |
| GLenum | target |
| Buffer object target (like GL_ARRAY_BUFFER, GL_ELEMENT_ARRAY_BUFFER...) | |
Buffer wrapper around OpenGL buffer objects.
This class is a wrapper around OpenGL buffer objects. It provides a simple interface to create, bind, unbind and delete buffer objects.
Definition at line 22 of file buffer.hpp.
|
inline |
Default constructor, does nothing.
Definition at line 38 of file buffer.hpp.
| buffer::buffer | ( | GLenum | input_target | ) |
Definition at line 12 of file buffer.cpp.
|
inlineconstexprnoexcept |
Definition at line 47 of file buffer.hpp.
| buffer::~buffer | ( | ) |
Definition at line 17 of file buffer.cpp.
| void buffer::bind | ( | ) |
Definition at line 63 of file buffer.cpp.
| void buffer::copy_data | ( | GLsizeiptr | size, |
| const void * | data, | ||
| GLenum | usage | ||
| ) |
Copy data to the buffer object.
| size | Size of the data in bytes |
| data | Pointer to the data |
| usage | OpenGL usage hint (like GL_STATIC_DRAW) |
Definition at line 22 of file buffer.cpp.
| void buffer::copy_indices | ( | GLsizeiptr | size, |
| const void * | data, | ||
| GLenum | usage | ||
| ) |
Copy data to the buffer object.
| size | Size of the data in bytes |
| data | Pointer to the data |
| usage | OpenGL usage hint (like GL_STATIC_DRAW) |
Same as copy_vertices() but for target GL_ELEMENT_ARRAY_BUFFER.
Definition at line 27 of file buffer.cpp.
| void buffer::copy_vertices | ( | GLsizeiptr | size, |
| const void * | data, | ||
| GLenum | usage | ||
| ) |
Copy data to the buffer object.
| size | Size of the data in bytes |
| data | Pointer to the data |
| usage | OpenGL usage hint (like GL_STATIC_DRAW) |
Same as copy_date() but for target GL_ARRAY_BUFFER. The naming is more specific to the use case.
Definition at line 36 of file buffer.cpp.
| void buffer::destroy | ( | ) |
Definition at line 53 of file buffer.cpp.
| int buffer::get_id | ( | ) |
Definition at line 78 of file buffer.cpp.
| GLenum buffer::get_target | ( | ) |
Definition at line 83 of file buffer.cpp.
| void buffer::init | ( | GLenum | input_target | ) |
Definition at line 45 of file buffer.cpp.
Definition at line 53 of file buffer.hpp.
| void buffer::set_id | ( | unsigned int | id | ) |
Definition at line 88 of file buffer.cpp.
| void buffer::set_target | ( | GLenum | target | ) |
Definition at line 93 of file buffer.cpp.
| void buffer::unbind | ( | ) |
Definition at line 73 of file buffer.cpp.
| unsigned int brenta::types::buffer::id |
Buffer object id, generated by OpenGL.
Definition at line 28 of file buffer.hpp.
| GLenum brenta::types::buffer::target |
Buffer object target (like GL_ARRAY_BUFFER, GL_ELEMENT_ARRAY_BUFFER...)
Definition at line 33 of file buffer.hpp.