diff options
author | Tristan Riehs <tristan.riehs@bordeaux-inp.fr> | 2024-06-20 20:39:08 +0900 |
---|---|---|
committer | Tristan Riehs <tristan.riehs@bordeaux-inp.fr> | 2024-06-20 20:39:08 +0900 |
commit | 82b1cce1bc5c91c0b56501f5dab912390206ace5 (patch) | |
tree | ccb0b9b293b6dccfdc95cbd657fb63227274dc41 /src/ray.c | |
parent | 685ec81e127c9409a91299a5ac8415bb94f55ad9 (diff) |
Use cli and gui as shared libraries
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 |