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):
BITMAP(3alleg4)END_OF_FUNCTION(3alleg4)END_OF_MAIN(3alleg4)LOCK_FUNCTION(3alleg4)LOCK_VARIABLE(3alleg4)MATRIX_f(3alleg4)PALETTE(3alleg4)POLYTYPE_GCOL(3alleg4)SCREEN_H(3alleg4)SCREEN_W(3alleg4)V3D_f(3alleg4)ZBUFFER(3alleg4)allegro_error(3alleg4)allegro_exit(3alleg4)allegro_init(3alleg4)allegro_message(3alleg4)apply_matrix_f(3alleg4)bitmap_color_depth(3alleg4)blit(3alleg4)clear_bitmap(3alleg4)clear_zbuffer(3alleg4)create_bitmap(3alleg4)create_zbuffer(3alleg4)desktop_palette(3alleg4)destroy_bitmap(3alleg4)destroy_zbuffer(3alleg4)font(3alleg4)get_transformation_matrix_f(3alleg4)gfx_mode_select_ex(3alleg4)install_int(3alleg4)install_keyboard(3alleg4)install_mouse(3alleg4)install_timer(3alleg4)keypressed(3alleg4)palette_color(3alleg4)persp_project_f(3alleg4)polygon_z_normal_f(3alleg4)quad3d_f(3alleg4)readkey(3alleg4)screen(3alleg4)set_color_depth(3alleg4)set_gfx_mode(3alleg4)set_palette(3alleg4)set_palette_range(3alleg4)set_projection_viewport(3alleg4)set_zbuffer(3alleg4)textprintf_ex(3alleg4)vsync(3alleg4)
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 π
π¦ where this page comes from
- debian bookworm: allegro4-doc 2:4.4.3.1-3 Β· Allegro-gift-ware
- debian trixie: allegro4-doc 2:4.4.3.1-5 Β· Allegro-gift-ware
- ubuntu jammy: allegro4-doc 2:4.4.3.1-2 Β· Allegro-gift-ware
- ubuntu noble: allegro4-doc 2:4.4.3.1-4.1build3 Β· Allegro-gift-ware
- ubuntu questing: allegro4-doc 2:4.4.3.1-6
- ubuntu resolute: allegro4-doc 2:4.4.3.1-7 Β· Allegro-gift-ware
- ubuntu stonking: allegro4-doc 2:4.4.3.1-9 Β· Allegro-gift-ware
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms