Skip to content

Commit 276b817

Browse files
committed
Merge branch 'main' into public
2 parents b24baef + 8ab0a98 commit 276b817

File tree

3 files changed

+19
-2
lines changed

3 files changed

+19
-2
lines changed

cmake/version.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
set(NAP_MAJOR_VERSION 0)
22
set(NAP_MINOR_VERSION 7)
3-
set(NAP_PATCH_VERSION 0)
3+
set(NAP_PATCH_VERSION 1)
44
set(NAP_VERSION "${NAP_MAJOR_VERSION}.${NAP_MINOR_VERSION}.${NAP_PATCH_VERSION}")
55
# Be careful updating this as it's currently parsed during packaging by package.py
66
message(STATUS "NAP version: ${NAP_VERSION}")

system_modules/naprenderadvanced/src/emptymesh.cpp

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@
1111

1212
RTTI_BEGIN_CLASS_NO_DEFAULT_CONSTRUCTOR(nap::EmptyMesh, "A mesh without data for simple render operations, with shaders without geometry")
1313
RTTI_CONSTRUCTOR(nap::Core&)
14-
RTTI_END_CLASS
14+
RTTI_PROPERTY("Usage", &nap::EmptyMesh::mUsage, nap::rtti::EPropertyMetaData::Default)
15+
RTTI_PROPERTY("DrawMode", &nap::EmptyMesh::mDrawMode, nap::rtti::EPropertyMetaData::Default)
16+
RTTI_PROPERTY("CullMode", &nap::EmptyMesh::mCullMode, nap::rtti::EPropertyMetaData::Default)
17+
RTTI_PROPERTY("PolygonMode", &nap::EmptyMesh::mPolygonMode, nap::rtti::EPropertyMetaData::Default)
18+
RTTI_END_CLASS
1519

1620
namespace nap
1721
{
@@ -28,6 +32,14 @@ namespace nap
2832
// Initialize no mesh instance
2933
assert(mRenderService != nullptr);
3034
mMeshInstance = std::make_unique<MeshInstance>(*mRenderService);
35+
36+
// Configure the mesh instance
37+
mMeshInstance->setUsage(mUsage);
38+
mMeshInstance->setDrawMode(mDrawMode);
39+
mMeshInstance->setCullMode(mCullMode);
40+
mMeshInstance->setPolygonMode(mPolygonMode);
41+
mMeshInstance->setNumVertices(0);
42+
3143
return mMeshInstance->init(errorState);
3244
}
3345
}

system_modules/naprenderadvanced/src/emptymesh.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,11 @@ namespace nap
4545
*/
4646
virtual const MeshInstance& getMeshInstance() const override { return *mMeshInstance; }
4747

48+
EMemoryUsage mUsage = EMemoryUsage::Static; ///< Property: 'Usage' GPU memory usage
49+
EDrawMode mDrawMode = EDrawMode::Triangles; ///< Property: 'DrawMode' The draw mode that should be used to draw the shapes
50+
ECullMode mCullMode = ECullMode::Back; ///< Property: 'CullMode' The triangle cull mode to use
51+
EPolygonMode mPolygonMode = EPolygonMode::Fill; ///< Property: 'PolygonMode' The polygon mode to use, fill is always available and should be the default
52+
4853
private:
4954
nap::RenderService* mRenderService = nullptr; ///< Handle to the render service
5055
std::unique_ptr<MeshInstance> mMeshInstance; ///< The mesh instance to construct

0 commit comments

Comments
 (0)