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

Go to the source code of this file.

Classes

struct  surface::Point
struct  surface::SurfaceDeleter
class  surface::SurfaceWindow

Namespaces

namespace  surface

Functions

std::array< Point, 10 > surface::create_star_points (float center_x, float center_y, float outer_radius, float inner_radius)
int main (int argc, char **argv)
bool surface::point_in_star (float x, float y, const std::array< Point, 10 > &points)

Variables

constexpr float surface::PI = 3.14159265358979323846f

Function Documentation

◆ main()

int main ( int argc,
char ** argv )

Definition at line 152 of file surface.cpp.

152 {
153 try {
154 Arguments args = proc_args(argc, argv);
155 surface::SurfaceWindow window(args.filename, args.width, args.height, args.fullscreen, args.enable_vsync);
156 window.loop();
157 } catch (mxvk::Exception &e) {
158 std::cerr << std::format("mxvk: Exception: {}\n", e.text());
159 return EXIT_FAILURE;
160 } catch (ArgException<std::string> &e) {
161 std::cerr << std::format("mxvk: Argument Exception: {}\n", e.text());
162 return EXIT_FAILURE;
163 }
164 return EXIT_SUCCESS;
165}
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 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 filename
Optional input filename (--filename).
Definition argz.hpp:738
int width
Viewport width in pixels (default: 1280).
Definition argz.hpp:732