1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
|
with Interfaces.C; use Interfaces.C;
with Raymath; use Raymath;
package Raylib is
procedure Init_Window(Width, Height: int; Title: in char_array)
with
Import => True,
Convention => C,
External_Name => "InitWindow";
procedure Close_Window
with
Import => True,
Convention => C,
External_Name => "CloseWindow";
function Window_Should_Close return C_Bool
with
Import => True,
Convention => C,
External_Name => "WindowShouldClose";
procedure Begin_Drawing
with
Import => True,
Convention => C,
External_Name => "BeginDrawing";
procedure End_Drawing
with
Import => True,
Convention => C,
External_Name => "EndDrawing";
type Color is record
r: unsigned_char;
g: unsigned_char;
b: unsigned_char;
a: unsigned_char;
end record
with Convention => C_Pass_By_Copy;
procedure Clear_Background(c: Color)
with
Import => True,
Convention => C,
External_Name => "ClearBackground";
procedure Draw_Rectangle(posX, posY, Width, Height: int; c: Color)
with
Import => True,
Convention => C,
External_Name => "DrawRectangle";
function Get_Screen_Width return int
with
Import => True,
Convention => C,
External_Name => "GetScreenWidth";
function Get_Screen_Height return int
with
Import => True,
Convention => C,
External_Name => "GetScreenHeight";
FLAG_WINDOW_RESIZABLE: constant unsigned := 16#00000004#;
procedure Set_Config_Flags(flags: unsigned)
with
Import => True,
Convention => C,
External_Name => "SetConfigFlags";
KEY_NULL: constant int := 0;
KEY_R: constant int := 82;
KEY_S: constant int := 83;
KEY_W: constant int := 87;
KEY_A: constant int := 65;
KEY_D: constant int := 68;
KEY_P: constant int := 80;
KEY_O: constant int := 79;
KEY_X: constant int := 88;
KEY_SPACE: constant int := 32;
KEY_ESCAPE: constant int := 256;
KEY_ENTER: constant Int := 257;
function Is_Key_Pressed(key: int) return C_bool
with
Import => True,
Convention => C,
External_Name => "IsKeyPressed";
procedure Draw_Rectangle_V(position: Vector2; size: Vector2; c: Color)
with
Import => True,
Convention => C,
External_Name => "DrawRectangleV";
type Camera2D is record
offset: Vector2;
target: Vector2;
rotation: C_float;
zoom: C_float;
end record
with Convention => C_Pass_By_Copy;
procedure Begin_Mode2D(camera: Camera2D)
with
Import => True,
Convention => C,
External_Name => "BeginMode2D";
procedure End_Mode2D
with
Import => True,
Convention => C,
External_Name => "EndMode2D";
function Get_Frame_Time return C_float
with
Import => True,
Convention => C,
External_Name => "GetFrameTime";
function Get_Color(hexValue: unsigned) return Color
with
Import => True,
Convention => C,
External_Name => "GetColor";
function Color_To_Int(C: Color) return unsigned
with
Import => True,
Convention => C,
External_Name => "ColorToInt";
procedure Draw_Circle(centerX, centerY: int; radius: C_float; c: Color)
with
Import => True,
Convention => C,
External_Name => "DrawCircle";
procedure Draw_Circle_V(center: Vector2; radius: C_float; C: Color)
with
Import => True,
Convention => C,
External_Name => "DrawCircleV";
function Is_Key_Down(Key: int) return C_Bool
with
Import => True,
Convention => C,
External_Name => "IsKeyDown";
function Measure_Text(Text: Char_Array; FontSize: Int) return Int
with
Import => True,
Convention => C,
External_Name => "MeasureText";
procedure Draw_Text(Text: Char_Array; PosX, PosY: Int; FontSize: Int; C: Color)
with
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";
function Color_Brightness(C: Color; Factor: C_Float) return Color
with
Import => True,
Convention => C,
External_Name => "ColorBrightness";
function Color_To_HSV(C: Color) return Vector3
with
Import => True,
Convention => C,
External_Name => "ColorToHSV";
function Color_From_HSV(Hue, Saturation, Value: C_Float) return Color
with
Import => True,
Convention => C,
External_Name => "ColorFromHSV";
procedure Set_Exit_Key(Key: Int)
with
Import => True,
Convention => C,
External_Name => "SetExitKey";
function Get_Time return Double
with
Import => True,
Convention => C,
External_Name => "GetTime";
type Addr is mod 2 ** Standard'Address_Size;
type Image is record
Data: Addr;
Width: int;
Height: int;
Mipmaps: int;
Format: int;
end record
with Convention => C_Pass_By_Copy;
function Load_Image(File_Name: Char_Array) return Image
with
Import => True,
Convention => C,
External_Name => "LoadImage";
function Gen_Image_Color(Width, Height: Int; C: Color) return Image
with
Import => True,
Convention => C,
External_Name => "GenImageColor";
function Export_Image(Img: Image; File_Name: Char_Array) return C_Bool
with
Import => True,
Convention => C,
External_Name => "ExportImage";
procedure Draw_Triangle(V1, V2, V3: Vector2; C: Color)
with
Import => True,
Convention => C,
External_Name => "DrawTriangle";
type Vector2_Array is array (size_t range <>) of aliased Vector2;
procedure Draw_Triangle_Strip(Points: Vector2_Array; C: Color);
end Raylib;
|