28 VBO(std::size_t size,
Usage usage = DefaultUsage);
37 operator unsigned int()
const {
return id; }
38 void setSize(std::size_t size,
Usage usage = DefaultUsage);
43 void setData(
const void *data, std::size_t count,
Usage usage = DefaultUsage);
46 void setData(
const std::vector<T> &data,
Usage usage = DefaultUsage) {
47 setData(data.data(), data.size()*
sizeof(T), usage);
50 void setData(
const T *data, std::size_t count,
Usage usage = DefaultUsage) {
51 setData(data, count*
sizeof(T), usage);
54 void update(
const void *data, std::size_t count = 0, std::size_t offset = 0);
57 void update(
const std::vector<T> &data, std::size_t count = 0, std::size_t offset = 0) {
61 update(data.data(), count*
sizeof(T), offset);
64 void update(
const T *data, std::size_t count, std::size_t offset = 0) {
65 update(data, count*
sizeof(T), offset);
71 return static_cast<VBO::Usage>(
static_cast<uint8_t
>(a) | static_cast<uint8_t>(b));
void setSize(std::size_t size, Usage usage=DefaultUsage)
Definition: VBO.cpp:82
void update(const T *data, std::size_t count, std::size_t offset=0)
Definition: VBO.hpp:64
void setData(const T *data, std::size_t count, Usage usage=DefaultUsage)
Definition: VBO.hpp:50
Definition: GameController.hpp:7
static constexpr Usage DefaultUsage
Definition: VBO.hpp:24
void update(const void *data, std::size_t count=0, std::size_t offset=0)
Definition: VBO.cpp:98
~VBO()
Definition: VBO.cpp:74
Usage
Definition: VBO.hpp:15
VBO()
Definition: VBO.cpp:51
std::size_t getSize() const
Definition: VBO.hpp:39
std::size_t size
Definition: VBO.hpp:11
void update(const std::vector< T > &data, std::size_t count=0, std::size_t offset=0)
Definition: VBO.hpp:57
constexpr VBO::Usage operator|(const VBO::Usage a, const VBO::Usage b)
Definition: VBO.hpp:70
unsigned int id
Definition: VBO.hpp:12
void bind() const
Definition: VBO.cpp:78
void setData(const std::vector< T > &data, Usage usage=DefaultUsage)
Definition: VBO.hpp:46
VBO & operator=(const VBO &)=delete
void setData(const void *data, std::size_t count, Usage usage=DefaultUsage)
Definition: VBO.cpp:90