aboutsummaryrefslogtreecommitdiffstats
path: root/pugl/pugl.h
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2020-03-09 21:49:53 +0100
committerDavid Robillard <d@drobilla.net>2020-03-09 21:49:53 +0100
commita7cb0cb1506792d6893556bc976822e254a89106 (patch)
treec6ea552a3fb0fbf711ecbfafc699030eda3f8158 /pugl/pugl.h
parented301f0548438692269481096e6ef51c3ead01dc (diff)
downloadpugl-a7cb0cb1506792d6893556bc976822e254a89106.tar.gz
pugl-a7cb0cb1506792d6893556bc976822e254a89106.tar.bz2
pugl-a7cb0cb1506792d6893556bc976822e254a89106.zip
Add create, destroy, map, and unmap events
These can be used to do things when a view is created or destroyed, in particular set up the GL context in a more controlled way. Map and unmap events are also added for when views are shown and hidden so application can react to this as well. Towards the deprecation of puglEnterContext() and puglLeaveContext(), which are prone to abuse. squash! Remove client event stuff
Diffstat (limited to 'pugl/pugl.h')
-rw-r--r--pugl/pugl.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/pugl/pugl.h b/pugl/pugl.h
index d14c086..04f5343 100644
--- a/pugl/pugl.h
+++ b/pugl/pugl.h
@@ -168,7 +168,11 @@ typedef enum {
PUGL_NOTHING, ///< No event
PUGL_BUTTON_PRESS, ///< Mouse button pressed, a #PuglEventButton
PUGL_BUTTON_RELEASE, ///< Mouse button released, a #PuglEventButton
- PUGL_CONFIGURE, ///< View moved and/or resized, a #PuglEventConfigure
+ PUGL_CREATE, ///< View created, a #PuglEventAny
+ PUGL_DESTROY, ///< View destroyed, a #PuglEventAny
+ PUGL_MAP, ///< View made visible, a #PuglEventAny
+ PUGL_UNMAP, ///< View made invisible, a #PuglEventAny
+ PUGL_CONFIGURE, ///< View moved/resized, a #PuglEventConfigure
PUGL_EXPOSE, ///< View must be drawn, a #PuglEventExpose
PUGL_CLOSE, ///< View will be closed, a #PuglEventAny
PUGL_KEY_PRESS, ///< Key pressed, a #PuglEventKey
@@ -390,6 +394,10 @@ typedef struct {
This is a union of all event types. The #type must be checked to determine
which fields are safe to access. A pointer to PuglEvent can either be cast
to the appropriate type, or the union members used.
+
+ The graphics system may only be accessed when handling certain events. The
+ graphics context is active for #PUGL_CREATE, #PUGL_DESTROY, #PUGL_CONFIGURE,
+ and #PUGL_EXPOSE, but only enabled for drawing for #PUGL_EXPOSE.
*/
typedef union {
PuglEventAny any; ///< Valid for all event types