Blowbox 2017
A 3D Game Engine by Riko Ophorst using DirectX 12
mesh.h
1 #pragma once
2 
3 #include "renderer/mesh_data.h"
4 #include "renderer/buffers/structured_buffer.h"
5 #include "renderer/buffers/byte_address_buffer.h"
6 
7 #include "util/shared_ptr.h"
8 
9 namespace blowbox
10 {
19  class Mesh
20  {
21  public:
22  Mesh();
23  ~Mesh();
24 
30  void Create(const MeshData& mesh);
31 
33  void Destroy();
34 
36  const MeshData& GetMeshData() const;
37 
39  const StructuredBuffer& GetVertexBuffer() const;
40 
42  const ByteAddressBuffer& GetIndexBuffer() const;
43  private:
44  bool initialized_;
48  };
49 }
bool initialized_
Whether the Mesh has been initialized yet.
Definition: mesh.h:44
Describes all the data for a Mesh.
Definition: mesh_data.h:16
ByteAddressBuffer index_buffer_
A ByteAddressBuffer that has all index data in it for this Mesh.
Definition: mesh.h:47
const StructuredBuffer & GetVertexBuffer() const
Definition: mesh.cc:58
Wrapper for random access buffers.
Definition: byte_address_buffer.h:13
const ByteAddressBuffer & GetIndexBuffer() const
Definition: mesh.cc:64
A mesh that can be rendered.
Definition: mesh.h:19
MeshData mesh_data_
The MeshData that was used to construct this Mesh.
Definition: mesh.h:45
The main Blowbox namespace.
Definition: image.cc:8
Wrapper for StructuredBuffer types.
Definition: structured_buffer.h:18
void Create(const MeshData &mesh)
Creates the buffers for a given MeshData.
Definition: mesh.cc:19
StructuredBuffer vertex_buffer_
A StructuredBuffer that has all vertex data in it for this Mesh.
Definition: mesh.h:46
void Destroy()
Destroys all buffers held in the Mesh.
Definition: mesh.cc:45
const MeshData & GetMeshData() const
Definition: mesh.cc:52