Reusing wl_egl_window for multiple EGL surfaces
Pekka Paalanen
ppaalanen at gmail.com
Thu Oct 30 01:16:49 PDT 2014
On Wed, 29 Oct 2014 08:48:12 -0700
Virtual Presence <virtualpresence.ucla at gmail.com> wrote:
> Thank you for the detailed gyaan. I will look into the "sub-surface"
> protocol as an alternative. What I do as of now is have the 2 threads on a
> 3 second timer where threadA renders triangle for 3 seconds then signals a
> mutex condition and wakes up threadB which renders gears for 3 seconds and
> so on and so on. I will also look into the option of reusing the wl_surface
> for multiple wl_egl_window. This seems closest to what i had in mind. I
> would also like to attach 3 second timer signal to the display FD and the
> custom queue i have setup for the 2 threads so that instead of having a
> dedicated timer logic I can blend the event handling into the Wayland
> model. I haven't been successful in doing this though. As an alternative I
> am looking into the option of writing a wl_timer protocol to provide the
> functionality. Any suggestions on how i can tie in the timer logic or any
> comments on having a dedicated wl_timer protocol? Thank you for all the
> help.
Don't do anything with protocol about timers, unless your only goal is
to learn how to define new protocols by a throw-away toy example.
Your client is already polling the wayland connection fd. You can just,
say, use timerfd API to create an fd for your timer needs, and simply
add that to the poll set. That is what
http://cgit.freedesktop.org/wayland/weston/tree/clients/window.c
already does (look for display_watch_fd), for instance.
Or use an event library that offers you everything in a portable
fashion. Or a real toolkit.
Thanks,
pq
More information about the wayland-devel
mailing list