summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorraysan5 <[email protected]>2020-07-10 13:14:56 +0200
committerraysan5 <[email protected]>2020-07-10 13:14:56 +0200
commit57dc8a91dd5aa7fe68c8659343a7a59de5fd24d0 (patch)
tree9508fe0150ef7162c54a7658c0abdb25615c0c40 /src
parent86a8f1d5d57aea88f95618661c52207547700258 (diff)
downloadraylib-57dc8a91dd5aa7fe68c8659343a7a59de5fd24d0.tar.gz
raylib-57dc8a91dd5aa7fe68c8659343a7a59de5fd24d0.zip
Disable FBO support on OpenGL 2.1 #1290
Diffstat (limited to 'src')
-rw-r--r--src/rlgl.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/rlgl.h b/src/rlgl.h
index 002d2955..16461f2e 100644
--- a/src/rlgl.h
+++ b/src/rlgl.h
@@ -1379,7 +1379,7 @@ void rlTextureParameters(unsigned int id, int param, int value)
// Enable rendering to texture (fbo)
void rlEnableRenderTexture(unsigned int id)
{
-#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2)
+#if !defined(GRAPHICS_API_OPENGL_21) && (defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2))
glBindFramebuffer(GL_FRAMEBUFFER, id);
//glDisable(GL_CULL_FACE); // Allow double side drawing for texture flipping
@@ -1390,7 +1390,7 @@ void rlEnableRenderTexture(unsigned int id)
// Disable rendering to texture
void rlDisableRenderTexture(void)
{
-#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2)
+#if !defined(GRAPHICS_API_OPENGL_21) && (defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2))
glBindFramebuffer(GL_FRAMEBUFFER, 0);
//glEnable(GL_CULL_FACE);
@@ -1446,7 +1446,7 @@ void rlDeleteTextures(unsigned int id)
// Unload render texture from GPU memory
void rlDeleteRenderTextures(RenderTexture2D target)
{
-#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2)
+#if !defined(GRAPHICS_API_OPENGL_21) && (defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2))
if (target.texture.id > 0) glDeleteTextures(1, &target.texture.id);
if (target.depth.id > 0)
{
@@ -2224,7 +2224,7 @@ RenderTexture2D rlLoadRenderTexture(int width, int height, int format, int depth
{
RenderTexture2D target = { 0 };
-#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2)
+#if !defined(GRAPHICS_API_OPENGL_21) && (defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2))
if (useDepthTexture && RLGL.ExtSupported.texDepth) target.depthTexture = true;
// Create the framebuffer object
@@ -2277,7 +2277,7 @@ RenderTexture2D rlLoadRenderTexture(int width, int height, int format, int depth
// NOTE: Attach type: 0-Color, 1-Depth renderbuffer, 2-Depth texture
void rlRenderTextureAttach(RenderTexture2D target, unsigned int id, int attachType)
{
-#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2)
+#if !defined(GRAPHICS_API_OPENGL_21) && (defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2))
glBindFramebuffer(GL_FRAMEBUFFER, target.id);
if (attachType == 0) glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, id, 0);
@@ -2296,7 +2296,7 @@ bool rlRenderTextureComplete(RenderTexture target)
{
bool result = false;
-#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2)
+#if !defined(GRAPHICS_API_OPENGL_21) && (defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2))
glBindFramebuffer(GL_FRAMEBUFFER, target.id);
GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER);