More function bindings, debugging stuff...
This commit is contained in:
239
raylib.ads
239
raylib.ads
@ -668,12 +668,21 @@ package Raylib is
|
|||||||
|
|
||||||
No_Image : Image;
|
No_Image : Image;
|
||||||
|
|
||||||
|
--~type Texture is record
|
||||||
|
--~Id : Natural := 0;
|
||||||
|
--~Width : Integer := 0;
|
||||||
|
--~Height : Integer := 0;
|
||||||
|
--~Mipmaps : Integer := 1;
|
||||||
|
--~Format : Pixel_Format := Pixel_Format_None;
|
||||||
|
--~end record with Convention => C_Pass_By_Copy;
|
||||||
|
|
||||||
type Texture is record
|
type Texture is record
|
||||||
Id : Natural := 0;
|
Id : Natural;
|
||||||
Width : Integer := 0;
|
Width : Integer;
|
||||||
Height : Integer := 0;
|
Height : Integer;
|
||||||
Mipmaps : Integer := 1;
|
Mipmaps : Integer;
|
||||||
Format : Pixel_Format := Pixel_Format_None;
|
--~Format : Pixel_Format;
|
||||||
|
Format : Integer;
|
||||||
end record with Convention => C_Pass_By_Copy;
|
end record with Convention => C_Pass_By_Copy;
|
||||||
|
|
||||||
No_Texture : Texture;
|
No_Texture : Texture;
|
||||||
@ -712,6 +721,8 @@ package Raylib is
|
|||||||
Glyphs : access Glyph_Info := null;
|
Glyphs : access Glyph_Info := null;
|
||||||
end record with Convention => C_Pass_By_Copy;
|
end record with Convention => C_Pass_By_Copy;
|
||||||
|
|
||||||
|
No_Font : Font;
|
||||||
|
|
||||||
type Camera_3D is record
|
type Camera_3D is record
|
||||||
Position : Vector_3D := (0.0, 0.0, 0.0);
|
Position : Vector_3D := (0.0, 0.0, 0.0);
|
||||||
Target : Vector_3D := (0.0, 0.0, 0.0);
|
Target : Vector_3D := (0.0, 0.0, 0.0);
|
||||||
@ -1508,10 +1519,12 @@ package Raylib is
|
|||||||
--~Convention => C,
|
--~Convention => C,
|
||||||
--~External_Name => "";
|
--~External_Name => "";
|
||||||
|
|
||||||
--~procedure SetTargetFPS (int fps) with
|
procedure Set_Target_FPS (
|
||||||
--~Import => True,
|
FPS : Integer := 60
|
||||||
--~Convention => C,
|
) with
|
||||||
--~External_Name => "";
|
Import => True,
|
||||||
|
Convention => C,
|
||||||
|
External_Name => "SetTargetFPS";
|
||||||
|
|
||||||
--~function float GetFrameTime (void) with
|
--~function float GetFrameTime (void) with
|
||||||
--~Import => True,
|
--~Import => True,
|
||||||
@ -1823,45 +1836,57 @@ package Raylib is
|
|||||||
--~Convention => C,
|
--~Convention => C,
|
||||||
--~External_Name => "";
|
--~External_Name => "";
|
||||||
|
|
||||||
--~function bool IsKeyPressed (int key) with
|
function Is_Key_Pressed (
|
||||||
--~Import => True,
|
Key : Keyboard_Key := Key_Null
|
||||||
--~Convention => C,
|
) return Logical with
|
||||||
--~External_Name => "";
|
Import => True,
|
||||||
|
Convention => C,
|
||||||
|
External_Name => "IsKeyPressed";
|
||||||
|
|
||||||
--~function bool IsKeyPressedRepeat (int key) with
|
function Is_Key_Pressed_Repeat (
|
||||||
--~Import => True,
|
Key : Keyboard_Key := Key_Null
|
||||||
--~Convention => C,
|
) return Logical with
|
||||||
--~External_Name => "";
|
Import => True,
|
||||||
|
Convention => C,
|
||||||
|
External_Name => "IsKeyPressedRepeat";
|
||||||
|
|
||||||
--~function bool IsKeyDown (int key) with
|
function Is_Key_Down (
|
||||||
--~Import => True,
|
Key : Keyboard_Key := Key_Null
|
||||||
--~Convention => C,
|
) return Logical with
|
||||||
--~External_Name => "";
|
Import => True,
|
||||||
|
Convention => C,
|
||||||
|
External_Name => "IsKeyDown";
|
||||||
|
|
||||||
--~function bool IsKeyReleased (int key) with
|
function Is_Key_Released (
|
||||||
--~Import => True,
|
Key : Keyboard_Key := Key_Null
|
||||||
--~Convention => C,
|
) return Logical with
|
||||||
--~External_Name => "";
|
Import => True,
|
||||||
|
Convention => C,
|
||||||
|
External_Name => "IsKeyReleased";
|
||||||
|
|
||||||
--~function bool IsKeyUp (int key) with
|
function Is_Key_Up (
|
||||||
--~Import => True,
|
Key : Keyboard_Key := Key_Null
|
||||||
--~Convention => C,
|
) return Logical with
|
||||||
--~External_Name => "";
|
Import => True,
|
||||||
|
Convention => C,
|
||||||
|
External_Name => "IsKeyUp";
|
||||||
|
|
||||||
--~function int GetKeyPressed (void) with
|
function Get_Key_Pressed return Keyboard_Key with
|
||||||
--~Import => True,
|
Import => True,
|
||||||
--~Convention => C,
|
Convention => C,
|
||||||
--~External_Name => "";
|
External_Name => "GetKeyPressed";
|
||||||
|
|
||||||
--~function int GetCharPressed (void) with
|
function Get_Character_Pressed return Character with
|
||||||
--~Import => True,
|
Import => True,
|
||||||
--~Convention => C,
|
Convention => C,
|
||||||
--~External_Name => "";
|
External_Name => "GetCharPressed";
|
||||||
|
|
||||||
--~procedure SetExitKey (int key) with
|
procedure Set_Exit_Key (
|
||||||
--~Import => True,
|
Key : Keyboard_Key := Key_Escape
|
||||||
--~Convention => C,
|
) with
|
||||||
--~External_Name => "";
|
Import => True,
|
||||||
|
Convention => C,
|
||||||
|
External_Name => "SetExitKey";
|
||||||
|
|
||||||
--~function bool IsGamepadAvailable (int gamepad) with
|
--~function bool IsGamepadAvailable (int gamepad) with
|
||||||
--~Import => True,
|
--~Import => True,
|
||||||
@ -2073,10 +2098,16 @@ package Raylib is
|
|||||||
--~Convention => C,
|
--~Convention => C,
|
||||||
--~External_Name => "";
|
--~External_Name => "";
|
||||||
|
|
||||||
--~procedure DrawLine (int startPosX, int startPosY, int endPosX, int endPosY, Color color) with
|
procedure Draw_Line (
|
||||||
--~Import => True,
|
X0 : Integer := 0;
|
||||||
--~Convention => C,
|
Y0 : Integer := 0;
|
||||||
--~External_Name => "";
|
X1 : Integer := 0;
|
||||||
|
Y1 : Integer := 0;
|
||||||
|
Tint : Color := Black
|
||||||
|
) with
|
||||||
|
Import => True,
|
||||||
|
Convention => C,
|
||||||
|
External_Name => "DrawLine";
|
||||||
|
|
||||||
--~procedure DrawLineV (Vector2 startPos, Vector2 endPos, Color color) with
|
--~procedure DrawLineV (Vector2 startPos, Vector2 endPos, Color color) with
|
||||||
--~Import => True,
|
--~Import => True,
|
||||||
@ -2153,10 +2184,16 @@ package Raylib is
|
|||||||
--~Convention => C,
|
--~Convention => C,
|
||||||
--~External_Name => "";
|
--~External_Name => "";
|
||||||
|
|
||||||
--~procedure DrawRectangle (int posX, int posY, int width, int height, Color color) with
|
procedure Draw_Rectangle (
|
||||||
--~Import => True,
|
X : Integer := 0;
|
||||||
--~Convention => C,
|
Y : Integer := 0;
|
||||||
--~External_Name => "";
|
Width : Integer := 0;
|
||||||
|
Height : Integer := 0;
|
||||||
|
Tint : Color := Black
|
||||||
|
) with
|
||||||
|
Import => True,
|
||||||
|
Convention => C,
|
||||||
|
External_Name => "DrawRectangle";
|
||||||
|
|
||||||
--~procedure DrawRectangleV (Vector2 position, Vector2 size, Color color) with
|
--~procedure DrawRectangleV (Vector2 position, Vector2 size, Color color) with
|
||||||
--~Import => True,
|
--~Import => True,
|
||||||
@ -2728,10 +2765,12 @@ package Raylib is
|
|||||||
--~Convention => C,
|
--~Convention => C,
|
||||||
--~External_Name => "";
|
--~External_Name => "";
|
||||||
|
|
||||||
--~function Texture2D LoadTexture (const char *fileName) with
|
function Load_Texture (
|
||||||
--~Import => True,
|
File_Path : String := ""
|
||||||
--~Convention => C,
|
) return Texture with
|
||||||
--~External_Name => "";
|
Import => True,
|
||||||
|
Convention => C,
|
||||||
|
External_Name => "LoadTexture";
|
||||||
|
|
||||||
--~function Texture2D LoadTextureFromImage (Image image) with
|
--~function Texture2D LoadTextureFromImage (Image image) with
|
||||||
--~Import => True,
|
--~Import => True,
|
||||||
@ -2753,10 +2792,12 @@ package Raylib is
|
|||||||
--~Convention => C,
|
--~Convention => C,
|
||||||
--~External_Name => "";
|
--~External_Name => "";
|
||||||
|
|
||||||
--~procedure UnloadTexture (Texture2D texture) with
|
procedure Unload_Texture (
|
||||||
--~Import => True,
|
Data : Texture := No_Texture
|
||||||
--~Convention => C,
|
) with
|
||||||
--~External_Name => "";
|
Import => True,
|
||||||
|
Convention => C,
|
||||||
|
External_Name => "UnloadTexture";
|
||||||
|
|
||||||
--~function bool IsRenderTextureReady (RenderTexture2D target) with
|
--~function bool IsRenderTextureReady (RenderTexture2D target) with
|
||||||
--~Import => True,
|
--~Import => True,
|
||||||
@ -2793,10 +2834,15 @@ package Raylib is
|
|||||||
--~Convention => C,
|
--~Convention => C,
|
||||||
--~External_Name => "";
|
--~External_Name => "";
|
||||||
|
|
||||||
--~procedure DrawTexture (Texture2D texture, int posX, int posY, Color tint) with
|
procedure Draw_Texture (
|
||||||
--~Import => True,
|
Data : Texture := No_Texture;
|
||||||
--~Convention => C,
|
X : Integer := 0;
|
||||||
--~External_Name => "";
|
Y : Integer := 0;
|
||||||
|
Tint : Color := White
|
||||||
|
) with
|
||||||
|
Import => True,
|
||||||
|
Convention => C,
|
||||||
|
External_Name => "DrawTexture";
|
||||||
|
|
||||||
--~procedure DrawTextureV (Texture2D texture, Vector2 position, Color tint) with
|
--~procedure DrawTextureV (Texture2D texture, Vector2 position, Color tint) with
|
||||||
--~Import => True,
|
--~Import => True,
|
||||||
@ -2813,10 +2859,17 @@ package Raylib is
|
|||||||
--~Convention => C,
|
--~Convention => C,
|
||||||
--~External_Name => "";
|
--~External_Name => "";
|
||||||
|
|
||||||
--~procedure DrawTexturePro (Texture2D texture, Rectangle source, Rectangle dest, Vector2 origin, float rotation, Color tint) with
|
procedure Draw_Texture_Pro (
|
||||||
--~Import => True,
|
Data : Texture := No_Texture;
|
||||||
--~Convention => C,
|
Source : Rectangle := No_Rectangle;
|
||||||
--~External_Name => "";
|
Destination : Rectangle := No_Rectangle;
|
||||||
|
Origin : Vector_2D := (0.0, 0.0);
|
||||||
|
Rotation : Float := 0.0;
|
||||||
|
Tint : Color := White
|
||||||
|
) with
|
||||||
|
Import => True,
|
||||||
|
Convention => C,
|
||||||
|
External_Name => "DrawTexturePro";
|
||||||
|
|
||||||
--~procedure DrawTextureNPatch (Texture2D texture, NPatchInfo nPatchInfo, Rectangle dest, Vector2 origin, float rotation, Color tint) with
|
--~procedure DrawTextureNPatch (Texture2D texture, NPatchInfo nPatchInfo, Rectangle dest, Vector2 origin, float rotation, Color tint) with
|
||||||
--~Import => True,
|
--~Import => True,
|
||||||
@ -2898,10 +2951,10 @@ package Raylib is
|
|||||||
--~Convention => C,
|
--~Convention => C,
|
||||||
--~External_Name => "";
|
--~External_Name => "";
|
||||||
|
|
||||||
--~function Font GetFontDefault (void) with
|
function Get_Font_Default return Font with
|
||||||
--~Import => True,
|
Import => True,
|
||||||
--~Convention => C,
|
Convention => C,
|
||||||
--~External_Name => "";
|
External_Name => "GetFontDefault";
|
||||||
|
|
||||||
--~function Font LoadFont (const char *fileName) with
|
--~function Font LoadFont (const char *fileName) with
|
||||||
--~Import => True,
|
--~Import => True,
|
||||||
@ -2953,25 +3006,47 @@ package Raylib is
|
|||||||
--~Convention => C,
|
--~Convention => C,
|
||||||
--~External_Name => "";
|
--~External_Name => "";
|
||||||
|
|
||||||
--~procedure DrawFPS (int posX, int posY) with
|
procedure Draw_FPS (
|
||||||
--~Import => True,
|
X : Integer := 0;
|
||||||
--~Convention => C,
|
Y : Integer := 0
|
||||||
--~External_Name => "";
|
) with
|
||||||
|
Import => True,
|
||||||
--~procedure DrawText (const char *text, int posX, int posY, int fontSize, Color color) with
|
Convention => C,
|
||||||
--~Import => True,
|
External_Name => "DrawFPS";
|
||||||
--~Convention => C,
|
--~################################################################
|
||||||
--~External_Name => "";
|
--~################################################################
|
||||||
|
--~################################################################
|
||||||
|
procedure Draw_Text (
|
||||||
|
Text : String := "";
|
||||||
|
--~Text : access String := null;
|
||||||
|
--~Text : String := "";
|
||||||
|
X : Integer := 0;
|
||||||
|
Y : Integer := 0;
|
||||||
|
Size : Integer := 32;
|
||||||
|
Tint : Color := Dark_Gray
|
||||||
|
) with
|
||||||
|
Import => True,
|
||||||
|
Convention => C,
|
||||||
|
External_Name => "DrawText";
|
||||||
|
|
||||||
--~procedure DrawTextEx (Font font, const char *text, Vector2 position, float fontSize, float spacing, Color tint) with
|
--~procedure DrawTextEx (Font font, const char *text, Vector2 position, float fontSize, float spacing, Color tint) with
|
||||||
--~Import => True,
|
--~Import => True,
|
||||||
--~Convention => C,
|
--~Convention => C,
|
||||||
--~External_Name => "";
|
--~External_Name => "";
|
||||||
|
|
||||||
--~procedure DrawTextPro (Font font, const char *text, Vector2 position, Vector2 origin, float rotation, float fontSize, float spacing, Color tint) with
|
procedure Draw_Text_Pro (
|
||||||
--~Import => True,
|
Data : Font := Get_Font_Default;
|
||||||
--~Convention => C,
|
Text : String := "NOOO";
|
||||||
--~External_Name => "";
|
Position : Vector_2D := (0.0, 0.0);
|
||||||
|
Origin : Vector_2D := (0.0, 0.0);
|
||||||
|
Rotation : Float := 0.0;
|
||||||
|
Font_Size : Float := 0.0;
|
||||||
|
Spacing : Float := 0.0;
|
||||||
|
Tint : Color := Dark_Gray
|
||||||
|
) with
|
||||||
|
Import => True,
|
||||||
|
Convention => C,
|
||||||
|
External_Name => "DrawTextPro";
|
||||||
|
|
||||||
--~procedure DrawTextCodepoint (Font font, int codepoint, Vector2 position, float fontSize, Color tint) with
|
--~procedure DrawTextCodepoint (Font font, int codepoint, Vector2 position, float fontSize, Color tint) with
|
||||||
--~Import => True,
|
--~Import => True,
|
||||||
|
BIN
texture.png
Normal file
BIN
texture.png
Normal file
Binary file not shown.
After ![]() (image error) Size: 212 KiB |
37
window.adb
37
window.adb
@ -3,20 +3,55 @@ use Raylib;
|
|||||||
|
|
||||||
procedure Window is
|
procedure Window is
|
||||||
|
|
||||||
|
Text : String := "Heyo world!" & Character'Val (0);
|
||||||
|
|
||||||
|
Dragdown : Texture;
|
||||||
|
|
||||||
|
X : Integer := 120;
|
||||||
|
Y : Integer := 120;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
|
|
||||||
Open_Window (720, 360, "Heyo Raylib!" & Character'Val (0));
|
Open_Window (720, 360, "Heyo Raylib!" & Character'Val (0));
|
||||||
|
|
||||||
|
Set_Exit_Key (Key_Q); -- Default is Key_Escape
|
||||||
|
Set_Target_FPS (72); -- Default is 60
|
||||||
|
|
||||||
|
Dragdown := Load_Texture ("./texture.png" & Character'Val (0));
|
||||||
|
|
||||||
Main_Loop: loop
|
Main_Loop: loop
|
||||||
exit when Window_Should_Close;
|
exit when Window_Should_Close;
|
||||||
--
|
--
|
||||||
Begin_Drawing;
|
Begin_Drawing;
|
||||||
--
|
--
|
||||||
Clear_Background (Blue);
|
Clear_Background (Sky_Blue);
|
||||||
|
--
|
||||||
|
Draw_Texture (Dragdown, (Get_Screen_Width - Dragdown.Width) / 2, (Get_Screen_Height - Dragdown.Height) / 2);
|
||||||
|
Draw_Texture (Dragdown, 100, 100, White);
|
||||||
|
Draw_Texture_Pro (Dragdown, (0.0, 0.0, 420.0, 420.0), (200.0, 0.0, 420.0, 420.0));
|
||||||
|
--~Data : Texture := No_Texture;
|
||||||
|
--~Source : Rectangle := No_Rectangle;
|
||||||
|
--~Destination : Rectangle := No_Rectangle;
|
||||||
|
--~Origin : Vector_2D := (0.0, 0.0);
|
||||||
|
--~Rotation : Float := 0.0;
|
||||||
|
--~Tint : Color := White
|
||||||
|
Draw_Text ("Heyo world!" & Character'Val (0), 30, 30, 32, Light_Gray);
|
||||||
|
Draw_Text (Text, 30, 30, 32, Black);
|
||||||
|
Draw_Text_Pro (Get_Font_Default, Text, (90.0, 90.0), (9.0, 9.0), 0.0, 32.0, 4.0, Red);
|
||||||
|
Draw_FPS (60, 60);
|
||||||
|
Draw_Line (0, 0, 300, 300, Red);
|
||||||
|
Draw_Rectangle (120, 120, 30, 60, Green);
|
||||||
|
Draw_FPS (X, Y);
|
||||||
|
if Is_Key_Pressed (Key_W) then Y := Y - 10; end if;
|
||||||
|
if Is_Key_Pressed (Key_S) then Y := Y + 10; end if;
|
||||||
|
if Is_Key_Pressed (Key_A) then X := X - 10; end if;
|
||||||
|
if Is_Key_Pressed (Key_D) then X := X + 10; end if;
|
||||||
--
|
--
|
||||||
End_Drawing;
|
End_Drawing;
|
||||||
end loop Main_Loop;
|
end loop Main_Loop;
|
||||||
|
|
||||||
|
Unload_Texture (Dragdown);
|
||||||
|
|
||||||
Close_Window;
|
Close_Window;
|
||||||
|
|
||||||
end Window;
|
end Window;
|
||||||
|
Reference in New Issue
Block a user