BRE12
Model.h
1 #pragma once
2 
3 #include <vector>
4 #include <wrl.h>
5 
6 #include <GeometryGenerator/GeometryGenerator.h>
7 #include <ModelManager/Mesh.h>
8 
9 struct ID3D12GraphicsCommandList;
10 struct ID3D12Resource;
11 
12 namespace BRE {
13 // - To load model data from a filepath.
14 // - To get meshes
15 class Model {
16 public:
17  ~Model() = default;
18  Model(const Model&) = delete;
19  const Model& operator=(const Model&) = delete;
20  Model(Model&&) = delete;
21  Model& operator=(Model&&) = delete;
22 
23  // Command lists are used to store buffers creation (vertex and index per mesh)
24  // Preconditions:
25  // - "commandList" must be in recorded state before calling these method.
26  // - "commandList" must be executed after calling these methods, to create the commited resource.
27  explicit Model(const char* modelFilename,
28  ID3D12GraphicsCommandList& commandList,
29  Microsoft::WRL::ComPtr<ID3D12Resource>& uploadVertexBuffer,
30  Microsoft::WRL::ComPtr<ID3D12Resource>& uploadIndexBuffer);
31 
32  explicit Model(const GeometryGenerator::MeshData& meshData,
33  ID3D12GraphicsCommandList& commandList,
34  Microsoft::WRL::ComPtr<ID3D12Resource>& uploadVertexBuffer,
35  Microsoft::WRL::ComPtr<ID3D12Resource>& uploadIndexBuffer);
36 
37  __forceinline bool HasMeshes() const noexcept
38  {
39  return (mMeshes.size() > 0UL);
40  }
41  __forceinline const std::vector<Mesh>& GetMeshes() const noexcept
42  {
43  return mMeshes;
44  }
45 
46 private:
47  std::vector<Mesh> mMeshes;
48 };
49 
50 }
51 
Definition: Camera.cpp:8
Definition: GeometryGenerator.h:30
Definition: Model.h:15