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.1KB

  1. with Raylib;
  2. use Raylib;
  3. procedure Window is
  4. function C_String (Data : String) return String is
  5. begin
  6. return (Data & Character'Val (0));
  7. end C_String;
  8. Text : String := C_String ("Heyo world!");
  9. Dragdown : Texture;
  10. X : Integer := 120;
  11. Y : Integer := 120;
  12. begin
  13. Open_Window (720, 360, C_String ("Heyo Raylib!"));
  14. Set_Exit_Key (Key_Q); -- Default is Key_Escape
  15. Set_Target_FPS (72); -- Default is 60
  16. Dragdown := Load_Texture (C_String ("./texture.png"));
  17. Main_Loop: loop
  18. exit when Window_Should_Close;
  19. --
  20. Begin_Drawing;
  21. --
  22. Clear_Background (Sky_Blue);
  23. Draw_Texture (Dragdown, 100, 100, White);
  24. Draw_Text (Text, 90, 90);
  25. Draw_FPS (X, Y);
  26. Draw_Line (0, 0, 300, 300, Black);
  27. Draw_Rectangle (120, 120, 30, 60, Blue);
  28. --
  29. if Is_Key_Pressed (Key_W) then Y := Y - 10; end if;
  30. if Is_Key_Pressed (Key_S) then Y := Y + 10; end if;
  31. if Is_Key_Pressed (Key_A) then X := X - 10; end if;
  32. if Is_Key_Pressed (Key_D) then X := X + 10; end if;
  33. --
  34. End_Drawing;
  35. end loop Main_Loop;
  36. Unload_Texture (Dragdown);
  37. Close_Window;
  38. end Window;