Rev 313 | Blame | Compare with Previous | Last modification | View Log | RSS feed
================================================================================= Documentation for the libggi-based draw library =================================================================================Requirements to use the draw library:1. Install libggiInstalling ggi from rpm's: (SuSE, CentOS, Red Hat, etc)============================================================As root, run something similar to the following:rpm -ivh libgii-0.9.2-1su100.i586.rpm libgii-devel-0.9.2-1su100.i586.rpmrpm -ivh libggi-2.1.2-1su100.i586.rpm libggi-devel-2.1.2-1su100.i586.rpmInstalling ggi from ebuild: (Gentoo)============================================================USE="fbcon" emerge libggiInstalling ggi from deb: (Debian)============================================================apt-get install libggi2apt-get install libggi-target-fbdev================================================================================= How to compile: =================================================================================All Code:============================================================Copy draw.h and draw.c into your source folder.#include "draw.h" in your source code.When you compile your program, include draw.c in the compile command.(See draw_test.c and draw_test.cpp for examples)C Code:============================================================gcc draw.c your_prog.c -lggi -o your_progC++ Code:============================================================g++ draw.c your_prog.cpp -lggi -o your_progTest Programs: (included with this distrobution)============================================================cd /path/to/drawmake================================================================================= Functions supported by the draw library: =================================================================================Colors:============================================================BLACKAQUABLUEFUCHSIAGRAYGREENLIMEMAROONNAVYOLIVEPURPLEREDSILVERTEALWHITEYELLOWThese can be used anywhere where a color is required. They are defined indraw.h for you. Note that you can also use integer numbers to representthese colors. You can find out the correspondence by looking in draw.h.Functions:============================================================draw_init ()This function must be called at the beginning of the programin order to setup the screen for rendering.draw_close ()This function must be called at the end of your program inorder to return control of the screen to the Linux console.draw_clearscreen ()This function makes the entire screen black.draw_putpixel (int x, int y, int color)This function puts a pixel on the screen at position (x, y)in the color given. Use 0-15 for the colors, or use thecolors that are defined in draw.h.draw_box (int x, int y, int width, int height, int color)This function draws a solid box with the upper-left cornerat position (x, y) and the dimensions width x height. Itwill be drawn in the color given.draw_line (int x1, int y1, int x2, int y2, int color)This function draws a line from point (x1, y1) to point(x2, y2) in the color given.draw_putc (int x, int y, char c, int color)This function draws a single character on screen in asingle-size monospaced font. The upper-left corner willbe at position (x, y). The character will be drawnin the color given.draw_puts (int x, int y, char *str, color)This function draws a string on screen in a single-sizemonospaced font. The upper-left corner of the string willbe at position (x, y). The character will be drawn in thecolor given.