aboutsummaryrefslogtreecommitdiff
path: root/src/display.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/display.c')
-rw-r--r--src/display.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/display.c b/src/display.c
index 2a46493..9ecb6cb 100644
--- a/src/display.c
+++ b/src/display.c
@@ -1,4 +1,9 @@
-#include <raylib.h>
+#ifdef PLATFORM_WEB
+ #include RAYLIB_SRC
+#else
+ #include <raylib.h>
+#endif
+
#include "display.h"
static dspl_createinfo info;
@@ -7,7 +12,7 @@ void dspl_create(dspl_createinfo createinfo)
{
info = createinfo;
}
-void dspl_start()
+void dspl_start(void)
{
InitWindow(info.width, info.height, info.name);
SetTargetFPS(info.fps);
@@ -22,21 +27,17 @@ void dspl_start()
}
}
-void dspl_destroy()
+void dspl_destroy(void)
{
CloseWindow();
}
void dspl_draw_circle(int cx, int cy, int r)
{
- int offsetx = (info.width/2);
- int offsety = (info.height/4);
- DrawCircle(offsetx + cx, offsety + cy, r, RED);
+ DrawCircle(OFFSETX + cx, OFFSETY + cy, r, RED);
}
void dspl_draw_line(int x1, int y1, int x2, int y2, int c)
{
- int offsetx = (info.width/2);
- int offsety = (info.height/4);
- DrawLine(offsetx + x1, offsety + y1, offsetx + x2, offsety + y2 , (c == 0) ? BLUE : RED);
+ DrawLine(OFFSETX + x1, OFFSETY + y1, OFFSETX + x2, OFFSETY + y2 , (c == 0) ? BLUE : RED);
}