Wiki Page Content

Differences between revisions 4 and 5
Revision 4 as of 2010-07-23 18:46:01
Size: 1608
Editor: SheenaSmith
Comment: update content
Revision 5 as of 2010-07-23 18:53:08
Size: 1608
Editor: SheenaSmith
Comment: minor change
Deletions are marked like this. Additions are marked like this.
Line 39: Line 39:
 .[[SDL_VERSIONNUM]]
Line 40: Line 41:
 .[[SDL_VERSIONNUM]]

DRAFT

SDL_VERSION

green

ie: SDL_VERSION (Macro)

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

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

This macro fills in an 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.

??? This macro gathers information from SDL_MAJOR_VERSION, SDL_MINOR_VERSION, AND SDL_PATCHLEVEL (#defines) and fills the structure SDL_version with that information. ???


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