summaryrefslogtreecommitdiff
path: root/tests/util/piglit-framework-gl/piglit_glut_framework.c
diff options
context:
space:
mode:
authorMarek Olšák <maraeo@gmail.com>2013-03-22 15:41:26 +0100
committerMarek Olšák <maraeo@gmail.com>2013-04-16 18:07:44 +0200
commitf6befdb5f9d736287784b894b259bd5dc3d07fc4 (patch)
tree1af5a51afc75ac09adc7651154b9ee82444125fe /tests/util/piglit-framework-gl/piglit_glut_framework.c
parent6a531205d131f2496468eea6a0582edb86906d1c (diff)
Rework the PIGLIT_GL_VISUAL flags, fix RGB vs RGBA vs ALPHA confusion
Changes: - SINGLE is removed, because its value was 0 - ALPHA is removed, because it becomes redundant with this change - RGB asks for an RGB visual - RGBA asks for an RGBA visual - if RGB and RGBA are unset, it asks for a visual without RGB(A) Reviewed-by: Brian Paul <brianp@vmware.com> Reviewed-by: Chris Forbes <chrisf@ijw.co.nz> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> v2: fix glut
Diffstat (limited to 'tests/util/piglit-framework-gl/piglit_glut_framework.c')
-rw-r--r--tests/util/piglit-framework-gl/piglit_glut_framework.c17
1 files changed, 16 insertions, 1 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);