diff options
author | sanine <sanine.not@pm.me> | 2022-01-25 22:59:44 -0600 |
---|---|---|
committer | sanine <sanine.not@pm.me> | 2022-01-25 22:59:44 -0600 |
commit | 008cf63a05d7be6ed165747ec5e735e002de3b2d (patch) | |
tree | 024d04980a4f0cd6faa426939cfb60e9a3d7b6a3 /experimental/tectonics/tectonics.c | |
parent | ec20b587362d76d6c48ecc1a5c1e65f1bb9293da (diff) |
add quadtree and basic world model
Diffstat (limited to 'experimental/tectonics/tectonics.c')
-rw-r--r-- | experimental/tectonics/tectonics.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/experimental/tectonics/tectonics.c b/experimental/tectonics/tectonics.c new file mode 100644 index 0000000..f294944 --- /dev/null +++ b/experimental/tectonics/tectonics.c @@ -0,0 +1,24 @@ +#include <cairo.h> + +#include "tectonics.h" + +#define X_RES 512 +#define Y_RES X_RES + +int main() +{ + cairo_surface_t *surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, X_RES, Y_RES); + cairo_t *cr = cairo_create(surface); + + struct world_t world; + create_world(&world, 1000); + if (world.points == NULL) + return 1; + render_world(cr, &world); + free_world(&world); + + cairo_destroy(cr); + cairo_surface_write_to_png(surface, "output.png"); + cairo_surface_destroy(surface); + return 0; +} |