1- /*
1+ /*
22 * COPYRIGHT: See COPYING in the top level directory
33 * PROJECT: RenderEngine
44 * FILE: Geometry2DBuilder.cs
5- * PURPOSE: Your file purpose here
5+ * PURPOSE: Builder for 2D geometry vertex buffers.
66 * PROGRAMMER: Peter Geinitz (Wayfarer)
77 */
88
@@ -16,6 +16,11 @@ namespace RenderEngine
1616 /// </summary>
1717 internal static class Geometry2DBuilder
1818 {
19+ /// <summary>
20+ /// Builds the colored lines.
21+ /// </summary>
22+ /// <param name="points">The points.</param>
23+ /// <returns>Array of floats representing the colored lines.</returns>
1924 internal static float [ ] BuildColoredLines (
2025 ( float x , float y , int r , int g , int b , int a ) [ ] points )
2126 {
@@ -34,6 +39,15 @@ internal static float[] BuildColoredLines(
3439 return data ;
3540 }
3641
42+ /// <summary>
43+ /// Builds the solid quad.
44+ /// </summary>
45+ /// <param name="p0">The p0.</param>
46+ /// <param name="p1">The p1.</param>
47+ /// <param name="p2">The p2.</param>
48+ /// <param name="p3">The p3.</param>
49+ /// <param name="fill">The fill.</param>
50+ /// <returns>Array of floats representing a solid quad.</returns>
3751 internal static float [ ] BuildSolidQuad (
3852 ( int x , int y ) p0 ,
3953 ( int x , int y ) p1 ,
@@ -53,6 +67,13 @@ internal static float[] BuildSolidQuad(
5367 } ;
5468 }
5569
70+ /// <summary>
71+ /// Builds the colored triangle.
72+ /// </summary>
73+ /// <param name="p0">The p0.</param>
74+ /// <param name="p1">The p1.</param>
75+ /// <param name="p2">The p2.</param>
76+ /// <returns>Array of floats representing a colored triangle.</returns>
5677 public static float [ ] BuildColoredTriangle (
5778 ( float x , float y , int r , int g , int b , int a ) p0 ,
5879 ( float x , float y , int r , int g , int b , int a ) p1 ,
@@ -66,6 +87,14 @@ public static float[] BuildColoredTriangle(
6687 } ;
6788 }
6889
90+ /// <summary>
91+ /// Builds the textured quad.
92+ /// </summary>
93+ /// <param name="p0">The p0.</param>
94+ /// <param name="p1">The p1.</param>
95+ /// <param name="p2">The p2.</param>
96+ /// <param name="p3">The p3.</param>
97+ /// <returns>Array of floats representing a textured quad.</returns>
6998 public static float [ ] BuildTexturedQuad (
7099 ( int x , int y ) p0 ,
71100 ( int x , int y ) p1 ,
@@ -79,6 +108,12 @@ public static float[] BuildTexturedQuad(
79108 } ;
80109 }
81110
111+ /// <summary>
112+ /// Builds the polyline.
113+ /// </summary>
114+ /// <param name="points">The points.</param>
115+ /// <param name="color">The color.</param>
116+ /// <returns>Array of floats representing a polyline.</returns>
82117 internal static ( float x , float y , int r , int g , int b , int a ) [ ] BuildPolyline (
83118 ReadOnlySpan < ( float x , float y ) > points ,
84119 ( int r , int g , int b , int a ) color )
@@ -98,6 +133,15 @@ internal static (float x, float y, int r, int g, int b, int a)[] BuildPolyline(
98133 return data ;
99134 }
100135
136+ /// <summary>
137+ /// Builds the rect outline.
138+ /// </summary>
139+ /// <param name="x">The x.</param>
140+ /// <param name="y">The y.</param>
141+ /// <param name="w">The w.</param>
142+ /// <param name="h">The h.</param>
143+ /// <param name="color">The color.</param>
144+ /// <returns>Array of floats representing a rectangle outline.</returns>
101145 public static ( float x , float y , int r , int g , int b , int a ) [ ]
102146 BuildRectOutline (
103147 float x , float y ,
@@ -110,6 +154,15 @@ public static (float x, float y, int r, int g, int b, int a)[]
110154 }
111155
112156
157+ /// <summary>
158+ /// Builds the circle outline.
159+ /// </summary>
160+ /// <param name="cx">The cx.</param>
161+ /// <param name="cy">The cy.</param>
162+ /// <param name="radius">The radius.</param>
163+ /// <param name="segments">The segments.</param>
164+ /// <param name="color">The color.</param>
165+ /// <returns>Array of floats representing a circle outline.</returns>
113166 internal static ( float x , float y , int r , int g , int b , int a ) [ ] BuildCircleOutline (
114167 float cx , float cy ,
115168 float radius ,
0 commit comments