VGL(3)

NAME
vgl - Video Graphics Library functions

SYNOPSIS
#include <vgl.h>

DESCRIPTION
Libvgl is a library that enables the programmer access to the graphics modes supported by the console driver (syscons). The library takes care of programming the actual video hardware, and provides a number of simple functions to do various graphic operations. There is also support for a mouse via the standard mouse system in FreeBSD, see moused() , including the ability to transparently have a mouse pointer superimposed on the graphic image currently being worked on. The library takes care of screen switching by storing the current image in memory before switching to another virtual console, and restoring when the user switches back. This allows several graphic applications at once, but on different virtual consoles. Below is a short description of the various functions:

AUTHORS
Søren Schmidt <sos@FreeBSD.org>

FUNCTIONS
int VGLInit(int mode) Initialize the library and set up the graphic mode mode. void VGLEnd(void) Terminate graphic mode, and restore the screenmode that was active before VGLInit() was called. void VGLCheckSwitch(void) If the program goes into longer periods of processing without doing any graphics output, calling this function occasionally will allow the system to switch screens. int VGLTextSetFontFile(char *filename) Instruct the char/string functions to use the font in file filename instead of the builtin font. int VGLMouseInit(int mode) Initialize the mouse. The optional on-screen mouse pointer is shown if the argument is VGL_MOUSESHOW. void VGLMouseMode(int mode) Either shows the mouse pointer if the argument is VGL_MOUSESHOW , or hides the mouse pointer if the argument is VGL_MOUSEHIDE. int VGLMouseStatus(int *x, int *y, char *buttons) Returns the current mouse pointer coordinates and button state in x, y , buttons. The return value reflects if the mouse pointer is currently shown on screen or not. void VGLMouseSetImage(VGLBitmap *AndMask, VGLBitmap *OrMask) With this function it is possible to change the image of the mouse pointer on screen. void VGLMouseSetStdImage(void) This function restores the mouse pointer to the standard arrow. void VGLLine(VGLBitmap *object, int x1, int y1, int x2, int y2, byte color) Draw a line from x1, y1 to x2, y2 in color color. void VGLBox(VGLBitmap *object, int x1, int y1, int x2, int y2, byte color) Draw a box with upper left hand corner at x1, y1 and lower right hand corner at x2, y2 in color color. void VGLFilledBox(VGLBitmap *object, int x1, int y1, int x2, int y2, byte color) Draw a filled (solid) box with upper left hand corner at x1, y1 and lower right hand corner at x2, y2 in color color. void VGLEllipse(VGLBitmap *object, int xc, int yc, int a, int b, byte color) Draw an ellipse centered at xc, yc make it a pixels wide, and b pixels high in color color. void VGLFilledEllipse(VGLBitmap *object, int xc, int yc, int a, int b, byte color) Draw a filled (solid) ellipse centered at xc, yc make it a pixels wide, and b pixels high in color color. int VGLBitmapCopy(VGLBitmap *src, int srcx, int srcy, VGLBitmap *dst, int dstx, int dsty, int width, int hight) Copy a rectangle of pixels from bitmap src upper left hand corner at srcx, srcy to bitmap dst at dstx, dsty of the size width, height. void VGLBitmapPutChar(VGLBitmap *Object, int x, int y, byte ch, byte fgcol, byte bgcol, int fill, int dir) Write the character ch at position x, y in foreground color fgcol. If fill is != 0, use the color bgcol as background otherwise the background is transparent. The character is drawn in the direction specified by the argument dir. void VGLBitmapString(VGLBitmap *Object, int x, int y, char *str, byte fgcol, byte bgcol, int fill, int dir) Write the string str at position x, y in foreground color fgcol. If fill is != 0, use the color bgcol as background otherwise the background is transparent. The string is drawn in the direction specified by the argument dir. void VGLClear(VGLBitmap *object, byte color) Clears the entire bitmap to color color. void VGLSetPalette(byte *red, byte *green, byte *blue) This function sets the palette used, the arguments red, green, blue should point to byte arrays of 256 positions each. void VGLSetPaletteIndex(byte color, byte red, byte green, byte blue) Set the palette index color to the specified RGB value. void VGLSetBorder(byte color) Set the border color to color color. void VGLBlankDisplay(int blank) Blank the display if the argment blank != 0. This can be done to shut off the screen during display updates that the user should first see when it's done.

HISTORY
The vgl library appeared in FreeBSD 3.0