MXVK Vulkan Framework 0.24.0
C++20 Vulkan rendering framework for practical 2D and 3D application development with SDL3.
Loading...
Searching...
No Matches
matrix.cpp File Reference
#include "mxvk/argz.hpp"
#include "mxvk/mxvk.hpp"
#include "mxvk/mxvk_exception.hpp"
#include "rain.hpp"
#include <SDL3/SDL.h>
#include <algorithm>
#include <chrono>
#include <cstdlib>
#include <format>
#include <iostream>
#include <memory>
#include <string>

Go to the source code of this file.

Classes

class  example::MatrixWindow

Namespaces

namespace  example
namespace  example::anonymous_namespace{matrix.cpp}

Functions

int main (int argc, char **argv)

Variables

constexpr int example::anonymous_namespace{matrix.cpp}::MATRIX_SURFACE_HEIGHT = 720
constexpr int example::anonymous_namespace{matrix.cpp}::MATRIX_SURFACE_WIDTH = 1280

Function Documentation

◆ main()

int main ( int argc,
char ** argv )

Definition at line 85 of file matrix.cpp.

85 {
86 try {
87 Arguments args = proc_args(argc, argv);
89 args.path, "-[ MXVK Matrix Digital Rain ]-", args.width, args.height, args.fullscreen, args.enable_vsync, args.binary,
90 args.font_size, args.font_path, args.color);
91 window.loop();
92 } catch (mxvk::Exception &e) {
93 std::cerr << std::format("mxvk: Exception: {}\n", e.text());
94 return EXIT_FAILURE;
95 } catch (ArgException<std::string> &e) {
96 std::cerr << std::format("mxvk: Argument Exception: {}\n", e.text());
97 return EXIT_FAILURE;
98 }
99
100 return EXIT_SUCCESS;
101}
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
String text() const
Definition argz.hpp:182
std::string text() const
Plain data structure returned by proc_args() with all common libmx2 CLI options.
Definition argz.hpp:730
std::string font_path
Optional font file path (--font-path).
Definition argz.hpp:762
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 color
Optional rain RGB tint (--color).
Definition argz.hpp:763
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
int font_size
Matrix rain font size in pixels (--font-size).
Definition argz.hpp:761
bool binary
Use binary glyphs only (--binary).
Definition argz.hpp:748