From 02b67083e2e644c7486c161f430b21c7a4bf869d Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Wed, 23 Jul 2003 05:08:43 +0000 Subject: [PATCH] *** empty log message *** --- IMG.c | 7 +++++++ SDL_image.h | 29 ++++++++++++++++++++++++++--- 2 files changed, 33 insertions(+), 3 deletions(-) diff --git a/IMG.c b/IMG.c index 86c9403d..ec568439 100644 --- a/IMG.c +++ b/IMG.c @@ -52,6 +52,13 @@ static struct { { "PNG", IMG_isPNG, IMG_LoadPNG_RW } }; +const SDL_version *IMG_Linked_Version(void) +{ + static SDL_version linked_version; + SDL_IMAGE_VERSION(&linked_version); + return(&linked_version); +} + /* Load an image from a file */ SDL_Surface *IMG_Load(const char *file) { diff --git a/SDL_image.h b/SDL_image.h index 17efb362..89c1746e 100644 --- a/SDL_image.h +++ b/SDL_image.h @@ -24,10 +24,11 @@ /* A simple library to load images of various formats as SDL surfaces */ -#ifndef _IMG_h -#define _IMG_h +#ifndef _SDL_image_h +#define _SDL_image_h #include "SDL.h" +#include "SDL_version.h" #include "begin_code.h" /* Set up for C function definitions, even when using C++ */ @@ -35,6 +36,28 @@ extern "C" { #endif +/* Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL +*/ +#define SDL_IMAGE_MAJOR_VERSION 1 +#define SDL_IMAGE_MINOR_VERSION 2 +#define SDL_IMAGE_PATCHLEVEL 4 + +/* This macro can be used to fill a version structure with the compile-time + * version of the SDL_image library. + */ +#define SDL_IMAGE_VERSION(X) \ +{ \ + (X)->major = SDL_IMAGE_MAJOR_VERSION; \ + (X)->minor = SDL_IMAGE_MINOR_VERSION; \ + (X)->patch = SDL_IMAGE_PATCHLEVEL; \ +} + +/* This function gets the version of the dynamically linked SDL_image library. + it should NOT be used to fill a version structure, instead you should + use the SDL_IMAGE_VERSION() macro. + */ +extern DECLSPEC const SDL_version * SDLCALL IMG_Linked_Version(void); + /* Load an image from an SDL data source. The 'type' may be one of: "BMP", "GIF", "PNG", etc. @@ -90,4 +113,4 @@ extern DECLSPEC SDL_Surface * SDLCALL IMG_ReadXPMFromArray(char **xpm); #endif #include "close_code.h" -#endif /* _IMG_h */ +#endif /* _SDL_image_h */