[Piglit] [PATCH 11/14] glut_waffle: Add libglut_waffle

Eric Anholt eric at anholt.net
Tue May 22 17:46:35 PDT 2012


On Mon, 21 May 2012 23:15:19 -0700, Chad Versace <chad.versace at linux.intel.com> wrote:
> +void
> +glutInitAPIMask(int mask)
> +{
> +	switch (mask) {
> +		case GLUT_OPENGL_BIT:
> +			_glut->waffle_context_api = WAFFLE_CONTEXT_OPENGL;
> +			break;
> +		case GLUT_OPENGL_ES1_BIT:
> +			_glut->waffle_context_api = WAFFLE_CONTEXT_OPENGL_ES1;
> +			break;
> +		case GLUT_OPENGL_ES2_BIT:
> +			_glut->waffle_context_api = WAFFLE_CONTEXT_OPENGL_ES2;
> +			break;
> +		default:
> +			glutFatal("api_mask has bad value %#x", mask);
> +			break;
> +	}
> +}

Wow, I never caught this before.  piglit introduces new functions in the
glut namespace?  That's evil.

> +	ADD_ATTR(WAFFLE_CONTEXT_API, _glut->waffle_context_api);
> +
> +	if (_glut->display_mode & (GLUT_RGB | GLUT_RGBA)) {
> +		ADD_ATTR(WAFFLE_RED_SIZE,    1);
> +		ADD_ATTR(WAFFLE_GREEN_SIZE,  1);
> +		ADD_ATTR(WAFFLE_BLUE_SIZE,   1);
> +	} else {
> +		ADD_ATTR(WAFFLE_RED_SIZE,    WAFFLE_DONT_CARE);
> +		ADD_ATTR(WAFFLE_GREEN_SIZE,  WAFFLE_DONT_CARE);
> +		ADD_ATTR(WAFFLE_BLUE_SIZE,   WAFFLE_DONT_CARE);
> +	}

Isn't not specifying the attrib equivalent to DONT_CARE?  Otherwise,
what's the point of this varargsy initialization scheme?

> +	// FIXME: Tests run without -auto require basic input.
> +
> +	// Workaround for input:
> +	// Since glut_waffle doesn't handle input yet, it sleeps in order to
> +	// give the user a chance to see the test output. If the user wishes
> +	// the test to sleep for a shorter or longer time, he can use Ctrl-C
> +	// or Ctrl-Z.
> +	sleep(20);
> +}

I think this is the part of this series that I'm least excited about
right now.  Getting "press escape or q or whatever to exit" into place
should be easy on GLX at least, right?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/piglit/attachments/20120522/f61d0644/attachment.pgp>


More information about the Piglit mailing list