Next Previous Contents

4. Drawing functions

4.1 Pixels

void ggiPutPixel(ggi_visual_t vis, int x, int y, ggi_pixel color);

void ggiDrawPixel(ggi_visual_t vis, int x, int y);

Draw a pixel at (x,y). Warning: libGGI's ggiPutPixel and ggiDrawPixel are overwritten!

void ggiDrawPixels(ggi_visual_t vis, ggi_coord coords[], uint count);

Draw several pixels.

4.2 Lines

void ggiScanLine(ggi_visual_t vis, int x1, int x2, int y);

Fill a horizontal scanline between (x1,y) and (x2,y) with the current fillcolor/texture.

void ggiScanLines(ggi_visual_t vis, int scanlines[], int starty, uint count);

Fill several horizontal scanlines with the current fillcolor/texture. "scanlines" is an array of "count" start- and endpoints (x1,x2). All scanlines from starty to starty+count will be filled.

void ggiHLine(ggi_visual_t vis, int x1, int x2, int y);

Draw a horizontal line from (x1,y) to (x2,y).

void ggiVLine(ggi_visual_t vis, int x, int y1, int y2);

Draw a vertical line from (x,y1) to (x,y2).

void ggiDrawRect(ggi_visual_t vis, int x1, int y1, int x2, int y2);

void ggiFillRect(ggi_visual_t vis, int x1, int y1, int x2, int y2);

Draw/Fill the rectangle ((x1,y1),(x2,y2)).

void ggiLine(ggi_visual_t vis, int x1, int y1, int x2, int y2);

void ggiLinef(ggi_visual_t vis, ggi_float x1, ggi_float y1, ggi_float x2, ggi_float y2);

Draw a line from (x1,y1) to (x2,y2).

void ggiDrawLines(ggi_visual_t vis, ggi_line lines[], uint count);

Draw several lines.

4.3 Circles and curves

void ggiDrawCircle(ggi_visual_t vis, int x, int y, uint r);

void ggiFillCircle(ggi_visual_t vis, int x, int y, uint r);

Draw/Fill a circle with radius r around (x,y).

void ggiDrawEllipse(ggi_visual_t vis, int x, int y, uint rx, uint ry);

void ggiFillEllipse(ggi_visual_t vis, int x, int y, uint rx, uint ry);

Draw/Fill an ellipse with radius (rx,ry) around (x,y).

void ggiDrawArc(ggi_visual_t vis, int x, int y, uint rx, uint ry, ggi_float start, ggi_float end, ggi_bool close);

Draw an arc with radius (rx,ry) around (x,y) between "start" and "end" (degree). If close is not GGI_FALSE the arc will be closed using the current arc drawing mode.

void ggiFillArc(ggi_visual_t vis, int x, int y, uint rx, uint ry, ggi_float start, ggi_float end);

Fill an arc with radius (rx,ry) around (x,y) between "start" and "end" (degree) using the current arc drawing mode.

void ggiBezier(ggi_visual_t vis, int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4);

Draw a bezier curve.

4.4 Polygons

void ggiTrapezoid(ggi_visual_t vis, int xl1, int xr1, int y1, int xl2, int xr2, int y2);

Fill a trapezoid.

void ggiTriangle(ggi_visual_t vis, int x1, int y1, int x2, int y2, int x3, int y3);

Fill a triangle.

void ggiDrawPoly(ggi_visual_t vis, ggi_coord coords[], uint count);

void ggiFillPoly(ggi_visual_t vis, ggi_coord coords[], uint count);

Draw/Fill a polygon. The polygon may be self overlapping.

void ggiFillPolys(ggi_visual_t vis, ggi_coord coords[], uint counts[], uint count);

Fill several polygons. The polygon may be overlapping.

4.5 Blitting functions

void ggiBlit(ggi_visual_t vis, int dx, int dy, ggi_visual src, int sx, int sy, int width, int height);

void ggiStretchBlit(ggi_visual dest, int dx, int dy, int dwidth, int dheight, ggi_visual src, int sx, int sy, int swidth, int sheight);

Copy the rectangular area ((sx,sy),(sx+width,sy+height)) from "src" to (dx,dy). ggiStretchBlit() can scale the image.

void ggiBlitTrans(ggi_visual dest, int dx, int dy, ggi_visual src, int sx, int sy, int width, int height, ggi_col transcol);

void ggiStretchBlitTrans(ggi_visual dest, int dx, int dy, int dwidth, int dheight,ggi_visual src, int sx, int sy, int swidth, int sheight,ggi_col transcol);

Copy the rectangular area ((sx,sy),(sx+width,sy+height)) from "src" to (dx,dy). Pixels with color "transcol" are not drawn. ggiStretchBlitTrans() can scale the image.

void ggiBlitOp(ggi_visual dest, int dx, int dy, ggi_visual src1, ggi_visual src2, int sx, int sy, int width, int height, ggi_operator op);

void ggiStretchBlitOp(ggi_visual dest, int dx, int dy, int dwidth, int dheight, ggi_visual src1, ggi_visual src2, int sx, int sy, int swidth, int sheight, ggi_operator op);

Apply the operator "op" to all pixels of the rectangular areas ((sx,sy),(sx+width,sy+height)) of "src1" and "src2" and draw them only if the result is not 0. ggiStretchBlitOp() can scale the image.


Next Previous Contents