<div dir="ltr">OK, but I would like to commit this conversion code instead of hacking the bits:<br><br>diff --git a/tests/util/piglit-framework-gl/piglit_glut_framework.c b/tests/util/piglit-framework-gl/piglit_glut_framework.c<br>
index ee5ac01..cfadf77 100644<br>--- a/tests/util/piglit-framework-gl/piglit_glut_framework.c<br>+++ b/tests/util/piglit-framework-gl/piglit_glut_framework.c<br>@@ -98,12 +98,27 @@ init_glut(void)<br> const struct piglit_gl_test_config *test_config = glut_fw.gl_fw.test_config;<br>
char *argv[] = {"piglit"};<br> int argc = 1;<br>+ unsigned flags = GLUT_RGB;<br>+<br>+ if (test_config->window_visual & PIGLIT_GL_VISUAL_RGBA)<br>+ flags |= GLUT_ALPHA;<br>
+ if (test_config->window_visual & PIGLIT_GL_VISUAL_DEPTH)<br>+ flags |= GLUT_DEPTH;<br>+ if (test_config->window_visual & PIGLIT_GL_VISUAL_STENCIL)<br>+ flags |= GLUT_STENCIL;<br>
+ if (test_config->window_visual & PIGLIT_GL_VISUAL_ACCUM)<br>+ flags |= GLUT_ACCUM;<br>+<br>+ if (test_config->window_visual & PIGLIT_GL_VISUAL_DOUBLE)<br>+ flags |= GLUT_DOUBLE;<br>
+ else<br>+ flags |= GLUT_SINGLE;<br> <br> glutInit(&argc, argv);<br> glutInitWindowPosition(0, 0);<br> glutInitWindowSize(test_config->window_width,<br> test_config->window_height);<br>
- glutInitDisplayMode(test_config->window_visual);<br>+ glutInitDisplayMode(flags);<br> glut_fw.window = glutCreateWindow("Piglit");<br> <br> glutDisplayFunc(display);<br><br><br>Marek<br>
<br><div class="gmail_extra"></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Apr 2, 2013 at 7:16 PM, Chad Versace <span dir="ltr"><<a href="mailto:chad.versace@linux.intel.com" target="_blank">chad.versace@linux.intel.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Tue, Mar 26, 2013 at 06:13:59PM +0100, Marek Olšák wrote:<br>
> Hi,<br>
><br>
> would anyone like to comment on this? Or is it still stuck in the<br>
> moderation queue?<br>
<br>
</div></div>The hunk below will break Piglit on Windows and Mac. Comments below.<br>
<br>
> diff --git a/tests/util/piglit-framework-gl.h b/tests/util/piglit-framework-gl.h<br>
> index bc3a3cd..f6ad839 100644<br>
> --- a/tests/util/piglit-framework-gl.h<br>
> +++ b/tests/util/piglit-framework-gl.h<br>
> @@ -34,25 +34,15 @@<br>
> * Each enum has the same value of its corresponding GLUT enum. That is, for<br>
> * each X, `PIGLIT_GL_VISUAL_X == GLUT_X`.<br>
> *<br>
> - * Note that PIGLIT_GL_VISUAL_RGBA is an alias for PIGLIT_GL_VISUAL_RGB and is<br>
> - * always selected. From the documentation of glutInitDisplayMode in<br>
> - * Kilgard's GLUT:<br>
> - *<br>
> - * Note that GLUT_RGBA selects the RGBA color model, but it does not<br>
> - * request any bits of alpha (sometimes called an alpha buffer or<br>
> - * destination alpha) be allocated. To request alpha, specify GLUT_ALPHA.<br>
> - *<br>
> * \see piglit_gl_test_config::window_visual<br>
> */<br>
> enum piglit_gl_visual {<br>
> - PIGLIT_GL_VISUAL_RGB = 0,<br>
> - PIGLIT_GL_VISUAL_RGBA = 0,<br>
> - PIGLIT_GL_VISUAL_SINGLE = 0,<br>
> - PIGLIT_GL_VISUAL_DOUBLE = 1 << 1,<br>
> - PIGLIT_GL_VISUAL_ACCUM = 1 << 2,<br>
> - PIGLIT_GL_VISUAL_ALPHA = 1 << 3,<br>
> + PIGLIT_GL_VISUAL_RGB = 1 << 0,<br>
> + PIGLIT_GL_VISUAL_RGBA = 1 << 1,<br>
> + PIGLIT_GL_VISUAL_DOUBLE = 1 << 2,<br>
> + PIGLIT_GL_VISUAL_ACCUM = 1 << 3,<br>
> PIGLIT_GL_VISUAL_DEPTH = 1 << 4,<br>
> - PIGLIT_GL_VISUAL_STENCIL = 1 << 5,<br>
> + PIGLIT_GL_VISUAL_STENCIL = 1 << 5<br>
> };<br>
> /**<br>
<br>
Currently, Waffle is used only on Linux. Mac and Windows still use GLUT. So,<br>
any change in the PIGLIT_GL_VISUAL values must be compatible with GLUT.<br>
<br>
I think the hunk below won't regress GLUT users, but I haven't tested it.<br>
<br>
diff --git a/tests/util/piglit-framework-gl.h b/tests/util/piglit-framework-gl.h<br>
enum piglit_gl_visual {<br>
PIGLIT_GL_VISUAL_RGB = 0,<br>
- PIGLIT_GL_VISUAL_RGBA = 0,<br>
- PIGLIT_GL_VISUAL_SINGLE = 0,<br>
PIGLIT_GL_VISUAL_DOUBLE = 1 << 1,<br>
PIGLIT_GL_VISUAL_ACCUM = 1 << 2,<br>
- PIGLIT_GL_VISUAL_ALPHA = 1 << 3,<br>
+ PIGLIT_GL_VISUAL_RGBA = 1 << 3,<br>
PIGLIT_GL_VISUAL_DEPTH = 1 << 4,<br>
PIGLIT_GL_VISUAL_STENCIL = 1 << 5,<br>
<br>
<br>
<br>
</blockquote></div><br></div>