|
libmx2 2.2.1
C++20 multimedia and game-engine library (SDL2 / OpenGL / Vulkan)
|
A cross-platform C++20 multimedia and game-engine library built on SDL2, OpenGL, and Vulkan.
libmx2 is a cross-platform library that facilitates SDL2/OpenGL or Vulkan development using modern C++20. It provides a collection of utilities and abstractions that streamline the creation of multimedia and game applications through an object-oriented design.
Tech specifications: https://lostsidedead.biz/libmx2/mx.html
libmx2 is split into three independently built modules:
| Module | Description |
|---|---|
| mx | Core module — SDL2 window management, input handling, font rendering (SDL2_ttf), PNG/JPEG loading, audio (SDL2_mixer), INI-style configuration, and general utilities. No graphics API dependency; always built. |
| mxgl | OpenGL module — GLAD/GLM initialisation, GLSL shader helpers, 3D model loading with CPU deformers, and an in-app console overlay. Built when -DOPENGL=ON (default). Links against mx. |
| mxgl_cv | OpenCV capture bridge for the OpenGL backend. Built when -DOPENGL=ON -DCV=ON. |
| mxvk | Vulkan module — Vulkan initialisation (via volk / MoltenVK), pipeline and shader helpers, Vulkan model/sprite/text rendering. Built when -DVULKAN=ON. Links against mx. |
| mxvk_cv | OpenCV capture bridge for the Vulkan backend. Built when -DVULKAN=ON -DCV=ON. |
OpenGL and Vulkan never depend on each other — they share only the mx core.
When OpenCV is enabled (-DCV=ON), libmx2 can build optional capture bridge libraries that connect cv::VideoCapture to the rendering backends:
| Library | Header | Depends on | Purpose |
|---|---|---|---|
| mxgl_cv | gl_cv.hpp | mxgl + OpenCV | Streams decoded OpenCV frames into a gl::GLSprite for OpenGL rendering. |
| mxvk_cv | vk_cv.hpp | mxvk + OpenCV | Streams decoded OpenCV frames into a mx::VKSprite for Vulkan rendering. |
Build conditions:
Both bridges expose mx::MXCapture (backend-specific implementation) with a similar API for opening camera/video sources, reading frames, and drawing through the selected graphics backend.