2 SDL_image: An example image loading library for use with SDL
3 Copyright (C) 1997-2009 Sam Lantinga
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
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 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public
16 License along with this library; if not, write to the Free Software
17 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
23 /* This is a generic "format not supported" image framework */
27 #include "SDL_image.h"
31 /* See if an image is contained in a data source */
32 int IMG_isXXX(SDL_RWops *src)
39 start = SDL_RWtell(src);
42 /* Detect the image here */
44 SDL_RWseek(src, start, SEEK_SET);
48 /* Load a XXX type image from an SDL datasource */
49 SDL_Surface *IMG_LoadXXX_RW(SDL_RWops *src)
52 const char *error = NULL;
53 SDL_Surface *surface = NULL;
56 /* The error message has been set in SDL_RWFromFile */
59 start = SDL_RWtell(src);
61 /* Load the image here */
64 SDL_RWseek(src, start, SEEK_SET);
66 SDL_FreeSurface(surface);
76 /* See if an image is contained in a data source */
77 int IMG_isXXX(SDL_RWops *src)
82 /* Load a XXX type image from an SDL datasource */
83 SDL_Surface *IMG_LoadXXX_RW(SDL_RWops *src)