Releases: lostjared/libmx2
Release list
MX2 v2.2.1c
MX2 v2.2.1b
Small fix to a few of the examples that do not use the mxvk module
Text needed to be properly reset
and compile script updated to support a clean argument.
MX2 v2.2.1 - Update to Model Loader/Viewer
libmx2 v2.2.1 Release Notes
Release Date: March 16, 2026
libmx2 v2.2.1 is a patch release focusing on model viewer parity between the OpenGL and Vulkan backends, MTL material file support, and build system improvements.
New Features
MTL Material File Support
- Both
Model(OpenGL) andMXModel(Vulkan) loaders now parse Wavefront MTL material files referenced viamtllibdirectives in OBJ files. - Texture filenames specified in
map_Kdentries are automatically resolved and loaded. - Structured
.texmanifest files are now distinguished from MTL files using format auto-detection (presence ofnewmtlkeyword).
Unified Model Viewer Controls
- The OpenGL (
gl_mxmod) and Vulkan (vk_mxmodel) model viewers now share the same control scheme:- Mouse drag to rotate the model.
- Scroll wheel or A/S keys to zoom in/out.
- Arrow keys to toggle auto-rotation axes.
- W to toggle wireframe rendering.
- H or Space to show/hide controls overlay.
- Home to reset the view.
- Escape to quit.
- Both viewers display a unified on-screen help overlay.
Vulkan Model Viewer Text Overlay
vk_mxmodelnow renders a semi-persistent help text overlay usingVKText, toggled with H.- Text pipeline, descriptor pool, and layout are managed automatically.
Vulkan Model Viewer CLI Unification
vk_mxmodelnow accepts the same command-line flags asgl_mxmod:-m,-t,-T,-p,-r,-f, and--compress.
Model Viewer Backend Selector
- The Qt-based
model_viewerlauncher now includes a combo box to select between OpenGL and Vulkan backends before launching.
Bug Fixes
Vertex Shader Double View-Matrix Application (Critical)
- Fixed a bug in the OpenGL vertex shader (
tri.vert) where the view matrix was applied twice to vertex positions, causing models to render at half their expected size. - Before:
gl_Position = projection * view * vec4(fragPos, 1.0)wherefragPoswas already in view space. - After:
gl_Position = projection * viewPos4— projection is applied directly to the view-space position. - Fixed in
gl_mxmod/data/,gl_mxmod/v4/data/, andmodel_viewer/data/.
Model Startup Position Parity
- OpenGL and Vulkan model viewers now display models at the same position and scale on startup.
- Both viewers center the model at the origin, normalize scale to fit a 2.5-unit bounding box, and position the camera at distance 5.0 with 45° FOV.
- GL viewer default window size changed from 1440×1080 to 1280×720 to match Vulkan viewer.
MTL File Misidentification
- Fixed a bug where MTL files were incorrectly parsed as texture list files, causing texture loading failures.
Rotation Clamping Removed
- Removed the ±89° pitch clamp in the Vulkan model viewer, allowing full 360° rotation on all axes.
macOS OpenGL Error Fix
- Fixed an OpenGL error on macOS related to context handling.
Improvements
VKAbstractModelupdated to reduce boilerplate code.- Improved log messages throughout the model loading pipeline.
vk_mxmodeltexture path support viasetTexturePath()for resolving textures relative to a specified directory.
Build System
- CMake project version updated to 2.2.1.
- Autotools
Makefile.amupdated with all new programs and library sources:- New library source:
vk_abstract_model.cppadded tolibmxvk. - New installed headers:
vk_abstract_model.hpp,config.hpp. - New programs:
mx2-example,mx2-gl-about,mx2-gl-animation,mx2-gl-tux,mx2-vk-abstract-model,mx2-vk-cube,mx2-vk-star3D,mx2-vk-tux,mx2-vk-skybox.
- New library source:
vk_mxmodelCMakeLists.txt updated with install target.
Upgrading from v2.2.0
- Vertex shader change: If you copied
tri.vertfromgl_mxmodfor your own project, updategl_Positionfromprojection * view * vec4(fragPos, 1.0)toprojection * viewPos4to fix the double view-matrix bug. - GL viewer window size: Default resolution changed from 1440×1080 to 1280×720. Use
-r WIDTHxHEIGHTto override. - Model positioning: GL viewer now centers models at the origin with normalized scale, matching the Vulkan viewer. If your code depended on the old camera-relative-to-model-center behavior, update accordingly.
Dependencies
- C++20 compiler (GCC 10+, Clang 10+, MSVC 2019+)
- SDL2, SDL2_ttf, SDL2_mixer (optional)
- libpng, zlib
- OpenGL + GLM (optional), Vulkan SDK (optional)
- libjpeg (optional), OpenCV (optional)
MX2 v2.2.0 Source Code Release
libmx2 v2.2.0 Release
Documentation:
https://lostsidedead.biz/libmx2/docs/
Source Code Release
Release Date: March 2026
libmx2 v2.2.0 is a feature and stability release of the cross-platform C++20 multimedia library built on SDL2, OpenGL, and Vulkan. This release adds a high-level Vulkan model abstraction, Vulkan text caching, new demo projects, expanded platform support, and numerous bug fixes since v2.0.
New Features
VKAbstractModel — High-Level Vulkan 3D Model Wrapper
- New
VKAbstractModelclass (vk_abstract_model.hpp/cpp) provides a convenience layer overMXModelfor Vulkan rendering. - Automatically handles texture loading from
.texmanifest files, uniform buffer allocation, descriptor pool/set creation, and bounding-box centring. - Supports per-model custom vertex and fragment shaders via
setShaders(). - Manages its own pipeline, UBO updates, and swapchain resize lifecycle.
Vulkan Text Caching
VKTextnow caches rendered text textures in anunordered_mapkeyed by text content and colour.- Eliminates redundant GPU texture uploads for repeated strings, improving frame performance.
- New
clearCache()method to explicitly free cached GPU textures. - Cache-aware ownership tracking (
ownsTextureflag) prevents double-free of shared textures.
OBJ Model Loading
Modelclass now supports loading Wavefront OBJ files directly via the newopenOBJ()method.- OBJ files can be loaded alongside the existing MXMOD and compressed MXMOD.z formats.
GLWindow::makeCurrent()
- New
makeCurrent()method onGLWindowrestores the window's OpenGL context as current on the calling thread, useful for multi-window or threaded GL workflows.
Console Home/End Key Support
GLConsolenow supports Home and End keys (moveCursorHome(),moveCursorEnd()) for fast cursor navigation in the input line.
Controller Subsystem On-Demand Initialization
- New
enableControllerInput()method onVKWindowinitializes joystick and game controller subsystems only when needed. controllerInputEnabled()query to check initialization state.
VKWindow Device Accessors
- Added public accessors:
getPhysicalDevice(),getDevice(),getGraphicsQueue(),getCommandPool(). - Enables external code and
VKAbstractModelto interact with the Vulkan device without exposing internal state directly.
MXCMD Plugin API
- New C plugin interface (
plugin_api.h) for cmd modules, enabling stable ABI-safe plugin development. - New
plugin_output.hppfor structured plugin output handling. - Multiline input support, wildcard pattern matching, and improved help/output messages in the command system.
New Examples & Demos
- gl_tux — OpenGL Tux penguin model rendering with shadow support and background shader.
- vk_tux — Vulkan Tux model rendering with sprite overlays and text.
- vk_abstract_model — Demonstrates the VKAbstractModel API for simplified Vulkan model loading and rendering.
- gl_asteroids v2.0 — Updated asteroids game with new starship OBJ model and multi-texture support.
- Hello World — Minimal example for getting started quickly.
- WebAssembly build — Updated MX2_Project for Emscripten/WebAssembly targets.
Improvements
- Vulkan UBO cleanup — Removed raycaster-specific fields (
playerPos,playerPlane) from the coreUniformBufferObject, keeping it general-purpose. - Wireframe support check — Vulkan pipeline creation now checks for
fillModeNonSoliddevice feature before enabling wireframe mode. - Validation layer updates — Improved Vulkan validation layer integration and resource release logging.
- Texture layout tracking — Better Vulkan texture image layout state management.
- Shader lifecycle — Added shutdown log messages and reload-on-load behaviour for
ShaderProgram. - Streaming output — Console and cmd output is now printed as it streams rather than buffering until program completion.
- ABI fix — Fixed an ABI incompatibility in cmd module loading by using a C interface.
- macOS compatibility — Fixed OpenGL errors on macOS and resolved header differences between platforms.
- Windows console — Added readline-equivalent input handling for Windows; falls back to
cmd.exewhen bash is unavailable. - Static library linking — Fixed static linking for DLL builds on Windows/MinGW.
Bug Fixes
- Fixed undefined behaviour when variable-length argument lists were used.
- Fixed resource leak detected by Vulkan validation layers.
- Fixed clean exit handling to properly release all resources.
- Fixed linker errors in Autotools and CMake builds.
- Removed duplicate log prints in cmd output.
- Removed unused projects (
gl_about) and dead code.
Build System
- CMake project version updated to 2.2.0.
- New
-DES3=OFFoption for OpenGL ES3 builds. - New
-DFRACTAL=OFFoption for fractal demo builds. - New
-DCROSS=OFFoption for cross-platform glue code. - New
-DBUILD_STATIC_LIB=OFFoption for static library compilation. - Updated shared object path locations for installation.
Documentation
- Added comprehensive Doxygen documentation (
mainpage.dox) with full class reference. - Updated README with current build instructions, feature flags, and example listing.
Platform Support
| Platform | Status |
|---|---|
| Linux | Full support (OpenGL + Vulkan) |
| macOS | Supported via MoltenVK (Homebrew auto-detection) |
| Windows | MinGW cross-compilation with GCC 15 compatibility |
| WebAssembly | Emscripten demos available |
Upgrading from v2.0
- UBO layout change:
UniformBufferObjectno longer containsplayerPosandplayerPlanefields. If your shaders referenced these, move them to application-specific UBO extensions or push constants. - Raycaster state removed:
VKWindow::raycastPlayerstruct has been removed. Applications using raycasting should manage player state externally.
Dependencies
- C++20 compiler (GCC 10+, Clang 10+, MSVC 2019+)
- SDL2, SDL2_ttf, SDL2_mixer (optional)
- libpng, zlib
- OpenGL + GLM (optional), Vulkan SDK (optional)
- libjpeg (optional), OpenCV (optional)
MX2 v2.1.0 - Source Code
Fixed a memory leak when recreating a texture.
Also updated the documentation:
https://lostsidedead.biz/libmx2/docs
v2.1.0 of the Source Code.
MX2 version 2.0 - Source Code Release
libmx2 2.0 Release
libmx2 2.0 is a cross-platform C++20 multimedia library designed to accelerate SDL2-based development with a modular architecture.
Documentation
https://lostsidedead.biz/libmx2/docs/
Version 2.0 provides:
- A core
mxmodule for SDL2 windowing, input, text, image loading, audio integration, and utility systems. - An optional
mxglmodule for OpenGL rendering (GL + GLM + bundled GLAD support). - An optional
mxvkmodule for Vulkan rendering (volk-based loader and Vulkan helper systems). - Cross-platform Linux/macOS/Windows workflows with both CMake and Autotools build support.
This modular design lets you build only what you need: core-only, OpenGL-enabled, Vulkan-enabled, or both.
Prerequisites
- C++20 compiler (
g++/clang++/MSVC with C++20 support) - SDL2
- SDL2_ttf
- zlib
- libpng
- Optional features:
- SDL2_mixer (audio)
- libjpeg (JPEG)
- OpenGL + GLM
- Vulkan SDK/loader + GLM
Build with CMake
All CMake commands below use libmx/ as the source directory.
1) Configure + build (default)
cd libmx2
mkdir -p build
cmake -S libmx -B build
cmake --build build -j"$(nproc)"2) Install
cmake --install buildUse sudo if your install prefix requires elevated permissions:
sudo cmake --install build3) Common CMake feature flags
# Core + OpenGL (default)
cmake -S libmx -B build -DOPENGL=ON -DVULKAN=OFF
# Core + Vulkan only
cmake -S libmx -B build -DOPENGL=OFF -DVULKAN=ON
# Enable/disable extras
cmake -S libmx -B build -DMIXER=ON -DJPEG=OFF -DEXAMPLES=ONBuild with Autotools
Autotools files are in libmx/.
1) Generate build system (if needed)
If configure is missing or you want to regenerate autotools outputs:
cd libmx2/libmx
./autogen.sh2) Configure + build (default)
cd libmx2/libmx
./configure
make -j"$(nproc)"3) Install
make installUse sudo if needed:
sudo make install4) Common Autotools feature flags
# OpenGL on (default), Vulkan off (default)
./configure --enable-opengl --disable-vulkan
# Vulkan on, OpenGL off
./configure --enable-vulkan --disable-opengl
# Optional components
./configure --enable-mixer --enable-jpeg --enable-examples --enable-opencv5) Prefix example
./configure --prefix=/usr/local
make -j"$(nproc)"
sudo make installNotes for 2.0
- Project version is
2.0.0in both CMake and Autotools metadata. - C++20 is required.
- OpenGL and Vulkan modules are independent optional layers built on top of the
mxcore.
libmx2 v1.4.1
libmx2 v1.3.1 Source Code
Update fixing Makefiles for ocmpiling with DMOLTEN=ON for MacOS.
libmx2 - 1.3 Source Code
MXCMD v1.10 Windows X64 build
MXCMD Online Guide:
visit: https://lostsidedead.biz/mxcmd for an online guide
Technical Details
Graphics: OpenGL 3.3+ with SDL2
Language: C++20 with modern STL features
Threading: Multi-threaded with mutex-protected console operations
Platforms: Linux, macOS, Windows (with WSL support)
Dependencies: SDL2, SDL2_TTF, OpenGL, libmx2 framework
Core Components
Interactive Console: Full-featured terminal with scrolling, history, and scripting language
MXCMD Integration: Execute MXCMD scripts with and execute commands
Shader System: Real-time visual effects with customizable fragment shaders
Cross-Platform: Native support for Linux/macOS with Windows WSL integration
Thread-Safe Operations: Multi-threaded command execution with main thread task queuing
Architecture
The application follows a modular architecture with clear separation between the console interface (GLConsole), the command execution engine (AstExecutor), and the rendering system (Game class). The main components include:
Game Class: Handles OpenGL rendering, shader management, and input processing
MainWindow: SDL2/OpenGL window management with console integration
Console System: Text rendering, scrolling, input handling, and command history
Command Processor: MXCMD script parsing and execution with interrupt support
Key Features
Console Features
Scrollable text output with mouse wheel and page up/down support
Command history navigation (up/down arrows)
Real-time text rendering with custom font support
Thread-safe message queuing for command output
Configurable prompt and console appearance
Visual Effects
Dynamic shader switching with 10+ built-in effects
Real-time time-based animations
Custom GLSL fragment shader support
Keyboard shortcuts for quick shader changes
Command System
Built-in console commands (clear, about, help, exit)
MXCMD script execution with full language support
Windows WSL integration for cross-platform commands
Command echo control and debugging features





