3
3
4
4
// nsc input/simple_shader.hlsl -T ps_6_0 -E Main -Fo output/shader.ps
5
5
6
+ #include " nbl/system/IApplicationFramework.h"
7
+
6
8
#include < iostream>
7
9
#include < cstdlib>
8
- # include < vector >
10
+
9
11
10
12
11
13
bool no_nbl_builtins;
12
14
13
15
14
- bool noNblBuiltinsEnabled (const std ::vector<std::string>& args)
16
+ bool noNblBuiltinsEnabled (const core ::vector<std::string>& args)
15
17
{
16
18
for (auto i=0 ; i<args.size (); i++)
17
19
{
@@ -23,30 +25,37 @@ bool noNblBuiltinsEnabled(const std::vector<std::string>& args)
23
25
24
26
25
27
26
- int main ( int argc, char * argv[])
28
+ class ShaderCompiler final : public system::IApplicationFramework
27
29
{
28
- // std::cout << "\n\t\t:: ::\n";
29
- // std::cout << "\tNABLA SHADER COMPILER";
30
- // std::cout << "\n\t\t:: ::\n\n";
30
+ using base_t = system::IApplicationFramework;
31
31
32
+ public:
33
+ using base_t ::base_t ;
32
34
33
- std::vector<std::string> arguments (argv + 1 , argv + argc);
35
+ bool onAppInitialized (smart_refctd_ptr<ISystem>&& system) override
36
+ {
37
+ auto argc = argv.size ();
34
38
35
- no_nbl_builtins = noNblBuiltinsEnabled ( arguments);
39
+ core::vector<std::string> arguments (argv + 1 , argv + argc );
36
40
37
- std::string command = " dxc.exe" ;
38
- for (std::string arg : arguments)
39
- {
40
- command.append (" " ).append (arg);
41
- }
41
+ no_nbl_builtins = noNblBuiltinsEnabled (arguments);
42
42
43
- int execute = std::system (command.c_str ());
43
+ std::string command = " dxc.exe" ;
44
+ for (std::string arg : arguments)
45
+ {
46
+ command.append (" " ).append (arg);
47
+ }
44
48
45
- std::string flag_set = no_nbl_builtins ? " TRUE" : " FALSE" ;
49
+ int execute = std::system (command.c_str ());
50
+
51
+ std::cout << " -no-nbl-builtins - " << no_nbl_builtins;
52
+
53
+
54
+ return true ;
55
+ }
46
56
47
- std::cout << " -no-nbl-builtins - " << flag_set;
48
57
58
+ void workLoopBody () override {}
49
59
50
- std::cout << " \n\n\n\n PRESS ENTER TO EXIT(): " ;
51
- std::cin.get ();
52
- }
60
+ bool keepRunning () override { return false ; }
61
+ };
0 commit comments