author | František Kučera <franta-hg@frantovo.cz> |
Thu, 28 Dec 2023 01:35:17 +0100 | |
branch | v_0 |
changeset 37 | fb673fa1cad5 |
parent 29 | dc3c102e1264 |
permissions | -rw-r--r-- |
0 | 1 |
/** |
29
dc3c102e1264
derive OHP3D from ShaderShark
František Kučera <franta-hg@frantovo.cz>
parents:
0
diff
changeset
|
2 |
* OHP3D |
0 | 3 |
* Copyright © 2023 František Kučera (Frantovo.cz, GlobalCode.info) |
4 |
* |
|
5 |
* This program is free software: you can redistribute it and/or modify |
|
6 |
* it under the terms of the GNU General Public License as published by |
|
7 |
* the Free Software Foundation, version 3 of the License. |
|
8 |
* |
|
9 |
* This program is distributed in the hope that it will be useful, |
|
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
12 |
* GNU General Public License for more details. |
|
13 |
* |
|
14 |
* You should have received a copy of the GNU General Public License |
|
15 |
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
16 |
*/ |
|
17 |
||
18 |
#include <iostream> |
|
19 |
#include <locale> |
|
20 |
#include <stdexcept> |
|
21 |
#include <vector> |
|
22 |
#include <string> |
|
23 |
||
24 |
#include "CLIParser.h" |
|
29
dc3c102e1264
derive OHP3D from ShaderShark
František Kučera <franta-hg@frantovo.cz>
parents:
0
diff
changeset
|
25 |
#include "OHP3D.h" |
0 | 26 |
|
27 |
int main(int argc, char** argv) { |
|
28 |
setlocale(LC_ALL, ""); |
|
29
dc3c102e1264
derive OHP3D from ShaderShark
František Kučera <franta-hg@frantovo.cz>
parents:
0
diff
changeset
|
29 |
std::cout << "OHP3D for OpenGL" << std::endl; |
0 | 30 |
int result = 0; |
31 |
||
32 |
try { |
|
33 |
std::vector<std::string> arguments; |
|
34 |
for (int i = 1; i < argc; i++) arguments.push_back(argv[i]); |
|
35 |
||
36 |
CLIParser cliParser; |
|
37 |
Configuration cfg = cliParser.parse(arguments); |
|
38 |
||
29
dc3c102e1264
derive OHP3D from ShaderShark
František Kučera <franta-hg@frantovo.cz>
parents:
0
diff
changeset
|
39 |
OHP3D shaderOHP3D(cfg); |
dc3c102e1264
derive OHP3D from ShaderShark
František Kučera <franta-hg@frantovo.cz>
parents:
0
diff
changeset
|
40 |
shaderOHP3D.run(); |
0 | 41 |
} catch (const std::exception& e) { |
42 |
std::cerr << "Exception: " << e.what() << std::endl; |
|
43 |
result = 1; |
|
44 |
} catch (...) { |
|
45 |
std::cerr << "Exception: unexpected" << std::endl; |
|
46 |
result = 2; |
|
47 |
} |
|
48 |
||
49 |
return result; |
|
50 |
} |