diff options
Diffstat (limited to 'src/ray.c')
-rw-r--r-- | src/ray.c | 24 |
1 files changed, 22 insertions, 2 deletions
@@ -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 |