diff options
Diffstat (limited to 'tests/util/piglit-framework-gl')
-rw-r--r-- | tests/util/piglit-framework-gl/piglit_glut_framework.c | 17 | ||||
-rw-r--r-- | tests/util/piglit-framework-gl/piglit_winsys_framework.c | 20 |
2 files changed, 28 insertions, 9 deletions
diff --git a/tests/util/piglit-framework-gl/piglit_glut_framework.c b/tests/util/piglit-framework-gl/piglit_glut_framework.c index ee5ac014b..cfadf770e 100644 --- a/tests/util/piglit-framework-gl/piglit_glut_framework.c +++ b/tests/util/piglit-framework-gl/piglit_glut_framework.c @@ -98,12 +98,27 @@ init_glut(void) const struct piglit_gl_test_config *test_config = glut_fw.gl_fw.test_config; char *argv[] = {"piglit"}; int argc = 1; + unsigned flags = GLUT_RGB; + + if (test_config->window_visual & PIGLIT_GL_VISUAL_RGBA) + flags |= GLUT_ALPHA; + if (test_config->window_visual & PIGLIT_GL_VISUAL_DEPTH) + flags |= GLUT_DEPTH; + if (test_config->window_visual & PIGLIT_GL_VISUAL_STENCIL) + flags |= GLUT_STENCIL; + if (test_config->window_visual & PIGLIT_GL_VISUAL_ACCUM) + flags |= GLUT_ACCUM; + + if (test_config->window_visual & PIGLIT_GL_VISUAL_DOUBLE) + flags |= GLUT_DOUBLE; + else + flags |= GLUT_SINGLE; glutInit(&argc, argv); glutInitWindowPosition(0, 0); glutInitWindowSize(test_config->window_width, test_config->window_height); - glutInitDisplayMode(test_config->window_visual); + glutInitDisplayMode(flags); glut_fw.window = glutCreateWindow("Piglit"); glutDisplayFunc(display); diff --git a/tests/util/piglit-framework-gl/piglit_winsys_framework.c b/tests/util/piglit-framework-gl/piglit_winsys_framework.c index 2564f81be..df74542c2 100644 --- a/tests/util/piglit-framework-gl/piglit_winsys_framework.c +++ b/tests/util/piglit-framework-gl/piglit_winsys_framework.c @@ -92,14 +92,18 @@ choose_config_attribs(const struct piglit_gl_test_config *test_config) static int32_t attrib_list[64]; int i = 0; - attrib_list[i++] = WAFFLE_RED_SIZE; - attrib_list[i++] = 1; - attrib_list[i++] = WAFFLE_GREEN_SIZE; - attrib_list[i++] = 1; - attrib_list[i++] = WAFFLE_BLUE_SIZE; - attrib_list[i++] = 1; - - if (test_config->window_visual & PIGLIT_GL_VISUAL_ALPHA) { + + if (test_config->window_visual & + (PIGLIT_GL_VISUAL_RGB | PIGLIT_GL_VISUAL_RGBA)) { + attrib_list[i++] = WAFFLE_RED_SIZE; + attrib_list[i++] = 1; + attrib_list[i++] = WAFFLE_GREEN_SIZE; + attrib_list[i++] = 1; + attrib_list[i++] = WAFFLE_BLUE_SIZE; + attrib_list[i++] = 1; + } + + if (test_config->window_visual & PIGLIT_GL_VISUAL_RGBA) { attrib_list[i++] = WAFFLE_ALPHA_SIZE; attrib_list[i++] = 1; } |