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

Go to the source code of this file.

Classes

class  knight::KnightsTourWindow
class  knight::Tour

Namespaces

namespace  knight

Functions

int main (int argc, char **argv)

Function Documentation

◆ main()

int main ( int argc,
char ** argv )

Definition at line 410 of file knight.cpp.

410 {
411 try {
412 Arguments args = proc_args(argc, argv);
413 if (!args.resolutionSpecified) {
414 args.width = 960;
415 args.height = 720;
416 }
417 knight::KnightsTourWindow window(args.path, args.width, args.height, args.fullscreen, args.enable_vsync);
418 window.loop();
419 } catch (mxvk::Exception &exception) {
420 std::cerr << std::format("mxvk: Exception: {}\n", exception.text());
421 return EXIT_FAILURE;
422 } catch (ArgException<std::string> &exception) {
423 std::cerr << std::format("mxvk: Argument Exception: {}\n", exception.text());
424 return EXIT_FAILURE;
425 }
426 return EXIT_SUCCESS;
427}
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
bool fullscreen
Whether fullscreen mode was requested.
Definition argz.hpp:736
bool resolutionSpecified
Whether -r/–resolution was provided.
Definition argz.hpp:734
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