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 "asteroids3d_window.hpp"
#include "mxvk/argz.hpp"
#include "mxvk/mxvk_exception.hpp"
#include <SDL3/SDL.h>
#include <cstdlib>
#include <format>
#include <iostream>
#include <string>

Go to the source code of this file.

Functions

int main (int argc, char **argv)

Function Documentation

◆ main()

int main ( int argc,
char ** argv )

Definition at line 13 of file main.cpp.

13 {
14 try {
15 if (!SDL_SetAppMetadata("Asteroids 3D", nullptr, "asteroids3d")) {
16 std::cerr << std::format("asteroids3d: could not set SDL application metadata: {}\n", SDL_GetError());
17 }
18
19 const Arguments args = proc_args(argc, argv);
21 } catch (const mxvk::Exception &e) {
22 std::cerr << std::format("mxvk: Exception: {}\n", e.text());
23 return EXIT_FAILURE;
24 } catch (const ArgException<std::string> &e) {
25 std::cerr << std::format("mxvk: Argument Exception: {}\n", e.text());
26 return EXIT_FAILURE;
27 }
28
29 return EXIT_SUCCESS;
30}
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
void run_asteroids3d(const Arguments &args)
Runs the Asteroids application.
Plain data structure returned by proc_args() with all common libmx2 CLI options.
Definition argz.hpp:730