sdlversion.inc 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. // based on "sdl_version.h" (2.0.14)
  2. {**
  3. * \file SDL_version.h
  4. *
  5. * This header defines the current SDL version.
  6. *}
  7. {**
  8. * Information the version of SDL in use.
  9. *
  10. * Represents the library's version as three levels: major revision
  11. * (increments with massive changes, additions, and enhancements),
  12. * minor revision (increments with backwards-compatible changes to the
  13. * major revision), and patchlevel (increments with fixes to the minor
  14. * revision).
  15. *
  16. * SDL_VERSION
  17. * SDL_GetVersion
  18. *}
  19. type
  20. PPSDL_Version = ^PSDL_Version;
  21. PSDL_Version = ^TSDL_Version;
  22. TSDL_Version = record
  23. major, {**< major version *}
  24. minor, {**< minor version *}
  25. patch: cuint8; {**< update version *}
  26. end;
  27. {*
  28. Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL
  29. Last updated when TSDL_FPoint and TSDL_FRect were added.
  30. *}
  31. const
  32. SDL_MAJOR_VERSION = 2;
  33. SDL_MINOR_VERSION = 29;
  34. SDL_PATCHLEVEL = 0;
  35. {**
  36. * Macro to determine SDL version program was compiled against.
  37. *
  38. * This macro fills in a SDL_version structure with the version of the
  39. * library you compiled against. This is determined by what header the
  40. * compiler uses. Note that if you dynamically linked the library, you might
  41. * have a slightly newer or older version at runtime. That version can be
  42. * determined with SDL_GetVersion(), which, unlike SDL_VERSION(),
  43. * is not a macro.
  44. *
  45. * x An instance on TSDL_Version to fill with version data.
  46. *
  47. * SDL_version
  48. * SDL_GetVersion
  49. *}
  50. procedure SDL_VERSION(out x: TSDL_Version);
  51. {**
  52. * This macro turns the version numbers into a numeric value:
  53. *
  54. * (1,2,3) -> (1203)
  55. *
  56. *
  57. * This assumes that there will never be more than 100 patchlevels.
  58. *}
  59. function SDL_VERSIONNUM(X,Y,Z: cuint8): Cardinal;
  60. {**
  61. * This is the version number macro for the current SDL version.
  62. *}
  63. function SDL_COMPILEDVERSION: Cardinal;
  64. {**
  65. * This macro will evaluate to true if compiled with SDL at least X.Y.Z.
  66. *}
  67. function SDL_VERSION_ATLEAST(X,Y,Z: cuint8): Boolean;
  68. {**
  69. * Get the version of SDL that is linked against your program.
  70. *
  71. * If you are linking to SDL dynamically, then it is possible that the
  72. * current version will be different than the version you compiled against.
  73. * This function returns the current version, while SDL_VERSION() is a
  74. * macro that tells you what version you compiled with.
  75. *
  76. *
  77. * compiled: TSDL_Version;
  78. * linked: TSDL_Version;
  79. *
  80. * SDL_VERSION(@compiled);
  81. * SDL_GetVersion(@linked);
  82. * WriteLn('We compiled against SDL version: ' +
  83. * IntToStr(compiled.major) +
  84. * IntToStr(compiled.minor) +
  85. * IntToStr(compiled.patch));
  86. * WriteLn('But we linked against SDL version:' +
  87. * IntToStr(compiled.major) +
  88. * IntToStr(compiled.minor) +
  89. * IntToStr(compiled.patch));
  90. *
  91. *
  92. * This function may be called safely at any time, even before SDL_Init().
  93. *
  94. * SDL_VERSION
  95. *}
  96. procedure SDL_GetVersion(ver: PSDL_Version); cdecl;
  97. external {$IFDEF DYNAMIC_LINK}SDL_LibName{$ENDIF} {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetVersion' {$ENDIF} {$ENDIF};
  98. {**
  99. * Get the code revision of SDL that is linked against your program.
  100. *
  101. * Returns an arbitrary string (a hash value) uniquely identifying the
  102. * exact revision of the SDL library in use, and is only useful in comparing
  103. * against other revisions. It is NOT an incrementing number.
  104. *}
  105. function SDL_GetRevision: PAnsiChar; cdecl;
  106. external {$IFDEF DYNAMIC_LINK}SDL_LibName{$ENDIF} {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetRevision' {$ENDIF} {$ENDIF};
  107. {**
  108. * Get the revision number of SDL that is linked against your program.
  109. *
  110. * Returns a number uniquely identifying the exact revision of the SDL
  111. * library in use. It is an incrementing number based on commits to
  112. * hg.libsdl.org.
  113. *}
  114. function SDL_GetRevisionNumber: cint; cdecl;
  115. external {$IFDEF DYNAMIC_LINK}SDL_LibName{$ENDIF} {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetRevisionNumber' {$ENDIF} {$ENDIF};