Modern C++ graphics

Build creative software across every screen.

libmx2 streamlines SDL2 and OpenGL development with a modern C++20 design, bringing desktop applications, games, visual experiments, and WebAssembly experiences together in one flexible library.

A visual project created with libmx2
About libmx2

A modern cross-platform development library

libmx2 is designed to give developers an efficient and streamlined way to create multimedia applications. Built on SDL2 and OpenGL, it uses C++20 to simplify the details of cross-platform development so more attention can stay on the creative work.

Its modular architecture adapts to projects ranging from simple 2D games to complex 3D applications. SDL2 handles graphics, input, fonts, and sound, while optional OpenGL, OpenGL ES 3, GLM, and GLAD support opens the door to advanced rendering techniques.

From native desktop applications to browser-based WebAssembly experiences, libmx2 provides practical abstractions without hiding the hands-on nature of graphics programming. The included games and visual demos show how the same foundation can support many styles of work.

Designed to stay flexible

Core features

Modern C++20

Write cleaner, efficient, object-oriented code with current language features.

SDL2 integration

Simplify windows, graphics, input, fonts, images, and sound across platforms.

Advanced graphics

Optional OpenGL, OpenGL ES 3, GLAD, and GLM support for 2D and 3D rendering.

Cross-platform

Target Linux, Windows, macOS, and WebAssembly from a shared foundation.

Modular architecture

Enable only the features your application needs, with static or dynamic linking.

Practical examples

Learn from Asteroids, Pong, Breakout, Matrix rain, 3D demos, and visual effects.

Built with MX2

Example projects

Explore a selection of graphics and game projects made with libmx2.

Start building

Installation

Clone the repository, configure the library with CMake, then build and install it:

git clone https://github.com/lostjared/libmx2.git
cd libmx2/libmx
mkdir build && cd build
cmake ..
make -j4
sudo make install
Run C++ in the browser

WebAssembly demos

Games, renderers, experiments, and shader-driven visual projects built on the MX2 ecosystem.

Open source and open to ideas

Contribute to libmx2

Contributions are welcome. Fork the repository and submit a pull request with a feature, example, documentation improvement, or bug fix.

GitHub repository