summaryrefslogtreecommitdiffhomepage
path: root/src/rlgl.h
diff options
context:
space:
mode:
authorJoão Coelho <[email protected]>2019-10-29 14:57:19 +0000
committerRay <[email protected]>2019-10-29 15:57:19 +0100
commit75b0264f35d8895c1e64c7c7bc85d1572d167cf2 (patch)
treed02dd8ce1f168e60c5f7e9551b9dca1101fdf51b /src/rlgl.h
parent64c588e9d8e9cb34da4fe592ae091d62f59d6853 (diff)
downloadraylib-75b0264f35d8895c1e64c7c7bc85d1572d167cf2.tar.gz
raylib-75b0264f35d8895c1e64c7c7bc85d1572d167cf2.zip
fix various problems, thanks CppCheck :) (#1005)
* explained a bit more the core_window_letterbox example * fixed a few 'ups' moments that could lead to mild head pain and time loss
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