aboutsummaryrefslogtreecommitdiffstats
path: root/pugl/pugl_internal_types.h
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2019-02-15 12:51:06 +0100
committerDavid Robillard <d@drobilla.net>2019-02-16 16:56:50 +0100
commitf46b5124627e47a197ad41ff5b9e27b82e19d945 (patch)
treebaa281528cfa2359630bf48f9d3fba2981e31b5d /pugl/pugl_internal_types.h
parentcf80f78f808e402d06dc891fce08b0f3b3865c15 (diff)
downloadpugl-f46b5124627e47a197ad41ff5b9e27b82e19d945.tar.gz
pugl-f46b5124627e47a197ad41ff5b9e27b82e19d945.tar.bz2
pugl-f46b5124627e47a197ad41ff5b9e27b82e19d945.zip
Factor out drawing context from platform window implementation
Diffstat (limited to 'pugl/pugl_internal_types.h')
-rw-r--r--pugl/pugl_internal_types.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/pugl/pugl_internal_types.h b/pugl/pugl_internal_types.h
index a0f5b91..dce5429 100644
--- a/pugl/pugl_internal_types.h
+++ b/pugl/pugl_internal_types.h
@@ -55,5 +55,31 @@ struct PuglViewImpl {
bool visible;
};
+/** Opaque surface used by draw context. */
+typedef void PuglSurface;
+
+/** Drawing context interface. */
+typedef struct {
+ /** Get visual information from display and setup view as necessary. */
+ int (*configure)(PuglView*);
+
+ /** Create surface and drawing context. */
+ int (*create)(PuglView*);
+
+ /** Destroy surface and drawing context. */
+ int (*destroy)(PuglView*);
+
+ /** Enter drawing context. */
+ int (*enter)(PuglView*);
+
+ /** Leave drawing context, explicitly flushing if parameter is true. */
+ int (*leave)(PuglView*, bool);
+
+ /** Resize drawing context to the given width and height. */
+ int (*resize)(PuglView*, int, int);
+
+ /** Return the puglGetContext() handle for the application, if any. */
+ void* (*getHandle)(PuglView*);
+} PuglDrawContext;
#endif // PUGL_INTERNAL_TYPES_H