Skip to content

Commit 001edd9

Browse files
Merge pull request #133 from suve/update-sdlgamecontroller.inc-to-SDL-2.30
Update sdlgamecontroller.inc to SDL 2.30
2 parents 3aa5e00 + 645dc3f commit 001edd9

File tree

2 files changed

+41
-1
lines changed

2 files changed

+41
-1
lines changed

units/sdl2.pas

+1-1
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.24.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

+40
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.
@@ -514,6 +528,32 @@ function SDL_GameControllerGetSensorDataRate(gamecontroller: PSDL_GameController
514528
function SDL_GameControllerGetSensorData(gamecontroller: PSDL_GameController; senstype: TSDL_SensorType; data: pcfloat; num_values: cint): cint; cdecl;
515529
external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GameControllerGetSensorData' {$ENDIF} {$ENDIF};
516530

531+
{**
532+
* Get the current state of a game controller sensor with the timestamp of the
533+
* last update.
534+
*
535+
* The number of values and interpretation of the data is sensor dependent.
536+
* See SDL_sensor.h for the details for each type of sensor.
537+
*
538+
* \param gamecontroller The controller to query
539+
* \param type The type of sensor to query
540+
* \param timestamp A pointer filled with the timestamp in microseconds of the
541+
* current sensor reading if available, or 0 if not
542+
* \param data A pointer filled with the current sensor state
543+
* \param num_values The number of values to write to data
544+
* \return 0 or -1 if an error occurred.
545+
*
546+
* \since This function is available since SDL 2.26.0.
547+
*}
548+
function SDL_GameControllerGetSensorDataWithTimestamp(
549+
gamecontroller: PSDL_GameController;
550+
senstype: TSDL_SensorType;
551+
timestamp: pcuint64;
552+
data: pcfloat;
553+
num_values: cint
554+
): cint; cdecl;
555+
external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GameControllerGetSensorDataWithTimestamp' {$ENDIF} {$ENDIF};
556+
517557
{**
518558
* Query whether a game controller has rumble support.
519559
*}

0 commit comments

Comments
 (0)