Skip to content

Commit 645dc3f

Browse files
committed
Add the SDL_GameControllerGetSteamHandle function
1 parent 4ebb33d commit 645dc3f

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

units/sdl2.pas

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ interface
154154
{$I sdlguid.inc} // 2.24.0
155155
{$I sdljoystick.inc} // 2.24.0
156156
{$I sdlsensor.inc} // 2.26.0
157-
{$I sdlgamecontroller.inc} // 2.26.0
157+
{$I sdlgamecontroller.inc} // 2.30.0
158158
{$I sdlhaptic.inc} // 2.26.2
159159
{$I sdlhidapi.inc} // 2.0.18
160160
{$I sdltouch.inc} // 2.24.0

units/sdlgamecontroller.inc

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,20 @@ function SDL_GameControllerGetFirmwareVersion(gamecontroller: PSDL_GameControlle
311311
function SDL_GameControllerGetSerial(gamecontroller: PSDL_GameController): PAnsiChar; cdecl;
312312
external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GameControllerGetSerial' {$ENDIF} {$ENDIF};
313313

314+
{**
315+
* Get the Steam Input handle of an opened controller, if available.
316+
*
317+
* Returns an InputHandle_t for the controller that can be used with Steam Input API:
318+
* https://partner.steamgames.com/doc/api/ISteamInput
319+
*
320+
* \param gamecontroller the game controller object to query.
321+
* \returns the gamepad handle, or 0 if unavailable.
322+
*
323+
* \since This function is available since SDL 2.30.0.
324+
*}
325+
function SDL_GameControllerGetSteamHandle(gamecontroller: PSDL_GameController): cuint64; cdecl;
326+
external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GameControllerGetSteamHandle' {$ENDIF} {$ENDIF};
327+
314328
{**
315329
* Returns SDL_TRUE if the controller has been opened and currently connected,
316330
* or SDL_FALSE if it has not.

0 commit comments

Comments
 (0)