aboutsummaryrefslogtreecommitdiffstats
path: root/pugl/pugl_osx.m
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2019-07-27 00:00:25 +0200
committerDavid Robillard <d@drobilla.net>2019-07-29 01:59:04 +0200
commitc6c91cca30d34b77202612bf365d3f7b686cb5c4 (patch)
tree26c4fab5b819cbeb172eb6741a8aa2ff6802d5ef /pugl/pugl_osx.m
parent4d1a4421f0d87a8dc94f131226971fa2ce7d8ed0 (diff)
downloadpugl-c6c91cca30d34b77202612bf365d3f7b686cb5c4.tar.gz
pugl-c6c91cca30d34b77202612bf365d3f7b686cb5c4.tar.bz2
pugl-c6c91cca30d34b77202612bf365d3f7b686cb5c4.zip
Move backend to PuglView
Diffstat (limited to 'pugl/pugl_osx.m')
-rw-r--r--pugl/pugl_osx.m16
1 files changed, 7 insertions, 9 deletions
diff --git a/pugl/pugl_osx.m b/pugl/pugl_osx.m
index 1da1354..9db9d87 100644
--- a/pugl/pugl_osx.m
+++ b/pugl/pugl_osx.m
@@ -45,8 +45,6 @@ typedef NSUInteger NSWindowStyleMask;
@class PuglOpenGLView;
struct PuglInternalsImpl {
- const PuglBackend* backend;
-
NSApplication* app;
PuglOpenGLView* glview;
id window;
@@ -175,7 +173,7 @@ struct PuglInternalsImpl {
bounds.size.height,
};
- puglview->impl->backend->resize(puglview, ev.width, ev.height);
+ puglview->backend->resize(puglview, ev.width, ev.height);
puglDispatchEvent(puglview, (const PuglEvent*)&ev);
}
@@ -729,13 +727,13 @@ puglInitInternals(void)
void
puglEnterContext(PuglView* view, bool drawing)
{
- view->impl->backend->enter(view, drawing);
+ view->backend->enter(view, drawing);
}
void
puglLeaveContext(PuglView* view, bool drawing)
{
- view->impl->backend->leave(view, drawing);
+ view->backend->leave(view, drawing);
}
static NSLayoutConstraint*
@@ -759,10 +757,10 @@ puglCreateWindow(PuglView* view, const char* title)
[NSAutoreleasePool new];
impl->app = [NSApplication sharedApplication];
- impl->backend = puglGlBackend();
+ view->backend = puglGlBackend();
if (view->ctx_type == PUGL_CAIRO) {
#ifdef PUGL_HAVE_CAIRO
- impl->backend = puglCairoBackend();
+ view->backend = puglCairoBackend();
#endif
}
@@ -848,7 +846,7 @@ puglHideWindow(PuglView* view)
void
puglDestroy(PuglView* view)
{
- view->impl->backend->destroy(view);
+ view->backend->destroy(view);
view->impl->glview->puglview = NULL;
[view->impl->glview removeFromSuperview];
if (view->impl->window) {
@@ -956,7 +954,7 @@ puglGetNativeWindow(PuglView* view)
void*
puglGetContext(PuglView* view)
{
- return view->impl->backend->getContext(view);
+ return view->backend->getContext(view);
}
// Backend