Skip to content

Commit

Permalink
Fixed bug 1432 - SDL 1.2 compatibility for SDL_image HG
Browse files Browse the repository at this point in the history
pelya

Just few #ifdefs around functions that use SDL_Texture
  • Loading branch information
slouken committed Jun 3, 2013
1 parent 67f4209 commit 2956cd8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions IMG.c
Expand Up @@ -203,6 +203,7 @@ SDL_Surface *IMG_LoadTyped_RW(SDL_RWops *src, int freesrc, const char *type)
return NULL;
}

#if SDL_VERSION_ATLEAST(2,0,0)
SDL_Texture *IMG_LoadTexture(SDL_Renderer *renderer, const char *file)
{
SDL_Texture *texture = NULL;
Expand Down Expand Up @@ -235,6 +236,7 @@ SDL_Texture *IMG_LoadTextureTyped_RW(SDL_Renderer *renderer, SDL_RWops *src, int
}
return texture;
}
#endif /* SDL 2.0 */

/* Invert the alpha of a surface for use with OpenGL
This function is a no-op and only kept for backwards compatibility.
Expand Down
2 changes: 2 additions & 0 deletions SDL_image.h
Expand Up @@ -85,11 +85,13 @@ extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadTyped_RW(SDL_RWops *src, int frees
extern DECLSPEC SDL_Surface * SDLCALL IMG_Load(const char *file);
extern DECLSPEC SDL_Surface * SDLCALL IMG_Load_RW(SDL_RWops *src, int freesrc);

#if SDL_VERSION_ATLEAST(2,0,0)
/* Load an image directly into a render texture.
*/
extern DECLSPEC SDL_Texture * SDLCALL IMG_LoadTexture(SDL_Renderer *renderer, const char *file);
extern DECLSPEC SDL_Texture * SDLCALL IMG_LoadTexture_RW(SDL_Renderer *renderer, SDL_RWops *src, int freesrc);
extern DECLSPEC SDL_Texture * SDLCALL IMG_LoadTextureTyped_RW(SDL_Renderer *renderer, SDL_RWops *src, int freesrc, const char *type);
#endif /* SDL 2.0 */

/* Invert the alpha of a surface for use with OpenGL
This function is now a no-op, and only provided for backwards compatibility.
Expand Down

0 comments on commit 2956cd8

Please sign in to comment.