|
Size: 1398
Comment: added question
|
Size: 1430
Comment: update content
|
| 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?)>> | <<Color2(green,Should the word "Macro" be in the title above so it is clear that this is not a true function?)>> ie: SDL_VERSION (Macro) |
| Line 8: | Line 8: |
| Use this ''macro'' to determine ^the^ SDL version ^a/your^ program was compiled against. | Use this macro to determine ^the^ SDL version ^a/your^ program was compiled against. |
| Line 27: | Line 27: |
| <<Include(SDL_GetVersion, , , from="== Code Examples ==", to="## End 1")>> {{{#!highlight cpp You can add your code example here }}} |
<<Include(SDL_GetVersion, , , from="== Code Examples ==", to="== Remarks")>> |
| Line 34: | Line 30: |
| 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. | 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. |
| Line 38: | Line 34: |
== Related Macros == .[[SDL_COMPILEDVERSION]] .[[SDL_VERSION_ATLEAST]] .[[SDL_VERSIONNUM]] |
DRAFT |
SDL_VERSION
green
ie: SDL_VERSION (Macro)
Use this macro to determine the SDL version a/your program was compiled against.
Contents
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.
Related Structures
Related Macros
