diff options
| author | xolatile | 2024-04-23 12:15:11 -0400 |
|---|---|---|
| committer | xolatile | 2024-04-23 12:15:11 -0400 |
| commit | ebd9faf5dd21247c1b3f7acdf4e910ffdf32bc37 (patch) | |
| tree | 1dcaded84d0d532e5834d85095f55d427e016506 /example/generation.adb | |
| parent | c173a91ff2e8ec09c1d2e10b8ac2b8b437efb4fa (diff) | |
| download | xolatile-raylib-ada-ebd9faf5dd21247c1b3f7acdf4e910ffdf32bc37.tar.xz xolatile-raylib-ada-ebd9faf5dd21247c1b3f7acdf4e910ffdf32bc37.tar.zst | |
New generation example...
Diffstat (limited to 'example/generation.adb')
| -rw-r--r-- | example/generation.adb | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/example/generation.adb b/example/generation.adb new file mode 100644 index 0000000..a3ed893 --- /dev/null +++ b/example/generation.adb @@ -0,0 +1,51 @@ +with Raylib; +use Raylib; + +procedure Preview is + + type Texture_Index is ( + Archery, + Barracks, + Blacksmith, + Castle, + House_1, + House_2, + House_3, + Stable, + Terrain, + Tree_1, + Tree_2, + Tree_3 + ); + + Texture_Array : array (Texture_Index) of Texture; + +begin + Open_Window (1280, 720, "Pandemos Empire" & ASCII.NUL); + -- + for I in Texture_Index + loop + Texture_Array (I) := Load_Texture ("./example/resource/" + & Texture_Index'Image (I) + & ".png" + & ASCII.NUL); + end loop; + -- + until Window_Should_Close + loop + Begin_Drawing; + for Y in 0 .. Get_Screen_Height / Terrain.Height - 2 + for X in 0 .. Get_Screen_Width / Terrain.Width - 2 + Draw_Texture (Data => Texture_Array (Terrain), + X => X * Terrain.Width, + Y => Y * Terrain.Height); + End_Drawing; + end loop; + -- + for I in Texture_Index + loop + Unload_Texture (Texture_Array (I)); + end loop; + -- + Close_Window; +end Preview; |
