summaryrefslogtreecommitdiff
path: root/cogl/cogl-renderer-private.h
diff options
context:
space:
mode:
authorRobert Bragg <robert@linux.intel.com>2013-04-16 23:46:03 +0100
committerRobert Bragg <robert@linux.intel.com>2013-04-30 16:39:31 +0100
commited90c6fed9f5eb924868fae1f0a87e4044a19f89 (patch)
tree9b2d30b0d02841b6d0582880c4d45ccce319c80c /cogl/cogl-renderer-private.h
parent816a5bc43764a3cbb6eda3a608ba71d528d66eb7 (diff)
downloadcogl-ed90c6fed9f5eb924868fae1f0a87e4044a19f89.tar.gz
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)
Diffstat (limited to 'cogl/cogl-renderer-private.h')
-rw-r--r--cogl/cogl-renderer-private.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/cogl/cogl-renderer-private.h b/cogl/cogl-renderer-private.h
index 8648374a..b01a1c93 100644
--- a/cogl/cogl-renderer-private.h
+++ b/cogl/cogl-renderer-private.h
@@ -30,6 +30,7 @@
#include "cogl-winsys-private.h"
#include "cogl-driver.h"
#include "cogl-texture-driver.h"
+#include "cogl-context.h"
#ifdef COGL_HAS_XLIB_SUPPORT
#include <X11/Xlib.h>
@@ -50,6 +51,24 @@ struct _CoglRenderer
CoglWinsysID winsys_id_override;
GList *constraints;
+ GArray *poll_fds;
+ int poll_fds_age;
+
+ /* NB: Currently a CoglContext can only be associated with 1
+ * CoglDisplay which itself can only be associated with 1
+ * CoglRenderer.
+ *
+ * We currently do event dispatching from the renderer but once we
+ * have fully setup a context then we need to refer to the context
+ * to dispatch context events.
+ *
+ * This gives us a back-reference to the CoglContext that can be
+ * referenced during event dispatching.
+ *
+ * We always need to consider that this may be NULL.
+ */
+ CoglContext *context;
+
GList *outputs;
#ifdef COGL_HAS_XLIB_SUPPORT