summaryrefslogtreecommitdiff
path: root/viewport.c
diff options
context:
space:
mode:
Diffstat (limited to 'viewport.c')
-rw-r--r--viewport.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/viewport.c b/viewport.c
index 0e9b9c5..2089d50 100644
--- a/viewport.c
+++ b/viewport.c
@@ -20,6 +20,12 @@ viewport_memdraw(Viewport *v, Memimage *dst)
v->fbctl->memdraw(v->fbctl, dst);
}
+static Framebuf *
+viewport_getfb(Viewport *v)
+{
+ return v->fbctl->fb[v->fbctl->idx^1]; /* address the back buffer */
+}
+
Viewport *
mkviewport(Rectangle r)
{
@@ -32,6 +38,7 @@ mkviewport(Rectangle r)
v->fbctl = mkfbctl(r);
v->draw = viewport_draw;
v->memdraw = viewport_memdraw;
+ v->getfb = viewport_getfb;
return v;
}