SDL 2.0
|
Go to the source code of this file.
Data Structures | |
struct | SDL_version |
Macros | |
#define | SDL_MAJOR_VERSION 2 |
#define | SDL_MINOR_VERSION 32 |
#define | SDL_PATCHLEVEL 0 |
#define | SDL_VERSION(x) |
#define | SDL_VERSIONNUM(X, Y, Z) ((X)*1000 + (Y)*100 + (Z)) |
#define | SDL_COMPILEDVERSION SDL_VERSIONNUM(SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL) |
#define | SDL_VERSION_ATLEAST(X, Y, Z) |
Functions | |
void | SDL_GetVersion (SDL_version *ver) |
const char * | SDL_GetRevision (void) |
SDL_DEPRECATED int | SDL_GetRevisionNumber (void) |
#define SDL_COMPILEDVERSION SDL_VERSIONNUM(SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL) |
This is the version number macro for the current SDL version.
In versions higher than 2.9.0, the minor version overflows into the thousands digit: for example, 2.23.0 is encoded as 4300. This macro will not be available in SDL 3.x.
Deprecated, use SDL_VERSION_ATLEAST or SDL_VERSION instead.
Definition at line 114 of file SDL_version.h.
#define SDL_MAJOR_VERSION 2 |
Definition at line 59 of file SDL_version.h.
#define SDL_MINOR_VERSION 32 |
Definition at line 60 of file SDL_version.h.
#define SDL_PATCHLEVEL 0 |
Definition at line 61 of file SDL_version.h.
#define SDL_VERSION | ( | x | ) |
Macro to determine SDL version program was compiled against.
This macro fills in a SDL_version structure with the version of the library you compiled against. This is determined by what header the compiler uses. Note that if you dynamically linked the library, you might have a slightly newer or older version at runtime. That version can be determined with SDL_GetVersion(), which, unlike SDL_VERSION(), is not a macro.
x | A pointer to a SDL_version struct to initialize. |
Definition at line 77 of file SDL_version.h.
#define SDL_VERSION_ATLEAST | ( | X, | |
Y, | |||
Z | |||
) |
This macro will evaluate to true if compiled with SDL at least X.Y.Z.
Definition at line 121 of file SDL_version.h.
#define SDL_VERSIONNUM | ( | X, | |
Y, | |||
Z | |||
) | ((X)*1000 + (Y)*100 + (Z)) |
This macro turns the version numbers into a numeric value:
This assumes that there will never be more than 100 patchlevels.
In versions higher than 2.9.0, the minor version overflows into the thousands digit: for example, 2.23.0 is encoded as 4300, and 2.255.99 would be encoded as 25799.
This macro will not be available in SDL 3.x.
Definition at line 102 of file SDL_version.h.
|
extern |
Get the code revision of SDL that is linked against your program.
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.
Prior to SDL 2.0.16, before development moved to GitHub, this returned a hash for a Mercurial repository.
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.
|
extern |
Obsolete function, do not use.
When SDL was hosted in a Mercurial repository, and was built carefully, this would return the revision number that the build was created from. This number was not reliable for several reasons, but more importantly, SDL is now hosted in a git repository, which does not offer numbers at all, only hashes. This function only ever returns zero now. Don't use it.
Before SDL 2.0.16, this might have returned an unreliable, but non-zero number.
|
extern |
Get the version of SDL that is linked against your program.
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 a macro that tells you what version you compiled with.
This function may be called safely at any time, even before SDL_Init().
ver | the SDL_version structure that contains the version information. |