demos: updated FBO tests to for ARB_fbo
authorBrian Paul <brianp@vmware.com>
Mon, 19 Jan 2009 23:12:17 +0000 (16:12 -0700)
committerBrian Paul <brianp@vmware.com>
Thu, 22 Jan 2009 22:22:54 +0000 (15:22 -0700)
Some things that were not errors in EXT_fbo are errors in ARB_fbo.

progs/tests/fbotest1.c
progs/tests/fbotexture.c

index 8f4569ff3b4f466cb4b3d71e36fd1de438bfccb6..ab2757c3c3d7ced2fd796c7b54573a5c0d477950 100644 (file)
@@ -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));
index 88d0549c8081721cc90886efcee7f08ddca124d2..fa231abddb63f79ed60a799ef967c65577dee5a5 100644 (file)
@@ -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);