<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"> <html><head><title> Allegro Manual: Structures and types defined by Allegro </title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <meta http-equiv="Content-Style-Type" content="text/css"> <link rel="stylesheet" title="Default" type="text/css" href="allegro.css"></head><body bgcolor=white text=black link="#0000ee" alink="#ff0000" vlink="#551a8b"> <h1><a name="Structures and types defined by Allegro">Structures and types defined by Allegro</a></h1> <ul> <li><a href="#al_ffblk">al_ffblk</a> — Cross platform structure storing file information. <li><a href="#AUDIOSTREAM">AUDIOSTREAM</a> — Stores an audiostream. <li><a href="#BITMAP">BITMAP</a> — Stores the contents of a bitmap. <li><a href="#COLOR_MAP">COLOR_MAP</a> — Stores a color map to accelerate drawing. <li><a href="#COMPILED_SPRITE">COMPILED_SPRITE</a> — Stores the contents of a compiled sprite. <li><a href="#DATAFILE">DATAFILE</a> — Stores an Allegro datafile in memory. <li><a href="#DIALOG">DIALOG</a> — Stores a GUI description. <li><a href="#DIALOG_PLAYER">DIALOG_PLAYER</a> — Stores GUI data internally used by Allegro. <li><a href="#fixed">fixed</a> — Fixed point integer to replace floats. <li><a href="#FONT">FONT</a> — Stores an Allegro font. <li><a href="#GFX_MODE">GFX_MODE</a> — Stores video mode information. <li><a href="#GFX_MODE_LIST">GFX_MODE_LIST</a> — Stores an array of GFX_MODE structures. <li><a href="#JOYSTICK_AXIS_INFO">JOYSTICK_AXIS_INFO</a> — Stores joystick axis information. <li><a href="#JOYSTICK_BUTTON_INFO">JOYSTICK_BUTTON_INFO</a> — Stores joystick button information. <li><a href="#JOYSTICK_INFO">JOYSTICK_INFO</a> — Stores information about joysticks. <li><a href="#JOYSTICK_STICK_INFO">JOYSTICK_STICK_INFO</a> — Stores joystick stick information. <li><a href="#LZSS_PACK_DATA">LZSS_PACK_DATA</a> — Opaque structure for handling LZSS compression. <li><a href="#LZSS_UNPACK_DATA">LZSS_UNPACK_DATA</a> — Opaque structure for handling LZSS decompression. <li><a href="#MATRIX">MATRIX</a> — Fixed point matrix structure. <li><a href="#MATRIX_f">MATRIX_f</a> — Floating point matrix structure. <li><a href="#MENU">MENU</a> — Stores the entries of a menu. <li><a href="#MENU_PLAYER">MENU_PLAYER</a> — Stores GUI data internally used by Allegro. <li><a href="#MIDI">MIDI</a> — Stores MIDI data. <li><a href="#PACKFILE">PACKFILE</a> — Packfile structure, similar to the libc FILE structure. <li><a href="#PACKFILE_VTABLE">PACKFILE_VTABLE</a> — Packfile vtable structure, for custom packfiles. <li><a href="#PAL_SIZE">PAL_SIZE</a> — Number of entries in a palette. <li><a href="#PALETTE">PALETTE</a> — Stores palette information. <li><a href="#QUAT">QUAT</a> — Stores quaternion information. <li><a href="#RGB">RGB</a> — Single palette entry. <li><a href="#RGB_MAP">RGB_MAP</a> — Stores an rgb map to accelerate conversions. <li><a href="#RLE_SPRITE">RLE_SPRITE</a> — Stores the contents of an RLE sprite. <li><a href="#SAMPLE">SAMPLE</a> — Stores sound data. <li><a href="#V3D">V3D</a> — Fixed point vertex structure used by 3d functions. <li><a href="#V3D_f">V3D_f</a> — Floating point vertex structure used by 3d functions. <li><a href="#ZBUFFER">ZBUFFER</a> — Stores 3d zbuffer information. </ul> <p> There are several structures and types defined by Allegro which are used in many functions (like the BITMAP structure). This section of the manual describes their useful content from a user point of view when they don't fit very well any of the existing manual sections, and redirects you to the appropriate section when it's already described there. Note that unless stated otherwise, the contents shown here are just for read only purposes, there might be other internal flags, but you shouldn't depend on them being available in past/future versions of Allegro. <p><br> <div class="al-api"><b>typedef long <a name="fixed">fixed</a></b></div><br> This is a fixed point integer which can replace float with similar results and is faster than float on low end machines. Read chapter "Fixed point math routines" for the full explanation. <blockquote class="xref"><em><b>See also:</b></em> <a class="xref" href="alleg032.html#Fixed point math routines" title="">Fixed point math routines</a>.</blockquote> <blockquote class="eref"><em><b>Examples using this:</b></em> <a class="eref" href="alleg045.html#ex12bit" title="How to fake a 12-bit truecolor mode on an 8-bit card.">ex12bit</a>, <a class="eref" href="alleg045.html#ex3buf" title="Mode-X triple buffering and retrace interrupt simulation.">ex3buf</a>, <a class="eref" href="alleg045.html#ex3d" title="3d 'bouncy cubes' demo.">ex3d</a>, <a class="eref" href="alleg045.html#excustom" title="Creating custom GUI objects.">excustom</a>, <a class="eref" href="alleg045.html#exfixed" title="Using fixed point maths.">exfixed</a>, <a class="eref" href="alleg045.html#exrotscl" title="Demonstrates rotate_scaled_sprite functions.">exrotscl</a>, <a class="eref" href="alleg045.html#exspline" title="Constructing smooth movement paths from spline curves.">exspline</a>, <a class="eref" href="alleg045.html#exsprite" title="Datafiles access and sprite animation.">exsprite</a>, <a class="eref" href="alleg045.html#exstars" title="3d starfield and lightsourced spaceship.">exstars</a>, <a class="eref" href="alleg045.html#exupdate" title="Supporting different screen update methods in a single program.">exupdate</a>.</blockquote> <div class="al-api"><b>typedef struct <a name="BITMAP">BITMAP</a></b></div><br> <blockquote class="code"><pre> int w, h; - size of the bitmap in pixels int clip; - non-zero if clipping is turned on int cl, cr, ct, cb; - clip rectangle left, right, top, and bottom unsigned char *<a href="alleg013.html#line" class="autotype" title="Draws a line onto the bitmap.">line</a>[]; - pointers to the start of each <a href="alleg013.html#line" class="autotype" title="Draws a line onto the bitmap.">line</a> </pre></blockquote> There is some other stuff in the structure as well, but it is liable to change and you shouldn't use anything except the above. The <tt>`w'</tt> and <tt>`h'</tt> fields can be used to obtain the size of an existing bitmap: <blockquote class="code"><pre> bmp = <a href="alleg010.html#load_bitmap" class="autotype" title="Loads any supported bitmap from a file.">load_bitmap</a>("file.bmp", pal); <a href="alleg000.html#allegro_message" class="autotype" title="Used mainly to show error messages to users.">allegro_message</a>("Bitmap size: (%dx%d)\n", bmp->w, bmp->h); </pre></blockquote> The clipping rectangle is inclusive on the left and top (0 allows drawing to position 0) but exclusive on the right and bottom (10 allows drawing to position 9, but not to 10). Note this is not the same format as that of the clipping API, which takes inclusive coordinates for all four corners. All the values of this structure should be regarded as read-only, with the exception of the line field, whose access is described in depth in the "Direct access to video memory" section of the manual. If you want to modify the clipping region, please refrain from changing this structure. Use set_clip_rect() instead. <blockquote class="xref"><em><b>See also:</b></em> <a class="xref" href="alleg009.html#create_bitmap" title="Creates a memory bitmap.">create_bitmap</a>, <a class="xref" href="alleg009.html#set_clip_rect" title="Sets the clipping rectangle of a bitmap.">set_clip_rect</a>, <a class="xref" href="alleg009.html#bitmap_color_depth" title="Returns the color depth of the specified bitmap.">bitmap_color_depth</a>, <a class="xref" href="#RLE_SPRITE" title="Stores the contents of an RLE sprite.">RLE_SPRITE</a>, <a class="xref" href="#COMPILED_SPRITE" title="Stores the contents of a compiled sprite.">COMPILED_SPRITE</a>, <a class="xref" href="alleg022.html#Direct access to video memory" title="">Direct access to video memory</a>.</blockquote> <blockquote class="eref"><em><b>Examples using this:</b></em> <a class="eref" href="alleg045.html#Available Allegro examples" title="">Available Allegro examples</a>.</blockquote> <div class="al-api"><b>typedef struct <a name="RLE_SPRITE">RLE_SPRITE</a></b></div><br> <blockquote class="code"><pre> int w, h; - width and height in pixels int color_depth; - color depth of the image </pre></blockquote> RLE sprites store the image in a simple run-length encoded format, where repeated zero pixels are replaced by a single length count, and strings of non-zero pixels are preceded by a counter giving the length of the solid run. Read chapter "RLE sprites" for a description of the restrictions and how to obtain/use this structure. <blockquote class="xref"><em><b>See also:</b></em> <a class="xref" href="alleg015.html#get_rle_sprite" title="Creates an RLE sprite using a bitmap as source.">get_rle_sprite</a>, <a class="xref" href="#BITMAP" title="Stores the contents of a bitmap.">BITMAP</a>, <a class="xref" href="#COMPILED_SPRITE" title="Stores the contents of a compiled sprite.">COMPILED_SPRITE</a>, <a class="xref" href="alleg015.html#RLE sprites" title="">RLE sprites</a>.</blockquote> <div class="al-api"><b>typedef struct <a name="COMPILED_SPRITE">COMPILED_SPRITE</a></b></div><br> <blockquote class="code"><pre> short planar; - set if it's a planar (mode-X) sprite short color_depth; - color depth of the image short w, h; - size of the sprite </pre></blockquote> Compiled sprites are stored as actual machine code instructions that draw a specific image onto a bitmap, using mov instructions with immediate data values. Read chapter "Compiled sprites" for a description of the restrictions and how to obtain/use this structure. <blockquote class="xref"><em><b>See also:</b></em> <a class="xref" href="alleg016.html#get_compiled_sprite" title="Creates a compiled sprite using a bitmap as source.">get_compiled_sprite</a>, <a class="xref" href="#BITMAP" title="Stores the contents of a bitmap.">BITMAP</a>, <a class="xref" href="#RLE_SPRITE" title="Stores the contents of an RLE sprite.">RLE_SPRITE</a>, <a class="xref" href="alleg016.html#Compiled sprites" title="">Compiled sprites</a>.</blockquote> <div class="al-api"><b>typedef struct <a name="JOYSTICK_INFO">JOYSTICK_INFO</a></b></div><br> <blockquote class="code"><pre> int flags; - status flags for this joystick int num_sticks; - how many stick inputs? int num_buttons; - how many buttons? <a href="#JOYSTICK_STICK_INFO" class="autotype" title="Stores joystick stick information.">JOYSTICK_STICK_INFO</a> stick[n]; - stick state information <a href="#JOYSTICK_BUTTON_INFO" class="autotype" title="Stores joystick button information.">JOYSTICK_BUTTON_INFO</a> button[n]; - button state information </pre></blockquote> Read chapter "Joystick routines" for a description on how to obtain/use this structure. <blockquote class="xref"><em><b>See also:</b></em> <a class="xref" href="alleg007.html#joy" title="Global array of joystick state information.">joy</a>, <a class="xref" href="alleg007.html#Joystick routines" title="">Joystick routines</a>.</blockquote> <div class="al-api"><b>typedef struct <a name="JOYSTICK_BUTTON_INFO">JOYSTICK_BUTTON_INFO</a></b></div><br> <blockquote class="code"><pre> int b; - boolean on/off flag char *name; - description of this button </pre></blockquote> Read chapter "Joystick routines" for a description on how to obtain/use this structure. <blockquote class="xref"><em><b>See also:</b></em> <a class="xref" href="alleg007.html#joy" title="Global array of joystick state information.">joy</a>, <a class="xref" href="alleg007.html#Joystick routines" title="">Joystick routines</a>.</blockquote> <div class="al-api"><b>typedef struct <a name="JOYSTICK_STICK_INFO">JOYSTICK_STICK_INFO</a></b></div><br> <blockquote class="code"><pre> int flags; - status flags for this input int num_axis; - how many axes do we have? (note the misspelling) <a href="#JOYSTICK_AXIS_INFO" class="autotype" title="Stores joystick axis information.">JOYSTICK_AXIS_INFO</a> axis[n]; - axis state information char *name; - description of this input </pre></blockquote> Read chapter "Joystick routines" for a description on how to obtain/use this structure. <blockquote class="xref"><em><b>See also:</b></em> <a class="xref" href="alleg007.html#joy" title="Global array of joystick state information.">joy</a>, <a class="xref" href="alleg007.html#Joystick routines" title="">Joystick routines</a>.</blockquote> <div class="al-api"><b>typedef struct <a name="JOYSTICK_AXIS_INFO">JOYSTICK_AXIS_INFO</a></b></div><br> <blockquote class="code"><pre> int pos; - analogue axis position int d1, d2; - digital axis position char *name; - description of this axis </pre></blockquote> Read chapter "Joystick routines" for a description on how to obtain/use this structure. <blockquote class="xref"><em><b>See also:</b></em> <a class="xref" href="alleg007.html#joy" title="Global array of joystick state information.">joy</a>, <a class="xref" href="alleg007.html#Joystick routines" title="">Joystick routines</a>.</blockquote> <div class="al-api"><b>typedef struct <a name="GFX_MODE_LIST">GFX_MODE_LIST</a></b></div><br> <blockquote class="code"><pre> int num_modes; <a href="#GFX_MODE" class="autotype" title="Stores video mode information.">GFX_MODE</a> *mode; </pre></blockquote> Structure returned by get_gfx_mode_list, which contains an array of GFX_MODE structures. <blockquote class="xref"><em><b>See also:</b></em> <a class="xref" href="#GFX_MODE" title="Stores video mode information.">GFX_MODE</a>, <a class="xref" href="alleg008.html#get_gfx_mode_list" title="Obtains a list of available video modes.">get_gfx_mode_list</a>.</blockquote> <div class="al-api"><b>typedef struct <a name="GFX_MODE">GFX_MODE</a></b></div><br> <blockquote class="code"><pre> int width, height, bpp; </pre></blockquote> Structure contained in GFX_MODE_LIST. <blockquote class="xref"><em><b>See also:</b></em> <a class="xref" href="#GFX_MODE_LIST" title="Stores an array of GFX_MODE structures.">GFX_MODE_LIST</a>, <a class="xref" href="alleg008.html#get_gfx_mode_list" title="Obtains a list of available video modes.">get_gfx_mode_list</a>.</blockquote> <div class="al-api"><b>#define <a name="PAL_SIZE">PAL_SIZE</a></b></div><br> Preprocessor constant equal to 256. <blockquote class="xref"><em><b>See also:</b></em> <a class="xref" href="#RGB" title="Single palette entry.">RGB</a>, <a class="xref" href="#PALETTE" title="Stores palette information.">PALETTE</a>, <a class="xref" href="#COLOR_MAP" title="Stores a color map to accelerate drawing.">COLOR_MAP</a>.</blockquote> <div class="al-api"><b>typedef <a name="PALETTE">PALETTE</a> RGB[PAL_SIZE]</b></div><br> Allegro palettes are arrays of PAL_SIZE RGB entries. <blockquote class="xref"><em><b>See also:</b></em> <a class="xref" href="#RGB" title="Single palette entry.">RGB</a>, <a class="xref" href="alleg011.html#Palette routines" title="">Palette routines</a>.</blockquote> <blockquote class="eref"><em><b>Examples using this:</b></em> <a class="eref" href="alleg045.html#Available Allegro examples" title="">Available Allegro examples</a>.</blockquote> <div class="al-api"><b>typedef struct <a name="RGB">RGB</a></b></div><br> <blockquote class="code"><pre> unsigned char r, g, b; </pre></blockquote> Palette entry. It contains an additional field for the purpose of padding but you should not usually care about it. Read chapter "Palette routines" for a description on how to obtain/use this structure. <blockquote class="xref"><em><b>See also:</b></em> <a class="xref" href="alleg011.html#Palette routines" title="">Palette routines</a>, <a class="xref" href="#PALETTE" title="Stores palette information.">PALETTE</a>.</blockquote> <blockquote class="eref"><em><b>Examples using this:</b></em> <a class="eref" href="alleg045.html#ex12bit" title="How to fake a 12-bit truecolor mode on an 8-bit card.">ex12bit</a>, <a class="eref" href="alleg045.html#ex3d" title="3d 'bouncy cubes' demo.">ex3d</a>, <a class="eref" href="alleg045.html#excolmap" title="Creating graphical effects with color mapping tables.">excolmap</a>, <a class="eref" href="alleg045.html#exconfig" title="Using the configuration routines.">exconfig</a>, <a class="eref" href="alleg045.html#expal" title="Palette effects and color cycling.">expal</a>, <a class="eref" href="alleg045.html#exrgbhsv" title="RGB <-> HSV color space conversions.">exrgbhsv</a>, <a class="eref" href="alleg045.html#exscroll" title="Mode-X hardware scrolling and split screens.">exscroll</a>, <a class="eref" href="alleg045.html#exshade" title="Gouraud shaded sprites.">exshade</a>, <a class="eref" href="alleg045.html#extrans" title="Lighting and translucency effects.">extrans</a>, <a class="eref" href="alleg045.html#extruec" title="Truecolor pixel format conversions.">extruec</a>.</blockquote> <div class="al-api"><b>typedef struct <a name="V3D">V3D</a></b></div><br> <blockquote class="code"><pre> <a href="#fixed" class="autotype" title="Fixed point integer to replace floats.">fixed</a> x, y, z; - position <a href="#fixed" class="autotype" title="Fixed point integer to replace floats.">fixed</a> u, v; - texture map coordinates int c; - color </pre></blockquote> A vertex structure used by polygon3d and other polygon rendering functions. Read the description of polygon3d() for a description on how to obtain/use this structure. <blockquote class="xref"><em><b>See also:</b></em> <a class="xref" href="#V3D_f" title="Floating point vertex structure used by 3d functions.">V3D_f</a>, <a class="xref" href="alleg019.html#polygon3d" title="Draws a 3d polygon onto the specified bitmap.">polygon3d</a>, <a class="xref" href="alleg032.html#Fixed point trig" title="">Fixed point trig</a>.</blockquote> <blockquote class="eref"><em><b>Examples using this:</b></em> <a class="eref" href="alleg045.html#ex3d" title="3d 'bouncy cubes' demo.">ex3d</a>.</blockquote> <div class="al-api"><b>typedef struct <a name="V3D_f">V3D_f</a></b></div><br> <blockquote class="code"><pre> float x, y, z; - position float u, v; - texture map coordinates int c; - color </pre></blockquote> Like V3D but using float values instead of fixed ones. Read the description of polygon3d_f() for a description on how to obtain/use this structure. <blockquote class="xref"><em><b>See also:</b></em> <a class="xref" href="#V3D" title="Fixed point vertex structure used by 3d functions.">V3D</a>, <a class="xref" href="alleg019.html#polygon3d_f" title="Draws a 3d polygon onto the specified bitmap.">polygon3d_f</a>, <a class="xref" href="alleg032.html#Fixed point trig" title="">Fixed point trig</a>.</blockquote> <blockquote class="eref"><em><b>Examples using this:</b></em> <a class="eref" href="alleg045.html#excamera" title="Viewing a 3d world from an arbitrary camera position.">excamera</a>, <a class="eref" href="alleg045.html#exscn3d" title="Using the 3d scene functions.">exscn3d</a>, <a class="eref" href="alleg045.html#exzbuf" title="Z-buffered polygons demo.">exzbuf</a>.</blockquote> <div class="al-api"><b>typedef struct <a name="COLOR_MAP">COLOR_MAP</a></b></div><br> <blockquote class="code"><pre> unsigned char data[<a href="#PAL_SIZE" class="autotype" title="Number of entries in a palette.">PAL_SIZE</a>][<a href="#PAL_SIZE" class="autotype" title="Number of entries in a palette.">PAL_SIZE</a>]; </pre></blockquote> Read chapter "Transparency and patterned drawing", section "256-color transparency" for a description on how to obtain/use this structure. <blockquote class="xref"><em><b>See also:</b></em> <a class="xref" href="alleg020.html#256-color transparency" title="">256-color transparency</a>, <a class="xref" href="alleg020.html#color_map" title="Global pointer to the color mapping table.">color_map</a>.</blockquote> <blockquote class="eref"><em><b>Examples using this:</b></em> <a class="eref" href="alleg045.html#ex3d" title="3d 'bouncy cubes' demo.">ex3d</a>, <a class="eref" href="alleg045.html#excolmap" title="Creating graphical effects with color mapping tables.">excolmap</a>, <a class="eref" href="alleg045.html#exlights" title="One way to do colored lighting effects in a hicolor video mode.">exlights</a>, <a class="eref" href="alleg045.html#exshade" title="Gouraud shaded sprites.">exshade</a>, <a class="eref" href="alleg045.html#extrans" title="Lighting and translucency effects.">extrans</a>.</blockquote> <div class="al-api"><b>typedef struct <a name="RGB_MAP">RGB_MAP</a></b></div><br> <blockquote class="code"><pre> unsigned char data[32][32][32]; </pre></blockquote> Read chapter "Converting between color formats" for a description on how to obtain/use this structure. <blockquote class="xref"><em><b>See also:</b></em> <a class="xref" href="alleg021.html#Converting between color formats" title="">Converting between color formats</a>, <a class="xref" href="alleg021.html#create_rgb_table" title="Generates an RGB mapping table with lookup data for a palette.">create_rgb_table</a>.</blockquote> <blockquote class="eref"><em><b>Examples using this:</b></em> <a class="eref" href="alleg045.html#ex3d" title="3d 'bouncy cubes' demo.">ex3d</a>, <a class="eref" href="alleg045.html#excolmap" title="Creating graphical effects with color mapping tables.">excolmap</a>, <a class="eref" href="alleg045.html#exrgbhsv" title="RGB <-> HSV color space conversions.">exrgbhsv</a>, <a class="eref" href="alleg045.html#exshade" title="Gouraud shaded sprites.">exshade</a>, <a class="eref" href="alleg045.html#extrans" title="Lighting and translucency effects.">extrans</a>.</blockquote> <div class="al-api"><b>struct <a name="al_ffblk">al_ffblk</a></b></div><br> <blockquote class="code"><pre> int attrib; - actual attributes of the file found time_t time; - modification time of file char name[512]; - name of file </pre></blockquote> Read the description of al_findfirst for a description on how to obtain/use this structure. <blockquote class="xref"><em><b>See also:</b></em> <a class="xref" href="alleg030.html#al_findfirst" title="Low-level function for searching files.">al_findfirst</a>, <a class="xref" href="alleg030.html#al_ffblk_get_size" title="Get size of file returned by al_findfirst/al_findnext.">al_ffblk_get_size</a>.</blockquote> <div class="al-api"><b>typedef struct <a name="DATAFILE">DATAFILE</a></b></div><br> <blockquote class="code"><pre> void *dat; - pointer to the actual data int type; - type of the data long size; - size of the data in bytes void *prop; - list of object properties </pre></blockquote> Read chapter "Datafile routines", section "Using datafiles" for a description on how to obtain/use this structure. <blockquote class="xref"><em><b>See also:</b></em> <a class="xref" href="alleg031.html#load_datafile" title="Loads a datafile into memory.">load_datafile</a>, <a class="xref" href="alleg031.html#Using datafiles" title="">Using datafiles</a>.</blockquote> <blockquote class="eref"><em><b>Examples using this:</b></em> <a class="eref" href="alleg045.html#excustom" title="Creating custom GUI objects.">excustom</a>, <a class="eref" href="alleg045.html#exdata" title="Accessing the contents of datafiles.">exdata</a>, <a class="eref" href="alleg045.html#exexedat" title="Appending datafiles onto your executable.">exexedat</a>, <a class="eref" href="alleg045.html#exgui" title="Using the GUI routines.">exgui</a>, <a class="eref" href="alleg045.html#exsprite" title="Datafiles access and sprite animation.">exsprite</a>, <a class="eref" href="alleg045.html#exunicod" title="Using Unicode string functions.">exunicod</a>.</blockquote> <div class="al-api"><b>typedef struct <a name="MATRIX">MATRIX</a></b></div><br> <blockquote class="code"><pre> <a href="#fixed" class="autotype" title="Fixed point integer to replace floats.">fixed</a> v[3][3]; - 3x3 scaling and rotation component <a href="#fixed" class="autotype" title="Fixed point integer to replace floats.">fixed</a> t[3]; - x/y/z translation component </pre></blockquote> Fixed point matrix structure. Read chapter "3D math routines" for a description on how to obtain/use this structure. <blockquote class="xref"><em><b>See also:</b></em> <a class="xref" href="#MATRIX_f" title="Floating point matrix structure.">MATRIX_f</a>, <a class="xref" href="alleg033.html#3D math routines" title="">3D math routines</a>.</blockquote> <blockquote class="eref"><em><b>Examples using this:</b></em> <a class="eref" href="alleg045.html#ex12bit" title="How to fake a 12-bit truecolor mode on an 8-bit card.">ex12bit</a>, <a class="eref" href="alleg045.html#ex3d" title="3d 'bouncy cubes' demo.">ex3d</a>, <a class="eref" href="alleg045.html#exstars" title="3d starfield and lightsourced spaceship.">exstars</a>.</blockquote> <div class="al-api"><b>typedef struct <a name="MATRIX_f">MATRIX_f</a></b></div><br> <blockquote class="code"><pre> float v[3][3]; - 3x3 scaling and rotation component float t[3]; - x/y/z translation component </pre></blockquote> Floating point matrix structure. Read chapter "3D math routines" for a description on how to obtain/use this structure. <blockquote class="xref"><em><b>See also:</b></em> <a class="xref" href="#MATRIX" title="Fixed point matrix structure.">MATRIX</a>, <a class="xref" href="alleg033.html#3D math routines" title="">3D math routines</a>.</blockquote> <blockquote class="eref"><em><b>Examples using this:</b></em> <a class="eref" href="alleg045.html#excamera" title="Viewing a 3d world from an arbitrary camera position.">excamera</a>, <a class="eref" href="alleg045.html#exquat" title="A comparison between Euler angles and quaternions.">exquat</a>, <a class="eref" href="alleg045.html#exscn3d" title="Using the 3d scene functions.">exscn3d</a>, <a class="eref" href="alleg045.html#exzbuf" title="Z-buffered polygons demo.">exzbuf</a>.</blockquote> <div class="al-api"><b>typedef struct <a name="QUAT">QUAT</a></b></div><br> <blockquote class="code"><pre> float w, x, y, z; </pre></blockquote> Read chapter "Quaternion math routines" for a description on how to obtain/use this structure. <blockquote class="xref"><em><b>See also:</b></em> <a class="xref" href="alleg034.html#Quaternion math routines" title="">Quaternion math routines</a>.</blockquote> <blockquote class="eref"><em><b>Examples using this:</b></em> <a class="eref" href="alleg045.html#exquat" title="A comparison between Euler angles and quaternions.">exquat</a>.</blockquote> <div class="al-api"><b>typedef struct <a name="DIALOG">DIALOG</a></b></div><br> <blockquote class="code"><pre> int (*proc)(int, <a href="#DIALOG" class="autotype" title="Stores a GUI description.">DIALOG</a> *, int); - dialog procedure (message handler) int x, y, w, h; - position and size of the object int fg, bg; - foreground and background colors int <a href="alleg006.html#key" class="autotype" title="Array of flags indicating key state.">key</a>; - ASCII keyboard shortcut int flags; - flags about the status of the object int d1, d2; - whatever you want to use them for void *dp, *dp2, *dp3; - pointers to more object-specific data </pre></blockquote> This is the structure which contains a GUI object. Read chapter "GUI routines" for a description on how to obtain/use this structure. <blockquote class="xref"><em><b>See also:</b></em> <a class="xref" href="alleg035.html#do_dialog" title="Basic dialog manager function.">do_dialog</a>, <a class="xref" href="alleg035.html#GUI routines" title="">GUI routines</a>.</blockquote> <blockquote class="eref"><em><b>Examples using this:</b></em> <a class="eref" href="alleg045.html#excustom" title="Creating custom GUI objects.">excustom</a>, <a class="eref" href="alleg045.html#exgui" title="Using the GUI routines.">exgui</a>, <a class="eref" href="alleg045.html#exrgbhsv" title="RGB <-> HSV color space conversions.">exrgbhsv</a>.</blockquote> <div class="al-api"><b>typedef struct <a name="MENU">MENU</a></b></div><br> <blockquote class="code"><pre> char *text; - the text to display for the menu item int (*proc)(void); - called when the menu item is clicked struct <a href="#MENU" class="autotype" title="Stores the entries of a menu.">MENU</a> *child; - nested child menu int flags; - disabled or checked state void *dp; - pointer to any data you need </pre></blockquote> Structure used to hold an entry of a menu. Read chapter "GUI routines", section "GUI menus" for a description on how to obtain/use this structure. <blockquote class="xref"><em><b>See also:</b></em> <a class="xref" href="alleg035.html#do_menu" title="Displays an animates a popup menu.">do_menu</a>, <a class="xref" href="alleg035.html#GUI menus" title="">GUI menus</a>.</blockquote> <blockquote class="eref"><em><b>Examples using this:</b></em> <a class="eref" href="alleg045.html#exgui" title="Using the GUI routines.">exgui</a>.</blockquote> <div class="al-api"><b>typedef struct <a name="DIALOG_PLAYER">DIALOG_PLAYER</a></b></div><br> A structure which holds GUI data used internally by Allegro. Read the documentation of init_dialog() for a description on how to obtain/use this structure. <blockquote class="xref"><em><b>See also:</b></em> <a class="xref" href="alleg035.html#init_dialog" title="Low level initialisation of a dialog.">init_dialog</a>, <a class="xref" href="alleg035.html#update_dialog" title="Low level function to update a dialog player.">update_dialog</a>, <a class="xref" href="alleg035.html#shutdown_dialog" title="Destroys a dialog player returned by init_dialog().">shutdown_dialog</a>, <a class="xref" href="alleg035.html#GUI routines" title="">GUI routines</a>.</blockquote> <div class="al-api"><b>typedef struct <a name="MENU_PLAYER">MENU_PLAYER</a></b></div><br> A structure which holds GUI data used internally by Allegro. Read the documentation of init_menu() for a description on how to obtain/use this structure. <blockquote class="xref"><em><b>See also:</b></em> <a class="xref" href="alleg035.html#init_menu" title="Low level initialisation of a menu.">init_menu</a>, <a class="xref" href="alleg035.html#update_menu" title="Low level function to update a menu player.">update_menu</a>, <a class="xref" href="alleg035.html#shutdown_menu" title="Destroys a menu player object returned by init_menu().">shutdown_menu</a>, <a class="xref" href="alleg035.html#GUI menus" title="">GUI menus</a>.</blockquote> <div class="al-api"><b>typedef struct <a name="FONT">FONT</a></b></div><br> A structure holding an Allegro font, usually created beforehand with the grabber tool or Allegro's default font. Read chapter "Fonts" for a description on how to load/destroy fonts, and chapter "Text output" for a description on how to show text. <blockquote class="xref"><em><b>See also:</b></em> <a class="xref" href="alleg018.html#font" title="A simple 8x8 fixed size font.">font</a>.</blockquote> <blockquote class="eref"><em><b>Examples using this:</b></em> <a class="eref" href="alleg045.html#excustom" title="Creating custom GUI objects.">excustom</a>, <a class="eref" href="alleg045.html#exfont" title="Loading and manipulating fonts.">exfont</a>, <a class="eref" href="alleg045.html#exunicod" title="Using Unicode string functions.">exunicod</a>.</blockquote> <div class="al-api"><b>typedef struct <a class="autotype" href="#BITMAP" title="Stores the contents of a bitmap.">BITMAP</a> <a name="ZBUFFER">ZBUFFER</a></b></div><br> Structure used by Allegro's 3d zbuffered rendering functions. You are not supposed to mix ZBUFFER with BITMAP even though it is currently possible to do so. This is just an internal representation, and it may change in the future. <blockquote class="xref"><em><b>See also:</b></em> <a class="xref" href="alleg019.html#Zbuffered rendering" title="">Zbuffered rendering</a>, <a class="xref" href="#BITMAP" title="Stores the contents of a bitmap.">BITMAP</a>.</blockquote> <blockquote class="eref"><em><b>Examples using this:</b></em> <a class="eref" href="alleg045.html#exzbuf" title="Z-buffered polygons demo.">exzbuf</a>.</blockquote> <div class="al-api"><b>typedef struct <a name="SAMPLE">SAMPLE</a></b></div><br> <blockquote class="code"><pre> int bits; - 8 or 16 int stereo; - sample type flag int freq; - sample frequency int priority; - 0-255 unsigned long len; - length (in samples) unsigned long loop_start; - loop start position unsigned long loop_end; - loop finish position void *data; - raw sample data </pre></blockquote> A sample structure, which holds sound data, used by the digital sample routines. You can consider all of these fields as read only except priority, loop_start and loop_end, which you can change them for example after loading a sample from disk. <p> The priority is a value from 0 to 255 (by default set to 128) and controls how hardware voices on the sound card are allocated if you attempt to play more than the driver can handle. This may be used to ensure that the less important sounds are cut off while the important ones are preserved. <p> The variables loop_start and loop_end specify the loop position in sample units, and are set by default to the start and end of the sample. <p> If you are creating your own samples on the fly, you might also want to modify the raw data of the sample pointed by the data field. The sample data are always in unsigned format. This means that if you are loading a PCM encoded sound file with signed 16-bit samples, you would have to XOR every two bytes (i.e. every sample value) with 0x8000 to change the signedness. <blockquote class="xref"><em><b>See also:</b></em> <a class="xref" href="alleg026.html#load_sample" title="Loads a sample from a file.">load_sample</a>, <a class="xref" href="alleg026.html#Digital sample routines" title="">Digital sample routines</a>, <a class="xref" href="alleg026.html#Voice control" title="">Voice control</a>.</blockquote> <blockquote class="eref"><em><b>Examples using this:</b></em> <a class="eref" href="alleg045.html#exsample" title="Playing digital samples.">exsample</a>.</blockquote> <div class="al-api"><b>typedef struct <a name="MIDI">MIDI</a></b></div><br> A structure holding MIDI data. Read chapter "Music routines (MIDI)" for a description on how to obtain/use this structure. <blockquote class="xref"><em><b>See also:</b></em> <a class="xref" href="alleg027.html#load_midi" title="Loads a MIDI file.">load_midi</a>, <a class="xref" href="alleg027.html#Music routines (MIDI)" title="">Music routines (MIDI)</a>.</blockquote> <blockquote class="eref"><em><b>Examples using this:</b></em> <a class="eref" href="alleg045.html#exmidi" title="Playing MIDI music.">exmidi</a>.</blockquote> <div class="al-api"><b>typedef struct <a name="AUDIOSTREAM">AUDIOSTREAM</a></b></div><br> <blockquote class="code"><pre> int voice; - the hardware voice used for the sample </pre></blockquote> A structure holding an audiostream, which is a convenience wrapper around a SAMPLE structure to double buffer sounds too big to fit into memory, or do clever things like generating the sound wave real time. <p> While you shouldn't modify directly the value of the voice, you can use all of the voice functions in chapter "Digital sample routines" to modify the properties of the sound, like the frequency. <blockquote class="xref"><em><b>See also:</b></em> <a class="xref" href="alleg028.html#play_audio_stream" title="Creates a new audio stream and starts playing it.">play_audio_stream</a>, <a class="xref" href="alleg028.html#Audio stream routines" title="">Audio stream routines</a>, <a class="xref" href="alleg026.html#Voice control" title="">Voice control</a>.</blockquote> <blockquote class="eref"><em><b>Examples using this:</b></em> <a class="eref" href="alleg045.html#exstream" title="Playing audio streams.">exstream</a>.</blockquote> <div class="al-api"><b>typedef struct <a name="PACKFILE">PACKFILE</a></b></div><br> A packfile structure, similar to the libc FILE structure. Read chapter "File and compression routines" for a description on how to obtain/use this structure. Note that prior to version 4.1.18, some internal fields were accidentally documented - but PACKFILE should be treated as an opaque structure, just like the libc FILE type. <blockquote class="xref"><em><b>See also:</b></em> <a class="xref" href="alleg030.html#File and compression routines" title="">File and compression routines</a>, <a class="xref" href="alleg030.html#pack_fopen" title="Opens a file according to mode.">pack_fopen</a>, <a class="xref" href="alleg030.html#pack_fopen_chunk" title="Opens a sub-chunk of a file.">pack_fopen_chunk</a>, <a class="xref" href="alleg030.html#pack_fopen_vtable" title="">pack_fopen_vtable</a>.</blockquote> <blockquote class="eref"><em><b>Examples using this:</b></em> <a class="eref" href="alleg045.html#expackf" title="Using custom PACKFILE vtables.">expackf</a>.</blockquote> <div class="al-api"><b>typedef struct <a name="PACKFILE_VTABLE">PACKFILE_VTABLE</a></b></div><br> <blockquote class="code"><pre> int pf_fclose(void *userdata); int pf_getc(void *userdata); int pf_ungetc(int c, void *userdata); long pf_fread(void *p, long n, void *userdata); int pf_putc(int c, void *userdata); long pf_fwrite(const void *p, long n, void *userdata); int pf_fseek(void *userdata, int offset); int pf_feof(void *userdata); int pf_ferror(void *userdata); </pre></blockquote> This is the vtable which must be provided for custom packfiles, which then can read from and write to wherever you like (eg. files in memory). You should provide all the entries of the vtable, even if they are empty stubs doing nothing, to avoid Allegro (or you) calling a NULL method at some point. <blockquote class="xref"><em><b>See also:</b></em> <a class="xref" href="alleg030.html#File and compression routines" title="">File and compression routines</a>, <a class="xref" href="alleg030.html#pack_fopen_vtable" title="">pack_fopen_vtable</a>.</blockquote> <blockquote class="eref"><em><b>Examples using this:</b></em> <a class="eref" href="alleg045.html#expackf" title="Using custom PACKFILE vtables.">expackf</a>.</blockquote> <div class="al-api"><b>typedef struct <a name="LZSS_PACK_DATA">LZSS_PACK_DATA</a></b></div><br> Opaque structure for handling LZSS compression. Read chapter "File and compression routines for a description on how to obtain/use this structure. <blockquote class="xref"><em><b>See also:</b></em> <a class="xref" href="alleg030.html#File and compression routines" title="">File and compression routines</a>, <a class="xref" href="alleg030.html#create_lzss_pack_data" title="Creates an LZSS structure for compression.">create_lzss_pack_data</a>.</blockquote> <div class="al-api"><b>typedef struct <a name="LZSS_UNPACK_DATA">LZSS_UNPACK_DATA</a></b></div><br> Opaque structure for handling LZSS decompression. Read chapter "File and compression routines for a description on how to obtain/use this structure. <blockquote class="xref"><em><b>See also:</b></em> <a class="xref" href="alleg030.html#File and compression routines" title="">File and compression routines</a>, <a class="xref" href="alleg030.html#create_lzss_unpack_data" title="Creates an LZSS structure for decompression.">create_lzss_unpack_data</a>.</blockquote> <hr><div class="al-back-to-contents"><a href="allegro.html">Back to contents</a></div> </body> </html>