72 tex.fileName = readNext(arguments, i); |
72 tex.fileName = readNext(arguments, i); |
73 c.textures.push_back(tex); |
73 c.textures.push_back(tex); |
74 } else if (option == OPTION_SHADER) { |
74 } else if (option == OPTION_SHADER) { |
75 const auto type = readNext(arguments, i); |
75 const auto type = readNext(arguments, i); |
76 const auto file = readNext(arguments, i); |
76 const auto file = readNext(arguments, i); |
77 if (type == "fragment") c.fragmentShaders.push_back({file}); |
77 c.shaders.push_back({file, type}); |
78 else if (type == "vertex") c.vertexShaders .push_back({file}); |
|
79 else throw std::invalid_argument("unsupported shader type"); |
|
80 } else if (option == OPTION_BACKGROUND_COLOR) { |
78 } else if (option == OPTION_BACKGROUND_COLOR) { |
81 c.backgroundColor = parseHexColor(readNext(arguments, i)); |
79 c.backgroundColor = parseHexColor(readNext(arguments, i)); |
82 } else if (option == OPTION_ROOT_WINDOW) { |
80 } else if (option == OPTION_ROOT_WINDOW) { |
83 c.rootWindow = std::stoul(readNext(arguments, i)); |
81 c.rootWindow = std::stoul(readNext(arguments, i)); |
84 } else throw std::logic_error("Unsupported CLI option: " + option); |
82 } else throw std::logic_error("Unsupported CLI option: " + option); |