ClanLib  2.3.7
List of all members
CL_Draw Class Reference

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. More...
 
static void point (CL_GraphicContext &gc, const CL_Pointf &point, const CL_Colorf &color)
 Point. More...
 
static void line (CL_GraphicContext &gc, float x1, float y1, float x2, float y2, const CL_Colorf &color)
 Draw a line. More...
 
static void line (CL_GraphicContext &gc, const CL_Pointf &start, const CL_Pointf &end, const CL_Colorf &color)
 Line. More...
 
static void line (CL_GraphicContext &gc, const CL_LineSegment2f &line_segment, const CL_Colorf &color)
 Line. More...
 
static void box (CL_GraphicContext &gc, float x1, float y1, float x2, float y2, const CL_Colorf &color)
 Draw a box / rectangle. More...
 
static void box (CL_GraphicContext &gc, const CL_Pointf &start, const CL_Pointf &end, const CL_Colorf &color)
 Box. More...
 
static void box (CL_GraphicContext &gc, const CL_Rectf &rect, const CL_Colorf &color)
 Box. More...
 
static void fill (CL_GraphicContext &gc, float x1, float y1, float x2, float y2, const CL_Colorf &color)
 Draw a filled box / rectangle. More...
 
static void fill (CL_GraphicContext &gc, const CL_Pointf &start, const CL_Pointf &end, const CL_Colorf &color)
 Fill. More...
 
static void fill (CL_GraphicContext &gc, const CL_Rectf &rect, const CL_Colorf &color)
 Fill. More...
 
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. More...
 
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. More...
 
static void gradient_fill (CL_GraphicContext &gc, float x1, float y1, float x2, float y2, const CL_Gradient &color)
 Gradient fill. More...
 
static void gradient_fill (CL_GraphicContext &gc, const CL_Pointf &start, const CL_Pointf &end, const CL_Gradient &gradient)
 Gradient fill. More...
 
static void gradient_fill (CL_GraphicContext &gc, const CL_Rectf &rect, const CL_Gradient &gradient)
 Gradient fill. More...
 
static void circle (CL_GraphicContext &gc, float center_x, float center_y, float radius, const CL_Colorf &color)
 Draw a circle. More...
 
static void circle (CL_GraphicContext &gc, const CL_Pointf &center, float radius, const CL_Colorf &color)
 Circle. More...
 
static void gradient_circle (CL_GraphicContext &gc, const CL_Pointf &center, float radius, const CL_Gradient &gradient)
 Gradient circle. More...
 
static void gradient_circle (CL_GraphicContext &gc, const CL_Pointf &center, const CL_Pointf &centergradient, float radius, const CL_Gradient &gradient)
 Gradient circle. More...
 
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. More...
 
static void triangle (CL_GraphicContext &gc, const CL_Trianglef &dest_triangle, const CL_Colorf &color)
 Draw a triangle. More...
 

Detailed Description

Primitives drawing class.

Member Function Documentation

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_Pointf start,
const CL_Pointf end,
const CL_Colorf color 
)
static

Box.

Parameters
gc= Graphic Context
start= Pointf
end= Pointf
color= Colorf
static void CL_Draw::box ( CL_GraphicContext gc,
const CL_Rectf rect,
const CL_Colorf color 
)
static

Box.

Parameters
gc= Graphic Context
rect= Rectf
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.

Parameters
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.

Parameters
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.

Parameters
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.

Parameters
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.

Parameters
gc= Graphic Context
center= Pointf
centergradient= Pointf
radius= value
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.

Parameters
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.

Parameters
gc= Graphic Context
start= Pointf
end= Pointf
gradient= Gradient
static void CL_Draw::gradient_fill ( CL_GraphicContext gc,
const CL_Rectf rect,
const CL_Gradient gradient 
)
static

Gradient fill.

Parameters
gc= Graphic Context
rect= Rectf
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.

Parameters
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.

Parameters
gc= Graphic Context
line_segment= The line
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::point ( CL_GraphicContext gc,
const CL_Pointf point,
const CL_Colorf color 
)
static

Point.

Parameters
gc= Graphic Context
point= Pointf
color= Colorf
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::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::triangle ( CL_GraphicContext gc,
const CL_Pointf a,
const CL_Pointf b,
const CL_Pointf c,
const CL_Colorf color 
)
static

Draw a triangle.

static void CL_Draw::triangle ( CL_GraphicContext gc,
const CL_Trianglef dest_triangle,
const CL_Colorf color 
)
static

Draw a triangle.


The documentation for this class was generated from the following file: