Commit 5a4ae0e4 authored by Dave Airlie's avatar Dave Airlie
Browse files

fix window pos handling in two tests.



On a GL 1.3 system with ARB_window_pos these tests were either
not running or segfaulting.

the version handling in gti-formats was complete bogus.
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent dc160055
...@@ -78,7 +78,7 @@ test(void) ...@@ -78,7 +78,7 @@ test(void)
} }
/* glDrawPixels the image on left */ /* glDrawPixels the image on left */
glWindowPos2i(0, 0); glWindowPos2iARB(0, 0);
glDrawPixels(TEX_SIZE, TEX_SIZE, GL_RGBA, GL_UNSIGNED_BYTE, buf); glDrawPixels(TEX_SIZE, TEX_SIZE, GL_RGBA, GL_UNSIGNED_BYTE, buf);
glGenTextures(1, &tex); glGenTextures(1, &tex);
...@@ -141,5 +141,8 @@ piglit_display(void) ...@@ -141,5 +141,8 @@ piglit_display(void)
void void
piglit_init(int argc, char **argv) piglit_init(int argc, char **argv)
{ {
if ((piglit_get_gl_version() < 14) && !piglit_is_extension_supported("GL_ARB_window_pos")) {
printf("Requires GL 1.4 or GL_ARB_window_pos");
piglit_report_result(PIGLIT_SKIP);
}
} }
...@@ -83,7 +83,7 @@ static void ...@@ -83,7 +83,7 @@ static void
print(int x, int y, const char *s) print(int x, int y, const char *s)
{ {
glColor3f(1, 1, 1); glColor3f(1, 1, 1);
glWindowPos2i(x, y); glWindowPos2iARB(x, y);
while (*s) { while (*s) {
glutBitmapCharacter(GLUT_BITMAP_8_BY_13, (int) *s); glutBitmapCharacter(GLUT_BITMAP_8_BY_13, (int) *s);
s++; s++;
...@@ -382,7 +382,7 @@ test_format(const struct test_desc *test, ...@@ -382,7 +382,7 @@ test_format(const struct test_desc *test,
assert(!glIsEnabled(GL_TEXTURE_2D)); assert(!glIsEnabled(GL_TEXTURE_2D));
/* Draw the texture image */ /* Draw the texture image */
glWindowPos2i(x, y); glWindowPos2iARB(x, y);
glEnable(GL_BLEND); glEnable(GL_BLEND);
assert(!glIsEnabled(GL_TEXTURE_2D)); assert(!glIsEnabled(GL_TEXTURE_2D));
glDrawPixels(w, h, GL_RGBA, GL_FLOAT, readback); glDrawPixels(w, h, GL_RGBA, GL_FLOAT, readback);
...@@ -522,13 +522,11 @@ reshape(int width, int height) ...@@ -522,13 +522,11 @@ reshape(int width, int height)
void void
piglit_init(int argc, char **argv) piglit_init(int argc, char **argv)
{ {
const GLubyte *verStr = glGetString(GL_VERSION);
GLuint version = verStr[0] * 10 + verStr[2];
GLuint t; GLuint t;
if (version < 14) { if ((piglit_get_gl_version() < 14) && !piglit_is_extension_supported("GL_ARB_window_pos")) {
printf("Requires GL 1.4 or GL_ARB_window_pos");
piglit_report_result(PIGLIT_SKIP); piglit_report_result(PIGLIT_SKIP);
return;
} }
fbo_formats_init(argc, argv, 0); fbo_formats_init(argc, argv, 0);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment