summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorilotterytea <iltsu@alright.party>2025-01-18 02:13:48 +0500
committerilotterytea <iltsu@alright.party>2025-01-18 02:13:48 +0500
commit5b7597c41e9b7a9b25f23516b4b532e078620ffc (patch)
tree9bb8fd1464806ce3851d978d3236ed58ea75e6ad /src/main.c
parentd5cc4f654fc50502c9e4f9ebbe310b9158d5b0a4 (diff)
feat: draw grid
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c
index 10e98f0..ca3a4ad 100644
--- a/src/main.c
+++ b/src/main.c
@@ -6,6 +6,8 @@ int main() {
InitWindow(800, 600, "sillyeditor");
SetTargetFPS(60);
+ int gridSize = 32;
+
Level *level = SE_CreateLevel(30, 30);
while (!WindowShouldClose()) {
@@ -16,6 +18,15 @@ int main() {
SE_RenderLevel(level);
+ // Drawing grid
+ for (int x = 0; x <= level->width; x++) {
+ DrawLine(x * gridSize, 0, x * gridSize, GetScreenHeight(), LIGHTGRAY);
+ }
+
+ for (int y = 0; y <= level->height; y++) {
+ DrawLine(0, y * gridSize, GetScreenWidth(), y * gridSize, LIGHTGRAY);
+ }
+
EndDrawing();
}