MXVK Vulkan Framework 0.24.0
C++20 Vulkan rendering framework for practical 2D and 3D application development with SDL3.
Loading...
Searching...
No Matches
mutatris.cpp
Go to the documentation of this file.
1#include <cstdlib>
2#include <format>
3#include <iostream>
4
5#include "mxvk/argz.hpp"
7
8#include "mutatris_window.hpp"
9
10int main(int argc, char **argv) {
11 try {
12 Arguments args = proc_args(argc, argv);
13 mutatris::MutatrisWindow window(args.path, args.width, args.height, args.fullscreen, args.enable_vsync, args.enable_crt);
14 window.loop();
15 } catch (const mxvk::Exception &e) {
16 std::cerr << std::format("mutatris: MXVK exception: {}\n", e.text());
17 return EXIT_FAILURE;
18 } catch (const ArgException<std::string> &e) {
19 std::cerr << std::format("mutatris: argument exception: {}\n", e.text());
20 return EXIT_FAILURE;
21 }
22 return EXIT_SUCCESS;
23}
Lightweight, header-only, template command-line argument parser.
Arguments proc_args(int &argc, char **argv)
Parse standard libmx2 command-line options from main()'s argv.
Definition argz.hpp:872
Exception thrown by Argz::proc() on unrecognised or malformed options.
Definition argz.hpp:178
std::string text() const
void loop()
Run the main event/render loop.
Definition mxvk.cpp:600
int main(void)
Definition main.cpp:7
Plain data structure returned by proc_args() with all common libmx2 CLI options.
Definition argz.hpp:730
bool fullscreen
Whether fullscreen mode was requested.
Definition argz.hpp:736
bool enable_vsync
Enable FIFO present mode / v-sync (--enable-vsync).
Definition argz.hpp:750
int height
Viewport height in pixels (default: 720).
Definition argz.hpp:733
std::string path
Asset root; proc_args() defaults it to the executable directory.
Definition argz.hpp:735
int width
Viewport width in pixels (default: 1280).
Definition argz.hpp:732
bool enable_crt
Enable CRT post-processing at startup (--enable-crt).
Definition argz.hpp:749