#include "SDL_stdinc.h"
#include "SDL_revision.h"
#include "begin_code.h"
#include "close_code.h"
Go to the source code of this file.
Data Structures | |
struct | SDL_version |
Information the version of SDL in use. More... | |
Defines | |
#define | SDL_MAJOR_VERSION 1 |
#define | SDL_MINOR_VERSION 3 |
#define | SDL_PATCHLEVEL 0 |
#define | SDL_VERSION(x) |
Macro to determine SDL version program was compiled against. | |
#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) (SDL_COMPILEDVERSION >= SDL_VERSIONNUM(X, Y, Z)) |
Functions | |
DECLSPEC void SDLCALL | SDL_GetVersion (SDL_version *ver) |
Get the version of SDL that is linked against your program. | |
DECLSPEC int SDLCALL | SDL_GetRevision (void) |
Get the code revision of SDL that is linked against your program. |
#define SDL_VERSION | ( | x | ) |
Value:
{ \ (x)->major = SDL_MAJOR_VERSION; \ (x)->minor = SDL_MINOR_VERSION; \ (x)->patch = SDL_PATCHLEVEL; \ }
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. |
void SDL_GetVersion | ( | SDL_version * | ver | ) |
Get the version of SDL that is linked against your program.
If you are using a shared library (DLL) version of SDL, then it is possible that it will be different than the version you compiled against.
This is a real function; the macro SDL_VERSION tells you what version of SDL you compiled against:
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 linked against SDL version %d.%d.%d.\n", linked.major, linked.minor, linked.patch);
This function may be called safely at any time, even before SDL_Init().