Skip to content

Commit 7b0e90d

Browse files
author
devsh
committed
Split MonoAssetManagerAndBuiltinResourceApplication.hpp in two, address some TODOs
1 parent 68bd6a9 commit 7b0e90d

File tree

6 files changed

+57
-65
lines changed

6 files changed

+57
-65
lines changed

include/nbl/application_templates/BasicMultiQueueApplication.hpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
// Copyright (C) 2023-2023 - DevSH Graphics Programming Sp. z O.O.
22
// This file is part of the "Nabla Engine".
33
// For conditions of distribution and use, see copyright notice in nabla.h
4-
#ifndef _NBL_EXAMPLES_APPLICATION_TEMPLATES_BASIC_MULTI_QUEUE_APPLICATION_HPP_INCLUDED_
5-
#define _NBL_EXAMPLES_APPLICATION_TEMPLATES_BASIC_MULTI_QUEUE_APPLICATION_HPP_INCLUDED_
4+
#ifndef _NBL_APPLICATION_TEMPLATES_BASIC_MULTI_QUEUE_APPLICATION_HPP_INCLUDED_
5+
#define _NBL_APPLICATION_TEMPLATES_BASIC_MULTI_QUEUE_APPLICATION_HPP_INCLUDED_
6+
67

78
// Build on top of the previous one
8-
#include "MonoDeviceApplication.hpp"
9+
#include "nbl/application_templates/MonoDeviceApplication.hpp"
10+
911

1012
namespace nbl::application_templates
1113
{
@@ -263,5 +265,4 @@ class BasicMultiQueueApplication : public virtual MonoDeviceApplication
263265
};
264266

265267
}
266-
267-
#endif // _CAMERA_IMPL_
268+
#endif

include/nbl/application_templates/MonoAssetManagerAndBuiltinResourceApplication.hpp

Lines changed: 0 additions & 52 deletions
This file was deleted.
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
// Copyright (C) 2023-2023 - DevSH Graphics Programming Sp. z O.O.
2+
// This file is part of the "Nabla Engine".
3+
// For conditions of distribution and use, see copyright notice in nabla.h
4+
#ifndef _NBL_APPLICATION_TEMPLATES_MONO_ASSET_MANAGER_APPLICATION_HPP_INCLUDED_
5+
#define _NBL_APPLICATION_TEMPLATES_MONO_ASSET_MANAGER_APPLICATION_HPP_INCLUDED_
6+
7+
8+
// we need a system and a logger
9+
#include "nbl/application_templates/MonoSystemMonoLoggerApplication.hpp"
10+
11+
12+
namespace nbl::application_templates
13+
{
14+
15+
// Virtual Inheritance because apps might end up doing diamond inheritance
16+
class MonoAssetManagerApplication : public virtual MonoSystemMonoLoggerApplication
17+
{
18+
using base_t = MonoSystemMonoLoggerApplication;
19+
20+
public:
21+
using base_t::base_t;
22+
23+
protected:
24+
// need this one for skipping passing all args into ApplicationFramework
25+
MonoAssetManagerApplication() = default;
26+
27+
virtual bool onAppInitialized(core::smart_refctd_ptr<system::ISystem>&& system) override
28+
{
29+
if (!base_t::onAppInitialized(std::move(system)))
30+
return false;
31+
32+
using namespace core;
33+
m_assetMgr = make_smart_refctd_ptr<asset::IAssetManager>(smart_refctd_ptr(m_system));
34+
35+
return true;
36+
}
37+
38+
core::smart_refctd_ptr<asset::IAssetManager> m_assetMgr;
39+
};
40+
41+
}
42+
#endif

include/nbl/application_templates/MonoDeviceApplication.hpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
// Copyright (C) 2023-2023 - DevSH Graphics Programming Sp. z O.O.
22
// This file is part of the "Nabla Engine".
33
// For conditions of distribution and use, see copyright notice in nabla.h
4-
#ifndef _NBL_EXAMPLES_APPLICATION_TEMPLATES_MONO_DEVICE_APPLICATION_HPP_INCLUDED_
5-
#define _NBL_EXAMPLES_APPLICATION_TEMPLATES_MONO_DEVICE_APPLICATION_HPP_INCLUDED_
4+
#ifndef _NBL_APPLICATION_TEMPLATES_MONO_DEVICE_APPLICATION_HPP_INCLUDED_
5+
#define _NBL_APPLICATION_TEMPLATES_MONO_DEVICE_APPLICATION_HPP_INCLUDED_
6+
67

78
// Build on top of the previous one
8-
#include "MonoSystemMonoLoggerApplication.hpp"
9+
#include "nbl/application_templates/MonoSystemMonoLoggerApplication.hpp"
10+
911

1012
namespace nbl::application_templates
1113
{
@@ -277,5 +279,4 @@ class MonoDeviceApplication : public virtual MonoSystemMonoLoggerApplication
277279
};
278280

279281
}
280-
281-
#endif // _CAMERA_IMPL_
282+
#endif

include/nbl/application_templates/MonoSystemMonoLoggerApplication.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// Copyright (C) 2023-2023 - DevSH Graphics Programming Sp. z O.O.
22
// This file is part of the "Nabla Engine".
33
// For conditions of distribution and use, see copyright notice in nabla.h
4-
#ifndef _NBL_EXAMPLES_APPLICATION_TEMPLATES_MONO_SYSTEM_MONO_LOGGER_APPLICATION_HPP_INCLUDED_
5-
#define _NBL_EXAMPLES_APPLICATION_TEMPLATES_MONO_SYSTEM_MONO_LOGGER_APPLICATION_HPP_INCLUDED_
4+
#ifndef _NBL_APPLICATION_TEMPLATES_MONO_SYSTEM_MONO_LOGGER_APPLICATION_HPP_INCLUDED_
5+
#define _NBL_APPLICATION_TEMPLATES_MONO_SYSTEM_MONO_LOGGER_APPLICATION_HPP_INCLUDED_
66

77
// always include nabla first
88
#include "nabla.h"

0 commit comments

Comments
 (0)