diff options
author | Tristan Riehs <tristan.riehs@bordeaux-inp.fr> | 2024-06-20 22:17:15 +0900 |
---|---|---|
committer | Tristan Riehs <tristan.riehs@bordeaux-inp.fr> | 2024-06-20 22:17:15 +0900 |
commit | eb333cc30568a732942a62dcb953387acb0195f5 (patch) | |
tree | d6083cee92171aeddbc2617c87de433d130cdcad | |
parent | 82b1cce1bc5c91c0b56501f5dab912390206ace5 (diff) |
Start using Raylib drawing
-rw-r--r-- | src/ray.c | 20 |
1 files changed, 11 insertions, 9 deletions
@@ -30,7 +30,6 @@ void init(void) { - printf("info: raylib interface initialized\n"); InitWindow(DEFAULT_WIDTH, DEFAULT_HEIGHT, "calculer"); if (!IsWindowReady()) @@ -40,25 +39,28 @@ window\n"); exit(1); } SetTargetFPS(24); + + BeginDrawing(); + ClearBackground(RAYWHITE); + EndDrawing(); } void display_calc(int x, int y) { - + char text[32] = {0}; + sprintf(text, "%d + %d", x, y); + BeginDrawing(); + ClearBackground(RAYWHITE); + DrawText(text, DEFAULT_WIDTH/2, DEFAULT_HEIGHT/2, 40, LIGHTGRAY); + EndDrawing(); } int read_input(void) { - if (!WindowShouldClose()) - { - sleep(1); - return 0; - } - else + while (!WindowShouldClose()) { - return INT_MAX; } } |