[Piglit] [PATCH 28/29] oes_draw_texture: Use dispatch to resolve extension functions

Pauli Nieminen pauli.nieminen at linux.intel.com
Mon May 21 11:09:03 PDT 2012


Signed-off-by: Pauli Nieminen <pauli.nieminen at linux.intel.com>
---
 tests/spec/oes_draw_texture/oes_draw_texture.c |   18 ++++++------------
 1 files changed, 6 insertions(+), 12 deletions(-)

diff --git a/tests/spec/oes_draw_texture/oes_draw_texture.c b/tests/spec/oes_draw_texture/oes_draw_texture.c
index 76ac382..ccc7c0a 100644
--- a/tests/spec/oes_draw_texture/oes_draw_texture.c
+++ b/tests/spec/oes_draw_texture/oes_draw_texture.c
@@ -41,8 +41,6 @@ static const float green[4] = { 0.0f, 1.0f, 0.0f, 0.25f };
 static const float blue[4] =  { 0.0f, 0.0f, 1.0f, 0.50f };
 static const float white[4] = { 1.0f, 1.0f, 1.0f, 1.0f };
 
-static PFNGLDRAWTEXIOESPROC piglit_glDrawTexiOES;
-
 /**
  * Test the basic use of glDrawTex
  */
@@ -59,7 +57,7 @@ test_basic(void)
 	glTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_CROP_RECT_OES, crop);
 
 	/* draw the RGBW texture */
-	piglit_glDrawTexiOES(0, 0, 0, piglit_width, piglit_height);
+	glDrawTexiOES(0, 0, 0, piglit_width, piglit_height);
 
 	pass = piglit_probe_pixel_rgb(x,     y,     red);
 	pass = piglit_probe_pixel_rgb(x + 5, y,     green) && pass;
@@ -88,7 +86,7 @@ test_negative_crop(void)
 	glTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_CROP_RECT_OES, crop);
 
 	/* draw the RGBW texture with negative crop */
-	piglit_glDrawTexiOES(0, 0, 0, piglit_width, piglit_height);
+	glDrawTexiOES(0, 0, 0, piglit_width, piglit_height);
 
 	pass = piglit_probe_pixel_rgb(x,     y,     white);
 	pass = piglit_probe_pixel_rgb(x + 5, y,     blue)  && pass;
@@ -119,7 +117,7 @@ test_right_top_crop(void)
 	glTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_CROP_RECT_OES, crop);
 
 	/* draw the right top quarter of RGBW texture */
-	piglit_glDrawTexiOES(0, 0, 0, piglit_width, piglit_height);
+	glDrawTexiOES(0, 0, 0, piglit_width, piglit_height);
 
 	pass = piglit_probe_pixel_rgb(x,     y,     white);
 	pass = piglit_probe_pixel_rgb(x + 5, y,     white) && pass;
@@ -150,7 +148,7 @@ test_right_top_win(void)
 	glTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_CROP_RECT_OES, crop);
 
 	/* draw the RGBW texture at the right top */
-	piglit_glDrawTexiOES(half_width, half_height, 0, half_width, half_height);
+	glDrawTexiOES(half_width, half_height, 0, half_width, half_height);
 
 	pass = piglit_probe_pixel_rgb(x,     y,     red);
 	pass = piglit_probe_pixel_rgb(x + 5, y,     green) && pass;
@@ -181,9 +179,9 @@ test_depth(void)
 	glEnable(GL_DEPTH_TEST);
 
 	/* draw at near plane */
-	piglit_glDrawTexiOES(0, 0, 0, piglit_width, piglit_height);
+	glDrawTexiOES(0, 0, 0, piglit_width, piglit_height);
 	/* draw at far plane: should be no-op */
-	piglit_glDrawTexiOES(0, 0, 1, piglit_width / 2, piglit_height / 2);
+	glDrawTexiOES(0, 0, 1, piglit_width / 2, piglit_height / 2);
 
 	glDisable(GL_DEPTH_TEST);
 
@@ -220,10 +218,6 @@ piglit_init(int argc, char **argv)
 	GLuint tex;
 
 	piglit_require_extension("GL_OES_draw_texture");
-	piglit_glDrawTexiOES = (PFNGLDRAWTEXIOESPROC)
-		eglGetProcAddress("glDrawTexiOES");
-	if (!piglit_glDrawTexiOES)
-		piglit_report_result(PIGLIT_FAIL);
 
 	piglit_ortho_projection(piglit_width, piglit_height, GL_FALSE);
 
-- 
1.7.5.4



More information about the Piglit mailing list