MXVK Vulkan Framework 0.24.0
C++20 Vulkan rendering framework for practical 2D and 3D application development with SDL3.
Loading...
Searching...
No Matches
starship.cpp File Reference
#include <algorithm>
#include <array>
#include <chrono>
#include <cmath>
#include <cstddef>
#include <cstdlib>
#include <cstring>
#include <format>
#include <iostream>
#include <random>
#include <string>
#include <vector>
#include <glm/ext/matrix_clip_space.hpp>
#include <glm/ext/matrix_transform.hpp>
#include <glm/glm.hpp>
#include "mxvk/argz.hpp"
#include "mxvk/mxvk.hpp"
#include "mxvk/mxvk_abstract_model.hpp"
#include "mxvk/mxvk_exception.hpp"
#include "mxvk/mxvk_png.hpp"

Go to the source code of this file.

Classes

struct  anonymous_namespace{starship.cpp}::FlamePushConstants
struct  anonymous_namespace{starship.cpp}::FlameVertex
struct  anonymous_namespace{starship.cpp}::Star
class  example::StarshipWindow
struct  anonymous_namespace{starship.cpp}::StarUniformBufferObject
struct  anonymous_namespace{starship.cpp}::StarVertex

Namespaces

namespace  anonymous_namespace{starship.cpp}
namespace  example

Functions

int main (int argc, char **argv)

Variables

constexpr float anonymous_namespace{starship.cpp}::PI = 3.14159265358979323846f

Function Documentation

◆ main()

int main ( int argc,
char ** argv )

Definition at line 1424 of file starship.cpp.

1424 {
1425 try {
1426 const Arguments args = proc_args(argc, argv);
1427 std::string filename = args.filename;
1428 if (filename.empty()) {
1429 filename = args.path + "/data/starship.obj";
1430 }
1431 example::StarshipWindow window(filename, args.path, "MXVK Starship Example", args.width, args.height, args.fullscreen, args.enable_vsync);
1432 window.loop();
1433 } catch (mxvk::Exception &e) {
1434 std::cerr << std::format("mxvk: Exception: {}\n", e.text());
1435 return EXIT_FAILURE;
1436 } catch (ArgException<std::string> &e) {
1437 std::cerr << std::format("mxvk: Argument Exception: {}\n", e.text());
1438 return EXIT_FAILURE;
1439 }
1440
1441 return EXIT_SUCCESS;
1442}
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
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