Skip to content

erikmillergalow/sandy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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