Ada bindings for Raylib 5.1 library.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

52 lines
1.2KB

  1. with Raylib;
  2. use Raylib;
  3. procedure Preview is
  4. type Texture_Index is (
  5. Archery,
  6. Barracks,
  7. Blacksmith,
  8. Castle,
  9. House_1,
  10. House_2,
  11. House_3,
  12. Stable,
  13. Terrain,
  14. Tree_1,
  15. Tree_2,
  16. Tree_3
  17. );
  18. Texture_Array : array (Texture_Index) of Texture;
  19. begin
  20. Open_Window (1280, 720, "Pandemos Empire" & ASCII.NUL);
  21. --
  22. for I in Texture_Index
  23. loop
  24. Texture_Array (I) := Load_Texture ("./example/resource/"
  25. & Texture_Index'Image (I)
  26. & ".png"
  27. & ASCII.NUL);
  28. end loop;
  29. --
  30. until Window_Should_Close
  31. loop
  32. Begin_Drawing;
  33. for Y in 0 .. Get_Screen_Height / Terrain.Height - 2
  34. for X in 0 .. Get_Screen_Width / Terrain.Width - 2
  35. Draw_Texture (Data => Texture_Array (Terrain),
  36. X => X * Terrain.Width,
  37. Y => Y * Terrain.Height);
  38. End_Drawing;
  39. end loop;
  40. --
  41. for I in Texture_Index
  42. loop
  43. Unload_Texture (Texture_Array (I));
  44. end loop;
  45. --
  46. Close_Window;
  47. end Preview;