aboutsummaryrefslogtreecommitdiff
path: root/src/ray.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ray.c')
-rw-r--r--src/ray.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/ray.c b/src/ray.c
index 81cc808..ad312f4 100644
--- a/src/ray.c
+++ b/src/ray.c
@@ -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;
}
}