aboutsummaryrefslogtreecommitdiff
path: root/src/rlgl.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/rlgl.h')
-rw-r--r--src/rlgl.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/rlgl.h b/src/rlgl.h
index b83da6e8..6eb215c0 100644
--- a/src/rlgl.h
+++ b/src/rlgl.h
@@ -1887,6 +1887,13 @@ unsigned int rlLoadTexture(void *data, int width, int height, int format, int mi
#endif
#endif // GRAPHICS_API_OPENGL_11
+ if( data == NULL ){
+ //ups!
+ TraceLog(LOG_WARNING, "Got asked to load texture from a NULL pointer!");
+
+ return id;
+ }
+
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
glGenTextures(1, &id); // Generate texture id