MXVK Vulkan Framework 0.35.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_cv.hpp"
#include "mxvk/mxvk_exception.hpp"
#include <array>
#include <chrono>
#include <cstdlib>
#include <format>
#include <iostream>
#include <opencv2/videoio.hpp>
#include <string>

Go to the source code of this file.

Classes

class  example::ExampleWindow

Namespaces

namespace  example

Macros

#define opencv_example_ASSET_DIR   "."
#define opencv_example_SHADER_DIR   "."

Functions

int main (int argc, char **argv)

Macro Definition Documentation

◆ opencv_example_ASSET_DIR

#define opencv_example_ASSET_DIR   "."

Definition at line 14 of file main.cpp.

◆ opencv_example_SHADER_DIR

#define opencv_example_SHADER_DIR   "."

Definition at line 18 of file main.cpp.

Function Documentation

◆ main()

int main ( int argc,
char ** argv )

Definition at line 199 of file main.cpp.

199 {
200 try {
201 Arguments args = proc_args(argc, argv);
202 example::ExampleWindow ex_window(args, "OpenCV Example");
203 ex_window.loop();
204 } catch (mxvk::Exception &e) {
205 std::cerr << std::format("mxvk: Exception: {}\n", e.text());
206 return EXIT_FAILURE;
207 } catch (ArgException<std::string> &e) {
208 std::cerr << std::format("mxvk: Argument Exception: {}\n", e.text());
209 }
210 return EXIT_SUCCESS;
211}
Arguments proc_args(int &argc, char **argv)
Parse standard libmx2 command-line options from main()'s argv.
Definition argz.hpp:854
Exception thrown by Argz::proc() on unrecognised or malformed options.
Definition argz.hpp:169
String text() const
Definition argz.hpp:173
std::string text() const
Plain data structure returned by proc_args() with all common libmx2 CLI options.
Definition argz.hpp:718