From 5049953041cbc9592f0470eb185e1448b69835d6 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 27 Jul 2019 00:59:16 +0200 Subject: Completely separate backends from platform implementation This removes PuglContextType and allows the user to pass a backend directly. Normally this would come from one of the two accessors declared in the headers, but it would be possible to add backends without changing any of the existing code at all. Unfortunately, it is not possible to preserve backwards compatibility and achieve the ultimate goal of linking only to the required dependencies, so puglInitContextType() has just been removed. --- pugl/pugl_x11.c | 18 ------------------ 1 file changed, 18 deletions(-) (limited to 'pugl/pugl_x11.c') diff --git a/pugl/pugl_x11.c b/pugl/pugl_x11.c index d9620e1..ad9acc8 100644 --- a/pugl/pugl_x11.c +++ b/pugl/pugl_x11.c @@ -25,13 +25,6 @@ #include "pugl/pugl_internal.h" #include "pugl/pugl_x11.h" -#ifdef PUGL_HAVE_GL -#include "pugl/pugl_gl_backend.h" -#endif -#ifdef PUGL_HAVE_CAIRO -#include "pugl/pugl_cairo_backend.h" -#endif - #include #include #include @@ -83,17 +76,6 @@ puglCreateWindow(PuglView* view, const char* title) impl->atoms.NET_WM_STATE_DEMANDS_ATTENTION = XInternAtom(display, "_NET_WM_STATE_DEMANDS_ATTENTION", 0); - if (view->ctx_type == PUGL_GL) { -#ifdef PUGL_HAVE_GL - view->backend = puglGlBackend(); -#endif - } - if (view->ctx_type == PUGL_CAIRO) { -#ifdef PUGL_HAVE_CAIRO - view->backend = puglCairoBackend(); -#endif - } - if (!view->backend || !view->backend->configure) { return 1; } else if (view->backend->configure(view) || !impl->vi) { -- cgit v1.2.1