diff options
Diffstat (limited to 'pugl/detail/win_cairo.c')
-rw-r--r-- | pugl/detail/win_cairo.c | 24 |
1 files changed, 5 insertions, 19 deletions
diff --git a/pugl/detail/win_cairo.c b/pugl/detail/win_cairo.c index 497711b..27765ec 100644 --- a/pugl/detail/win_cairo.c +++ b/pugl/detail/win_cairo.c @@ -80,28 +80,14 @@ puglWinCairoDestroyDrawContext(PuglView* view) static PuglStatus puglWinCairoConfigure(PuglView* view) { - PuglInternals* const impl = view->impl; - PuglStatus st = PUGL_SUCCESS; + const PuglStatus st = puglWinStubConfigure(view); - if ((st = puglWinCreateWindow(view, "Pugl", &impl->hwnd, &impl->hdc))) { - return st; - } - - impl->pfd = puglWinGetPixelFormatDescriptor(view->hints); - impl->pfId = ChoosePixelFormat(impl->hdc, &impl->pfd); - - if (!SetPixelFormat(impl->hdc, impl->pfId, &impl->pfd)) { - ReleaseDC(impl->hwnd, impl->hdc); - DestroyWindow(impl->hwnd); - impl->hwnd = NULL; - impl->hdc = NULL; - return PUGL_SET_FORMAT_FAILED; + if (!st) { + view->impl->surface = (PuglWinCairoSurface*)calloc( + 1, sizeof(PuglWinCairoSurface)); } - impl->surface = (PuglWinCairoSurface*)calloc( - 1, sizeof(PuglWinCairoSurface)); - - return PUGL_SUCCESS; + return st; } static PuglStatus |