exzbuf(3alleg4)

πŸ’– exzbuf β€” bestie edition πŸ’–

okay so this is a page from the Allegro manual (yes, the 3alleg4 manual, we're in the Allegro 4 era and it's lowkey iconic) and it's all about a lil demo called exzbuf. sit down, grab a strawberry, we're doing Z-buffered polygons today πŸ“βœ¨


✨ NAME ✨

exzbuf β€” Z-buffered polygons demo. Allegro game programming library.

like. the whole vibe is "polygons, but make them know their own depth". no cap πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

#include <allegro.h>

Example exzbuf

that's it, that's the whole entry point, she's simple like that πŸ¦‹


πŸ’œ DESCRIPTION πŸ’œ

okay bestie so listen. this program demonstrates how to use Z-buffered polygons and floating point 3D math routines. two things. both slaying. 🫢

it also provides a simple way to compute fps (frames per second) using a timer. yes, a timer. we're doing performance metrics, we're doing it manually, we're thriving. ⏱️

after selecting a screen resolution through the standard GUI dialog, the example shows two 3D cubes rotating and intersecting each other. two cubes!! rotating!! intersecting!! it's giving choreography honestly πŸ‘‘

and here's the part that actually matters, the why of this whole demo: rather than having full polygons incorrectly overlap other polygons due to per-polygon sorting, each pixel is drawn at the correct depth. like, pixel by pixel, depth-checked, no messy overlap drama. the polygons are NOT fighting each other for z-order. we love a system that just works. periodt. ✨

ngl if you've ever seen two polys clip through each other like they're passing through a wall in a horror movie, that's the exact problem this demo exists to not have. the Z-buffer is the fix. she's the main character. πŸ’€

🌈 SEE ALSO 🌈

the whole friend group, in the exact order they were introduced (no queue-jumping besties):

go read them, they're all baddies, iykyk πŸ§šπŸ’–


mwah, that's the page. this was Allegro, version 4.4.3 β€” shoutout to the whole Allegro team, love y'all, thanks for the 3D math πŸ«ΆπŸ’…βœ¨ bye bestie, go render something at the correct depth πŸ’–