Visualizer helper class for drawing a rectangle in an OpenGL context.
More...
#include <Rectangle.h>
|
static void | draw (float _left=-0.5, float _right=0.5, float _top=0.5, float _bottom=-0.5) |
| Draw rectangle from border coordinates. More...
|
|
static void | draw (QSize const &_size) |
|
static void | draw (QRectF const &) |
| Draw rectangle from given QRectF. More...
|
|
static void | drawFlipped (float _left=-0.5, float _right=0.5, float _top=0.5, float _bottom=-0.5) |
| Draw rectangle from border coordinates, flipped on y axis version. More...
|
|
static void | drawFlipped (QRectF const &) |
| Draw rectangle from given QRectF, flipped on y axis version. More...
|
|
Visualizer helper class for drawing a rectangle in an OpenGL context.
void omni::visual::Rectangle::draw |
( |
float |
_left = -0.5 , |
|
|
float |
_right = 0.5 , |
|
|
float |
_top = 0.5 , |
|
|
float |
_bottom = -0.5 |
|
) |
| |
|
static |
Draw rectangle from border coordinates.
32 glTexCoord2f(0.0f, 1.0f);
33 glVertex2f(_left, _bottom);
34 glTexCoord2f(1.0f, 1.0f);
35 glVertex2f(_right, _bottom);
36 glTexCoord2f(1.0f, 0.0f);
37 glVertex2f(_right, _top);
38 glTexCoord2f(0.0f, 0.0f);
39 glVertex2f(_left, _top);
void omni::visual::Rectangle::draw |
( |
QSize const & |
_size | ) |
|
|
static |
48 int _w = _size.width();
49 int _h = _size.height();
50 glTexCoord2f(0.0f, _h);
51 glVertex2f(-0.5, -0.5);
53 glVertex2f(0.5, -0.5);
54 glTexCoord2f(_w, 0.0f);
56 glTexCoord2f(0.0f, 0.0f);
57 glVertex2f(-0.5, 0.5);
void withCurrentContext(ContextFunctor f)
Do OpenGL operations with current context, if it exists.
Definition: ContextSwitch.cpp:45
void omni::visual::Rectangle::draw |
( |
QRectF const & |
_rect | ) |
|
|
static |
Draw rectangle from given QRectF.
65 Rectangle::draw(_rect.left(), _rect.right(), _rect.top(), _rect.bottom());
static void draw(float _left=-0.5, float _right=0.5, float _top=0.5, float _bottom=-0.5)
Draw rectangle from border coordinates.
Definition: Rectangle.cpp:28
void omni::visual::Rectangle::drawFlipped |
( |
float |
_left = -0.5 , |
|
|
float |
_right = 0.5 , |
|
|
float |
_top = 0.5 , |
|
|
float |
_bottom = -0.5 |
|
) |
| |
|
static |
Draw rectangle from border coordinates, flipped on y axis version.
75 glTexCoord2f(0.0f, 0.0f);
76 glVertex2f(_left, _bottom);
77 glTexCoord2f(1.0f, 0.0f);
78 glVertex2f(_right, _bottom);
79 glTexCoord2f(1.0f, 1.0f);
80 glVertex2f(_right, _top);
81 glTexCoord2f(0.0f, 1.0f);
82 glVertex2f(_left, _top);
void omni::visual::Rectangle::drawFlipped |
( |
QRectF const & |
_rect | ) |
|
|
static |
Draw rectangle from given QRectF, flipped on y axis version.
90 _rect.top(), _rect.bottom());
static void drawFlipped(float _left=-0.5, float _right=0.5, float _top=0.5, float _bottom=-0.5)
Draw rectangle from border coordinates, flipped on y axis version.
Definition: Rectangle.cpp:68
The documentation for this struct was generated from the following files: