exzbuf3alleg
Z-buffered polygons demo. allegro game programming library.
Usage
#include <allegro.h>
Example exzbuf
Overview
This program demonstrates how to use Z-buffered polygons and floating point 3D math routines. It also provides a simple way to compute fps (frames per second) using a timer. After selecting a screen resolution through the standard GUI dialog, the example shows two 3D cubes rotating and intersecting each other. Rather than having full polygons incorrectly overlap other polygons due to per-polygon sorting, each pixel is drawn at the correct depth.
Releases
4 releases since Debian 3.1 (Sarge); the text changed 2 times.
See also
BITMAP(3alleg)
Stores the contents of a bitmap. Allegro game programming library.
END_OF_FUNCTION(3alleg)
Locks the code used by a timer. Allegro game programming library.
END_OF_MAIN(3alleg)
Macro to put after your main() function. Allegro game programming library.
LOCK_FUNCTION(3alleg)
Locks the memory of a function used by a timer. Allegro game programming library.
LOCK_VARIABLE(3alleg)
Locks the memory of a variable used by a timer. Allegro game programming library.
MATRIX_f(3alleg)
Floating point matrix structure. Allegro game programming library.
PALETTE(3alleg)
Stores palette information. Allegro game programming library.
POLYTYPE_GCOL(3alleg)
Polygon rendering mode type Allegro game programming library.
SCREEN_H(3alleg)
Global define to obtain the size of the screen. Allegro game programming library.
SCREEN_W(3alleg)
Global define to obtain the size of the screen. Allegro game programming library.
V3D_f(3alleg)
Floating point vertex structure used by 3d functions. Allegro game programming library.
ZBUFFER(3alleg)
Stores 3d zbuffer information. Allegro game programming library.
allegro_error(3alleg)
Stores the last Allegro error message.
allegro_exit(3alleg)
Closes down the Allegro system.
allegro_init(3alleg)
Macro to initialise the Allegro library.
allegro_message(3alleg)
Used mainly to show error messages to users. Allegro game programming library.
apply_matrix_f(3alleg)
Multiplies a point by a transformation matrix. Allegro game programming library.
bitmap_color_depth(3alleg)
Returns the color depth of the specified bitmap. Allegro game programming library.
blit(3alleg)
Copies a rectangular area from one bitmap to another. Allegro game programming library.
clear_bitmap(3alleg)
Clears the bitmap to color 0. Allegro game programming library.
clear_zbuffer(3alleg)
Writes a depth value into the given Z-buffer. Allegro game programming library.
create_bitmap(3alleg)
Creates a memory bitmap. Allegro game programming library.
create_zbuffer(3alleg)
Creates a Z-buffer for a bitmap. Allegro game programming library.
desktop_palette(3alleg)
The palette used by the Atari ST low resolution desktop. Allegro game programming library.
destroy_bitmap(3alleg)
Destroys any type of created bitmap. Allegro game programming library.
destroy_zbuffer(3alleg)
Destroys a Z-buffer. Allegro game programming library.
font(3alleg)
A simple 8x8 fixed size font. Allegro game programming library.
get_transformation_matrix_f(3alleg)
Floating point version of get_transformation_matrix(). Allegro game programming library.
gfx_mode_select_ex(3alleg)
Extended version of the graphics mode selection dialog. Allegro game programming library.
install_int(3alleg)
Installs a user timer handler. Allegro game programming library.
install_keyboard(3alleg)
Installs the Allegro keyboard interrupt handler.
install_mouse(3alleg)
Installs the Allegro mouse handler.
install_timer(3alleg)
Installs the Allegro timer interrupt handler.
keypressed(3alleg)
Tells if there are keypresses waiting in the input buffer. Allegro game programming library.
palette_color(3alleg)
Maps palette indexes into the current pixel format colors. Allegro game programming library.
persp_project_f(3alleg)
Projects a 3d point into 2d screen space. Allegro game programming library.
polygon_z_normal_f(3alleg)
Finds the Z component of the normal vector to three vertices. Allegro game programming library.
quad3d_f(3alleg)
Draws a 3d quad onto the specified bitmap. Allegro game programming library.
readkey(3alleg)
Returns the next character from the keyboard buffer. Allegro game programming library.
screen(3alleg)
Global pointer to the screen hardware video memory. Allegro game programming library.
set_color_depth(3alleg)
Sets the global pixel color depth. Allegro game programming library.
set_gfx_mode(3alleg)
Sets a graphic video mode. Allegro game programming library.
set_palette(3alleg)
Sets the entire palette of 256 colors. Allegro game programming library.
set_palette_range(3alleg)
Sets a specific range of the palette. Allegro game programming library.
set_projection_viewport(3alleg)
Sets the viewport used to scale the output of persp_project(). Allegro game programming library.
set_zbuffer(3alleg)
Makes the given Z-buffer the active one. Allegro game programming library.
textprintf_ex(3alleg)
Formatted output of a string. Allegro game programming library.
vsync(3alleg)
Waits for a vertical retrace to begin. Allegro game programming library.
Referred to by
V3D_f(3alleg)
Floating point vertex structure used by 3d functions. Allegro game programming library.
ZBUFFER(3alleg)
Stores 3d zbuffer information. Allegro game programming library.
MATRIX_f(3alleg)
Floating point matrix structure. Allegro game programming library.
install_int(3alleg)
Installs a user timer handler. Allegro game programming library.
set_zbuffer(3alleg)
Makes the given Z-buffer the active one. Allegro game programming library.
allegro_exit(3alleg)
Closes down the Allegro system.
LOCK_FUNCTION(3alleg)
Locks the memory of a function used by a timer. Allegro game programming library.
LOCK_VARIABLE(3alleg)
Locks the memory of a variable used by a timer. Allegro game programming library.
POLYTYPE_GCOL(3alleg)
Polygon rendering mode type Allegro game programming library.
clear_zbuffer(3alleg)
Writes a depth value into the given Z-buffer. Allegro game programming library.
create_zbuffer(3alleg)
Creates a Z-buffer for a bitmap. Allegro game programming library.
END_OF_FUNCTION(3alleg)
Locks the code used by a timer. Allegro game programming library.
destroy_zbuffer(3alleg)
Destroys a Z-buffer. Allegro game programming library.
set_palette_range(3alleg)
Sets a specific range of the palette. Allegro game programming library.
bitmap_color_depth(3alleg)
Returns the color depth of the specified bitmap. Allegro game programming library.
gfx_mode_select_ex(3alleg)
Extended version of the graphics mode selection dialog. Allegro game programming library.
set_projection_viewport(3alleg)
Sets the viewport used to scale the output of persp_project(). Allegro game programming library.
get_transformation_matrix_f(3alleg)
Floating point version of get_transformation_matrix(). Allegro game programming library.