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

Go to the source code of this file.

Classes

struct  anonymous_namespace{main.cpp}::FaceDraw
class  example::Math3DPyramidWindow
class  anonymous_namespace{main.cpp}::SurfaceDeleter

Namespaces

namespace  anonymous_namespace{main.cpp}
namespace  example

Functions

SurfacePtr anonymous_namespace{main.cpp}::create_frame_surface (int width, int height)
int main (int argc, char **argv)
std::filesystem::path anonymous_namespace{main.cpp}::pyramid_path (const std::string &asset_path)

Function Documentation

◆ main()

int main ( int argc,
char ** argv )

Definition at line 297 of file main.cpp.

297 {
298 try {
299 Arguments args = proc_args(argc, argv);
300 example::Math3DPyramidWindow window(args.path, "MXVK 3D Math Pyramid", args.width, args.height, args.fullscreen, args.enable_vsync, args.framebuffer);
301 window.loop();
302 } catch (mxvk::Exception &e) {
303 std::cerr << std::format("mxvk: Exception: {}\n", e.text());
304 return EXIT_FAILURE;
305 } catch (ArgException<std::string> &e) {
306 std::cerr << std::format("mxvk: Argument Exception: {}\n", e.text());
307 return EXIT_FAILURE;
308 }
309 return EXIT_SUCCESS;
310}
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
FramebufferDimensions framebuffer
Software framebuffer size requested by --framebuffer.
Definition argz.hpp:758
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