[Piglit] [PATCH 2/4] fbo-drawbuffers: Port to new FBO wrapper functions
Ian Romanick
idr at freedesktop.org
Mon Oct 3 11:40:22 PDT 2011
From: Ian Romanick <ian.d.romanick at intel.com>
Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
---
tests/fbo/fbo-drawbuffers.c | 31 +++++++++++++++----------------
1 files changed, 15 insertions(+), 16 deletions(-)
diff --git a/tests/fbo/fbo-drawbuffers.c b/tests/fbo/fbo-drawbuffers.c
index 61127e0..a67c2f8 100644
--- a/tests/fbo/fbo-drawbuffers.c
+++ b/tests/fbo/fbo-drawbuffers.c
@@ -32,6 +32,7 @@
*/
#include "piglit-util.h"
+#include "piglit-fbo.h"
int piglit_width = 128;
int piglit_height = 128;
@@ -51,11 +52,11 @@ attach_texture(int i)
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
- glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT,
- GL_COLOR_ATTACHMENT0_EXT + i,
- GL_TEXTURE_2D,
- tex,
- 0);
+ piglit_FramebufferTexture2D(GL_FRAMEBUFFER,
+ GL_COLOR_ATTACHMENT0 + i,
+ GL_TEXTURE_2D,
+ tex,
+ 0);
assert(glGetError() == 0);
return tex;
@@ -69,22 +70,20 @@ piglit_display(void)
GLenum status;
float green[] = {0, 1, 0, 0};
const GLenum attachments[] = {
- GL_COLOR_ATTACHMENT0_EXT,
- GL_COLOR_ATTACHMENT1_EXT,
+ GL_COLOR_ATTACHMENT0,
+ GL_COLOR_ATTACHMENT1,
};
- piglit_ortho_projection(piglit_width, piglit_height, GL_FALSE);
-
- glGenFramebuffersEXT(1, &fb);
- glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fb);
+ piglit_GenFramebuffers(1, &fb);
+ piglit_BindFramebuffer(GL_FRAMEBUFFER, fb);
tex0 = attach_texture(0);
tex1 = attach_texture(1);
glDrawBuffersARB(2, attachments);
- status = glCheckFramebufferStatusEXT (GL_FRAMEBUFFER_EXT);
- if (status != GL_FRAMEBUFFER_COMPLETE_EXT) {
+ status = piglit_CheckFramebufferStatus(GL_FRAMEBUFFER);
+ if (status != GL_FRAMEBUFFER_COMPLETE) {
fprintf(stderr, "fbo incomplete (status = 0x%04x)\n", status);
piglit_report_result(PIGLIT_SKIP);
}
@@ -96,7 +95,7 @@ piglit_display(void)
glColor4fv(green);
piglit_draw_rect(0, 0, piglit_width, piglit_height);
- glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
+ piglit_BindFramebuffer(GL_FRAMEBUFFER, 0);
/* Draw the two green textures to halves of the window. */
glEnable(GL_TEXTURE_2D);
@@ -112,7 +111,7 @@ piglit_display(void)
glDisable(GL_TEXTURE_2D);
glDeleteTextures(1, &tex0);
glDeleteTextures(1, &tex1);
- glDeleteFramebuffersEXT(1, &fb);
+ piglit_DeleteFramebuffers(1, &fb);
pass = pass && piglit_probe_rect_rgb(0, 0, piglit_width, piglit_height,
green);
@@ -129,7 +128,7 @@ piglit_init(int argc, char **argv)
piglit_ortho_projection(piglit_width, piglit_height, GL_FALSE);
- piglit_require_extension("GL_EXT_framebuffer_object");
+ piglit_require_fbo();
piglit_require_extension("GL_ARB_draw_buffers");
glGetIntegerv(GL_MAX_DRAW_BUFFERS_ARB, &num);
--
1.7.6
More information about the Piglit
mailing list