sdlguid.inc 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. {**
  2. * \file SDL_guid.h
  3. *
  4. * Include file for handling ::SDL_GUID values.
  5. *}
  6. {**
  7. * An SDL_GUID is a 128-bit identifier for an input device that
  8. * identifies that device across runs of SDL programs on the same
  9. * platform. If the device is detached and then re-attached to a
  10. * different port, or if the base system is rebooted, the device
  11. * should still report the same GUID.
  12. *
  13. * GUIDs are as precise as possible but are not guaranteed to
  14. * distinguish physically distinct but equivalent devices. For
  15. * example, two game controllers from the same vendor with the same
  16. * product ID and revision may have the same GUID.
  17. *
  18. * GUIDs may be platform-dependent (i.e., the same device may report
  19. * different GUIDs on different operating systems).
  20. *}
  21. type
  22. PPSDL_GUID = ^PSDL_GUID;
  23. PSDL_GUID = ^TSDL_GUID;
  24. TSDL_GUID = record
  25. data: array[0..15] of cuint8;
  26. end;
  27. {**
  28. * Get an ASCII string representation for a given ::SDL_GUID.
  29. *
  30. * You should supply at least 33 bytes for pszGUID.
  31. *
  32. * \param guid the ::SDL_GUID you wish to convert to string
  33. * \param pszGUID buffer in which to write the ASCII string
  34. * \param cbGUID the size of pszGUID
  35. *
  36. * \since This function is available since SDL 2.24.0.
  37. *
  38. * \sa SDL_GUIDFromString
  39. *}
  40. procedure SDL_GUIDToString(guid: TSDL_GUID; pszGUID: PAnsiChar; cbGUID: cint); cdecl;
  41. external {$IFDEF DYNAMIC_LINK}SDL_LibName{$ENDIF} {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GUIDToString' {$ENDIF} {$ENDIF};
  42. {**
  43. * Convert a GUID string into a ::SDL_GUID structure.
  44. *
  45. * Performs no error checking. If this function is given a string containing
  46. * an invalid GUID, the function will silently succeed, but the GUID generated
  47. * will not be useful.
  48. *
  49. * \param pchGUID string containing an ASCII representation of a GUID
  50. * \returns a ::SDL_GUID structure.
  51. *
  52. * \since This function is available since SDL 2.24.0.
  53. *
  54. * \sa SDL_GUIDToString
  55. *}
  56. function SDL_GUIDFromString(const pchGUID: PAnsiChar): TSDL_GUID; cdecl;
  57. external {$IFDEF DYNAMIC_LINK}SDL_LibName{$ENDIF} {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GUIDFromString' {$ENDIF} {$ENDIF};