NAP
meshfromfile.h
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2  * License, v. 2.0. If a copy of the MPL was not distributed with this
3  * file, You can obtain one at https://mozilla.org/MPL/2.0/. */
4 
5 #pragma once
6 
7 #include "mesh.h"
8 
9 namespace nap
10 {
11  class Core;
19  class NAPAPI MeshFromFile : public IMesh
20  {
21  RTTI_ENABLE(IMesh)
22 
23  public:
24  MeshFromFile(Core& core);
25 
31  virtual bool init(utility::ErrorState& errorState) override;
32 
36  virtual MeshInstance& getMeshInstance() override { return *mMeshInstance; }
37 
41  virtual const MeshInstance& getMeshInstance() const override { return *mMeshInstance; }
42 
43  std::string mPath;
45  ECullMode mCullMode = ECullMode::Back;
47 
48  private:
49  RenderService* mRenderService = nullptr;
50  std::unique_ptr<MeshInstance> mMeshInstance = nullptr;
51  };
52 }
53 
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::MeshFromFile::mPath
std::string mPath
Property: 'Path' path to the '.mesh' file on disk.
Definition: meshfromfile.h:43
nap::IMesh
Definition: mesh.h:394
nap::RenderService
Definition: renderservice.h:275
nap::Core
Definition: core.h:82
nap::ECullMode::Back
@ Back
Cull back facing triangles.
nap::EPolygonMode::Fill
@ Fill
Polygons are interpreted and rendered using the specified 'EDrawMode'.
nap::MeshFromFile::getMeshInstance
virtual MeshInstance & getMeshInstance() override
Definition: meshfromfile.h:36
nap
Definition: templateapp.h:17
nap::MeshInstance
Definition: mesh.h:196
nap::MeshFromFile::getMeshInstance
virtual const MeshInstance & getMeshInstance() const override
Definition: meshfromfile.h:41
nap::MeshFromFile
Definition: meshfromfile.h:19