summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAryadev Chavali <aryadev@aryadevchavali.com>2023-09-02 18:59:18 +0100
committerAryadev Chavali <aryadev@aryadevchavali.com>2023-09-02 18:59:18 +0100
commitaab3db7f321067b8ff14d589119936d3cbbfc2b0 (patch)
tree8d88fae5bba6cbde7b7ba91d0a40a23c63202350
downloadoreobrot-aab3db7f321067b8ff14d589119936d3cbbfc2b0.tar.gz
oreobrot-aab3db7f321067b8ff14d589119936d3cbbfc2b0.tar.bz2
oreobrot-aab3db7f321067b8ff14d589119936d3cbbfc2b0.zip
INITIAL COMMIT
Simple hello world in raylib
-rw-r--r--.gitignore2
-rw-r--r--Makefile20
-rw-r--r--main.c29
3 files changed, 51 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..dfc21eb
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,2 @@
+*.o
+*.out \ No newline at end of file
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..61be3b9
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,20 @@
+CC=gcc
+CFLAGS=-Wall -Wextra -Wpedantic -ggdb -fsanitize=address -std=c11
+LIBS=-lm -lraylib
+OBJECTS=main.o
+OUT=simulation.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..f9388d5
--- /dev/null
+++ b/main.c
@@ -0,0 +1,29 @@
+/* main.c
+ * Created: 2023-09-02
+ * Author: Aryadev Chavali
+ * Description: Entrypoint of program
+ */
+
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#include <raylib.h>
+#include <raymath.h>
+
+#define WIDTH 512
+#define HEIGHT 512
+
+int main(void)
+{
+ InitWindow(WIDTH, HEIGHT, "Mandelbrot simulation");
+ for (size_t ticks = 0; !WindowShouldClose(); ++ticks)
+ {
+ BeginDrawing();
+ ClearBackground(BLACK);
+ DrawText("Hello, world!", 100, 100, 50, RAYWHITE);
+ EndDrawing();
+ }
+ CloseWindow();
+ return 0;
+}