| 271 | } |
| 272 | |
| 273 | void DrawUtilities::rectangle(const Vector3f & color, const Vector2f & tl, const Vector2f & br, bool fill, float alpha, const Viewport & vp) |
| 274 | { |
| 275 | auto rectangleMesh = std::make_shared<Mesh>(); |
| 276 | |
| 277 | rectangleMesh->vertices({ |
| 278 | { tl.x(), tl.y() , 0 }, |
| 279 | { tl.x(), br.y() , 0 }, |
| 280 | { br.x(), br.y() , 0 }, |
| 281 | { br.x(), tl.y() , 0 } |
| 282 | }); |
| 283 | |
| 284 | if (fill) { |
| 285 | rectangleMesh->triangles({ |
| 286 | { 0,1,2 }, |
| 287 | { 0,2,3 } |
| 288 | }); |
| 289 | |
| 290 | baseRendering(*rectangleMesh, Mesh::FillRenderMode, color, { 0,0 }, { 1,1 }, alpha, vp); |
| 291 | } |
| 292 | |
| 293 | rectangleMesh->triangles({ |
| 294 | { 0,0,1 },{ 1,1,2 },{ 2,2,3 },{ 3,3,0 } |
| 295 | }); |
| 296 | |
| 297 | baseRendering(*rectangleMesh, Mesh::LineRenderMode, color, { 0,0 }, { 1,1 }, 1.0f, vp); |
| 298 | } |
| 299 | |
| 300 | void DrawUtilities::rectanglePixels(const Vector3f & color, const Vector2f & center, const Vector2f & diagonalPixs, bool fill, float alpha, const Viewport & vp) |
| 301 | { |
no test coverage detected