diff options
-rw-r--r-- | graphics.h | 1 | ||||
-rw-r--r-- | render.c | 2 | ||||
-rw-r--r-- | viewport.c | 9 |
3 files changed, 10 insertions, 2 deletions
@@ -216,6 +216,7 @@ struct Viewport void (*draw)(Viewport*, Image*); void (*memdraw)(Viewport*, Memimage*); Framebuf *(*getfb)(Viewport*); + Framebuf *(*getbb)(Viewport*); }; struct Camera @@ -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; @@ -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; } |