From 5a89655e5a6e0d91eb6dcb1968ffc99b5fe0f7c5 Mon Sep 17 00:00:00 2001 From: rexim Date: Sun, 10 Mar 2024 23:07:17 +0700 Subject: Lock FPS to 60 --- game.adb | 2 ++ map.txt | 2 +- raylib.ads | 10 ++++++++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/game.adb b/game.adb index c9c8fb6..d20f166 100644 --- a/game.adb +++ b/game.adb @@ -449,6 +449,7 @@ begin Put_Line("Keys: " & Integer'Image(Game.Player.Keys)); Set_Config_Flags(FLAG_WINDOW_RESIZABLE); Init_Window(800, 600, Title); + Set_Target_FPS(60); while Window_Should_Close = 0 loop Begin_Drawing; Clear_Background(COLOR_BACKGROUND); @@ -474,6 +475,7 @@ begin End_Mode2D; Game_Hud(Game); + Draw_FPS(10, 10); End_Drawing; end loop; Close_Window; diff --git a/map.txt b/map.txt index 018cfee..bc7fb1d 100644 --- a/map.txt +++ b/map.txt @@ -11,7 +11,7 @@ #.....#.........######################....B........#.......# #..*..=....@....&..................................&...%...# #.....#.........######################.............#.......# -#.....#....*....# #.............#.......# +#.....#.........# #.............#.......# #######.........# #.............######### #.........# #.............# #####.##### ######...###### diff --git a/raylib.ads b/raylib.ads index d37a432..2beab5e 100644 --- a/raylib.ads +++ b/raylib.ads @@ -131,4 +131,14 @@ package Raylib is Import => True, Convention => C, External_Name => "DrawText"; + procedure Set_Target_FPS(Fps: int) + with + Import => True, + Convention => C, + External_Name => "SetTargetFPS"; + procedure Draw_FPS(PosX, PosY: Int) + with + Import => True, + Convention => C, + External_Name => "DrawFPS"; end Raylib; -- cgit v1.2.3