NAP
toymesh.h
1 #pragma once
2 
3 // External Includes
4 #include <mesh.h>
5 
6 namespace nap
7 {
12  class NAPAPI ToyMesh : public IMesh
13  {
14  RTTI_ENABLE(IMesh)
15  public:
16  // Constructor
17  ToyMesh(Core& core);
18 
24  virtual bool init(utility::ErrorState& errorState) override;
25 
29  virtual MeshInstance& getMeshInstance() override { assert(mMeshInstance != nullptr); return *mMeshInstance; }
30 
34  virtual const MeshInstance& getMeshInstance() const override { assert(mMeshInstance != nullptr); return *mMeshInstance; }
35 
38  ECullMode mCullMode = ECullMode::Back;
39 
40  private:
41  RenderService* mRenderService = nullptr;
42  std::unique_ptr<MeshInstance> mMeshInstance = nullptr;
43  };
44 }
nap::EMemoryUsage::Static
@ Static
Buffer data is uploaded only once from the CPU to the GPU.
nap::EPolygonMode
EPolygonMode
Definition: mesh.h:55
nap::ECullMode
ECullMode
Definition: mesh.h:43
nap::EMemoryUsage
EMemoryUsage
Definition: gpubuffer.h:41
nap::utility::ErrorState
Definition: errorstate.h:19
nap::IMesh
Definition: mesh.h:401
nap::RenderService
Definition: renderservice.h:198
nap::Core
Definition: core.h:82
nap::ToyMesh::getMeshInstance
virtual MeshInstance & getMeshInstance() override
Definition: toymesh.h:29
nap::ToyMesh
Definition: toymesh.h:12
nap::ECullMode::Back
@ Back
Cull back facing triangles.
nap::EPolygonMode::Fill
@ Fill
Polygons are interpreted and rendered using the specified 'EDrawMode'.
nap
Definition: templateapp.h:17
nap::MeshInstance
Definition: mesh.h:196
nap::ToyMesh::getMeshInstance
virtual const MeshInstance & getMeshInstance() const override
Definition: toymesh.h:34