Functionality to query the current SDL version, both as headers the app was compiled against, and a library the app is linked to.
More...
◆ SDL_MAJOR_VERSION
#define SDL_MAJOR_VERSION |
If this were SDL version 3.2.1, this value would be 3.
- Since
- This macro is available since SDL 3.2.0.
◆ SDL_MICRO_VERSION
#define SDL_MICRO_VERSION |
If this were SDL version 3.2.1, this value would be 1.
- Since
- This macro is available since SDL 3.2.0.
◆ SDL_MINOR_VERSION
#define SDL_MINOR_VERSION |
If this were SDL version 3.2.1, this value would be 2.
- Since
- This macro is available since SDL 3.2.0.
◆ SDL_VERSION
- Since
- This macro is available since SDL 3.2.0.
- See also
- GetVersion
◆ SDL_VERSION_ATLEAST
- Since
- This macro is available since SDL 3.2.0.
◆ SDL_VERSIONNUM
#define SDL_VERSIONNUM |
( |
|
major, |
|
|
|
minor, |
|
|
|
patch |
|
) |
| ((major) * 1000000 + (minor) * 1000 + (patch)) |
(1,2,3) becomes 1002003.
- Parameters
-
major | the major version number. |
minor | the minorversion number. |
patch | the patch version number. |
- Since
- This macro is available since SDL 3.2.0.
◆ SDL_VERSIONNUM_MAJOR
#define SDL_VERSIONNUM_MAJOR |
( |
|
version | ) |
((version) / 1000000) |
1002003 becomes 1.
- Parameters
-
version | the version number. |
- Since
- This macro is available since SDL 3.2.0.
◆ SDL_VERSIONNUM_MICRO
#define SDL_VERSIONNUM_MICRO |
( |
|
version | ) |
((version) % 1000) |
1002003 becomes 3.
- Parameters
-
version | the version number. |
- Since
- This macro is available since SDL 3.2.0.
◆ SDL_VERSIONNUM_MINOR
#define SDL_VERSIONNUM_MINOR |
( |
|
version | ) |
(((version) / 1000) % 1000) |
1002003 becomes 2.
- Parameters
-
version | the version number. |
- Since
- This macro is available since SDL 3.2.0.
◆ GetRevision()
const char * SDL::GetRevision |
( |
| ) |
|
|
inline |
This value is the revision of the code you are linked with and may be different from the code you are compiling with, which is found in the constant SDL_REVISION.
The revision is arbitrary string (a hash value) uniquely identifying the exact revision of the SDL library in use, and is only useful in comparing against other revisions. It is NOT an incrementing number.
If SDL wasn't built from a git repository with the appropriate tools, this will return an empty string.
You shouldn't use this function for anything but logging it for debugging purposes. The string is not intended to be reliable in any way.
- Returns
- an arbitrary string, uniquely identifying the exact revision of the SDL library in use.
- Since
- This function is available since SDL 3.2.0.
- See also
- GetVersion
◆ GetVersion()
If you are linking to SDL dynamically, then it is possible that the current version will be different than the version you compiled against. This function returns the current version, while SDL_VERSION is the version you compiled with.
This function may be called safely at any time, even before InitSubSystem().
- Returns
- the version of the linked library.
- Since
- This function is available since SDL 3.2.0.
- See also
- GetRevision