32 #include "vertex_array_buffer.h"
33 #include "transfer_vector.h"
42 template<
typename Type>
80 :
VertexArrayBuffer(gc, data.empty() ? (Type*)0 : &data[0], data.size() * sizeof(Type), usage)
110 size = size *
sizeof(Type);
118 size = size *
sizeof(Type);
void upload_data(GraphicContext &gc, int offset, const void *data, int size)
Uploads data to vertex array buffer.
void copy_from(GraphicContext &gc, TransferBuffer &buffer, int dest_pos=0, int src_pos=0, int size=-1)
Copies data from transfer buffer.
Transfer Vector.
Definition: transfer_vector.h:43
@ usage_static_draw
Definition: buffer_usage.h:45
Vertex Array Buffer.
Definition: vertex_array_buffer.h:47
VertexArrayVector()
Constructs a null instance.
Definition: vertex_array_vector.h:49
void upload_data(GraphicContext &gc, int offset, const Type *data, int size)
Uploads data to vertex array buffer.
Definition: vertex_array_vector.h:94
VertexArrayVector(GraphicContext &gc, int size, BufferUsage usage=usage_static_draw)
Constructs a VertexArrayBuffer.
Definition: vertex_array_vector.h:63
void copy_to(GraphicContext &gc, TransferVector< Type > &buffer, int dest_pos=0, int src_pos=0, int size=-1)
Copies data to transfer buffer.
Definition: vertex_array_vector.h:115
BufferUsage
Array Buffer usage enum.
Definition: buffer_usage.h:41
Vertex Array Vector.
Definition: vertex_array_vector.h:44
Interface to drawing graphics.
Definition: graphic_context.h:258
VertexArrayVector(const VertexArrayBuffer &buffer)
Constructs a VertexArrayBuffer using an existing VertexArrayBuffer.
Definition: vertex_array_vector.h:54
VertexArrayVector(GraphicContext &gc, Type *data, int size, BufferUsage usage=usage_static_draw)
Constructs a VertexArrayBuffer.
Definition: vertex_array_vector.h:74
void upload_data(GraphicContext &gc, int offset, const std::vector< Type > &data)
Uploads data to vertex array buffer.
Definition: vertex_array_vector.h:100
VertexArrayVector(GraphicContext &gc, const std::vector< Type > &data, BufferUsage usage=usage_static_draw)
Definition: vertex_array_vector.h:79
void copy_to(GraphicContext &gc, TransferBuffer &buffer, int dest_pos=0, int src_pos=0, int size=-1)
Copies data to transfer buffer.
void copy_from(GraphicContext &gc, TransferVector< Type > &buffer, int dest_pos=0, int src_pos=0, int size=-1)
Copies data from transfer buffer.
Definition: vertex_array_vector.h:107