Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion units/sdl2.pas
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,8 @@ interface
{$I sdlscancode.inc}
{$I sdlkeyboard.inc}
{$I sdlmouse.inc} // 2.0.24
{$I sdljoystick.inc}
{$I sdlguid.inc} // 2.24.0
{$I sdljoystick.inc} // 2.24.0
{$I sdlsensor.inc}
{$I sdlgamecontroller.inc} // 2.0.22
{$I sdlhaptic.inc}
Expand Down
58 changes: 58 additions & 0 deletions units/sdlguid.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{**
* \file SDL_guid.h
*
* Include file for handling ::SDL_GUID values.
*}

{**
* An SDL_GUID is a 128-bit identifier for an input device that
* identifies that device across runs of SDL programs on the same
* platform. If the device is detached and then re-attached to a
* different port, or if the base system is rebooted, the device
* should still report the same GUID.
*
* GUIDs are as precise as possible but are not guaranteed to
* distinguish physically distinct but equivalent devices. For
* example, two game controllers from the same vendor with the same
* product ID and revision may have the same GUID.
*
* GUIDs may be platform-dependent (i.e., the same device may report
* different GUIDs on different operating systems).
*}
type
TSDL_GUID = record
data: array[0..15] of cuint8;
end;

{**
* Get an ASCII string representation for a given ::SDL_GUID.
*
* You should supply at least 33 bytes for pszGUID.
*
* \param guid the ::SDL_GUID you wish to convert to string
* \param pszGUID buffer in which to write the ASCII string
* \param cbGUID the size of pszGUID
*
* \since This function is available since SDL 2.24.0.
*
* \sa SDL_GUIDFromString
*}
procedure SDL_GUIDToString(guid: TSDL_GUID; pszGUID: PAnsiChar; cbGUID: cint); cdecl;
external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GUIDToString' {$ENDIF} {$ENDIF};

{**
* Convert a GUID string into a ::SDL_GUID structure.
*
* Performs no error checking. If this function is given a string containing
* an invalid GUID, the function will silently succeed, but the GUID generated
* will not be useful.
*
* \param pchGUID string containing an ASCII representation of a GUID
* \returns a ::SDL_GUID structure.
*
* \since This function is available since SDL 2.24.0.
*
* \sa SDL_GUIDToString
*}
function SDL_GUIDFromString(const pchGUID: PAnsiChar): TSDL_GUID; cdecl;
external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GUIDFromString' {$ENDIF} {$ENDIF};
Loading