summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorraysan5 <[email protected]>2020-09-18 20:47:39 +0200
committerraysan5 <[email protected]>2020-09-18 20:47:39 +0200
commitb5d50ee51afe7d30bbbcdd619534e9d4f432f4d3 (patch)
tree6dac6db6b04934c37b86ca84de893d53e83e1dff /src
parent79d63e6ca1a1fa3b9e5e8647c522157e616f023f (diff)
downloadraylib-b5d50ee51afe7d30bbbcdd619534e9d4f432f4d3.tar.gz
raylib-b5d50ee51afe7d30bbbcdd619534e9d4f432f4d3.zip
EXAMPLE: models_skybox works on OpenGL ES 2.0
Diffstat (limited to 'src')
-rw-r--r--src/rlgl.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/rlgl.h b/src/rlgl.h
index 60f68691..adf0900e 100644
--- a/src/rlgl.h
+++ b/src/rlgl.h
@@ -2065,20 +2065,20 @@ unsigned int rlLoadTexture(void *data, int width, int height, int format, int mi
unsigned int rlLoadTextureDepth(int width, int height, bool useRenderBuffer)
{
unsigned int id = 0;
-
+
#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2)
- if (!RLGL.ExtSupported.texDepth) useRenderBuffer = false;
+ // In case depth textures not supported, we force renderbuffer usage
+ if (!RLGL.ExtSupported.texDepth) useRenderBuffer = true;
// NOTE: We let the implementation to choose the best bit-depth
unsigned int glInternalFormat = GL_DEPTH_COMPONENT;
-/*
-#if defined(GRAPHICS_API_OPENGL_33)
- glInternalFormat = GL_DEPTH_COMPONENT24; // GL_DEPTH_COMPONENT32
-#elif defined(GRAPHICS_API_OPENGL_ES2)
+
+#if defined(GRAPHICS_API_OPENGL_ES2)
if (RLGL.ExtSupported.maxDepthBits == 32) glInternalFormat = GL_DEPTH_COMPONENT32_OES;
else if (RLGL.ExtSupported.maxDepthBits == 24) glInternalFormat = GL_DEPTH_COMPONENT24_OES;
+ else glInternalFormat = GL_DEPTH_COMPONENT16;
#endif
-*/
+
if (!useRenderBuffer && RLGL.ExtSupported.texDepth)
{
glGenTextures(1, &id);