aboutsummaryrefslogtreecommitdiff
path: root/src/ray.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ray.c')
-rw-r--r--src/ray.c24
1 files changed, 22 insertions, 2 deletions
diff --git a/src/ray.c b/src/ray.c
index ad69902..81cc808 100644
--- a/src/ray.c
+++ b/src/ray.c
@@ -16,17 +16,29 @@
*/
#include "config.h"
+#include <limits.h>
#include <raylib.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
#include "disp.h"
#define DEFAULT_HEIGHT 200
-#define DEFAULT_WIDTH 16*9/DEFAULT_HEIGHT
+#define DEFAULT_WIDTH 16*DEFAULT_HEIGHT/9
void
init(void)
{
+ printf("info: raylib interface initialized\n");
InitWindow(DEFAULT_WIDTH, DEFAULT_HEIGHT, "calculer");
+
+ if (!IsWindowReady())
+ {
+ fprintf(stderr, "calculer: error initialiazing Raylib \
+window\n");
+ exit(1);
+ }
SetTargetFPS(24);
}
@@ -39,7 +51,15 @@ display_calc(int x, int y)
int
read_input(void)
{
-
+ if (!WindowShouldClose())
+ {
+ sleep(1);
+ return 0;
+ }
+ else
+ {
+ return INT_MAX;
+ }
}
void