Move event polling into CoglRenderer
This updates the cogl_poll_ apis to allow dispatching events before we have a CoglContext and to also enables pollfd state to be changed in a more add-hoc way by different Cogl components by replacing the winsys->get_poll_info with _cogl_poll_renderer_add/remove_fd functions and a winsys->get_dispatch_timeout vfunc. One of the intentions here is that applications should be able to run their mainloop before creating a CoglContext to potentially get events relating to CoglOutputs. Reviewed-by: Neil Roberts <neil@linux.intel.com> (cherry picked from commit 667e58c9cb2662aef5f44e580a9eda42dc8d0176)
This commit is contained in:
@ -168,6 +168,8 @@ _cogl_renderer_free (CoglRenderer *renderer)
|
||||
NULL);
|
||||
g_slist_free (renderer->event_filters);
|
||||
|
||||
g_array_free (renderer->poll_fds, TRUE);
|
||||
|
||||
g_free (renderer);
|
||||
}
|
||||
|
||||
@ -181,6 +183,8 @@ cogl_renderer_new (void)
|
||||
renderer->connected = FALSE;
|
||||
renderer->event_filters = NULL;
|
||||
|
||||
renderer->poll_fds = g_array_new (FALSE, TRUE, sizeof (CoglPollFD));
|
||||
|
||||
#ifdef COGL_HAS_XLIB_SUPPORT
|
||||
renderer->xlib_enable_event_retrieval = TRUE;
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user