7
7
#include " nbl/system/declarations.h"
8
8
#include " nbl/system/definitions.h"
9
9
10
+ #if defined(_NBL_PLATFORM_WINDOWS_)
11
+ #include " nbl/system/CColoredStdoutLoggerWin32.h"
12
+ #elif defined(_NBL_PLATFORM_ANDROID_)
13
+ #include " nbl/system/CStdoutLoggerAndroid.h"
14
+ #endif
15
+ #include " nbl/system/CSystemAndroid.h"
16
+ #include " nbl/system/CSystemLinux.h"
17
+ #include " nbl/system/CSystemWin32.h"
10
18
11
19
namespace nbl ::system
12
20
{
13
21
14
22
class IApplicationFramework
15
23
{
16
24
public:
25
+ // this is safe to call multiple times
17
26
static void GlobalsInit ()
18
27
{
19
28
#ifdef _NBL_PLATFORM_WINDOWS_
20
29
#ifdef NBL_CPACK_PACKAGE_DXC_DLL_DIR
21
- const HRESULT dxcLoad = CSystemWin32::delayLoadDLL (" dxcompiler.dll" , { system:: path (_DXC_DLL_).parent_path (), NBL_CPACK_PACKAGE_DXC_DLL_DIR });
30
+ const HRESULT dxcLoad = CSystemWin32::delayLoadDLL (" dxcompiler.dll" , { path (_DXC_DLL_).parent_path (), NBL_CPACK_PACKAGE_DXC_DLL_DIR });
22
31
#else
23
- const HRESULT dxcLoad = CSystemWin32::delayLoadDLL (" dxcompiler.dll" , { system:: path (_DXC_DLL_).parent_path () });
32
+ const HRESULT dxcLoad = CSystemWin32::delayLoadDLL (" dxcompiler.dll" , { path (_DXC_DLL_).parent_path () });
24
33
#endif
25
34
26
35
// assert(SUCCEEDED(dxcLoad)); // no clue why this fails to find the dll
@@ -43,17 +52,28 @@ class IApplicationFramework
43
52
#endif
44
53
}
45
54
55
+ static nbl::core::smart_refctd_ptr<ISystem> createSystem ()
56
+ {
57
+ GlobalsInit ();
58
+ #ifdef _NBL_PLATFORM_WINDOWS_
59
+ return nbl::core::make_smart_refctd_ptr<CSystemWin32>();
60
+ #elif defined(_NBL_PLATFORM_ANDROID_)
61
+ return nbl::core::make_smart_refctd_ptr<CSystemAndroid>(std::move (caller));
62
+ #endif
63
+ return nullptr ;
64
+ }
65
+
46
66
IApplicationFramework (
47
- const system:: path& _localInputCWD,
48
- const system:: path& _localOutputCWD,
49
- const system:: path& _sharedInputCWD,
50
- const system:: path& _sharedOutputCWD) :
67
+ const path& _localInputCWD,
68
+ const path& _localOutputCWD,
69
+ const path& _sharedInputCWD,
70
+ const path& _sharedOutputCWD) :
51
71
localInputCWD (_localInputCWD), localOutputCWD(_localOutputCWD), sharedInputCWD(_sharedInputCWD), sharedOutputCWD(_sharedOutputCWD)
52
72
{
53
73
GlobalsInit ();
54
74
}
55
75
56
- virtual void setSystem (core::smart_refctd_ptr<nbl::system:: ISystem>&& system) = 0;
76
+ virtual void setSystem (core::smart_refctd_ptr<ISystem>&& system) = 0;
57
77
58
78
void onAppInitialized ()
59
79
{
@@ -90,22 +110,22 @@ class IApplicationFramework
90
110
91
111
To add files to your assets directory, create an "assets" directory in your app's source directory
92
112
*/
93
- system:: path localInputCWD;
113
+ path localInputCWD;
94
114
95
115
/*
96
116
This is a CWD used to output app-local data e.g. screenshots
97
117
*/
98
- system:: path localOutputCWD;
118
+ path localOutputCWD;
99
119
100
120
/*
101
121
The CWD for input data that can be shared among apps, like the "examples_tests/media" directory for Nabla examples
102
122
*/
103
- system:: path sharedInputCWD;
123
+ path sharedInputCWD;
104
124
105
125
/*
106
126
This CWD is used to output data that can be shared between apps e.g. quantization cache
107
127
*/
108
- system:: path sharedOutputCWD;
128
+ path sharedOutputCWD;
109
129
};
110
130
111
131
}
0 commit comments