Lugdunum  0.1.0
Mesh.cpp
Go to the documentation of this file.
2 
4 
5 namespace lug {
6 namespace Graphics {
7 namespace Builder {
8 
9 Mesh::Mesh(Renderer& renderer) : _renderer(renderer) {}
10 
11 void Mesh::PrimitiveSet::addAttributeBuffer(const void* data, uint32_t elementSize, uint32_t elementsCount, Render::Mesh::PrimitiveSet::Attribute::Type type) {
13 
14  attribute.type = type;
15  attribute.buffer.size = elementSize * elementsCount;
16  attribute.buffer.data = new char[attribute.buffer.size];
17  attribute.buffer.elementsCount = elementsCount;
18 
19  std::memcpy(attribute.buffer.data, static_cast<const char*>(data), attribute.buffer.size);
20 
21  _attributes.push_back(std::move(attribute));
22 }
23 
25  switch (_renderer.getType()) {
28  }
29 
30  return nullptr;
31 }
32 
33 } // Builder
34 } // Graphics
35 } // lug
Resource::SharedPtr< Render::Mesh > build()
Definition: Mesh.cpp:24
void addAttributeBuffer(const void *data, uint32_t elementSize, uint32_t elementsCount, Render::Mesh::PrimitiveSet::Attribute::Type type)
Definition: Mesh.cpp:11
enum lug::Graphics::Render::Mesh::PrimitiveSet::Attribute::Type type
Dummy class for a shared pointer.
Definition: Resource.hpp:66
Resource::SharedPtr< lug::Graphics::Render::Mesh > build(const ::lug::Graphics::Builder::Mesh &builder)
Definition: Mesh.cpp:18
Mesh(Renderer &renderer)
Definition: Mesh.cpp:9
struct lug::Graphics::Render::Mesh::PrimitiveSet::Attribute::Buffer buffer
Type getType() const
Definition: Renderer.inl:5
uint32_t size
The size of the above data buffer, in bytes.
Definition: Mesh.hpp:49
uint32_t elementsCount
The number of elements (indices, vertices, normals)
Definition: Mesh.hpp:50