summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--graphics.h1
-rw-r--r--render.c2
-rw-r--r--viewport.c9
3 files changed, 10 insertions, 2 deletions
diff --git a/graphics.h b/graphics.h
index f109be3..b523c2b 100644
--- a/graphics.h
+++ b/graphics.h
@@ -216,6 +216,7 @@ struct Viewport
void (*draw)(Viewport*, Image*);
void (*memdraw)(Viewport*, Memimage*);
Framebuf *(*getfb)(Viewport*);
+ Framebuf *(*getbb)(Viewport*);
};
struct Camera
diff --git a/render.c b/render.c
index 6be8179..bef319e 100644
--- a/render.c
+++ b/render.c
@@ -527,7 +527,7 @@ sendparams:
if(ent != nil && ent != &sc->ents){
params = emalloc(sizeof *params);
memset(params, 0, sizeof *params);
- params->fb = job->v->getfb(job->v);
+ params->fb = job->v->getbb(job->v);
params->id = job->lastid++;
params->frag = rgb(DBlack);
params->donec = donec;
diff --git a/viewport.c b/viewport.c
index 2089d50..7f963a8 100644
--- a/viewport.c
+++ b/viewport.c
@@ -23,7 +23,13 @@ viewport_memdraw(Viewport *v, Memimage *dst)
static Framebuf *
viewport_getfb(Viewport *v)
{
- return v->fbctl->fb[v->fbctl->idx^1]; /* address the back buffer */
+ return v->fbctl->fb[v->fbctl->idx]; /* front buffer */
+}
+
+static Framebuf *
+viewport_getbb(Viewport *v)
+{
+ return v->fbctl->fb[v->fbctl->idx^1]; /* back buffer */
}
Viewport *
@@ -39,6 +45,7 @@ mkviewport(Rectangle r)
v->draw = viewport_draw;
v->memdraw = viewport_memdraw;
v->getfb = viewport_getfb;
+ v->getbb = viewport_getbb;
return v;
}