{"id":22816320,"url":"https://github.com/lostjared/libmx2","last_synced_at":"2026-02-16T21:07:32.502Z","repository":{"id":263283495,"uuid":"889897151","full_name":"lostjared/libmx2","owner":"lostjared","description":"Cross-Platform Library for Development with SDL2/OpenGL/Vulkan  in C++20","archived":false,"fork":false,"pushed_at":"2026-02-13T20:31:14.000Z","size":217667,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-13T20:32:23.216Z","etag":null,"topics":["cplusplus-20","cross-platform","sdl2"],"latest_commit_sha":null,"homepage":"https://lostsidedead.biz/libmx2","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lostjared.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-11-17T14:21:33.000Z","updated_at":"2026-02-13T20:31:17.000Z","dependencies_parsed_at":"2024-11-17T15:29:25.300Z","dependency_job_id":"2417fe66-aabb-4207-8e5e-954b2c37981c","html_url":"https://github.com/lostjared/libmx2","commit_stats":null,"previous_names":["lostjared/libmx2"],"tags_count":19,"template":false,"template_full_name":null,"purl":"pkg:github/lostjared/libmx2","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lostjared%2Flibmx2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lostjared%2Flibmx2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lostjared%2Flibmx2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lostjared%2Flibmx2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lostjared","download_url":"https://codeload.github.com/lostjared/libmx2/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lostjared%2Flibmx2/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29518748,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-16T18:37:19.720Z","status":"ssl_error","status_checked_at":"2026-02-16T18:36:46.920Z","response_time":115,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cplusplus-20","cross-platform","sdl2"],"created_at":"2024-12-12T14:07:11.820Z","updated_at":"2026-02-16T21:07:32.469Z","avatar_url":"https://github.com/lostjared.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# libmx2\n\n![libmx cube](https://github.com/user-attachments/assets/68a4a55e-98a3-4bcc-9cf6-f6bf3cbb7b86)\n![breakout-3d](https://github.com/user-attachments/assets/bd0a7d5d-fdfb-4118-aaa5-6b5975129fd5)\n\nlibmx2 is a cross-platform library that facilitates cross-platform SDL2/OpenGL development using C++20.\nIt provides a collection of utilities and abstractions to streamline the creation of multimedia applications.\n\n## Motivation\n\nThe motivation for creating this library was to give me an easy way to assemble new SDL2 applications \nwhile using an approach I prefer, an Object Oriented Design. I have experimented with AI in some of the example projects for this library.\n\n\n## Features\n\n- **SDL2 Integration**: Simplifies the setup and management of SDL2 components.\n- **Modern C++20 Design**: Utilizes C++20 features for cleaner and more efficient code.\n- **Modular Architecture**: Offers a flexible structure to accommodate various project needs.\n- **Optional OpenGL/GLAD/GLM support**: You can compile in support for these libraries with examples\n## Getting Started\n\n### Prerequisites\n\n- C++20 compatible compiler (e.g., GCC 10+, Clang 10+, MSVC 2019+\n- SDL2/SDL2_ttf/SDL2_mixer, libpng, zlib installed\n- Optional: OpenGL/GLM includes GLAD\n\n### Installation\n\n1. Clone the repository:\n\n   ```bash\n   git clone https://github.com/lostjared/libmx2.git\n   ```\n\n2. Navigate to the project directory:\n\n   ```bash\n   cd libmx2/libmx\n   ```\n\n3. Build the library using CMake:\n\n   ```bash\n   mkdir build\n   cd build\n   cmake ..\n   make -j4\n   sudo make install\n   ```\n\nOptionally you can build as a static library\n\n\n   ```bash\n   mkdir build\n   cd build\n   cmake .. -DBUILD_STATIC_LIB=ON\n   make -j4\n   sudo make install\n   ```\nCurrent Options:\n\n* -DJPEG=OFF - optionally compile in support for JPEG images with jpeglib ON or OFF\n* -DBUILD_STATIC_LIB=OFF - optionally compile library as a static library ON or OFF\n* -DOPENGL=ON optionally compile OpenGL support into the library either ON or OFF\n* -DMIXER=ON optionally compile audio support with SDL2_mixer either ON or OFF\n## Usage\n\nInclude the `libmx2` headers in your project and link against the compiled library.\nRefer to the `examples` directory for sample usage scenarios. Also various subfolders for example projects\n\n## 2D Examples Included\n\n* asteroids\n* blocks\n* breakout\n* frogger\n* knights tour\n* mad\n* matrix\n* piece\n* pong\n* space shooter\n\n## OpenGL Examples\n* Basic GL Window\n* Triangle\n* Skeleton (Hello, World!)\n* 3D Texture Mapped Cube\n* 3D Texture Mapped Animated Cube\n* 3D Pyramid with Lighting\n* GL Pong with Lighting\n* 3D Breakout ( https://lostsidedead.biz/game/3DBreak )\n* MXMOD Format/3D Model Viewer\n* Space3D: Attack of the Drones ( https://lostsidedead.biz/game/Space3D )\n* Four Point Sprite Examples ( gl_ps, gl_ps2, gl_ps3, gl_ps4 https://lostsidedead.biz/point-sprites )\n* 3D Snow Particle Demo ( https://lostsidedead.biz/holiday/3d.html )\n* \n## How to Run the Examples\n\nThe examples require the resources for each instance to be within the same directory as the executable or to pass the path of that directory to the program with the -p or --path argument.\nIf you created the build directory an example to run gl_pong from build/gl_pong would be\n\n```bash\n./gl_pong -p ../../gl_pong/v4\n```\nor to run space:\n\n```bash\n./space -p ../../space\n```\nIf you are using Windows and MSYS/MINGW64 its a requirement to copy the libmx.dll file into the same directory as the EXE file. From inside say the build/gl_pong directory\n\n```bash\ncp ../libmx/libmx.dll .\n```\n\nThen I would recommend running my ldd-deploy project https://github.com/lostjared/ldd-deploy/tree/main/C%2B%2B20 mingw-deploy on the EXE to copy all the required DLL Files\n\n```bash\nmingw-deploy -i gl_pong.exe -o .\n```\n\n## WebAssembly Makefiles\n\nTo compile the WebAssembly makefiles is a little more difficult you will first need to create a folder for libpng16 zlib and libmx to be installed to you will need to edit the Makefile and place\nthe path to this folder\n\n```\nLIBS_PATH = /home/jared/emscripten-libs\n```\n\nthen install libpng16, zlib by compiling them with emscripten and placing the files in this location\nyou will also need to install GLM on your host system use  your package manager to get it  something like\n```\nsudo pacman -S glm\n```\n\nthe paths in the Makefile look like this\n\n```\nZLIB_INCLUDE = -I$(LIBS_PATH)/zlib/include\nPNG_INCLUDE = -I$(LIBS_PATH)/libpng/include\nMX_INCLUDE = -I$(LIBS_PATH)/mx2/include -I/usr/include/glm\nZLIB_LIB = $(LIBS_PATH)/zlib/lib/libz.a\nPNG_LIB = $(LIBS_PATH)/libpng/lib/libpng.a\n```\n\nthen enter the libmx directory edit the Makefile for the path\nand\n\n```bash\nmake -f Makefile.em\nsudo make -f Makefile.em install\n```\n\nthen you should be able to build the projects with emscripten after setting the path in each Makefile.em using\n\n```bash\nmake -f Makefile.em\n```\n\n## Playing the Example games in WebAssembly\n\nYou can point your browser to https://lostsidedead.biz/\nand select Free Web Apps and the projects are available to play in your browser\n  \n## Contributing\n\nContributions are welcome!\nPlease fork the repository, create a new branch for your feature or bugfix, and submit a pull request.\n\n## License\n\nThis project is licensed under the MIT License.\nSee the [LICENSE](LICENSE) file for details.\n\n## Acknowledgments\n\nSpecial thanks to the SDL2 community for providing a robust multimedia library.\n\nScreenshots of Examples\n\n![libmx matrix](https://github.com/user-attachments/assets/df69b3c1-1d1f-4806-9366-21a480494461)\n![vb_tetris](https://github.com/user-attachments/assets/efbb3881-ba0a-483c-92db-4abba66c61d8)\n![libmx knight 2](https://github.com/user-attachments/assets/0f12d584-6478-4df7-8da0-81903ce7eac6)\n![vb_aster](https://github.com/user-attachments/assets/91bf11ad-b171-4363-96be-cad2bd7f5ea2)\n![vb_pong](https://github.com/user-attachments/assets/ae63f64b-1830-4a2d-a3ed-26ccc6fd2578)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flostjared%2Flibmx2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flostjared%2Flibmx2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flostjared%2Flibmx2/lists"}