Added unit tests
This commit is contained in:
@@ -25,12 +25,21 @@ int main() {
|
||||
|
||||
SetConfigFlags(FLAG_WINDOW_HIGHDPI);
|
||||
InitWindow(WINDOW_WIDTH, WINDOW_HEIGHT, "2048");
|
||||
SetTargetFPS(30); // So my laptop doesn't burn
|
||||
SetTargetFPS(90); // We have event blocking so we can affort higher FPS
|
||||
EnableEventWaiting();
|
||||
|
||||
while (!WindowShouldClose()) {
|
||||
ClearBackground(RAYWHITE);
|
||||
BeginDrawing();
|
||||
render(&game_state);
|
||||
ClearBackground(RAYWHITE);
|
||||
|
||||
// If we are not animating, we can wait for input events instead of continuously rendering
|
||||
bool animating = render(&game_state);
|
||||
if (animating) {
|
||||
DisableEventWaiting();
|
||||
} else {
|
||||
EnableEventWaiting();
|
||||
}
|
||||
|
||||
EndDrawing();
|
||||
handle_mouse_input(&game_state);
|
||||
handle_keyboard_input(&game_state);
|
||||
|
||||
Reference in New Issue
Block a user