mintload is a zero-allocation runtime loader for assets produced by mint.
Reads .mscb, .mmesh, .mmat, .mskel, .manim directly from disk via mmap/MapViewOfFile — no heap, no mallocs, no JSON, no dependencies. Cross-platform (Linux + Windows).
git clone https://github.com/koftamainee/mintload.git
cd mintload
cmake -B build -DMINTLOAD_ENABLE_CPP=ON
cmake --build build#include <mintload/mintload.h>
#include <stdio.h>
int main(int argc, char** argv) {
MintScb scene;
mintload_MscbLoad(argv[1], &scene);
printf("entities: %u\n", scene.entity_count);
for (uint32_t i = 0; i < scene.entity_count; i++) {
MintScbEntity e = mintload_MscbEntity(&scene, i);
printf(" \"%.*s\" parent=%d comps=%u\n",
(int)e.name_len, e.name,
e.parent_index, e.comp_count);
}
mintload_MscbUnload(&scene);
}#include <mintload/mintload.hpp>
#include <iostream>
#include <string_view>
int main(int argc, char** argv) {
auto scene = Mintload::Scene::Load(argv[1]);
if (!scene.IsValid()) return 1;
std::cout << "entities: " << scene.EntityCount() << "\n";
for (uint32_t i = 0; i < scene.EntityCount(); i++) {
auto e = scene.EntityAt(i);
std::cout << " \"" << std::string_view(e.name, e.name_len)
<< "\" parent=" << e.parent_index
<< " comps=" << e.comp_count << "\n";
}
}Detailed examples live in examples/.
| Type | Loader | Accessors |
|---|---|---|
.mscb |
mintload_MscbLoad / Scene::Load |
entities + typed components (Transform, MeshRenderer, Skin, AnimationPlayer) |
.mmesh |
mintload_MmeshLoad / Mesh::Load |
vertices, indices, sub-meshes, LODs |
.mmat |
mintload_MmatLoad / Material::Load |
PBR params, texture slots (UUID) |
.mskel |
mintload_MskelLoad / Skeleton::Load |
bones, hierarchy, inverse bind matrices, rest pose |
.manim |
mintload_ManimLoad / Animation::Load |
channels, keyframes |
All C functions return MintloadResult (zero = success).
All C++ types are move-only, no exceptions, no heap allocation.
| Option | Default | Description |
|---|---|---|
MINTLOAD_BUILD_EXAMPLES |
OFF |
Build mtl-c (and mtl-cpp if C++ enabled) |
MINTLOAD_ENABLE_CPP |
OFF |
Include mintload.hpp in install, allow C++ examples |
PRs welcome!
MIT — do whatever you want, just keep the copyright notice.