Skip to content

Commit 1b3c19c

Browse files
author
devsh
committed
make the BuiltinResourcesApplication work for examples without builtins too
1 parent 21a88ff commit 1b3c19c

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

09_GeometryCreator/include/common.hpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#ifndef _NBL_THIS_EXAMPLE_COMMON_H_INCLUDED_
22
#define _NBL_THIS_EXAMPLE_COMMON_H_INCLUDED_
33

4-
// TODO: @AnastaZIuk do we even make that explicit?
5-
#include "nbl/examples/PCH.hpp"
4+
5+
#include "nbl/examples/examples.hpp"
66

77
using namespace nbl;
88
using namespace core;
@@ -14,4 +14,5 @@ using namespace video;
1414
using namespace scene;
1515
using namespace nbl::examples;
1616

17+
1718
#endif // __NBL_THIS_EXAMPLE_COMMON_H_INCLUDED__

common/include/nbl/examples/common/BuiltinResourcesApplication.hpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@
1212
// TODO: the include/header `nbl/examples` archive
1313
// TODO: the source `nbl/examples` archive
1414
// TODO: the build `nbl/examples` archive
15-
// TODO: make the `this_example` optional, only if the example has builtins
16-
#include "nbl/this_example/builtin/CArchive.h"
15+
#if __has_include("nbl/this_example/builtin/CArchive.h")
16+
#include "nbl/this_example/builtin/CArchive.h"
17+
#endif
1718
#endif
1819

1920

@@ -55,7 +56,8 @@ class BuiltinResourcesApplication : public virtual application_templates::MonoAs
5556
m_system->mount(std::move(examplesHeaderArch),"nbl/examples");
5657
m_system->mount(std::move(examplesSourceArch),"nbl/examples");
5758
// m_system->mount(std::move(examplesBuildArch),"nbl/examples");
58-
m_system->mount(std::move(thisExampleArch),"app_resources");
59+
if (thisExampleArch)
60+
m_system->mount(std::move(thisExampleArch),"app_resources");
5961

6062
return true;
6163
}

0 commit comments

Comments
 (0)