aboutsummaryrefslogtreecommitdiffstats
path: root/pugl/pugl.h
diff options
context:
space:
mode:
Diffstat (limited to 'pugl/pugl.h')
-rw-r--r--pugl/pugl.h21
1 files changed, 20 insertions, 1 deletions
diff --git a/pugl/pugl.h b/pugl/pugl.h
index 0c6dd79..c376d3f 100644
--- a/pugl/pugl.h
+++ b/pugl/pugl.h
@@ -141,7 +141,7 @@ typedef void (*PuglSpecialFunc)(PuglView* view, bool press, PuglKey key);
*/
/**
- Create a Pugl context.
+ Create a Pugl view.
To create a window, call the various puglInit* functions as necessary, then
call puglCreateWindow().
@@ -310,6 +310,25 @@ PUGL_API void
puglIgnoreKeyRepeat(PuglView* view, bool ignore);
/**
+ Enter the drawing context.
+
+ This must be called before any code that accesses the drawing context,
+ including any GL functions. This is only necessary for code that does so
+ outside the usual draw callback or handling of an expose event.
+*/
+PUGL_API void
+puglEnterContext(PuglView* view);
+
+/**
+ Leave the drawing context.
+
+ This must be called after puglEnterContext and applies the results of the
+ drawing code (for example, by swapping buffers).
+*/
+PUGL_API void
+puglLeaveContext(PuglView* view, bool flush);
+
+/**
@name Event Callbacks
Functions to set event callbacks for handling user input.
@{