aboutsummaryrefslogtreecommitdiffstats
path: root/pugl/detail
diff options
context:
space:
mode:
Diffstat (limited to 'pugl/detail')
-rw-r--r--pugl/detail/mac.m15
-rw-r--r--pugl/detail/win.c38
-rw-r--r--pugl/detail/x11.c15
3 files changed, 68 insertions, 0 deletions
diff --git a/pugl/detail/mac.m b/pugl/detail/mac.m
index c9847eb..e8a5d57 100644
--- a/pugl/detail/mac.m
+++ b/pugl/detail/mac.m
@@ -24,6 +24,7 @@
#include "pugl/detail/implementation.h"
#include "pugl/detail/mac.h"
#include "pugl/pugl.h"
+#include "pugl/pugl_stub_backend.h"
#import <Cocoa/Cocoa.h>
@@ -1071,3 +1072,17 @@ puglSetClipboard(PuglView* const view,
return PUGL_SUCCESS;
}
+
+const PuglBackend*
+puglStubBackend(void)
+{
+ static const PuglBackend backend = {puglStubConfigure,
+ puglStubCreate,
+ puglStubDestroy,
+ puglStubEnter,
+ puglStubLeave,
+ puglStubResize,
+ puglStubGetContext};
+
+ return &backend;
+}
diff --git a/pugl/detail/win.c b/pugl/detail/win.c
index 408e7ba..b9004b2 100644
--- a/pugl/detail/win.c
+++ b/pugl/detail/win.c
@@ -21,6 +21,7 @@
#include "pugl/detail/implementation.h"
#include "pugl/detail/win.h"
#include "pugl/pugl.h"
+#include "pugl/pugl_stub_backend.h"
#include <windows.h>
#include <windowsx.h>
@@ -927,3 +928,40 @@ puglSetClipboard(PuglView* const view,
CloseClipboard();
return PUGL_SUCCESS;
}
+
+static PuglStatus
+puglWinStubEnter(PuglView* view, bool drawing)
+{
+ if (drawing) {
+ PAINTSTRUCT ps;
+ BeginPaint(view->impl->hwnd, &ps);
+ }
+
+ return PUGL_SUCCESS;
+}
+
+static PuglStatus
+puglWinStubLeave(PuglView* view, bool drawing)
+{
+ if (drawing) {
+ PAINTSTRUCT ps;
+ EndPaint(view->impl->hwnd, &ps);
+ SwapBuffers(view->impl->hdc);
+ }
+
+ return PUGL_SUCCESS;
+}
+
+const PuglBackend*
+puglStubBackend(void)
+{
+ static const PuglBackend backend = {puglWinStubConfigure,
+ puglStubCreate,
+ puglStubDestroy,
+ puglWinStubEnter,
+ puglWinStubLeave,
+ puglStubResize,
+ puglStubGetContext};
+
+ return &backend;
+}
diff --git a/pugl/detail/x11.c b/pugl/detail/x11.c
index 7bf5223..fd47db3 100644
--- a/pugl/detail/x11.c
+++ b/pugl/detail/x11.c
@@ -26,6 +26,7 @@
#include "pugl/detail/types.h"
#include "pugl/detail/x11.h"
#include "pugl/pugl.h"
+#include "pugl/pugl_stub_backend.h"
#include <X11/X.h>
#include <X11/Xatom.h>
@@ -908,3 +909,17 @@ puglSetClipboard(PuglView* const view,
XSetSelectionOwner(impl->display, atoms->CLIPBOARD, impl->win, CurrentTime);
return PUGL_SUCCESS;
}
+
+const PuglBackend*
+puglStubBackend(void)
+{
+ static const PuglBackend backend = {puglX11StubConfigure,
+ puglStubCreate,
+ puglStubDestroy,
+ puglStubEnter,
+ puglStubLeave,
+ puglStubResize,
+ puglStubGetContext};
+
+ return &backend;
+}