[Piglit] [PATCH 5/5] glut_waffle: Add input support for X11

Chad Versace chad.versace at linux.intel.com
Thu Aug 30 12:10:18 PDT 2012


On 08/30/2012 06:57 AM, Brian Paul wrote:
> On 08/30/2012 12:16 AM, Chad Versace wrote:
>> Add support for input when using glut_waffle's GLX and
>> X11/EGL backends. Tested with fbo-clean-formats; I cycled through the
>> tests with the keyboard and then quit with the escape key.
>>
>> Signed-off-by: Chad Versace<chad.versace at linux.intel.com>
>> ---
>>   CMakeLists.txt                        |  1 +
>>   src/glut_waffle/CMakeLists.no_api.txt |  6 ++-
>>   src/glut_waffle/glut_waffle.c         | 71 ++++++++++++++++++++++++----
>>   src/glut_waffle/priv/common.h         | 11 +++++
>>   src/glut_waffle/priv/x11.c            | 89 +++++++++++++++++++++++++++++++++++
>>   src/glut_waffle/priv/x11.h            | 31 ++++++++++++
>>   6 files changed, 200 insertions(+), 9 deletions(-)
>>   create mode 100644 src/glut_waffle/priv/x11.c
>>   create mode 100644 src/glut_waffle/priv/x11.h



>> +void
>> +x11_event_loop(void)
>> +{
>> +    while (true) {
>> +        x11_process_next_event();
>> +
>> +        if (!_glut->redisplay)
>> +            continue;
>> +        _glut->redisplay = 0;
>> +
>> +        if (_glut->window->display_cb)
>> +            _glut->window->display_cb();
>> +
>> +        waffle_window_swap_buffers(_glut->window->waffle);
>> +    }
> 
> Just a nit, but I'd opt to implement that without the continue statement:
> 
>     while (true) {
>         x11_process_next_event();
> 
>         if (_glut->redisplay) {
>             _glut->redisplay = 0;
> 
>             if (_glut->window->display_cb)
>                 _glut->window->display_cb();
> 
>             waffle_window_swap_buffers(_glut->window->waffle);
>         }
>     }
> 
> I find that a little quicker to follow.

I agree with your nit. I'll remove the continue in the final patch.

> And you've probably explained this before, but what exactly is glut-waffle?  I
> get the impression that it's a glut-like API over waffle.  Is that correct?
> 
> -Brina
> 

Correct. It's a small subset of the glut API implemented over waffle. I'm trying
to keep that subset as small as possible, the minimal subset needed by piglit.

In order to test GL 3.1, GLES3, Android, and Wayland, I plan to transition
piglit away from glut-proper to glut-waffle. Once that transition is complete,
it might become a good idea to replace glut-waffle with something that better
suits piglit's needs, or maybe glut-waffle will be good enough. We'll cross that
bridge when we get to it.

-Chad


More information about the Piglit mailing list