]> git.localhorst.tv Git - space.git/blobdiff - src/graphics/Canvas.cpp
Vector<int> : SDL_Point optimization
[space.git] / src / graphics / Canvas.cpp
index 45997c6b3d3ad92cac6b5c38e6ff29ec570b3b71..e4befc0bf04886003dc3d8f04ce409c0d5f15c46 100644 (file)
@@ -95,6 +95,16 @@ void Canvas::Cross(Vector<int> pos, int extent) {
                Vector<int>(pos.x, pos.y + extent));
 }
 
+void Canvas::Triangle(Vector<int> v1, Vector<int> v2, Vector<int> v3) {
+       SDL_Point points[4] = { v1, v2, v3, v1 };
+       SDL_RenderDrawPoints(canv, points, 4);
+}
+
+void Canvas::Quad(Vector<int> v1, Vector<int> v2, Vector<int> v3, Vector<int> v4) {
+       SDL_Point points[5] = { v1, v2, v3, v4, v1 };
+       SDL_RenderDrawPoints(canv, points, 5);
+}
+
 
 namespace {