Skip to content

Releases: lostjared/libmx2

MX2 v2.2.1c

Choose a tag to compare

@lostjared lostjared released this 16 Mar 22:52
dcc0119

Some minor bug fixes, updated Makefile.am for autotools builds
and added logic to pick the best device to use for the Vulkan mxvk shared object.

MX2 v2.2.1b

Choose a tag to compare

@lostjared lostjared released this 16 Mar 19:52
edfd5a1

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

Choose a tag to compare

@lostjared lostjared released this 16 Mar 17:00
c454835

libmx2 v2.2.1 Release Notes

Screenshot From 2026-03-16 09-45-45 Screenshot From 2026-03-16 09-44-52

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) and MXModel (Vulkan) loaders now parse Wavefront MTL material files referenced via mtllib directives in OBJ files.
  • Texture filenames specified in map_Kd entries are automatically resolved and loaded.
  • Structured .tex manifest files are now distinguished from MTL files using format auto-detection (presence of newmtl keyword).

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_mxmodel now renders a semi-persistent help text overlay using VKText, toggled with H.
  • Text pipeline, descriptor pool, and layout are managed automatically.

Vulkan Model Viewer CLI Unification

  • vk_mxmodel now accepts the same command-line flags as gl_mxmod: -m, -t, -T, -p, -r, -f, and --compress.

Model Viewer Backend Selector

  • The Qt-based model_viewer launcher 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) where fragPos was 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/, and model_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

  • VKAbstractModel updated to reduce boilerplate code.
  • Improved log messages throughout the model loading pipeline.
  • vk_mxmodel texture path support via setTexturePath() for resolving textures relative to a specified directory.

Build System

  • CMake project version updated to 2.2.1.
  • Autotools Makefile.am updated with all new programs and library sources:
    • New library source: vk_abstract_model.cpp added to libmxvk.
    • 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.
  • vk_mxmodel CMakeLists.txt updated with install target.

Upgrading from v2.2.0

  • Vertex shader change: If you copied tri.vert from gl_mxmod for your own project, update gl_Position from projection * view * vec4(fragPos, 1.0) to projection * viewPos4 to fix the double view-matrix bug.
  • GL viewer window size: Default resolution changed from 1440×1080 to 1280×720. Use -r WIDTHxHEIGHT to 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

Choose a tag to compare

@lostjared lostjared released this 16 Mar 08:30
816919c

libmx2 v2.2.0 Release

Screenshot From 2026-03-14 16-37-16 tux Screenshot From 2026-03-15 08-35-01

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 VKAbstractModel class (vk_abstract_model.hpp/cpp) provides a convenience layer over MXModel for Vulkan rendering.
  • Automatically handles texture loading from .tex manifest 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

  • VKText now caches rendered text textures in an unordered_map keyed 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 (ownsTexture flag) prevents double-free of shared textures.

OBJ Model Loading

  • Model class now supports loading Wavefront OBJ files directly via the new openOBJ() method.
  • OBJ files can be loaded alongside the existing MXMOD and compressed MXMOD.z formats.

GLWindow::makeCurrent()

  • New makeCurrent() method on GLWindow restores the window's OpenGL context as current on the calling thread, useful for multi-window or threaded GL workflows.

Console Home/End Key Support

  • GLConsole now supports Home and End keys (moveCursorHome(), moveCursorEnd()) for fast cursor navigation in the input line.

Controller Subsystem On-Demand Initialization

  • New enableControllerInput() method on VKWindow initializes 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 VKAbstractModel to 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.hpp for 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 core UniformBufferObject, keeping it general-purpose.
  • Wireframe support check — Vulkan pipeline creation now checks for fillModeNonSolid device 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.exe when 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=OFF option for OpenGL ES3 builds.
  • New -DFRACTAL=OFF option for fractal demo builds.
  • New -DCROSS=OFF option for cross-platform glue code.
  • New -DBUILD_STATIC_LIB=OFF option 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: UniformBufferObject no longer contains playerPos and playerPlane fields. If your shaders referenced these, move them to application-specific UBO extensions or push constants.
  • Raycaster state removed: VKWindow::raycastPlayer struct 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

Choose a tag to compare

@lostjared lostjared released this 28 Feb 22:44

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

Choose a tag to compare

@lostjared lostjared released this 26 Feb 13:22

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 mx module for SDL2 windowing, input, text, image loading, audio integration, and utility systems.
  • An optional mxgl module for OpenGL rendering (GL + GLM + bundled GLAD support).
  • An optional mxvk module 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 build

Use sudo if your install prefix requires elevated permissions:

sudo cmake --install build

3) 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=ON

Build 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.sh

2) Configure + build (default)

cd libmx2/libmx
./configure
make -j"$(nproc)"

3) Install

make install

Use sudo if needed:

sudo make install

4) 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-opencv

5) Prefix example

./configure --prefix=/usr/local
make -j"$(nproc)"
sudo make install

Notes for 2.0

  • Project version is 2.0.0 in both CMake and Autotools metadata.
  • C++20 is required.
  • OpenGL and Vulkan modules are independent optional layers built on top of the mx core.

libmx2 v1.4.1

Choose a tag to compare

@lostjared lostjared released this 16 Feb 19:31

source code for libmx2 v1.4.1

libmx2 v1.3.1 Source Code

Choose a tag to compare

@lostjared lostjared released this 10 Feb 16:55

Update fixing Makefiles for ocmpiling with DMOLTEN=ON for MacOS.

libmx2 - 1.3 Source Code

Choose a tag to compare

@lostjared lostjared released this 10 Feb 16:10
e9aff98

v1.3 source code

image image image image

MXCMD v1.10 Windows X64 build

Choose a tag to compare

@lostjared lostjared released this 27 May 07:00

image
image

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