home *** CD-ROM | disk | FTP | other *** search
/ Enter 2005 March / ENTER.ISO / files / fwp-0.0.6-win32-installer.exe / SDL_image.h < prev    next >
Encoding:
C/C++ Source or Header  |  2003-03-09  |  3.7 KB  |  94 lines

  1. /*
  2.     SDL_image:  An example image loading library for use with SDL
  3.     Copyright (C) 1999, 2000, 2001  Sam Lantinga
  4.  
  5.     This library is free software; you can redistribute it and/or
  6.     modify it under the terms of the GNU Library General Public
  7.     License as published by the Free Software Foundation; either
  8.     version 2 of the License, or (at your option) any later version.
  9.  
  10.     This library is distributed in the hope that it will be useful,
  11.     but WITHOUT ANY WARRANTY; without even the implied warranty of
  12.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  13.     Library General Public License for more details.
  14.  
  15.     You should have received a copy of the GNU Library General Public
  16.     License along with this library; if not, write to the Free
  17.     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  18.  
  19.     Sam Lantinga
  20.     slouken@libsdl.org
  21. */
  22.  
  23. /* $Id: SDL_image.h,v 1.13 2002/04/13 15:06:00 slouken Exp $ */
  24.  
  25. /* A simple library to load images of various formats as SDL surfaces */
  26.  
  27. #ifndef _IMG_h
  28. #define _IMG_h
  29.  
  30. #include "SDL.h"
  31. #include "begin_code.h"
  32.  
  33. /* Set up for C function definitions, even when using C++ */
  34. #ifdef __cplusplus
  35. extern "C" {
  36. #endif
  37.  
  38. /* Load an image from an SDL data source.
  39.    The 'type' may be one of: "BMP", "GIF", "PNG", etc.
  40.  
  41.    If the image format supports a transparent pixel, SDL will set the
  42.    colorkey for the surface.  You can enable RLE acceleration on the
  43.    surface afterwards by calling:
  44.     SDL_SetColorKey(image, SDL_RLEACCEL, image->format->colorkey);
  45.  */
  46. extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadTyped_RW(SDL_RWops *src, int freesrc, char *type);
  47. /* Convenience functions */
  48. extern DECLSPEC SDL_Surface * SDLCALL IMG_Load(const char *file);
  49. extern DECLSPEC SDL_Surface * SDLCALL IMG_Load_RW(SDL_RWops *src, int freesrc);
  50.  
  51. /* Invert the alpha of a surface for use with OpenGL
  52.    This function is now a no-op, and only provided for backwards compatibility.
  53. */
  54. extern DECLSPEC int SDLCALL IMG_InvertAlpha(int on);
  55.  
  56. /* Functions to detect a file type, given a seekable source */
  57. extern DECLSPEC int SDLCALL IMG_isBMP(SDL_RWops *src);
  58. extern DECLSPEC int SDLCALL IMG_isPNM(SDL_RWops *src);
  59. extern DECLSPEC int SDLCALL IMG_isXPM(SDL_RWops *src);
  60. extern DECLSPEC int SDLCALL IMG_isXCF(SDL_RWops *src);
  61. extern DECLSPEC int SDLCALL IMG_isPCX(SDL_RWops *src);
  62. extern DECLSPEC int SDLCALL IMG_isGIF(SDL_RWops *src);
  63. extern DECLSPEC int SDLCALL IMG_isJPG(SDL_RWops *src);
  64. extern DECLSPEC int SDLCALL IMG_isTIF(SDL_RWops *src);
  65. extern DECLSPEC int SDLCALL IMG_isPNG(SDL_RWops *src);
  66. extern DECLSPEC int SDLCALL IMG_isLBM(SDL_RWops *src);
  67.  
  68. /* Individual loading functions */
  69. extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadBMP_RW(SDL_RWops *src);
  70. extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadPNM_RW(SDL_RWops *src);
  71. extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadXPM_RW(SDL_RWops *src);
  72. extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadXCF_RW(SDL_RWops *src);
  73. extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadPCX_RW(SDL_RWops *src);
  74. extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadGIF_RW(SDL_RWops *src);
  75. extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadJPG_RW(SDL_RWops *src);
  76. extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadTIF_RW(SDL_RWops *src);
  77. extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadPNG_RW(SDL_RWops *src);
  78. extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadTGA_RW(SDL_RWops *src);
  79. extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadLBM_RW(SDL_RWops *src);
  80.  
  81. extern DECLSPEC SDL_Surface * SDLCALL IMG_ReadXPMFromArray(char **xpm);
  82.  
  83. /* We'll use SDL for reporting errors */
  84. #define IMG_SetError    SDL_SetError
  85. #define IMG_GetError    SDL_GetError
  86.  
  87. /* Ends C function definitions when using C++ */
  88. #ifdef __cplusplus
  89. }
  90. #endif
  91. #include "close_code.h"
  92.  
  93. #endif /* _IMG_h */
  94.