summaryrefslogtreecommitdiffstats
path: root/sdl/gltools.c
diff options
context:
space:
mode:
Diffstat (limited to 'sdl/gltools.c')
-rw-r--r--sdl/gltools.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sdl/gltools.c b/sdl/gltools.c
index 2449cfc..7fc92f7 100644
--- a/sdl/gltools.c
+++ b/sdl/gltools.c
@@ -30,7 +30,10 @@ GLuint gltLoadTGATexture(const char *fname)
pBytes = gltLoadTGA(fname, &iWidth, &iHeight, &iComponents, &eFormat);
if (!pBytes)
+ {
fprintf(stderr, "gltLoadTGA: failed to load texture!\n");
+ return -1;
+ }
glTexImage2D(GL_TEXTURE_2D, 0, iComponents, iWidth, iHeight, 0, eFormat,
GL_UNSIGNED_BYTE, pBytes);