demos: use glGenerateMipmapEXT entrypoint in cubemap.c
authorKeith Whitwell <keithw@vmware.com>
Thu, 12 Mar 2009 14:30:22 +0000 (14:30 +0000)
committerKeith Whitwell <keithw@vmware.com>
Thu, 12 Mar 2009 14:30:49 +0000 (14:30 +0000)
glGenerateMipmap() is part of ARB_framebuffer_object, which many mesa
drivers don't advertise.  Add check for EXT_framebuffer_object.

progs/demos/cubemap.c

index b85a1282c86ad45742740232381fc0084e37f5e4..41f99d0164de5797f19acabe1bdb3676058de6c4 100644 (file)
@@ -426,7 +426,7 @@ static void init_checkers( void )
                    GL_BGRA, GL_UNSIGNED_BYTE, image);
    }
 
-   glGenerateMipmap(GL_TEXTURE_CUBE_MAP_ARB);
+   glGenerateMipmapEXT(GL_TEXTURE_CUBE_MAP_ARB);
 }
 
 
@@ -502,6 +502,13 @@ static void init( GLboolean useImageFiles )
          printf("Sorry, this demo requires GL_ARB_texture_cube_map\n");
          exit(0);
       }
+
+      /* Needed for glGenerateMipmapEXT
+       */
+      if (!strstr(exten, "GL_EXT_framebuffer_object")) {
+         printf("Sorry, this demo requires GL_ARB_texture_cube_map\n");
+         exit(0);
+      }
    }
    printf("GL_RENDERER: %s\n", (char *) glGetString(GL_RENDERER));