Skip to content

Latest commit

 

History

History
45 lines (33 loc) · 1005 Bytes

README.md

File metadata and controls

45 lines (33 loc) · 1005 Bytes

Sandy

screenshot

Yet another falling sand simulator, developed using sokol and nuklear.

Compile and run

// needed for cross-platform shader compilation
git clone https://github.com/floooh/sokol-tools-bin.git

// linux
make linux
./sandy

// mac
make mac-opengl
./sandy

// wasm
make wasm
emrun sandy.html

Profile

// run relevant build command from makefile with -g -O0 flags
perf record -g ./sandy
perf report

Adding new materials

  • Add material name to material enum
  • Define material color in draw_material
  • Create process_<material_name>(int index) function to define behavior
  • Call process function in process_world()
  • Add button to select material in draw_ui