| 124 | } |
| 125 | |
| 126 | void OpenGLWrapper::DrawRectangle(Vector2D p1, Vector2D p2) const { |
| 127 | VertexArray buf(2, 4); |
| 128 | buf.Set(0, p1); |
| 129 | buf.Set(1, Vector2D(p2, p1)); |
| 130 | buf.Set(2, p2); |
| 131 | buf.Set(3, Vector2D(p1, p2)); |
| 132 | |
| 133 | // Fill |
| 134 | if (fill_a != 0.f) { |
| 135 | SetModeFill(); |
| 136 | buf.Draw(GL_QUADS, false); |
| 137 | } |
| 138 | // Outline |
| 139 | if (line_a != 0.f) { |
| 140 | SetModeLine(); |
| 141 | buf.Draw(GL_LINE_LOOP); |
| 142 | } |
| 143 | } |
| 144 | |
| 145 | void OpenGLWrapper::DrawTriangle(Vector2D p1, Vector2D p2, Vector2D p3) const { |
| 146 | VertexArray buf(2, 3); |