gdk-graphics  1b6d84e044c2c953fd7c9501e628a67e80f4da0d
Public Member Functions | List of all members
gdk::batch_model Class Referencefinal

#include <batch_model.h>

Public Member Functions

size_t write_to_buffer (size_t vertexDataIndex, const graphics_vector3_type &aPos, const graphics_vector3_type &aRot={}, const graphics_vector3_type &aScale={1})
 
void rewrite_buffer_at (size_t BufferIndex, size_t vertexDataIndex, const graphics_vector3_type &pos, const graphics_vector3_type &rot, const graphics_vector3_type &sca={1})
 throws if the new data goes out of bounds of the buffer
 
vertex_data::interleaved_data_view view_to_interleaved_data ()
 gets a view to the buffer
 
void clear_buffer ()
 erase all vertex data in the buffer
 
void update_model ()
 clear the model's vertex data then upload the buffered data to the model
 
 batch_model (std::shared_ptr< gdk::graphics::context > pContext, std::vector< vertex_data > data)
 rewrite a subset of model's vertex data with the buffer range specified More...
 
std::shared_ptr< gdk::modelmodel ()
 gets the model
 

Detailed Description

the transformed vertex data of many separate objects. these objects could be separate instances of the same model or instances of many different models, the only restrictions are: the vertex formats must match they must all use the same material TODO: add a max_buffer_vertex_count, optional try_write_to_buffer, optional points to the head of the data just added to the buffer, so you can replace a section, returns nullptr if the vertex count would exceed the max

Constructor & Destructor Documentation

◆ batch_model()

gdk::batch_model::batch_model ( std::shared_ptr< gdk::graphics::context pContext,
std::vector< vertex_data data 
)

rewrite a subset of model's vertex data with the buffer range specified

throw is no a_Position throw is a_Postion does not have 3 components

Member Function Documentation

◆ write_to_buffer()

size_t gdk::batch_model::write_to_buffer ( size_t  vertexDataIndex,
const graphics_vector3_type &  aPos,
const graphics_vector3_type &  aRot = {},
const graphics_vector3_type &  aScale = {1} 
)

update buffer at location returns index into the buffer where the written data starts


The documentation for this class was generated from the following file: