File tree 2 files changed +41
-0
lines changed 2 files changed +41
-0
lines changed Original file line number Diff line number Diff line change @@ -271,4 +271,33 @@ package body SDL.Inputs.Joysticks.Game_Controllers is
271
271
begin
272
272
return To_Boolean (SDL_Is_Game_Controller (C.int (Device) - 1 ));
273
273
end Is_Game_Controller ;
274
+
275
+ function Has_Rumble (Self : in Game_Controller) return Boolean is
276
+ function SDL_Game_Controller_Has_Rumble (Controller : in SDL.C_Pointers.Game_Controller_Pointer)
277
+ return SDL_Bool with
278
+ Import => True,
279
+ Convention => C,
280
+ External_Name => " SDL_GameControllerHasRumble" ;
281
+ begin
282
+ return To_Boolean (SDL_Game_Controller_Has_Rumble (Self.Internal));
283
+ end Has_Rumble ;
284
+
285
+ function Rumble (Self : in Game_Controller;
286
+ Low_Frequency : in Uint16;
287
+ High_Frequency : in Uint16;
288
+ Duration : in Uint32) return Integer is
289
+ function SDL_Game_Controller_Rumble (Controller : in SDL.C_Pointers.Game_Controller_Pointer;
290
+ Low_Frequency : in Uint16;
291
+ High_Frequency : in Uint16;
292
+ Duration : in Uint32)
293
+ return C.int with
294
+ Import => True,
295
+ Convention => C,
296
+ External_Name => " SDL_GameControllerRumble" ;
297
+ begin
298
+ return Integer (SDL_Game_Controller_Rumble (Self.Internal,
299
+ Low_Frequency,
300
+ High_Frequency,
301
+ Duration));
302
+ end Rumble ;
274
303
end SDL.Inputs.Joysticks.Game_Controllers ;
Original file line number Diff line number Diff line change @@ -49,6 +49,9 @@ package SDL.Inputs.Joysticks.Game_Controllers is
49
49
50
50
Null_Game_Controller : constant Game_Controller;
51
51
52
+ subtype Uint16 is Interfaces.Unsigned_16;
53
+ subtype Uint32 is Interfaces.Unsigned_32;
54
+
52
55
procedure Add_Mapping (Data : in String; Updated_Existing : out Boolean);
53
56
procedure Add_Mappings_From_File (Database_Filename : in String; Number_Added : out Natural);
54
57
@@ -92,6 +95,15 @@ package SDL.Inputs.Joysticks.Game_Controllers is
92
95
93
96
function Is_Game_Controller (Device : in Devices) return Boolean with
94
97
Inline => True;
98
+
99
+ function Has_Rumble (Self : in Game_Controller) return Boolean with
100
+ Inline => True;
101
+
102
+ function Rumble (Self : in Game_Controller;
103
+ Low_Frequency : in Uint16;
104
+ High_Frequency : in Uint16;
105
+ Duration : in Uint32) return Integer with
106
+ Inline => True;
95
107
private
96
108
type Game_Controller is new Ada.Finalization.Limited_Controlled with
97
109
record
You can’t perform that action at this time.
0 commit comments