Wiki Page Content

Differences between revisions 11 and 12
Revision 11 as of 2010-07-21 05:23:01
Size: 1243
Editor: SheenaSmith
Comment: add RF; remove 'draft' note
Revision 12 as of 2010-09-09 22:06:13
Size: 1267
Editor: SheenaSmith
Comment: update formatting - Relateds
Deletions are marked like this. Additions are marked like this.
Line 35: Line 35:
== Related Macros ==
 .[[SDL_VERSION]]
Line 37: Line 40:
 .[[SDL_VERSION]]

SDL_GetVersion

Use this function to get the version of SDL that is linked against your program.

Syntax

void SDL_GetVersion(SDL_version* ver)

Function Parameters

ver

a pointer to the SDL_version structure that contains the version information

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

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().


CategoryAPI, CategoryVersion

None: SDL_GetVersion (last edited 2010-10-18 22:02:11 by SheenaSmith)

(Page Info.)
Feedback
Please include your contact information if you'd like to receive a reply.
Submit