gdk-graphics  1b6d84e044c2c953fd7c9501e628a67e80f4da0d
batch_model.h
1 // © Joseph Cameron - All Rights Reserved
2 
3 #ifndef GDK_GFX_BATCH_MODEL_H
4 #define GDK_GFX_BATCH_MODEL_H
5 
6 #include <memory>
7 #include <vector>
8 
9 #include <gdk/vertex_data.h>
10 #include <gdk/graphics_types.h>
11 
12 namespace gdk
13 {
14  class model;
15  namespace graphics { class context; }
16 
17  // \brief a batch model is a model whos vertex data is made up of
27  class batch_model final
28  {
29  public:
32  size_t write_to_buffer(size_t vertexDataIndex,
33  const graphics_vector3_type &aPos,
34  const graphics_vector3_type &aRot = {},
35  const graphics_vector3_type &aScale = {1});
36 
38  void rewrite_buffer_at(size_t BufferIndex,
39  size_t vertexDataIndex,
40  const graphics_vector3_type &pos,
41  const graphics_vector3_type &rot,
42  const graphics_vector3_type &sca = {1});
43 
45  vertex_data::interleaved_data_view view_to_interleaved_data();
46 
48  void clear_buffer();
49 
51  void update_model();
52 
54  //void update_model(size_t aBeginIndex, size_t aEndIndex);
55 
58  batch_model(std::shared_ptr<gdk::graphics::context> pContext,
59  std::vector<vertex_data> data);
60 
62  std::shared_ptr<gdk::model> model();
63 
64  private:
66  std::shared_ptr<gdk::model> m_pModel;
67 
69  vertex_data m_Buffer = vertex_data({});
70 
72  std::vector<vertex_data> m_Inputs;
73  };
74 }
75 
76 #endif
77 
used to construct a model. Vertex data represents a set of vertex data in system memory ...
Definition: vertex_data.h:44
Vertex data representing a 3D graphical object.
Definition: model.h:11
Definition: camera.h:9
Definition: vertex_data.h:57
Definition: batch_model.h:27