diff options
author | David Robillard <d@drobilla.net> | 2019-07-26 22:49:30 +0200 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2019-07-29 01:58:40 +0200 |
commit | 39553be4dd02773a7d71eaab63efbf5c76f5e9d2 (patch) | |
tree | 1999800ae6651dc61aef8059b045a2d10b958227 /pugl/pugl_win.c | |
parent | b63194bf2536b156bbda688b3bf9917a5dcdc3f3 (diff) | |
download | pugl-39553be4dd02773a7d71eaab63efbf5c76f5e9d2.tar.gz pugl-39553be4dd02773a7d71eaab63efbf5c76f5e9d2.tar.bz2 pugl-39553be4dd02773a7d71eaab63efbf5c76f5e9d2.zip |
Windows: Add Cairo support
Diffstat (limited to 'pugl/pugl_win.c')
-rw-r--r-- | pugl/pugl_win.c | 15 |
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); +} |