summaryrefslogtreecommitdiffhomepage
path: root/src/rlgl.h
diff options
context:
space:
mode:
authorRay <[email protected]>2019-04-11 16:11:54 +0200
committerRay <[email protected]>2019-04-11 16:11:54 +0200
commit01367fcb1e1c9e00a74cbbe146d415fd64110d30 (patch)
tree69c014ae46ab1a1b3a39358a69482cc2fec4ddf9 /src/rlgl.h
parenta28dfd4a7b479b0ad8248fe0e25c5e8ce3d9d3cf (diff)
downloadraylib-01367fcb1e1c9e00a74cbbe146d415fd64110d30.tar.gz
raylib-01367fcb1e1c9e00a74cbbe146d415fd64110d30.zip
Review cubemap generation
Diffstat (limited to 'src/rlgl.h')
-rw-r--r--src/rlgl.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/rlgl.h b/src/rlgl.h
index a4a481f2..048c75da 100644
--- a/src/rlgl.h
+++ b/src/rlgl.h
@@ -2027,10 +2027,10 @@ unsigned int rlLoadTextureCubemap(void *data, int size, int format)
unsigned int glInternalFormat, glFormat, glType;
rlGetGlTextureFormats(format, &glInternalFormat, &glFormat, &glType);
- // Load cubemap faces
- for (unsigned int i = 0; i < 6; i++)
+ if (glInternalFormat != -1)
{
- if (glInternalFormat != -1)
+ // Load cubemap faces
+ for (unsigned int i = 0; i < 6; i++)
{
if (format < COMPRESSED_DXT1_RGB) glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, glInternalFormat, size, size, 0, glFormat, glType, (unsigned char *)data + i*dataSize);
#if !defined(GRAPHICS_API_OPENGL_11)