diff options
Diffstat (limited to 'src')
-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; } } |