MCPcopy Create free account
hub / github.com/LukasBanana/LLGL / ParseSamples

Function ParseSamples

examples/Cpp/ExampleBase/ExampleBase.cpp:224–242  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

222}
223
224static bool ParseSamples(std::uint32_t& samples, int argc, char* argv[])
225{
226 const LLGL::StringView msArg = "-ms=";
227 for_subrange(i, 1, argc)
228 {
229 const LLGL::StringView arg = argv[i];
230 if (arg.compare(0, msArg.size(), msArg) == 0)
231 {
232 if (arg.size() < msArg.size() + 1)
233 return false;
234
235 int value = ::atoi(argv[i] + msArg.size());
236 samples = static_cast<std::uint32_t>(std::max(1, std::min(value, 16)));
237
238 return true;
239 }
240 }
241 return false;
242}
243
244
245/*

Callers 1

ParseProgramArgsMethod · 0.85

Calls 3

compareMethod · 0.80
for_subrangeFunction · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected