{"id":29830949,"url":"https://github.com/seekrs/macrolibx","last_synced_at":"2025-07-29T10:14:16.286Z","repository":{"id":151546466,"uuid":"545534273","full_name":"seekrs/MacroLibX","owner":"seekrs","description":"✏️ Rewritten version of the minilibx graphics API used at 42school, using SDL2 \u0026 Vulkan. ","archived":false,"fork":false,"pushed_at":"2025-07-22T00:41:08.000Z","size":13950,"stargazers_count":42,"open_issues_count":5,"forks_count":5,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-07-23T06:54:12.896Z","etag":null,"topics":["42","42-school","api","c","cplusplus-20","cpp","cpp20","graphics-programming","minilibx","vulkan","xmake"],"latest_commit_sha":null,"homepage":"https://macrolibx.kbz8.me","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/seekrs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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}},"created_at":"2022-10-04T14:38:03.000Z","updated_at":"2025-07-03T19:10:40.000Z","dependencies_parsed_at":"2023-12-08T12:29:54.577Z","dependency_job_id":"db0a6d06-0779-4a7c-8a68-659f6500b598","html_url":"https://github.com/seekrs/MacroLibX","commit_stats":null,"previous_names":["seekrs/macrolibx"],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/seekrs/MacroLibX","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seekrs%2FMacroLibX","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seekrs%2FMacroLibX/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seekrs%2FMacroLibX/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seekrs%2FMacroLibX/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/seekrs","download_url":"https://codeload.github.com/seekrs/MacroLibX/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seekrs%2FMacroLibX/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267668973,"owners_count":24124975,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-29T02:00:12.549Z","response_time":2574,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["42","42-school","api","c","cplusplus-20","cpp","cpp20","graphics-programming","minilibx","vulkan","xmake"],"created_at":"2025-07-29T10:14:15.337Z","updated_at":"2025-07-29T10:14:16.276Z","avatar_url":"https://github.com/seekrs.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n    \u003cimg src=\"./res/logo.png\" alt=\"drawing\" width=\"200\"/\u003e\n    \u003cdiv align=\"center\"\u003e\n        \u003ca href=\"https://github.com/seekrs/MacroLibX/actions/workflows/linux_clang.yml\"\u003e\u003cimg src=\"https://github.com/seekrs/MacroLibX/actions/workflows/linux_clang.yml/badge.svg\"\u003e\u003c/a\u003e\n        \u003ca href=\"https://github.com/seekrs/MacroLibX/actions/workflows/linux_gcc.yml\"\u003e\u003cimg src=\"https://github.com/seekrs/MacroLibX/actions/workflows/linux_gcc.yml/badge.svg\"\u003e\u003c/a\u003e\n        \u003ca href=\"https://github.com/seekrs/MacroLibX/actions/workflows/macos_x86.yml\"\u003e\u003cimg src=\"https://github.com/seekrs/MacroLibX/actions/workflows/macos_x86.yml/badge.svg\"\u003e\u003c/a\u003e\n    \u003c/div\u003e\n    \u003cdiv align=\"center\"\u003e\n        \u003ca href=\"https://github.com/seekrs/MacroLibX/actions/workflows/windows.yml\"\u003e\u003cimg src=\"https://github.com/seekrs/MacroLibX/actions/workflows/windows.yml/badge.svg\"\u003e\u003c/a\u003e\n    \u003c/div\u003e\n\u003c/div\u003e\n\n###### MacroLibX, a rewrite of 42 School's MiniLibX using SDL2 and Vulkan. \nThe goal of this version is to provide a light, fast, and modern graphical tool.\n\n## 🌟 Features\n\n### 🚀 Performances\nBuilt on top of Vulkan, the MacroLibX takes advantage of its very low-level nature to achieve high performance with great control over available resources.\n\n### 💻 Cross-Platform\nDesigned to be totally cross-platform, it can run on any SDL2-supported platform that supports Vulkan (even the Nintendo Switch ! theoretically... ).\n\n### 📖 It's all FOSS\nEverything in this repo is entirely free and open source, all available under the MIT license (even the third-party libraries used).\n\n### 🔍 Valgrind suppressions file\nExperimental for now, a [suppressions file for valgrind](./valgrind.supp) is given to remove potential leaks comming from Xorg, Nvidia drivers, SDL2, or any other tool which the user has no control. It is far from perfect at the moment and may allow some leaks but it will block the majority.\n\n### ⛔ Error system\nStrong error handling informing the user of problems with their code and even capable of informing them of graphics memory leaks that tools like Valgrind cannot detect.\n\n## 🖥️ Installation\n\n### Dependencies\nYou first need to install the proper dependencies for your operating-system. \n\n#### 🐧 Linux\nHere are a few common cases for different Linux distributions:\n\n\u003cdetails\u003e\n  \u003csummary\u003e\n    For \u003ca href=\"https://ubuntu.com\"\u003eUbuntu\u003c/a\u003e/\u003ca href=\"https://debian.org\"\u003eDebian\u003c/a\u003e-based distros:\n  \u003c/summary\u003e\n\u003cpre\u003e\u003ccode\u003e\u003c!--\n--\u003esudo apt update\nsudo apt install libsdl2-2.0-0 libsdl2-dev build-essential\n\u003c/code\u003e\u003c/pre\u003e\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003e\n    For \u003ca href=\"https://archlinux.org\"\u003eArchLinux\u003c/a\u003e-based distros:\n  \u003c/summary\u003e\n\u003cpre\u003e\u003ccode\u003esudo pacman -S sdl2\u003c/code\u003e\u003c/pre\u003e\n\u003c/details\u003e\n\n\u003cbr\u003e\nNote that you need to have up do date video drivers with \u003ccode\u003elibvulkan.so\u003c/code\u003e installed.\n\n#### 🍎 macOS\n[MacroLibX](#) on macOS requires [SDL2](#) and [MoltenVK](https://github.com/KhronosGroup/MoltenVK). You can install both using the [Homebrew](https://brew.sh) package manager:\n```sh\nbrew install molten-vk\nbrew install SDL2\n```\n\n### 🪟 Windows\nTo build on Windows you may need to use the [xmake](https://xmake.io) build. [Here's](./XMAKE_BUILD.md) how you can use it.\n\n### Clone and Build\nFinally, you can clone the Git repository. When inside it, run the GNU `make` command to compile MacroLibX. \n```bash\ngit clone https://github.com/seekrs/MacroLibX.git\ncd MacroLibX\nmake\n```\n\n## 🔨 Compile your project\nTo compile your project with MacroLibX, you just provide the shared library path in your compilation/linking command:\n\n```sh\nclang myApp.c /path/to/MacroLibX/libmlx.so -lSDL2\n```\n\nAnd you can enjoy your project\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"./res/screenshot_test.png\" alt=\"drawing\" width=\"400\"/\u003e\n\u003c/p\u003e\n\n## ⚙️ Some compilation configurations\n\n### 📦 Compile mode\nBy default the mlx is built in release mode but you can switch to debug by using `make DEBUG=true`.\n\n### 🦺 Safety\nMacroLibX has a strong safety support, mainly by checking every pointer that you pass to it. But this safety has a cost that can be avoided by enabling `DISABLE_ALL_SAFETIES=true` before compiling but don't be afraid to recieve segmentation faults from the mlx.\n\n### 🛠️ Set the toolchain\nIf you want to use `GCC` to build the mlx you can use `make TOOLCHAIN=gcc`\n\n### ⚠️⚠️⚠️ 🖼️ Image optimisations ⚠️⚠️⚠️\nIf you run into glitches when writing or reading pixels from images you can turn off images optimisations by using `make IMAGES_OPTIMIZED=false`.\n\n### 🖥️ Force the integrated GPU (not recommended)\nYou can force the mlx to use your integrated GPU by using `make FORCE_INTEGRATED_GPU=true`. Note that there are a lot of chances that your application crashes by using that.\n\n### 💽 Dump the graphics memory\nThe mlx can dump it's graphics memory use to json files every two seconds by enabling this option `make GRAPHICS_MEMORY_DUMP=true`.\n\n## License\nThis project and all its files, even the [`third_party`](./third_party) directory or unless otherwise mentionned, are licenced under the [MIT license](./LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseekrs%2Fmacrolibx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fseekrs%2Fmacrolibx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseekrs%2Fmacrolibx/lists"}