ALLEGRO_VERTEX_ELEMENT man page on DragonFly

Man page or keyword search:  
man Server   44335 pages
apropos Keyword Search (all sections)
Output format
DragonFly logo
[printable version]

ALLEGRO_VERTEX_ELEMENT(3)			     ALLEGRO_VERTEX_ELEMENT(3)

NAME
       ALLEGRO_VERTEX_ELEMENT - Allegro 5 API

SYNOPSIS
	      #include <allegro5/allegro_primitives.h>

	      typedef struct ALLEGRO_VERTEX_ELEMENT ALLEGRO_VERTEX_ELEMENT;

DESCRIPTION
       A  small structure describing a certain element of a vertex.  E.g.  the
       position of the vertex, or its color.  These structures are used by the
       al_create_vertex_decl  function	to create the vertex declaration.  For
       that they generally occur in an array.  The last	 element  of  such  an
       array should have the attribute field equal to 0, to signify that it is
       the end of the array.  Here is an example code that would create a dec‐
       laration	 describing the ALLEGRO_VERTEX structure (passing this as ver‐
       tex declaration to al_draw_prim would be identical to passing NULL):

	      /* On compilers without the offsetof keyword you need to obtain the
	       * offset with sizeof and make sure to account for packing.
	       */
	      ALLEGRO_VERTEX_ELEMENT elems[] = {
		 {ALLEGRO_PRIM_POSITION, ALLEGRO_PRIM_FLOAT_3, offsetof(ALLEGRO_VERTEX, x)},
		 {ALLEGRO_PRIM_TEX_COORD_PIXEL, ALLEGRO_PRIM_FLOAT_2, offsetof(ALLEGRO_VERTEX, u)},
		 {ALLEGRO_PRIM_COLOR_ATTR, 0, offsetof(ALLEGRO_VERTEX, color)},
		 {0, 0, 0}
	      };
	      ALLEGRO_VERTEX_DECL* decl = al_create_vertex_decl(elems, sizeof(ALLEGRO_VERTEX));

       Fields:

       · attribute - A member of the ALLEGRO_PRIM_ATTR(3) enumeration,	speci‐
	 fying what this attribute signifies

       · storage - A member of the ALLEGRO_PRIM_STORAGE(3) enumeration, speci‐
	 fying how this attribute is stored

       · offset - Offset in bytes from the  beginning  of  the	custom	vertex
	 structure.  C function offsetof is very useful here.

SEE ALSO
       al_create_vertex_decl(3), ALLEGRO_VERTEX_DECL(3), ALLEGRO_PRIM_ATTR(3),
       ALLEGRO_PRIM_STORAGE(3)

Allegro reference manual			     ALLEGRO_VERTEX_ELEMENT(3)
[top]

List of man pages available for DragonFly

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net