diff options
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -7,6 +7,7 @@ #include <stdio.h> #include <raylib.h> +#include <raymath.h> struct State { @@ -49,15 +50,17 @@ int main(void) state.data = calloc(state.dwidth * state.dwidth, sizeof(*state.data)); state.multiplier = state.window_len / state.dwidth; + Camera2D camera = {0}; + camera.zoom = 1.0f; InitWindow(state.window_len, state.window_len, "Abelian sand pile"); SetTargetFPS(60); + while (!WindowShouldClose()) { step(&state); BeginDrawing(); ClearBackground(BLACK); - DrawText("Hello, world!", 100, 100, 25, RAYWHITE); - + BeginMode2D(camera); for (size_t i = 0; i < state.dwidth; ++i) for (size_t j = 0; j < state.dwidth; ++j) { @@ -75,6 +78,7 @@ int main(void) DrawRectangle(i * state.multiplier, j * state.multiplier, state.multiplier, state.multiplier, c); } + EndMode2D(); EndDrawing(); } CloseWindow(); |