aldacron
Joined: 05 May 2004 Posts: 1322 Location: Seoul, South Korea
|
Posted: Thu May 18, 2006 8:52 am Post subject: SDL Library Versions |
|
|
Each SDL library has version information included into the header. This information is translated into the Derelict modules as constant values: a major version number, a minor version number, and a patchlevel. This information can be accessed directly in each library, or you can use it to fill out a SDL_version struct with a translated macro.
What is important to remember when using these version numbers is that, in Derelict terms, they represent the minimum supported version of the interface for that particular library. It is not uncommon for SDL versions to change yet have the same interface as the previous version. For example, the following constants are defined in derelict.sdl.image:
Code: |
const Uint8 SDL_IMAGE_MAJOR_VERSION = 1;
const Uint8 SDL_IMAGE_MINOR_VERSION = 2;
const Uint8 SDL_IMAGE_PATCHLEVEL = 3;
|
The currently released version of SDL_image is 1.2.5. This means that DerelictSDLImage currently supports version 1.2.3 and higher. This will continue to be true until a later version of SDL_image breaks the current interface by adding or removing features. You can use the following function to retrieve this information:
Code: |
void SDL_IMAGE_VERSION(SDL_version* X);
|
Sometimes, it may be neccessary to determine which version of an SDL library is actually loaded. You can do so with the *_Linked_Version function in each library. Using SDL_Image again as an example:
Code: |
SDL_version* IMG_Linked_Version();
|
It is very possible, even likely, that the version returned by *_Linked_Version may not match the version defined in the Derelict module. As long as the library loaded with no exceptions, then this is no problem. Remember, each DerelictSDL* library contains the same verision interface, using a naming convention specific to that library. Study the source if you aren't sure. |
|