DEADSOFTWARE

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