commit ffe1a84634db0bec6031789f0d64ac6cf2534221
parent eadd3f9c4e4c0060ae9b6d4146d45d9ef71f237a
Author: falkTX <falktx@falktx.com>
Date: Thu, 6 May 2021 22:18:15 +0100
cleanup pugl.cpp
Diffstat:
4 files changed, 21 insertions(+), 23 deletions(-)
diff --git a/dgl/Widget.hpp b/dgl/Widget.hpp
@@ -164,7 +164,7 @@ public:
/**
Get top-level widget, as passed directly in the constructor
- or going up the chain of group widgets until it finds the top-level widget.
+ or going up the chain of group widgets until it finds the top-level one.
*/
TopLevelWidget* getTopLevelWidget() const noexcept;
diff --git a/dgl/src/Cairo.cpp b/dgl/src/Cairo.cpp
@@ -88,4 +88,15 @@ void Widget::PrivateData::display(const uint width,
// -----------------------------------------------------------------------
+const GraphicsContext& Window::PrivateData::getGraphicsContext() const noexcept
+{
+ GraphicsContext& context((GraphicsContext&)graphicsContext);
+#ifdef DGL_CAIRO
+ ((CairoGraphicsContext&)context).handle = (cairo_t*)puglGetContext(view);
+#endif
+ return context;
+}
+
+// -----------------------------------------------------------------------
+
END_NAMESPACE_DGL
diff --git a/dgl/src/OpenGL.cpp b/dgl/src/OpenGL.cpp
@@ -16,6 +16,7 @@
#include "../OpenGL.hpp"
#include "WidgetPrivateData.hpp"
+#include "WindowPrivateData.hpp"
START_NAMESPACE_DGL
@@ -170,4 +171,11 @@ void Widget::PrivateData::display(const uint width,
// -----------------------------------------------------------------------
+const GraphicsContext& Window::PrivateData::getGraphicsContext() const noexcept
+{
+ return (const GraphicsContext&)graphicsContext;
+}
+
+// -----------------------------------------------------------------------
+
END_NAMESPACE_DGL
diff --git a/dgl/src/pugl.cpp b/dgl/src/pugl.cpp
@@ -171,6 +171,7 @@ void puglSetMatchingBackendForCurrentBuild(PuglView* view)
// --------------------------------------------------------------------------------------------------------------------
// DGL specific, build-specific fallback drawing
+
void puglFallbackOnDisplay(PuglView*)
{
#ifdef DGL_OPENGL
@@ -196,28 +197,6 @@ void puglFallbackOnResize(PuglView* view)
#endif
}
-END_NAMESPACE_DGL
-
// --------------------------------------------------------------------------------------------------------------------
-// extra, build-specific stuff
-
-#include "WindowPrivateData.hpp"
-
-#ifdef DGL_CAIRO
-# include "../Cairo.hpp"
-#endif
-
-START_NAMESPACE_DGL
-
-const GraphicsContext& Window::PrivateData::getGraphicsContext() const noexcept
-{
- GraphicsContext& context((GraphicsContext&)graphicsContext);
-#ifdef DGL_CAIRO
- ((CairoGraphicsContext&)context).handle = (cairo_t*)puglGetContext(view);
-#endif
- return context;
-}
END_NAMESPACE_DGL
-
-// --------------------------------------------------------------------------------------------------------------------