Files
flecs_tests/README.md

64 lines
2.1 KiB
Markdown

# Cartograph
A browser-based world map creation tool inspired by Wonderdraft and Inkarnate. Uses shape-based terrain generation with procedural detail.
## Features (planned)
- **Shapes** — the fundamental building block. Each shape has:
- **Height** — additive (raise terrain) or subtractive (lower terrain)
- **Biome** — determines the sampled texture applied to the shape
- **Intensity** — blending weight of the biome texture
- **Roughness** — edge noise amount (voronoi-like jagged edges at maximum)
- **Shape editing** — select, move, rotate, scale individual shapes
- **Groups** — combine shapes into groups for batch operations
- **Shake landmass** — procedurally decompose a shape into a more complex set of shapes
- **Viewport** — zoom and pan across the map canvas
## Tech stack
| Layer | Library |
|---|---|
| Language | C (C99) |
| Compiler | [Emscripten](https://emscripten.org/) (emcc) → WebAssembly |
| Graphics | [Sokol](https://github.com/floooh/sokol) with WebGPU backend |
| UI | [Dear ImGui](https://github.com/ocornut/imgui) via [cimgui](https://github.com/cimgui/cimgui) |
| Math | [cglm](https://github.com/recp/cglm) |
| Shaders | WGSL (compiled to C headers via `xxd`) |
## Build
```sh
# Install dependencies
./fetch_libs.sh
# Release build
make
# Debug build
make debug
```
Output is `app.html`, served by Emscripten's built-in web server or any static server.
## Project structure
```
src/
main.c Entry point, sokol init, render loop, input handling
api.h Central include — all library headers and project-wide defines
sprite.h Sprite batching, texture management, file import
util.h Vector (dynamic array) and memory pool data structures
rand.h Xorshift32 PRNG utilities
shaders/ WGSL shader sources
generated/ xxd-generated C headers from shaders
lib/
sokol/ Sokol single-file headers (gfx, app, glue, log)
imgui/ Dear ImGui + cimgui
cglm/ C linear math library
util/ Sokol utility headers (memtrack, imgui integration)
```
## License
MIT