[iortcw] 08/95: All: Rend2: Don't bind null framebuffers when not using framebuffers

Simon McVittie smcv at debian.org
Fri Sep 8 10:41:44 UTC 2017


This is an automated email from the git hooks/post-receive script.

smcv pushed a commit to tag 1.51
in repository iortcw.

commit 07225dd6cf0c9ed3b80ceeaba5cf29ae7f77897b
Author: MAN-AT-ARMS <M4N4T4RMS at gmail.com>
Date:   Thu Dec 8 11:57:24 2016 -0500

    All: Rend2: Don't bind null framebuffers when not using framebuffers
---
 MP/code/rend2/tr_fbo.c  | 6 ++++++
 MP/code/rend2/tr_init.c | 4 +++-
 SP/code/rend2/tr_fbo.c  | 6 ++++++
 SP/code/rend2/tr_init.c | 4 +++-
 4 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/MP/code/rend2/tr_fbo.c b/MP/code/rend2/tr_fbo.c
index 41cfdd7..aa5148c 100644
--- a/MP/code/rend2/tr_fbo.c
+++ b/MP/code/rend2/tr_fbo.c
@@ -230,6 +230,12 @@ FBO_Bind
 */
 void FBO_Bind(FBO_t * fbo)
 {
+	if (!glRefConfig.framebufferObject)
+	{
+		ri.Printf(PRINT_WARNING, "FBO_Bind() called without framebuffers enabled!\n");
+		return;
+	}
+
 	if (glState.currentFBO == fbo)
 		return;
 		
diff --git a/MP/code/rend2/tr_init.c b/MP/code/rend2/tr_init.c
index ec0a200..3f2c4de 100644
--- a/MP/code/rend2/tr_init.c
+++ b/MP/code/rend2/tr_init.c
@@ -1021,7 +1021,9 @@ void GL_SetDefaultState( void ) {
 	qglColor4f( 1,1,1,1 );
 
 	GL_BindNullTextures();
-	GL_BindNullFramebuffers();
+
+	if (glRefConfig.framebufferObject)
+		GL_BindNullFramebuffers();
 
 	qglEnable( GL_TEXTURE_2D );
 	GL_TextureMode( r_textureMode->string );
diff --git a/SP/code/rend2/tr_fbo.c b/SP/code/rend2/tr_fbo.c
index 41cfdd7..aa5148c 100644
--- a/SP/code/rend2/tr_fbo.c
+++ b/SP/code/rend2/tr_fbo.c
@@ -230,6 +230,12 @@ FBO_Bind
 */
 void FBO_Bind(FBO_t * fbo)
 {
+	if (!glRefConfig.framebufferObject)
+	{
+		ri.Printf(PRINT_WARNING, "FBO_Bind() called without framebuffers enabled!\n");
+		return;
+	}
+
 	if (glState.currentFBO == fbo)
 		return;
 		
diff --git a/SP/code/rend2/tr_init.c b/SP/code/rend2/tr_init.c
index 115ee35..cd7e5bd 100644
--- a/SP/code/rend2/tr_init.c
+++ b/SP/code/rend2/tr_init.c
@@ -1025,7 +1025,9 @@ void GL_SetDefaultState( void ) {
 	qglColor4f( 1,1,1,1 );
 
 	GL_BindNullTextures();
-	GL_BindNullFramebuffers();
+
+	if (glRefConfig.framebufferObject)
+		GL_BindNullFramebuffers();
 
 	qglEnable( GL_TEXTURE_2D );
 	GL_TextureMode( r_textureMode->string );

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/iortcw.git



More information about the Pkg-games-commits mailing list