408 {
409 std::cout.setf(std::ios::unitbuf);
410 std::cerr.setf(std::ios::unitbuf);
411 setvbuf(stdout, nullptr, _IONBF, 0);
412 setvbuf(stderr, nullptr, _IONBF, 0);
413
414 try {
419 std::cout << "viewer: benchmark resolution defaults to 320x180; use -r or --resolution to override\n";
420 }
422 window.loop();
424 std::cerr << std::format(
"mxvk: Exception: {}\n", e.
text());
425 return EXIT_FAILURE;
427 std::cerr << std::format(
"mxvk: Argument Exception: {}\n", e.
text());
428 return EXIT_FAILURE;
429 } catch (const std::exception &e) {
430 std::cerr << std::format("viewer: Exception: {}\n", e.what());
431 return EXIT_FAILURE;
432 }
433 return EXIT_SUCCESS;
434}
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).