SDL_VERSION macro

SDL_VERSION -- fills a version structure with the compile-time version of the SDL library.

Syntax

SDL_VERSION(SDL_version* pointer);

Description

The SDL_VERSION macro is a helper macro that fills out a SDL_version structure with the compile-time SDL version.

Note : The version information comes from the defines SDL_MAJOR_VERSION, SDL_MINOR_VERSION and SDL_PATCHLEVEL macros, so it's often simpler to use these directly.

Parameter

pointer [in]

Return value

nothing

Example

   1 void print_SDL_version(char* preamble, SDL_version* v) {
   2    printf("%s %u.%u.%u\n", preamble, v->major, v->minor, v->patch);
   3 }
   4 
   5 void print_SDL_versions() {
   6     SDL_version ver;
   7 
   8     // Prints the compile time version
   9     SDL_VERSION(&ver);
  10     print_SDL_version("SDL compile-time version", &ver);
  11 
  12     // Prints the run-time version
  13     ver = *SDL_Linked_Version();
  14     print_SDL_version("SDL runtime version", &ver);
  15 }

See also

SDL_version, SDL_Linked_Version

Requirements

Header

SDL.h

Version

1.2.13

Shared object

libSDL.so

DLL

SDL.dll


CategorySDLGeneral

SDL_VERSION (last edited 2009-04-28 15:42:59 by NeoNeurone)