MXVK Vulkan Framework
0.33.1
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
"
6
#include "
mxvk/mxvk_exception.hpp
"
7
8
#include "
mutatris_window.hpp
"
9
10
int
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
}
argz.hpp
Lightweight, header-only, template command-line argument parser.
proc_args
Arguments proc_args(int &argc, char **argv)
Parse standard libmx2 command-line options from main()'s argv.
Definition
argz.hpp:872
ArgException
Exception thrown by Argz::proc() on unrecognised or malformed options.
Definition
argz.hpp:178
mutatris::MutatrisWindow
Definition
mutatris_window.hpp:24
mxvk::Exception
Definition
mxvk_exception.hpp:7
mxvk::Exception::text
std::string text() const
Definition
mxvk_exception.hpp:10
mxvk::VK_Window::loop
void loop()
Run the main event/render loop.
Definition
mxvk.cpp:627
main
int main(int argc, char **argv)
Definition
main.cpp:173
mutatris_window.hpp
mxvk_exception.hpp
Arguments
Plain data structure returned by proc_args() with all common libmx2 CLI options.
Definition
argz.hpp:730
Arguments::fullscreen
bool fullscreen
Whether fullscreen mode was requested.
Definition
argz.hpp:736
Arguments::enable_vsync
bool enable_vsync
Enable FIFO present mode / v-sync (--enable-vsync).
Definition
argz.hpp:750
Arguments::height
int height
Viewport height in pixels (default: 720).
Definition
argz.hpp:733
Arguments::path
std::string path
Asset root; proc_args() defaults it to the executable directory.
Definition
argz.hpp:735
Arguments::width
int width
Viewport width in pixels (default: 1280).
Definition
argz.hpp:732
Arguments::enable_crt
bool enable_crt
Enable CRT post-processing at startup (--enable-crt).
Definition
argz.hpp:749
examples
mutatris
mutatris.cpp
Generated by
1.18.0