diff options
author | rodri <rgl@antares-labs.eu> | 2024-08-10 17:57:02 +0000 |
---|---|---|
committer | rodri <rgl@antares-labs.eu> | 2024-08-10 17:57:02 +0000 |
commit | d3b48593b0fee862ea60687336031fd9374ab667 (patch) | |
tree | 7810bcb85cbba3beee05e89b911c35f1d8e1b769 /fb.c | |
parent | 6eab9793d68feb3282714083b355d38c6c36400b (diff) | |
download | libgraphics-d3b48593b0fee862ea60687336031fd9374ab667.tar.gz libgraphics-d3b48593b0fee862ea60687336031fd9374ab667.tar.bz2 libgraphics-d3b48593b0fee862ea60687336031fd9374ab667.zip |
experimental A-buffer implementation.
very simple, without anti-aliasing, made for getting
OIT (order independent transparency) rendering of
arbitrary objects.
also added switches for blending, depth testing and the
A-buffer to the camera.
Diffstat (limited to 'fb.c')
-rw-r--r-- | fb.c | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -212,12 +212,23 @@ framebufctl_swap(Framebufctl *ctl) } static void +resetAbuf(Abuf *buf) +{ + while(buf->nact--) + free(buf->act[buf->nact]->items); + free(buf->act); + free(buf->stk); + memset(buf, 0, sizeof *buf); +} + +static void framebufctl_reset(Framebufctl *ctl) { Framebuf *fb; /* address the back buffer—resetting the front buffer is VERBOTEN */ fb = ctl->getbb(ctl); + resetAbuf(&fb->abuf); memset(fb->nb, 0, Dx(fb->r)*Dy(fb->r)*4); memsetf(fb->zb, Inf(-1), Dx(fb->r)*Dy(fb->r)); memset(fb->cb, 0, Dx(fb->r)*Dy(fb->r)*4); |