*** empty log message ***
authorSam Lantinga <slouken@libsdl.org>
Wed, 23 Jul 2003 05:08:43 +0000
changeset 899a1b32277af8
parent 88 4b33899c0861
child 90 a77224354608
*** empty log message ***
IMG.c
SDL_image.h
     1.1 --- a/IMG.c	Sat May 03 20:15:25 2003 +0000
     1.2 +++ b/IMG.c	Wed Jul 23 05:08:43 2003 +0000
     1.3 @@ -52,6 +52,13 @@
     1.4  	{ "PNG", IMG_isPNG, IMG_LoadPNG_RW }
     1.5  };
     1.6  
     1.7 +const SDL_version *IMG_Linked_Version(void)
     1.8 +{
     1.9 +	static SDL_version linked_version;
    1.10 +	SDL_IMAGE_VERSION(&linked_version);
    1.11 +	return(&linked_version);
    1.12 +}
    1.13 +
    1.14  /* Load an image from a file */
    1.15  SDL_Surface *IMG_Load(const char *file)
    1.16  {
     2.1 --- a/SDL_image.h	Sat May 03 20:15:25 2003 +0000
     2.2 +++ b/SDL_image.h	Wed Jul 23 05:08:43 2003 +0000
     2.3 @@ -24,10 +24,11 @@
     2.4  
     2.5  /* A simple library to load images of various formats as SDL surfaces */
     2.6  
     2.7 -#ifndef _IMG_h
     2.8 -#define _IMG_h
     2.9 +#ifndef _SDL_image_h
    2.10 +#define _SDL_image_h
    2.11  
    2.12  #include "SDL.h"
    2.13 +#include "SDL_version.h"
    2.14  #include "begin_code.h"
    2.15  
    2.16  /* Set up for C function definitions, even when using C++ */
    2.17 @@ -35,6 +36,28 @@
    2.18  extern "C" {
    2.19  #endif
    2.20  
    2.21 +/* Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL
    2.22 +*/
    2.23 +#define SDL_IMAGE_MAJOR_VERSION	1
    2.24 +#define SDL_IMAGE_MINOR_VERSION	2
    2.25 +#define SDL_IMAGE_PATCHLEVEL	4
    2.26 +
    2.27 +/* This macro can be used to fill a version structure with the compile-time
    2.28 + * version of the SDL_image library.
    2.29 + */
    2.30 +#define SDL_IMAGE_VERSION(X)						\
    2.31 +{									\
    2.32 +	(X)->major = SDL_IMAGE_MAJOR_VERSION;				\
    2.33 +	(X)->minor = SDL_IMAGE_MINOR_VERSION;				\
    2.34 +	(X)->patch = SDL_IMAGE_PATCHLEVEL;				\
    2.35 +}
    2.36 +
    2.37 +/* This function gets the version of the dynamically linked SDL_image library.
    2.38 +   it should NOT be used to fill a version structure, instead you should
    2.39 +   use the SDL_IMAGE_VERSION() macro.
    2.40 + */
    2.41 +extern DECLSPEC const SDL_version * SDLCALL IMG_Linked_Version(void);
    2.42 +
    2.43  /* Load an image from an SDL data source.
    2.44     The 'type' may be one of: "BMP", "GIF", "PNG", etc.
    2.45  
    2.46 @@ -90,4 +113,4 @@
    2.47  #endif
    2.48  #include "close_code.h"
    2.49  
    2.50 -#endif /* _IMG_h */
    2.51 +#endif /* _SDL_image_h */