| 262 | |
| 263 | template<typename T> |
| 264 | static void drawRectangle(const Rectangle<T>& rect, const bool outline) |
| 265 | { |
| 266 | DISTRHO_SAFE_ASSERT_RETURN(rect.isValid(),); |
| 267 | |
| 268 | glBegin(outline ? GL_LINE_LOOP : GL_QUADS); |
| 269 | |
| 270 | { |
| 271 | const T x = rect.getX(); |
| 272 | const T y = rect.getY(); |
| 273 | const T w = rect.getWidth(); |
| 274 | const T h = rect.getHeight(); |
| 275 | |
| 276 | glTexCoord2f(0.0f, 0.0f); |
| 277 | glVertex2d(x, y); |
| 278 | |
| 279 | glTexCoord2f(1.0f, 0.0f); |
| 280 | glVertex2d(x+w, y); |
| 281 | |
| 282 | glTexCoord2f(1.0f, 1.0f); |
| 283 | glVertex2d(x+w, y+h); |
| 284 | |
| 285 | glTexCoord2f(0.0f, 1.0f); |
| 286 | glVertex2d(x, y+h); |
| 287 | } |
| 288 | |
| 289 | glEnd(); |
| 290 | } |
| 291 | |
| 292 | template<typename T> |
| 293 | void Rectangle<T>::draw(const GraphicsContext& context) |