aboutsummaryrefslogtreecommitdiff
path: root/src/display.c
diff options
context:
space:
mode:
authorkartofen <mladenovnasko0@gmail.com>2022-10-28 22:23:02 +0300
committerkartofen <mladenovnasko0@gmail.com>2022-10-28 22:23:02 +0300
commit7363f062baf99097a9a5e2e4366cced0afd526cb (patch)
treec1578d5fdbf9639aada5d48c6aa8e48565c43816 /src/display.c
parent8e235c8e6641f223c59e8502ac0caebf9c5c1ffc (diff)
wasm supportHEADmaster
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);
}