|
Size: 1774
Comment: add link to major macro
|
Size: 1691
Comment: update content (incomplete)
|
| Deletions are marked like this. | Additions are marked like this. |
| Line 17: | Line 17: |
| <<Include(SDL_GetVersion, , , from="== Code Examples ==", to="## End 1")>> | <<Include(SDL_GetVersion, , , from="== Code Examples ==", to="== Remarks")>> |
| Line 19: | Line 19: |
| {{{#!highlight cpp You can add your code example here }}} |
|
| Line 34: | Line 31: |
| == Related Minor Macros == '''SDL_VERSIONNUM'''<<BR>> |
== Related Macros == .[[SDL_VERSIONNUM]] |
| Line 45: | Line 42: |
| '''SDL_COMPILEDVERSION'''<<BR>> | .[[SDL_COMPILEDVERSION]] |
| Line 53: | Line 50: |
| '''SDL_VERSION_ATLEAST'''<<BR>> | .[[SDL_VERSION_ATLEAST]] |
DRAFT |
SDL_version
A structure that contains information about the version of SDL in use.
Data Fields
Uint8 |
major |
major version |
Uint8 |
minor |
minor version |
Uint8 |
patch |
update version |
Code Examples
SDL_version compiled;
SDL_version linked;
SDL_VERSION(&compiled);
SDL_GetVersion(&linked);
printf("We compiled against SDL version %d.%d.%d ...\n",
compiled.major, compiled.minor, compiled.patch);
printf("But we are linking against SDL version %d.%d.%d.\n",
linked.major, linked.minor, linked.patch);
Remarks
Represents the library's version as three levels:
- major revision (increments with massive changes, additions, and enhancements)
- minor revision (increments with backwards-compatible changes to the major revision), and
- patchlevel (increments with fixes to the minor revision)
The macro SDL_VERSION can be used to populate this structure with information.
Related Functions
Related Macros
This macro turns the version numbers into a numeric value:
(1,2,3) -> (1203)
SDL_VERSIONNUM(X, Y, Z)
((X)*1000 + (Y)*100 + (Z))
- This assumes that there will never be more than 100 patchlevels.
This is the version number macro for the current SDL version.
SDL_COMPILEDVERSION \
SDL_VERSIONNUM(SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL)
This macro will evaluate to true if compiled with SDL at least X.Y.Z.
SDL_VERSION_ATLEAST(X, Y, Z) \
(SDL_COMPILEDVERSION >= SDL_VERSIONNUM(X, Y, Z))
