diff options
Diffstat (limited to 'src/ray.c')
-rw-r--r-- | src/ray.c | 27 |
1 files changed, 24 insertions, 3 deletions
@@ -30,6 +30,12 @@ void init(void) { +#ifndef NDEBUG + SetTraceLogLevel(LOG_DEBUG); +#else + SetTraceLogLevel(LOG_ERROR); +#endif + InitWindow(DEFAULT_WIDTH, DEFAULT_HEIGHT, "calculer"); if (!IsWindowReady()) @@ -38,11 +44,14 @@ init(void) window\n"); exit(1); } - SetTargetFPS(24); + + SetTargetFPS(60); BeginDrawing(); ClearBackground(RAYWHITE); EndDrawing(); + + TraceLog(LOG_INFO, "window successfully initialized"); } static int @@ -79,22 +88,34 @@ display_calc(int x, int y) BeginDrawing(); ClearBackground(RAYWHITE); - DrawText(txt, (win_width-txt_width)/2, win_height/6, font_size, LIGHTGRAY); + DrawText(txt, (win_width-txt_width)/2, win_height/6, font_size, GRAY); EndDrawing(); + + TraceLog(LOG_INFO, "calulation %d + %d successfully drawn", x, y); } int read_input(void) { + TraceLog(LOG_INFO, "waiting for user input"); while (!WindowShouldClose()) { + /* BeginDrawing(); */ + PollInputEvents(); + if (IsKeyPressed(KEY_ENTER)) + { + TraceLog(LOG_INFO, "enter key pressed"); + return INT_MAX; + } + /* EndDrawing(); */ } + return INT_MAX; } void display_res(bool, int) { - + } void |