summaryrefslogtreecommitdiff
path: root/camera.c
diff options
context:
space:
mode:
authorrodri <rgl@antares-labs.eu>2024-08-11 21:40:53 +0000
committerrodri <rgl@antares-labs.eu>2024-08-11 21:40:53 +0000
commit139a46c56af04a0b8c2f06769ac77078f5581395 (patch)
tree25b0ba14e35d62b061975e97b5445529cace0137 /camera.c
parentd3b48593b0fee862ea60687336031fd9374ab667 (diff)
downloadlibgraphics-139a46c56af04a0b8c2f06769ac77078f5581395.tar.gz
libgraphics-139a46c56af04a0b8c2f06769ac77078f5581395.tar.bz2
libgraphics-139a46c56af04a0b8c2f06769ac77078f5581395.zip
fix FPINVAL error. knob for fb clear color. general improvements.
Diffstat (limited to 'camera.c')
-rw-r--r--camera.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/camera.c b/camera.c
index 8395c0e..e67601f 100644
--- a/camera.c
+++ b/camera.c
@@ -211,21 +211,24 @@ shootcamera(Camera *c, Shadertab *s)
static Scene *skyboxscene;
static Shadertab skyboxshader = { nil, skyboxvs, skyboxfs };
Model *mdl;
+ Framebufctl *fbctl;
Renderjob *job;
uvlong t0, t1;
assert(c->view != nil && c->rctl != nil && c->scene != nil && s != nil);
+ fbctl = c->view->fbctl;
+
job = emalloc(sizeof *job);
memset(job, 0, sizeof *job);
- job->fb = c->view->fbctl->getbb(c->view->fbctl);
+ job->fb = fbctl->getbb(fbctl);
job->camera = emalloc(sizeof *c);
*job->camera = *c;
job->scene = dupscene(c->scene); /* take a snapshot */
job->shaders = s;
job->donec = chancreate(sizeof(void*), 0);
- c->view->fbctl->reset(c->view->fbctl);
+ fbctl->reset(fbctl, c->clearcolor);
t0 = nanosec();
sendp(c->rctl->c, job);
recvp(job->donec);
@@ -250,7 +253,7 @@ shootcamera(Camera *c, Shadertab *s)
delscene(job->scene);
}
t1 = nanosec();
- c->view->fbctl->swap(c->view->fbctl);
+ fbctl->swap(fbctl);
updatestats(c, t1-t0);
updatetimes(c, job);