| 194 | } |
| 195 | |
| 196 | static bool ParseWindowSize(LLGL::Extent2D& size, int argc, char* argv[]) |
| 197 | { |
| 198 | const LLGL::StringView resArg = "-res="; |
| 199 | for_subrange(i, 1, argc) |
| 200 | { |
| 201 | const LLGL::StringView arg = argv[i]; |
| 202 | if (arg.compare(0, resArg.size(), resArg) == 0) |
| 203 | { |
| 204 | if (arg.size() < resArg.size() + 3) |
| 205 | return false; |
| 206 | |
| 207 | char* tok = ::strtok(argv[i] + resArg.size(), "x"); |
| 208 | int values[2] = {}; |
| 209 | for (int tokIndex = 0; tok != nullptr && tokIndex < 2; ++tokIndex) |
| 210 | { |
| 211 | values[tokIndex] = ::atoi(tok); |
| 212 | tok = ::strtok(nullptr, "x"); |
| 213 | } |
| 214 | |
| 215 | size.width = static_cast<std::uint32_t>(std::max(1, std::min(values[0], 16384))); |
| 216 | size.height = static_cast<std::uint32_t>(std::max(1, std::min(values[1], 16384))); |
| 217 | |
| 218 | return true; |
| 219 | } |
| 220 | } |
| 221 | return false; |
| 222 | } |
| 223 | |
| 224 | static bool ParseSamples(std::uint32_t& samples, int argc, char* argv[]) |
| 225 | { |
no test coverage detected