Wiki Page Content

Differences between revisions 1 and 2
Revision 1 as of 2010-04-20 18:29:14
Size: 1253
Editor: SheenaSmith
Comment: create page, add content (Wed Mar 10 ver)
Revision 2 as of 2010-05-08 20:58:39
Size: 1398
Editor: SheenaSmith
Comment: added question
Deletions are marked like this. Additions are marked like this.
Line 6: Line 6:
<<Color2(green,Should the word "Macro" be in the title above (ie: SDL_VERSION ''(Macro)'')so it is clear that this is not a true function?)>>

DRAFT

SDL_VERSION

green

Use this macro to determine the SDL version a/your program was compiled against.

Syntax

SDL_VERSION(x)

Function Parameters

x

a pointer to an SDL_version struct to initialize

Return Value

Fills the selected struct with:

  • (x)->major = SDL_MAJOR_VERSION

  • (x)->minor = SDL_MINOR_VERSION

  • (x)->patch = SDL_PATCHLEVEL

Code Examples

Include: Nothing found for "## End 1"!

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

Related Macros

Related Functions


CategoryAPI, CategoryVersion

You can add your code example here

Remarks

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.


CategoryAPI, CategoryVersion

None: SDL_VERSION (last edited 2014-03-30 21:06:13 by PhilippWiesemann)

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