aboutsummaryrefslogtreecommitdiff
path: root/src/display.c
diff options
context:
space:
mode:
authorkartofen <mladenovnasko0@gmail.com>2022-10-07 23:26:38 +0300
committerkartofen <mladenovnasko0@gmail.com>2022-10-07 23:26:38 +0300
commite41af6679dae3f4c69b46962a6bf1a1f81bee600 (patch)
treeb8d48e6707c4114408b270853ba8c6114d5d5a21 /src/display.c
kind of working but not really
Diffstat (limited to 'src/display.c')
-rw-r--r--src/display.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/display.c b/src/display.c
new file mode 100644
index 0000000..57acf86
--- /dev/null
+++ b/src/display.c
@@ -0,0 +1,37 @@
+#include <raylib.h>
+#include "display.h"
+
+static dspl_createinfo info;
+
+void dspl_create(dspl_createinfo createinfo)
+{
+ info = createinfo;
+}
+void dspl_start()
+{
+ InitWindow(info.width, info.height, info.name);
+ SetTargetFPS(info.fps);
+
+ while(!WindowShouldClose())
+ {
+ BeginDrawing();
+ ClearBackground(RAYWHITE);
+ info.update_func();
+ EndDrawing();
+ }
+}
+
+void dspl_destroy()
+{
+ CloseWindow();
+}
+
+void dspl_draw_circle(int cx, int cy, int r)
+{
+ DrawCircle((info.width/2) + cx, cy, 5, RED);
+}
+
+void dspl_draw_line(int x1, int y1, int x2, int y2, int c)
+{
+ DrawLine((info.width/2) + x1, y1, (info.width/2) + x2, y2 , (c == 0) ? BLUE : RED);
+}