diff options
author | David Robillard <d@drobilla.net> | 2019-02-15 12:51:06 +0100 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2019-02-16 16:56:50 +0100 |
commit | f46b5124627e47a197ad41ff5b9e27b82e19d945 (patch) | |
tree | baa281528cfa2359630bf48f9d3fba2981e31b5d /pugl/pugl_internal_types.h | |
parent | cf80f78f808e402d06dc891fce08b0f3b3865c15 (diff) | |
download | pugl-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.h | 26 |
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 |