aboutsummaryrefslogtreecommitdiffstats
path: root/pugl/pugl_win.c
diff options
context:
space:
mode:
Diffstat (limited to 'pugl/pugl_win.c')
-rw-r--r--pugl/pugl_win.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/pugl/pugl_win.c b/pugl/pugl_win.c
index 0f18eba..ac1993e 100644
--- a/pugl/pugl_win.c
+++ b/pugl/pugl_win.c
@@ -24,6 +24,9 @@
#ifdef PUGL_HAVE_GL
#include "pugl/pugl_gl_backend.h"
#endif
+#ifdef PUGL_HAVE_CAIRO
+#include "pugl/pugl_cairo_backend.h"
+#endif
#include <windows.h>
#include <windowsx.h>
@@ -93,6 +96,11 @@ puglCreateWindow(PuglView* view, const char* title)
impl->backend = puglGlBackend();
#endif
}
+ if (view->ctx_type == PUGL_CAIRO) {
+#ifdef PUGL_HAVE_CAIRO
+ impl->backend = puglCairoBackend();
+#endif
+ }
// Get refresh rate for resize draw timer
DEVMODEA devMode = {0};
@@ -367,6 +375,7 @@ handleConfigure(PuglView* view, PuglEvent* event)
event->configure.width = view->width;
event->configure.height = view->height;
+ view->impl->backend->resize(view, view->width, view->height);
return rect;
}
@@ -684,3 +693,9 @@ puglGetNativeWindow(PuglView* view)
{
return (PuglNativeWindow)view->impl->hwnd;
}
+
+void*
+puglGetContext(PuglView* view)
+{
+ return view->impl->backend->getContext(view);
+}