diff options
author | Harry Jeffery <harry@exec64.co.uk> | 2015-11-06 14:17:26 +0000 |
---|---|---|
committer | Harry Jeffery <harry@exec64.co.uk> | 2015-11-06 14:17:26 +0000 |
commit | 77dfcacf38b14ce4c5a8223b40343c2bcea54dde (patch) | |
tree | 99a8fa8ac5c2d2616ca0e263bccba58f63f8e581 /loader.c | |
parent | f4d54f4982f4f5e5dceb72e72a1980f1eb63e0b8 (diff) | |
download | imv-77dfcacf38b14ce4c5a8223b40343c2bcea54dde.tar.gz |
Load images using freeimage
Diffstat (limited to 'loader.c')
-rw-r--r-- | loader.c | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/loader.c b/loader.c deleted file mode 100644 index 9164074..0000000 --- a/loader.c +++ /dev/null @@ -1,30 +0,0 @@ -#include <SDL2/SDL.h> -#include <string.h> - -SDL_Texture* imv_load_png(SDL_Renderer *r, const char* path); -SDL_Texture* imv_load_jpeg(SDL_Renderer *r, const char* path); -SDL_Texture* imv_load_tiff(SDL_Renderer *r, const char* path); - -SDL_Texture* imv_load_image(SDL_Renderer *r, const char* path) -{ - if(!path) - return NULL; - - const char* ext = strrchr(path, '.'); - - if(!ext) - return NULL; - - if(strcasecmp(ext, ".png") == 0) { - return imv_load_png(r, path); - } else if(strcasecmp(ext, ".jpeg") == 0 || strcasecmp(ext, ".jpg") == 0) { - return imv_load_jpeg(r, path); - } else if(strcasecmp(ext, ".tif") == 0 || strcasecmp(ext, ".tiff") == 0) { - return imv_load_tiff(r, path); - } - - fprintf(stderr, - "Could not determine filetype of '%s' from its extension.\n", - path); - return NULL; -} |