From: SiegeLord <sie...@us...> - 2012-07-29 03:29:07
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Allegro". The branch, 5.1 has been updated via 14beacf2d8fc6d56fa1c740396cacc6bd6d0ded1 (commit) via c874b966665df13b12f50c7f55530c718981190f (commit) from 2e4dbf81a04440b99b6c40f21780e0e0c17a9b96 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 14beacf2d8fc6d56fa1c740396cacc6bd6d0ded1 Author: SiegeLord <sie...@us...> Date: Sat Jul 28 23:27:20 2012 -0400 Mention the minimum bitmap size issue in the primitives addon documentation commit c874b966665df13b12f50c7f55530c718981190f Author: SiegeLord <sie...@us...> Date: Sat Jul 28 23:21:35 2012 -0400 Rearrange the primitives docs a bit. The vertex declaration routines were blatantly miscategorized and al_draw_vertex_buffer suffers from the same issues as the other low level drawing routines, so it belongs there. ----------------------------------------------------------------------- Summary of changes: docs/src/refman/primitives.txt | 87 +++++++++++++++++++++------------------ 1 files changed, 47 insertions(+), 40 deletions(-) diff --git a/docs/src/refman/primitives.txt b/docs/src/refman/primitives.txt index d7f122a..e4fe84a 100644 --- a/docs/src/refman/primitives.txt +++ b/docs/src/refman/primitives.txt @@ -412,7 +412,9 @@ See also: [al_calculate_ribbon] Low level drawing routines allow for more advanced usage of the addon, allowing you to pass arbitrary sequences of vertices to draw to the screen. These -routines also support using textures on the primitives with some restrictions. +routines also support using textures on the primitives with the following +restrictions: + For maximum portability, you should only use textures that have dimensions that are a power of two, as not every videocard supports them completely. This warning is relaxed, however, if the texture coordinates never exit the @@ -420,6 +422,9 @@ boundaries of a single bitmap (i.e. you are not having the texture repeat/tile). As long as that is the case, any texture can be used safely. Sub-bitmaps work as textures, but cannot be tiled. +Some platforms also dictate a minimum texture size, which means that textures +smaller than that size will not tile properly. This minimum size is 16 by 16. + A note about pixel coordinates. In OpenGL the texture coordinate (0, 0) refers to the top left corner of the pixel. This confuses some drivers, because due to rounding errors the actual pixel sampled might be the pixel to the top and/or @@ -482,31 +487,28 @@ Number of primitives drawn See also: [ALLEGRO_VERTEX], [ALLEGRO_PRIM_TYPE], [ALLEGRO_VERTEX_DECL], [al_draw_prim] -### API: al_create_vertex_decl +### API: al_draw_vertex_buffer -Creates a vertex declaration, which describes a custom vertex format. +Draws a subset of the passed vertex buffer. The vertex buffer must not be +locked. Additionally, to draw onto memory bitmaps or with memory bitmap textures +the vertex buffer must support reading (so it must not be created write only). *Parameters:* -* elements - An array of ALLEGRO_VERTEX_ELEMENT structures. -* stride - Size of the custom vertex structure +* texture - Texture to use, pass 0 to use only color shaded primitves +* vertex_buffer - Vertex buffer to draw +* start - Start index of the subset of the vertex buffer to draw +* end - One past the last index of the subset of the vertex buffer to draw +* type - A member of the [ALLEGRO_PRIM_TYPE] enumeration, specifying what kind + of primitive to draw *Returns:* -Newly created vertex declaration. - -See also: -[ALLEGRO_VERTEX_ELEMENT], [ALLEGRO_VERTEX_DECL], [al_destroy_vertex_decl] - -### API: al_destroy_vertex_decl - -Destroys a vertex declaration. - -*Parameters:* +Number of primitives drawn -* decl - Vertex declaration to destroy +Since: 5.1.3 See also: -[ALLEGRO_VERTEX_ELEMENT], [ALLEGRO_VERTEX_DECL], [al_create_vertex_decl] +[ALLEGRO_VERTEX_BUFFER], [ALLEGRO_PRIM_TYPE], [ALLEGRO_VERTEX_DECL] ### API: al_draw_soft_triangle @@ -567,6 +569,34 @@ The line is drawn top to bottom. See also: [al_draw_line] +## Custom vertex declaration routines + +### API: al_create_vertex_decl + +Creates a vertex declaration, which describes a custom vertex format. + +*Parameters:* + +* elements - An array of ALLEGRO_VERTEX_ELEMENT structures. +* stride - Size of the custom vertex structure + +*Returns:* +Newly created vertex declaration. + +See also: +[ALLEGRO_VERTEX_ELEMENT], [ALLEGRO_VERTEX_DECL], [al_destroy_vertex_decl] + +### API: al_destroy_vertex_decl + +Destroys a vertex declaration. + +*Parameters:* + +* decl - Vertex declaration to destroy + +See also: +[ALLEGRO_VERTEX_ELEMENT], [ALLEGRO_VERTEX_DECL], [al_create_vertex_decl] + ## Vertex buffer routines ### API: al_create_vertex_buffer @@ -624,29 +654,6 @@ Since: 5.1.3 See also: [ALLEGRO_VERTEX_BUFFER], [al_lock_vertex_buffer] -### API: al_draw_vertex_buffer - -Draws a subset of the passed vertex buffer. The vertex buffer must not be -locked. Additionally, to draw onto memory bitmaps or with memory bitmap textures -the vertex buffer must support reading (so it must not be created write only). - -*Parameters:* - -* texture - Texture to use, pass 0 to use only color shaded primitves -* vertex_buffer - Vertex buffer to draw -* start - Start index of the subset of the vertex buffer to draw -* end - One past the last index of the subset of the vertex buffer to draw -* type - A member of the [ALLEGRO_PRIM_TYPE] enumeration, specifying what kind - of primitive to draw - -*Returns:* -Number of primitives drawn - -Since: 5.1.3 - -See also: -[ALLEGRO_VERTEX_BUFFER], [ALLEGRO_PRIM_TYPE], [ALLEGRO_VERTEX_DECL] - ## Polygon routines ### API: al_draw_polyline hooks/post-receive -- Allegro |