From 008cf63a05d7be6ed165747ec5e735e002de3b2d Mon Sep 17 00:00:00 2001 From: sanine Date: Tue, 25 Jan 2022 22:59:44 -0600 Subject: add quadtree and basic world model --- experimental/tectonics/tectonics.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 experimental/tectonics/tectonics.c (limited to 'experimental/tectonics/tectonics.c') 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 + +#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; +} -- cgit v1.2.1