From: Brian Paul Date: Mon, 19 Jan 2009 23:12:17 +0000 (-0700) Subject: demos: updated FBO tests to for ARB_fbo X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=aed7403f32d71d6791678b356801c2b790c17686;p=mesa.git demos: updated FBO tests to for ARB_fbo Some things that were not errors in EXT_fbo are errors in ARB_fbo. --- diff --git a/progs/tests/fbotest1.c b/progs/tests/fbotest1.c index 8f4569ff3b4..ab2757c3c3d 100644 --- a/progs/tests/fbotest1.c +++ b/progs/tests/fbotest1.c @@ -122,6 +122,7 @@ Key( unsigned char key, int x, int y ) static void Init( void ) { + GLboolean ARB_fbo = glutExtensionSupported("GL_ARB_framebuffer_object"); GLint i; if (!glutExtensionSupported("GL_EXT_framebuffer_object")) { @@ -133,16 +134,20 @@ Init( void ) glGenFramebuffersEXT(1, &MyFB); assert(MyFB); assert(!glIsFramebufferEXT(MyFB)); - glDeleteFramebuffersEXT(1, &MyFB); - assert(!glIsFramebufferEXT(MyFB)); + if (!ARB_fbo) { + glDeleteFramebuffersEXT(1, &MyFB); + assert(!glIsFramebufferEXT(MyFB)); + } /* Note, continue to use MyFB below */ glGenRenderbuffersEXT(1, &MyRB); assert(MyRB); assert(!glIsRenderbufferEXT(MyRB)); - glDeleteRenderbuffersEXT(1, &MyRB); - assert(!glIsRenderbufferEXT(MyRB)); - MyRB = 42; /* an arbitrary ID */ + if (!ARB_fbo) { + glDeleteRenderbuffersEXT(1, &MyRB); + assert(!glIsRenderbufferEXT(MyRB)); + MyRB = 42; /* an arbitrary ID */ + } glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, MyFB); assert(glIsFramebufferEXT(MyFB)); diff --git a/progs/tests/fbotexture.c b/progs/tests/fbotexture.c index 88d0549c808..fa231abddb6 100644 --- a/progs/tests/fbotexture.c +++ b/progs/tests/fbotexture.c @@ -310,6 +310,7 @@ static void Init(int argc, char *argv[]) { static const GLfloat mat[4] = { 1.0, 0.5, 0.5, 1.0 }; + GLboolean ARB_fbo = glutExtensionSupported("GL_ARB_framebuffer_object"); GLint i; if (!glutExtensionSupported("GL_EXT_framebuffer_object")) { @@ -332,8 +333,10 @@ Init(int argc, char *argv[]) glGenFramebuffersEXT(1, &MyFB); assert(MyFB); assert(!glIsFramebufferEXT(MyFB)); - glDeleteFramebuffersEXT(1, &MyFB); - assert(!glIsFramebufferEXT(MyFB)); + if (!ARB_fbo) { + glDeleteFramebuffersEXT(1, &MyFB); + assert(!glIsFramebufferEXT(MyFB)); + } /* Note, continue to use MyFB below */ glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, MyFB);