Primitives drawing class. More...
#include <draw.h>
Static Public Member Functions | |
Operations | |
static void | point (CL_GraphicContext &gc, float x1, float y1, const CL_Colorf &color) |
Draw a point. | |
static void | point (CL_GraphicContext &gc, const CL_Pointf &point, const CL_Colorf &color) |
Point. | |
static void | line (CL_GraphicContext &gc, float x1, float y1, float x2, float y2, const CL_Colorf &color) |
Draw a line. | |
static void | line (CL_GraphicContext &gc, const CL_Pointf &start, const CL_Pointf &end, const CL_Colorf &color) |
Line. | |
static void | line (CL_GraphicContext &gc, const CL_LineSegment2f &line_segment, const CL_Colorf &color) |
Line. | |
static void | box (CL_GraphicContext &gc, float x1, float y1, float x2, float y2, const CL_Colorf &color) |
Draw a box / rectangle. | |
static void | box (CL_GraphicContext &gc, const CL_Pointf &start, const CL_Pointf &end, const CL_Colorf &color) |
Box. | |
static void | box (CL_GraphicContext &gc, const CL_Rectf &rect, const CL_Colorf &color) |
Box. | |
static void | fill (CL_GraphicContext &gc, float x1, float y1, float x2, float y2, const CL_Colorf &color) |
Draw a filled box / rectangle. | |
static void | fill (CL_GraphicContext &gc, const CL_Pointf &start, const CL_Pointf &end, const CL_Colorf &color) |
Fill. | |
static void | fill (CL_GraphicContext &gc, const CL_Rectf &rect, const CL_Colorf &color) |
Fill. | |
static void | texture (CL_GraphicContext &gc, const CL_Rectf &rect, const CL_Colorf &color=CL_Colorf::white, const CL_Rectf &texture_unit1_coords=CL_Rectf(0.0, 0.0, 1.0, 1.0)) |
Draw a textured rectangle with the selected texture at unit 0. | |
static void | texture (CL_GraphicContext &gc, const CL_Texture &texture, const CL_Quadf &quad, const CL_Colorf &color=CL_Colorf::white, const CL_Rectf &texture_unit1_coords=CL_Rectf(0.0, 0.0, 1.0, 1.0)) |
Draw a textured rectangle. | |
static void | gradient_fill (CL_GraphicContext &gc, float x1, float y1, float x2, float y2, const CL_Gradient &color) |
Gradient fill. | |
static void | gradient_fill (CL_GraphicContext &gc, const CL_Pointf &start, const CL_Pointf &end, const CL_Gradient &gradient) |
Gradient fill. | |
static void | gradient_fill (CL_GraphicContext &gc, const CL_Rectf &rect, const CL_Gradient &gradient) |
Gradient fill. | |
static void | circle (CL_GraphicContext &gc, float center_x, float center_y, float radius, const CL_Colorf &color) |
Draw a circle. | |
static void | circle (CL_GraphicContext &gc, const CL_Pointf ¢er, float radius, const CL_Colorf &color) |
Circle. | |
static void | gradient_circle (CL_GraphicContext &gc, const CL_Pointf ¢er, float radius, const CL_Gradient &gradient) |
Gradient circle. | |
static void | gradient_circle (CL_GraphicContext &gc, const CL_Pointf ¢er, const CL_Pointf ¢ergradient, float radius, const CL_Gradient &gradient) |
Gradient circle. | |
static void | triangle (CL_GraphicContext &gc, const CL_Pointf &a, const CL_Pointf &b, const CL_Pointf &c, const CL_Colorf &color) |
Draw a triangle. | |
static void | triangle (CL_GraphicContext &gc, const CL_Trianglef &dest_triangle, const CL_Colorf &color) |
Draw a triangle. |
Primitives drawing class.
static void CL_Draw::box | ( | CL_GraphicContext & | gc, | |
float | x1, | |||
float | y1, | |||
float | x2, | |||
float | y2, | |||
const CL_Colorf & | color | |||
) | [static] |
Draw a box / rectangle.
static void CL_Draw::box | ( | CL_GraphicContext & | gc, | |
const CL_Rectf & | rect, | |||
const CL_Colorf & | color | |||
) | [static] |
Box.
gc | = Graphic Context | |
rect | = Rectf | |
color | = Colorf |
static void CL_Draw::box | ( | CL_GraphicContext & | gc, | |
const CL_Pointf & | start, | |||
const CL_Pointf & | end, | |||
const CL_Colorf & | color | |||
) | [static] |
Box.
gc | = Graphic Context | |
start | = Pointf | |
end | = Pointf | |
color | = Colorf |
static void CL_Draw::circle | ( | CL_GraphicContext & | gc, | |
float | center_x, | |||
float | center_y, | |||
float | radius, | |||
const CL_Colorf & | color | |||
) | [static] |
Draw a circle.
static void CL_Draw::circle | ( | CL_GraphicContext & | gc, | |
const CL_Pointf & | center, | |||
float | radius, | |||
const CL_Colorf & | color | |||
) | [static] |
Circle.
gc | = Graphic Context | |
center | = Pointf | |
radius | = value | |
color | = Colorf |
static void CL_Draw::fill | ( | CL_GraphicContext & | gc, | |
float | x1, | |||
float | y1, | |||
float | x2, | |||
float | y2, | |||
const CL_Colorf & | color | |||
) | [static] |
Draw a filled box / rectangle.
static void CL_Draw::fill | ( | CL_GraphicContext & | gc, | |
const CL_Pointf & | start, | |||
const CL_Pointf & | end, | |||
const CL_Colorf & | color | |||
) | [static] |
Fill.
gc | = Graphic Context | |
start | = Pointf | |
end | = Pointf | |
color | = Colorf |
static void CL_Draw::fill | ( | CL_GraphicContext & | gc, | |
const CL_Rectf & | rect, | |||
const CL_Colorf & | color | |||
) | [static] |
Fill.
gc | = Graphic Context | |
rect | = Rectf | |
color | = Colorf |
static void CL_Draw::gradient_circle | ( | CL_GraphicContext & | gc, | |
const CL_Pointf & | center, | |||
float | radius, | |||
const CL_Gradient & | gradient | |||
) | [static] |
Gradient circle.
gc | = Graphic Context | |
center | = Pointf | |
radius | = value | |
gradient | = Gradient |
static void CL_Draw::gradient_circle | ( | CL_GraphicContext & | gc, | |
const CL_Pointf & | center, | |||
const CL_Pointf & | centergradient, | |||
float | radius, | |||
const CL_Gradient & | gradient | |||
) | [static] |
Gradient circle.
gc | = Graphic Context | |
center | = Pointf | |
centergradient | = Pointf | |
radius | = value | |
gradient | = Gradient |
static void CL_Draw::gradient_fill | ( | CL_GraphicContext & | gc, | |
const CL_Rectf & | rect, | |||
const CL_Gradient & | gradient | |||
) | [static] |
Gradient fill.
gc | = Graphic Context | |
rect | = Rectf | |
gradient | = Gradient |
static void CL_Draw::gradient_fill | ( | CL_GraphicContext & | gc, | |
float | x1, | |||
float | y1, | |||
float | x2, | |||
float | y2, | |||
const CL_Gradient & | color | |||
) | [static] |
Gradient fill.
gc | = Graphic Context | |
x1 | = value | |
y1 | = value | |
x2 | = value | |
y2 | = value | |
color | = Gradient |
static void CL_Draw::gradient_fill | ( | CL_GraphicContext & | gc, | |
const CL_Pointf & | start, | |||
const CL_Pointf & | end, | |||
const CL_Gradient & | gradient | |||
) | [static] |
Gradient fill.
gc | = Graphic Context | |
start | = Pointf | |
end | = Pointf | |
gradient | = Gradient |
static void CL_Draw::line | ( | CL_GraphicContext & | gc, | |
float | x1, | |||
float | y1, | |||
float | x2, | |||
float | y2, | |||
const CL_Colorf & | color | |||
) | [static] |
Draw a line.
static void CL_Draw::line | ( | CL_GraphicContext & | gc, | |
const CL_Pointf & | start, | |||
const CL_Pointf & | end, | |||
const CL_Colorf & | color | |||
) | [static] |
Line.
gc | = Graphic Context | |
start | = Pointf | |
end | = Pointf | |
color | = Colorf |
static void CL_Draw::line | ( | CL_GraphicContext & | gc, | |
const CL_LineSegment2f & | line_segment, | |||
const CL_Colorf & | color | |||
) | [static] |
Line.
gc | = Graphic Context | |
line_segment | = The line | |
color | = Colorf |
static void CL_Draw::point | ( | CL_GraphicContext & | gc, | |
const CL_Pointf & | point, | |||
const CL_Colorf & | color | |||
) | [static] |
Point.
gc | = Graphic Context | |
point | = Pointf | |
color | = Colorf |
static void CL_Draw::point | ( | CL_GraphicContext & | gc, | |
float | x1, | |||
float | y1, | |||
const CL_Colorf & | color | |||
) | [static] |
Draw a point.
static void CL_Draw::texture | ( | CL_GraphicContext & | gc, | |
const CL_Texture & | texture, | |||
const CL_Quadf & | quad, | |||
const CL_Colorf & | color = CL_Colorf::white , |
|||
const CL_Rectf & | texture_unit1_coords = CL_Rectf(0.0, 0.0, 1.0, 1.0) | |||
) | [static] |
Draw a textured rectangle.
This is a convenience function. If using repeatedly, it is a lot faster to use CL_PrimitivesArray with gc.draw_primitives instead
static void CL_Draw::texture | ( | CL_GraphicContext & | gc, | |
const CL_Rectf & | rect, | |||
const CL_Colorf & | color = CL_Colorf::white , |
|||
const CL_Rectf & | texture_unit1_coords = CL_Rectf(0.0, 0.0, 1.0, 1.0) | |||
) | [static] |
Draw a textured rectangle with the selected texture at unit 0.
Usage: gc.set_texture(0, texture); CL_Draw::texture(gc, rect, ...); gc.reset_texture(0);
It is recommended to use CL_Image draw function instead of this function. CL_Image is faster because it internally batch draws
static void CL_Draw::triangle | ( | CL_GraphicContext & | gc, | |
const CL_Trianglef & | dest_triangle, | |||
const CL_Colorf & | color | |||
) | [static] |
Draw a triangle.
static void CL_Draw::triangle | ( | CL_GraphicContext & | gc, | |
const CL_Pointf & | a, | |||
const CL_Pointf & | b, | |||
const CL_Pointf & | c, | |||
const CL_Colorf & | color | |||
) | [static] |
Draw a triangle.