1 module bindbc.raylib.bind.shapes;
2 
3 import bindbc.raylib.types;
4 
5 version (BindRaylib_Static) {
6    extern (C) @nogc nothrow {
7    }
8 } else {
9    extern (C) @nogc nothrow {
10       /**
11        * Draw a pixel
12        */
13       alias pDrawPixel = void function(int posX, int posY, Color color);
14       /**
15        * Draw a pixel (Vector version)
16        */
17       alias pDrawPixelV = void function(Vector2 position, Color color);
18       /**
19        * Draw a line
20        */
21       alias pDrawLine = void function(int startPosX, int startPosY, int endPosX, int endPosY, Color color);
22       /**
23        * Draw a line (Vector version)
24        */
25       alias pDrawLineV = void function(Vector2 startPos, Vector2 endPos, Color color);
26       /**
27        * Draw a line defining thickness
28        */
29       alias pDrawLineEx = void function(Vector2 startPos, Vector2 endPos, float thick, Color color);
30       /**
31        * Draw a line using cubic-bezier curves in-out
32        */
33       alias pDrawLineBezier = void function(Vector2 startPos, Vector2 endPos, float thick, Color color);
34       /**
35        * Draw lines sequence
36        */
37       alias pDrawLineStrip = void function(Vector2* points, int numPoints, Color color);
38       /**
39        * Draw a color-filled circle
40        */
41       alias pDrawCircle = void function(int centerX, int centerY, float radius, Color color);
42       /**
43        * Draw a piece of a circle
44        */
45       alias pDrawCircleSector = void function(Vector2 center, float radius, int startAngle, int endAngle, int segments, Color color);
46       /**
47        * Draw circle sector outline
48        */
49       alias pDrawCircleSectorLines = void function(Vector2 center, float radius, int startAngle, int endAngle, int segments, Color color);
50       /**
51        * Draw a gradient-filled circle
52        */
53       alias pDrawCircleGradient = void function(int centerX, int centerY, float radius, Color color1, Color color2);
54       /**
55        * Draw a color-filled circle (Vector version)
56        */
57       alias pDrawCircleV = void function(Vector2 center, float radius, Color color);
58       /**
59        * Draw circle outline
60        */
61       alias pDrawCircleLines = void function(int centerX, int centerY, float radius, Color color);
62       /**
63        * Draw ellipse
64        */
65       alias pDrawEllipse = void function(int centerX, int centerY, float radiusH, float radiusV, Color color);
66       /**
67        * Draw ellipse outline
68        */
69       alias pDrawEllipseLines = void function(int centerX, int centerY, float radiusH, float radiusV, Color color);
70       /**
71        * Draw ring
72        */
73       alias pDrawRing = void function(Vector2 center, float innerRadius, float outerRadius, int startAngle, int endAngle,
74             int segments, Color color);
75       /**
76        * Draw ring outline
77        */
78       alias pDrawRingLines = void function(Vector2 center, float innerRadius, float outerRadius, int startAngle,
79             int endAngle, int segments, Color color);
80       /**
81        * Draw a color-filled rectangle
82        */
83       alias pDrawRectangle = void function(int posX, int posY, int width, int height, Color color);
84       /**
85        * Draw a color-filled rectangle (Vector version)
86        */
87       alias pDrawRectangleV = void function(Vector2 position, Vector2 size, Color color);
88       /**
89        * Draw a color-filled rectangle
90        */
91       alias pDrawRectangleRec = void function(Rectangle rec, Color color);
92       /**
93        * Draw a color-filled rectangle with pro parameters
94        */
95       alias pDrawRectanglePro = void function(Rectangle rec, Vector2 origin, float rotation, Color color);
96       /**
97        * Draw a vertical-gradient-filled rectangle
98        */
99       alias pDrawRectangleGradientV = void function(int posX, int posY, int width, int height, Color color1, Color color2);
100       /**
101        * Draw a horizontal-gradient-filled rectangle
102        */
103       alias pDrawRectangleGradientH = void function(int posX, int posY, int width, int height, Color color1, Color color2);
104       /**
105        * Draw a gradient-filled rectangle with custom vertex colors
106        */
107       alias pDrawRectangleGradientEx = void function(Rectangle rec, Color col1, Color col2, Color col3, Color col4);
108       /**
109        * Draw rectangle outline
110        */
111       alias pDrawRectangleLines = void function(int posX, int posY, int width, int height, Color color);
112       /**
113        * Draw rectangle outline with extended parameters
114        */
115       alias pDrawRectangleLinesEx = void function(Rectangle rec, int lineThick, Color color);
116       /**
117        * Draw rectangle with rounded edges
118        */
119       alias pDrawRectangleRounded = void function(Rectangle rec, float roundness, int segments, Color color);
120       /**
121        * Draw rectangle with rounded edges outline
122        */
123       alias pDrawRectangleRoundedLines = void function(Rectangle rec, float roundness, int segments, int lineThick, Color color);
124       /**
125        * Draw a color-filled triangle (vertex in counter-clockwise order!)
126        */
127       alias pDrawTriangle = void function(Vector2 v1, Vector2 v2, Vector2 v3, Color color);
128       /**
129        * Draw triangle outline (vertex in counter-clockwise order!)
130        */
131       alias pDrawTriangleLines = void function(Vector2 v1, Vector2 v2, Vector2 v3, Color color);
132       /**
133        * Draw a triangle fan defined by points (first vertex is the center)
134        */
135       alias pDrawTriangleFan = void function(Vector2* points, int numPoints, Color color);
136       /**
137        * Draw a triangle strip defined by points
138        */
139       alias pDrawTriangleStrip = void function(Vector2* points, int pointsCount, Color color);
140       /**
141        * Draw a regular polygon (Vector version)
142        */
143       alias pDrawPoly = void function(Vector2 center, int sides, float radius, float rotation, Color color);
144       /**
145        * Draw a polygon outline of n sides
146        */
147       alias pDrawPolyLines = void function(Vector2 center, int sides, float radius, float rotation, Color color);
148 
149       /**
150        * Check collision between two rectangles
151        */
152       alias pCheckCollisionRecs = bool function(Rectangle rec1, Rectangle rec2);
153       /**
154        * Check collision between two circles
155        */
156       alias pCheckCollisionCircles = bool function(Vector2 center1, float radius1, Vector2 center2, float radius2);
157       /**
158        * Check collision between circle and rectangle
159        */
160       alias pCheckCollisionCircleRec = bool function(Vector2 center, float radius, Rectangle rec);
161       /**
162        * Get collision rectangle for two rectangles collision
163        */
164       alias pGetCollisionRec = Rectangle function(Rectangle rec1, Rectangle rec2);
165       /**
166        * Check if point is inside rectangle
167        */
168       alias pCheckCollisionPointRec = bool function(Vector2 point, Rectangle rec);
169       /**
170        * Check if point is inside circle
171        */
172       alias pCheckCollisionPointCircle = bool function(Vector2 point, Vector2 center, float radius);
173       /**
174        * Check if point is inside a triangle
175        */
176       alias pCheckCollisionPointTriangle = bool function(Vector2 point, Vector2 p1, Vector2 p2, Vector2 p3);
177    }
178 
179    __gshared {
180       pDrawPixel DrawPixel;
181       pDrawPixelV DrawPixelV;
182       pDrawLine DrawLine;
183       pDrawLineV DrawLineV;
184       pDrawLineEx DrawLineEx;
185       pDrawLineBezier DrawLineBezier;
186       pDrawLineStrip DrawLineStrip;
187       pDrawCircle DrawCircle;
188       pDrawCircleSector DrawCircleSector;
189       pDrawCircleSectorLines DrawCircleSectorLines;
190       pDrawCircleGradient DrawCircleGradient;
191       pDrawCircleV DrawCircleV;
192       pDrawCircleLines DrawCircleLines;
193       pDrawEllipse DrawEllipse;
194       pDrawEllipseLines DrawEllipseLines;
195       pDrawRing DrawRing;
196       pDrawRingLines DrawRingLines;
197       pDrawRectangle DrawRectangle;
198       pDrawRectangleV DrawRectangleV;
199       pDrawRectangleRec DrawRectangleRec;
200       pDrawRectanglePro DrawRectanglePro;
201       pDrawRectangleGradientV DrawRectangleGradientV;
202       pDrawRectangleGradientH DrawRectangleGradientH;
203       pDrawRectangleGradientEx DrawRectangleGradientEx;
204       pDrawRectangleLines DrawRectangleLines;
205       pDrawRectangleLinesEx DrawRectangleLinesEx;
206       pDrawRectangleRounded DrawRectangleRounded;
207       pDrawRectangleRoundedLines DrawRectangleRoundedLines;
208       pDrawTriangle DrawTriangle;
209       pDrawTriangleLines DrawTriangleLines;
210       pDrawTriangleFan DrawTriangleFan;
211       pDrawTriangleStrip DrawTriangleStrip;
212       pDrawPoly DrawPoly;
213       pDrawPolyLines DrawPolyLines;
214       pCheckCollisionRecs CheckCollisionRecs;
215       pCheckCollisionCircles CheckCollisionCircles;
216       pCheckCollisionCircleRec CheckCollisionCircleRec;
217       pGetCollisionRec GetCollisionRec;
218       pCheckCollisionPointRec CheckCollisionPointRec;
219       pCheckCollisionPointCircle CheckCollisionPointCircle;
220       pCheckCollisionPointTriangle CheckCollisionPointTriangle;
221    }
222 }