summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAryadev Chavali <aryadev@aryadevchavali.com>2023-08-25 18:24:31 +0100
committerAryadev Chavali <aryadev@aryadevchavali.com>2023-08-25 18:24:31 +0100
commit0d25b2b78e213df5beabf429b3ab4081b0ad0751 (patch)
tree2db1de9dd265d08fd3084e2076045c54ba1cd60c
downloadabelian-sandpile-0d25b2b78e213df5beabf429b3ab4081b0ad0751.tar.gz
abelian-sandpile-0d25b2b78e213df5beabf429b3ab4081b0ad0751.tar.bz2
abelian-sandpile-0d25b2b78e213df5beabf429b3ab4081b0ad0751.zip
INITIAL
Simple hello world in raylib, with a Makefile to do the compilation for me!
-rw-r--r--.gitignore3
-rw-r--r--Makefile20
-rw-r--r--main.c26
3 files changed, 49 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..888dceb
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,3 @@
+*.out
+*.o
+*.so \ No newline at end of file
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..5f13bd7
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,20 @@
+CC=gcc
+CFLAGS=-Wall -Wextra -pedantic -ggdb -fsanitize=address
+LIBS=-lm -lraylib
+OBJECTS=main.o
+OUT=sandpile.out
+ARGS=
+
+%.o: %.c
+ $(CC) $(CFLAGS) -c $^ -o $@ $(LIBS)
+
+$(OUT): $(OBJECTS)
+ $(CC) $(CFLAGS) $^ -o $@ $(LIBS)
+
+.PHONY:
+clean:
+ rm -rfv $(OUT) $(OBJECTS)
+
+.PHONY: run
+run: $(OUT)
+ ./$^ $(ARGS)
diff --git a/main.c b/main.c
new file mode 100644
index 0000000..f1ec861
--- /dev/null
+++ b/main.c
@@ -0,0 +1,26 @@
+/* main.c
+ * Created: 2023-08-25
+ * Author: Aryadev Chavali
+ * Description: Entry point of program
+ */
+#include <stdio.h>
+
+#include <raylib.h>
+
+#define WIDTH 512
+#define HEIGHT 512
+
+int main(void)
+{
+ InitWindow(WIDTH, HEIGHT, "Abelian sand pile");
+ SetTargetFPS(60);
+ while (!WindowShouldClose())
+ {
+ BeginDrawing();
+ ClearBackground(BLACK);
+ DrawText("Hello, world!", 100, 100, 25, RAYWHITE);
+ EndDrawing();
+ }
+ CloseWindow();
+ return 0;
+}