scene_polygon3d(3)

πŸ“¦ version 4.4.3.1, in fedora 43, fedora 44

πŸ’– scene_polygon3d(3) β€” the Allegro manual, but make it make sense πŸ’–

okay bestie, so this is scene_polygon3d and scene_polygon3d_f, straight out of the Allegro game programming library manual. it's giving "put a polygon in the scene rendering list" energy, and honestly? we're obsessed. πŸ¦‹


✨ NAME ✨

scene_polygon3d, scene_polygon3d_f β€” puts a polygon in the scene rendering list. Allegro game programming library. periodt. πŸ’…


🌸 SYNOPSIS 🌸

#include <allegro.h>

int scene_polygon3d(int type, BITMAP *texture, int vc, V3D *vtx[]);

int scene_polygon3d_f(int type, BITMAP *texture, int vc, V3D_f *vtx[]);

πŸŽ€ DESCRIPTION πŸŽ€

So here's the tea: this function puts a polygon in the rendering list. That's it. That's the whole vibe. Nothing is really rendered at this moment β€” no cap, it's literally just queuing it up. πŸ™ˆ

You should call it between clear_scene() and render_scene(). that's the window, bestie, respect the window.

The arguments are the same as for polygon3d(), except the bitmap is missing. Instead, the one you passed to clear_scene() will be used. so like... it's borrowing your bitmap. keep an eye on it. 😭

Now the fun part: unlike polygon3d(), the polygon may be concave or self-intersecting. iconic, we love flexibility. Shapes that penetrate one another may look OK, but they are not really handled by this code β€” so don't come crying to me when they look cursed. πŸ’€

Heads up fr fr: the texture is stored as a pointer only, and you should keep the actual bitmap around until render_scene(), where it is used. do NOT let it get freed early. that's a one-way ticket to sadness city. 🫢

Since the FLAT style is implemented with the low-level hline() function, the FLAT style is subject to DRAW_MODEs. All these modes are valid. Along with the polygon, this mode will be stored for the rendering moment β€” and also all the other related variables, bestie, meaning the color_map pointer, the pattern pointer, the anchor, and the blender values. all of it. tucked in. cozy. 🧚

One more thing, and it's lowkey important: the settings of the CPU_MMX and CPU_3DNOW flags of the cpu_capabilities global variable on entry in this routine affect the choice of low-level asm routine that will be used by render_scene() for this polygon. so whatever those flags say when you walk in the door? that's what decides the asm routine later. πŸ‘‘


⭐ RETURN VALUE ⭐

Returns zero on success, or a negative number if it won't be rendered for lack of a rendering routine. so like... check it. don't just ignore it and act surprised later. 🫠


🌈 SEE ALSO 🌈


and that's the whole page, bestie!! this was Allegro, version 4.4.3, serving scene_polygon3d(3) realness. go forth and queue your polygons responsibly πŸ’–βœ¨πŸŽ€πŸ¦‹πŸŒΈπŸ’…

πŸ“¦ where this page comes from