MCPcopy Create free account
hub / github.com/AcademySoftwareFoundation/MaterialX / main

Function main

source/MaterialXGraphEditor/Main.cpp:59–316  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

57} // anonymous namespace
58
59int main(int argc, char* const argv[])
60{
61 std::vector<std::string> tokens;
62 for (int i = 1; i < argc; i++)
63 {
64 tokens.emplace_back(argv[i]);
65 }
66
67 std::string materialFilename = "resources/Materials/Examples/StandardSurface/standard_surface_marble_solid.mtlx";
68 std::string meshFilename = "resources/Geometry/shaderball.glb";
69 mx::FileSearchPath searchPath = mx::getDefaultDataSearchPath();
70 mx::FilePathVec libraryFolders;
71 int viewWidth = 256;
72 int viewHeight = 256;
73 float uiScale = 0.0f;
74 std::string fontFilename;
75 int fontSize = 18;
76 float previewWidth = 256.0f;
77 std::string captureFilename;
78
79 for (size_t i = 0; i < tokens.size(); i++)
80 {
81 const std::string& token = tokens[i];
82 const std::string& nextToken = i + 1 < tokens.size() ? tokens[i + 1] : mx::EMPTY_STRING;
83
84 if (token == "--material")
85 {
86 materialFilename = nextToken;
87 }
88 else if (token == "--mesh")
89 {
90 meshFilename = nextToken;
91 }
92 else if (token == "--path")
93 {
94 searchPath.append(mx::FileSearchPath(nextToken));
95 }
96 else if (token == "--library")
97 {
98 libraryFolders.push_back(nextToken);
99 }
100 else if (token == "--viewWidth")
101 {
102 parseToken(nextToken, "integer", viewWidth);
103 }
104 else if (token == "--viewHeight")
105 {
106 parseToken(nextToken, "integer", viewHeight);
107 }
108 else if (token == "--uiScale")
109 {
110 parseToken(nextToken, "float", uiScale);
111 }
112 else if (token == "--font")
113 {
114 parseToken(nextToken, "string", fontFilename);
115 }
116 else if (token == "--fontSize")

Callers

nothing calls this directly

Calls 15

FileSearchPathFunction · 0.85
getVersionStringFunction · 0.85
glfwSetErrorCallbackFunction · 0.85
glfwInitFunction · 0.85
glfwWindowHintFunction · 0.85
glfwCreateWindowFunction · 0.85
glfwMakeContextCurrentFunction · 0.85
glfwSwapIntervalFunction · 0.85
glfwGetPrimaryMonitorFunction · 0.85
glfwWindowShouldCloseFunction · 0.85
glfwPollEventsFunction · 0.85

Tested by

no test coverage detected