aboutsummaryrefslogtreecommitdiffstats
path: root/pugl/pugl_osx.m
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2019-07-26 23:46:29 +0200
committerDavid Robillard <d@drobilla.net>2019-07-28 19:06:39 +0200
commit6a77f96642b201f614ce7eb67f3b6ec4e1e8c181 (patch)
tree051a02fcd8ffd6ec0a6c6fb8c1331a4a1592d99b /pugl/pugl_osx.m
parent6a3159df3e41cfef6d94ff52f2cf9c5375254243 (diff)
downloadpugl-6a77f96642b201f614ce7eb67f3b6ec4e1e8c181.tar.gz
pugl-6a77f96642b201f614ce7eb67f3b6ec4e1e8c181.tar.bz2
pugl-6a77f96642b201f614ce7eb67f3b6ec4e1e8c181.zip
Make enterContext take a drawing parameter like leaveContext
These need to be symmetric because sometimes different things need to happen in either situation when entering the context as well.
Diffstat (limited to 'pugl/pugl_osx.m')
-rw-r--r--pugl/pugl_osx.m12
1 files changed, 6 insertions, 6 deletions
diff --git a/pugl/pugl_osx.m b/pugl/pugl_osx.m
index c5a94f8..82bc9a6 100644
--- a/pugl/pugl_osx.m
+++ b/pugl/pugl_osx.m
@@ -740,21 +740,21 @@ puglInitInternals(void)
}
void
-puglEnterContext(PuglView* view)
+puglEnterContext(PuglView* view, bool PUGL_UNUSED(drawing))
{
[[view->impl->glview openGLContext] makeCurrentContext];
}
void
-puglLeaveContext(PuglView* view, bool flush)
+puglLeaveContext(PuglView* view, bool drawing)
{
+ if (drawing) {
#ifdef PUGL_HAVE_CAIRO
- if (view->ctx_type & PUGL_CAIRO) {
- pugl_cairo_gl_draw(&view->impl->cairo_gl, view->width, view->height);
- }
+ if (view->ctx_type & PUGL_CAIRO) {
+ pugl_cairo_gl_draw(&view->impl->cairo_gl, view->width, view->height);
+ }
#endif
- if (flush) {
[[view->impl->glview openGLContext] flushBuffer];
}