mirror of
https://github.com/allemangD/toddcox-visualize.git
synced 2025-11-10 12:02:47 -05:00
accept config file as program argument
This commit is contained in:
@@ -7,7 +7,3 @@ groups:
|
|||||||
color: [0.3, 0.3, 0.3]
|
color: [0.3, 0.3, 0.3]
|
||||||
exclude:
|
exclude:
|
||||||
- [0, 1, 2]
|
- [0, 1, 2]
|
||||||
wires:
|
|
||||||
- root: [0.50, 0.05, 0.05, 0.05, 0.01]
|
|
||||||
color: [0.9, 0.9, 0.9]
|
|
||||||
curve: true
|
|
||||||
|
|||||||
@@ -180,7 +180,7 @@ struct Wire {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
void run(GLFWwindow *window) {
|
void run(const std::string &config_file, GLFWwindow *window) {
|
||||||
glEnable(GL_DEPTH_TEST);
|
glEnable(GL_DEPTH_TEST);
|
||||||
|
|
||||||
glEnable(GL_BLEND);
|
glEnable(GL_BLEND);
|
||||||
@@ -199,7 +199,7 @@ void run(GLFWwindow *window) {
|
|||||||
.stage(sh.slice)
|
.stage(sh.slice)
|
||||||
.stage(sh.solid);
|
.stage(sh.solid);
|
||||||
|
|
||||||
auto scene = YAML::LoadFile("presets/default.yaml");
|
auto scene = YAML::LoadFile(config_file);
|
||||||
|
|
||||||
auto slices = std::vector<Slice<4>>();
|
auto slices = std::vector<Slice<4>>();
|
||||||
auto wires = std::vector<Wire>();
|
auto wires = std::vector<Wire>();
|
||||||
@@ -326,7 +326,10 @@ int main(int argc, char *argv[]) {
|
|||||||
|
|
||||||
std::cout << utilInfo();
|
std::cout << utilInfo();
|
||||||
|
|
||||||
run(window);
|
std::string config_file = "presets/default.yaml";
|
||||||
|
if (argc > 1) config_file = std::string(argv[1]);
|
||||||
|
|
||||||
|
run(config_file, window);
|
||||||
|
|
||||||
glfwTerminate();
|
glfwTerminate();
|
||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
|
|||||||
Reference in New Issue
Block a user