module lib.sdl2._version

Code Map

module lib.sdl2._version;


enum SDL_MAJOR_VERSION;
enum SDL_MINOR_VERSION;
enum SDL_PATCHLEVEL;

struct SDL_version
{
public:
	//! major version *
	major: Uint8;
	//! minor version *
	minor: Uint8;
	//! update version *
	patch: Uint8;
}

//! \brief Get the version of SDL that is linked against your program.
fn SDL_GetVersion(ver: SDL_version*);
//! \brief Get the code revision of SDL that is linked against your
//! program.
fn SDL_GetRevision() char*;
//! \brief Get the revision number of SDL that is linked against your
//! program.
fn SDL_GetRevisionNumber() i32;
fn SDL_GetVersion(ver: SDL_version*)

\brief 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.

\code 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); \endcode

This function may be called safely at any time, even before SDL_Init().

\sa SDL_VERSION

fn SDL_GetRevision() char*

\brief Get the code revision of SDL that is linked against your program.

Returns an 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.

fn SDL_GetRevisionNumber() i32

\brief Get the revision number of SDL that is linked against your program.

Returns a number uniquely identifying the exact revision of the SDL library in use. It is an incrementing number based on commits to hg.libsdl.org.