A hint: This file contains one or more very long lines, so maybe it is better readable using the pure text view mode that shows the contents as wrapped lines within the browser window.
1 '' FreeBASIC binding for allegro-5.0.11 2 '' 3 '' based on the C header files: 4 '' Copyright (c) 2004-2011 the Allegro 5 Development Team 5 '' 6 '' This software is provided 'as-is', without any express or implied 7 '' warranty. In no event will the authors be held liable for any damages 8 '' arising from the use of this software. 9 '' 10 '' Permission is granted to anyone to use this software for any purpose, 11 '' including commercial applications, and to alter it and redistribute it 12 '' freely, subject to the following restrictions: 13 '' 14 '' 1. The origin of this software must not be misrepresented; you must not 15 '' claim that you wrote the original software. If you use this software 16 '' in a product, an acknowledgment in the product documentation would be 17 '' appreciated but is not required. 18 '' 19 '' 2. Altered source versions must be plainly marked as such, and must not be 20 '' misrepresented as being the original software. 21 '' 22 '' 3. This notice may not be removed or altered from any source 23 '' distribution. 24 '' 25 '' translated to FreeBASIC by: 26 '' Copyright © 2015 FreeBASIC development team 27 28 #pragma once 29 30 #ifdef __FB_UNIX__ 31 #inclib "allegro_primitives" 32 #elseif defined(__FB_WIN32__) and defined(ALLEGRO_STATICLINK) 33 #inclib "allegro_primitives-5.0.10-static-md" 34 #else 35 #inclib "allegro_primitives-5.0.10-md" 36 #endif 37 38 #include once "allegro5/allegro.bi" 39 40 extern "C" 41 42 #define __al_included_allegro5_allegro_primitives_h 43 44 type ALLEGRO_PRIM_TYPE as long 45 enum 46 ALLEGRO_PRIM_LINE_LIST 47 ALLEGRO_PRIM_LINE_STRIP 48 ALLEGRO_PRIM_LINE_LOOP 49 ALLEGRO_PRIM_TRIANGLE_LIST 50 ALLEGRO_PRIM_TRIANGLE_STRIP 51 ALLEGRO_PRIM_TRIANGLE_FAN 52 ALLEGRO_PRIM_POINT_LIST 53 ALLEGRO_PRIM_NUM_TYPES 54 end enum 55 56 type ALLEGRO_PRIM_ATTR as long 57 enum 58 ALLEGRO_PRIM_POSITION = 1 59 ALLEGRO_PRIM_COLOR_ATTR 60 ALLEGRO_PRIM_TEX_COORD 61 ALLEGRO_PRIM_TEX_COORD_PIXEL 62 ALLEGRO_PRIM_ATTR_NUM 63 end enum 64 65 type ALLEGRO_PRIM_STORAGE as long 66 enum 67 ALLEGRO_PRIM_FLOAT_2 68 ALLEGRO_PRIM_FLOAT_3 69 ALLEGRO_PRIM_SHORT_2 70 end enum 71 72 const ALLEGRO_VERTEX_CACHE_SIZE = 256 73 const ALLEGRO_PRIM_QUALITY = 10 74 75 type ALLEGRO_VERTEX_ELEMENT 76 attribute as long 77 storage as long 78 offset as long 79 end type 80 81 #define _ALLEGRO_VERTEX_DEFINED 82 83 type ALLEGRO_VERTEX 84 x as single 85 y as single 86 z as single 87 u as single 88 v as single 89 color as ALLEGRO_COLOR 90 end type 91 92 declare function al_get_allegro_primitives_version() as ulong 93 declare function al_init_primitives_addon() as byte 94 declare sub al_shutdown_primitives_addon() 95 type ALLEGRO_VERTEX_DECL as ALLEGRO_VERTEX_DECL_ 96 declare function al_draw_prim(byval vtxs as const any ptr, byval decl as const ALLEGRO_VERTEX_DECL ptr, byval texture as ALLEGRO_BITMAP ptr, byval start as long, byval end as long, byval type as long) as long 97 declare function al_draw_indexed_prim(byval vtxs as const any ptr, byval decl as const ALLEGRO_VERTEX_DECL ptr, byval texture as ALLEGRO_BITMAP ptr, byval indices as const long ptr, byval num_vtx as long, byval type as long) as long 98 declare function al_create_vertex_decl(byval elements as const ALLEGRO_VERTEX_ELEMENT ptr, byval stride as long) as ALLEGRO_VERTEX_DECL ptr 99 declare sub al_destroy_vertex_decl(byval decl as ALLEGRO_VERTEX_DECL ptr) 100 declare sub al_draw_soft_triangle(byval v1 as ALLEGRO_VERTEX ptr, byval v2 as ALLEGRO_VERTEX ptr, byval v3 as ALLEGRO_VERTEX ptr, byval state as uinteger, byval init as sub(byval as uinteger, byval as ALLEGRO_VERTEX ptr, byval as ALLEGRO_VERTEX ptr, byval as ALLEGRO_VERTEX ptr), byval first as sub(byval as uinteger, byval as long, byval as long, byval as long, byval as long), byval step as sub(byval as uinteger, byval as long), byval draw as sub(byval as uinteger, byval as long, byval as long, byval as long)) 101 declare sub al_draw_soft_line(byval v1 as ALLEGRO_VERTEX ptr, byval v2 as ALLEGRO_VERTEX ptr, byval state as uinteger, byval first as sub(byval as uinteger, byval as long, byval as long, byval as ALLEGRO_VERTEX ptr, byval as ALLEGRO_VERTEX ptr), byval step as sub(byval as uinteger, byval as long), byval draw as sub(byval as uinteger, byval as long, byval as long)) 102 declare sub al_draw_line(byval x1 as single, byval y1 as single, byval x2 as single, byval y2 as single, byval color as ALLEGRO_COLOR, byval thickness as single) 103 declare sub al_draw_triangle(byval x1 as single, byval y1 as single, byval x2 as single, byval y2 as single, byval x3 as single, byval y3 as single, byval color as ALLEGRO_COLOR, byval thickness as single) 104 declare sub al_draw_rectangle(byval x1 as single, byval y1 as single, byval x2 as single, byval y2 as single, byval color as ALLEGRO_COLOR, byval thickness as single) 105 declare sub al_draw_rounded_rectangle(byval x1 as single, byval y1 as single, byval x2 as single, byval y2 as single, byval rx as single, byval ry as single, byval color as ALLEGRO_COLOR, byval thickness as single) 106 declare sub al_calculate_arc(byval dest as single ptr, byval stride as long, byval cx as single, byval cy as single, byval rx as single, byval ry as single, byval start_theta as single, byval delta_theta as single, byval thickness as single, byval num_points as long) 107 declare sub al_draw_circle(byval cx as single, byval cy as single, byval r as single, byval color as ALLEGRO_COLOR, byval thickness as single) 108 declare sub al_draw_ellipse(byval cx as single, byval cy as single, byval rx as single, byval ry as single, byval color as ALLEGRO_COLOR, byval thickness as single) 109 declare sub al_draw_arc(byval cx as single, byval cy as single, byval r as single, byval start_theta as single, byval delta_theta as single, byval color as ALLEGRO_COLOR, byval thickness as single) 110 declare sub al_draw_elliptical_arc(byval cx as single, byval cy as single, byval rx as single, byval ry as single, byval start_theta as single, byval delta_theta as single, byval color as ALLEGRO_COLOR, byval thickness as single) 111 declare sub al_draw_pieslice(byval cx as single, byval cy as single, byval r as single, byval start_theta as single, byval delta_theta as single, byval color as ALLEGRO_COLOR, byval thickness as single) 112 declare sub al_calculate_spline(byval dest as single ptr, byval stride as long, byval points as single ptr, byval thickness as single, byval num_segments as long) 113 declare sub al_draw_spline(byval points as single ptr, byval color as ALLEGRO_COLOR, byval thickness as single) 114 declare sub al_calculate_ribbon(byval dest as single ptr, byval dest_stride as long, byval points as const single ptr, byval points_stride as long, byval thickness as single, byval num_segments as long) 115 declare sub al_draw_ribbon(byval points as const single ptr, byval points_stride as long, byval color as ALLEGRO_COLOR, byval thickness as single, byval num_segments as long) 116 declare sub al_draw_filled_triangle(byval x1 as single, byval y1 as single, byval x2 as single, byval y2 as single, byval x3 as single, byval y3 as single, byval color as ALLEGRO_COLOR) 117 declare sub al_draw_filled_rectangle(byval x1 as single, byval y1 as single, byval x2 as single, byval y2 as single, byval color as ALLEGRO_COLOR) 118 declare sub al_draw_filled_ellipse(byval cx as single, byval cy as single, byval rx as single, byval ry as single, byval color as ALLEGRO_COLOR) 119 declare sub al_draw_filled_circle(byval cx as single, byval cy as single, byval r as single, byval color as ALLEGRO_COLOR) 120 declare sub al_draw_filled_pieslice(byval cx as single, byval cy as single, byval r as single, byval start_theta as single, byval delta_theta as single, byval color as ALLEGRO_COLOR) 121 declare sub al_draw_filled_rounded_rectangle(byval x1 as single, byval y1 as single, byval x2 as single, byval y2 as single, byval rx as single, byval ry as single, byval color as ALLEGRO_COLOR) 122 123 end extern