379 {
380 std::cout.setf(std::ios::unitbuf);
381 std::cerr.setf(std::ios::unitbuf);
382 setvbuf(stdout, nullptr, _IONBF, 0);
383 setvbuf(stderr, nullptr, _IONBF, 0);
384
385 try {
390 std::cout << "viewer: benchmark resolution defaults to 320x180; use -r or --resolution to override\n";
391 }
393 window.loop();
395 std::cerr << std::format(
"mxvk: Exception: {}\n", e.
text());
396 return EXIT_FAILURE;
398 std::cerr << std::format(
"mxvk: Argument Exception: {}\n", e.
text());
399 return EXIT_FAILURE;
400 } catch (const std::exception &e) {
401 std::cerr << std::format("viewer: Exception: {}\n", e.what());
402 return EXIT_FAILURE;
403 }
404 return EXIT_SUCCESS;
405}
Arguments proc_args(int &argc, char **argv)
Parse standard libmx2 command-line options from main()'s argv.
Exception thrown by Argz::proc() on unrecognised or malformed options.
Plain data structure returned by proc_args() with all common libmx2 CLI options.
bool resolutionSpecified
Whether -r/–resolution was provided.
int height
Viewport height in pixels (default: 720).
bool benchmark
Enable application benchmark mode (--benchmark).
int width
Viewport width in pixels (default: 1280).