gdk-graphics 0a0aef92e917cfbac53dffbc32c295e4de914093
Loading...
Searching...
No Matches
batch_modeler.h
1// © Joseph Cameron - MIT License
2
3#ifndef GDK_GRAPHICS_EXT_BATCH_MODELER_H
4#define GDK_GRAPHICS_EXT_BATCH_MODELER_H
5
6#include <cstddef>
7#include <gdk/graphics/context.h>
8#include <gdk/graphics/types.h>
9#include <gdk/graphics/model_data.h>
10
11namespace gdk::graphics {
14 class batch_modeler final {
15 public:
17 const_model_ptr_type model() const;
18
20 const_material_ptr_type material() const;
21
23 std::size_t vertex_count() const;
24
26 void push_back(const model_data &data);
27
29 void upload();
30
31 batch_modeler(context_ptr_type aGraphics, material_ptr_type aMaterial);
32
33 private:
34 material_ptr_type m_pMaterial;
35 model_data m_BatchData = {};
36 model_ptr_type m_pModel;
37 };
38}
39
40#endif
41
const_model_ptr_type model() const
get the model, contains the uploaded model data for the batch
void push_back(const model_data &data)
add model data to the batch
void upload()
upload the batch data to the model and clear the batch
std::size_t vertex_count() const
get the number of vertices in the current buffer
const_material_ptr_type material() const
get the material, used to render the model
vertex data stored in system memory.
Definition model_data.h:25