1997-08-17 21:09:35 +00:00
|
|
|
|
.\" Copyright (c) 1997 S<>ren Schmidt
|
|
|
|
|
.\" All rights reserved.
|
2001-07-15 07:53:42 +00:00
|
|
|
|
.\"
|
1997-08-17 21:09:35 +00:00
|
|
|
|
.\" Redistribution and use in source and binary forms, with or without
|
|
|
|
|
.\" modification, are permitted provided that the following conditions
|
|
|
|
|
.\" are met:
|
|
|
|
|
.\" 1. Redistributions of source code must retain the above copyright
|
|
|
|
|
.\" notice, this list of conditions and the following disclaimer,
|
|
|
|
|
.\" in this position and unchanged.
|
|
|
|
|
.\" 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
|
.\" notice, this list of conditions and the following disclaimer in the
|
|
|
|
|
.\" documentation and/or other materials provided with the distribution.
|
|
|
|
|
.\" 3. The name of the author may not be used to endorse or promote products
|
2001-08-07 12:47:57 +00:00
|
|
|
|
.\" derived from this software without specific prior written permission.
|
2001-07-15 07:53:42 +00:00
|
|
|
|
.\"
|
1997-08-17 21:09:35 +00:00
|
|
|
|
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
|
|
|
|
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
|
|
|
|
.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
|
|
|
|
.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
|
|
|
.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
|
|
|
|
.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
|
|
|
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
|
|
|
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
|
|
|
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
|
|
|
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
2001-07-15 07:53:42 +00:00
|
|
|
|
.\"
|
1999-08-28 00:22:10 +00:00
|
|
|
|
.\" $FreeBSD$
|
1999-11-08 11:37:46 +00:00
|
|
|
|
.Dd November 7, 1999
|
1997-08-17 21:09:35 +00:00
|
|
|
|
.Dt VGL 3
|
2001-07-10 13:41:46 +00:00
|
|
|
|
.Os
|
1997-08-17 21:09:35 +00:00
|
|
|
|
.Sh NAME
|
1999-11-08 11:37:46 +00:00
|
|
|
|
.Nm VGLBitmapAllocateBits ,
|
1999-10-28 15:51:50 +00:00
|
|
|
|
.Nm VGLBitmapCopy ,
|
1999-11-08 11:37:46 +00:00
|
|
|
|
.Nm VGLBitmapCreate ,
|
|
|
|
|
.Nm VGLBitmapDestroy ,
|
1999-10-28 15:51:50 +00:00
|
|
|
|
.Nm VGLBitmapPutChar ,
|
|
|
|
|
.Nm VGLBitmapString ,
|
|
|
|
|
.Nm VGLBlankDisplay ,
|
|
|
|
|
.Nm VGLBox ,
|
|
|
|
|
.Nm VGLCheckSwitch ,
|
|
|
|
|
.Nm VGLClear ,
|
|
|
|
|
.Nm VGLEllipse ,
|
|
|
|
|
.Nm VGLEnd ,
|
|
|
|
|
.Nm VGLFilledBox ,
|
|
|
|
|
.Nm VGLFilledEllipse ,
|
1999-12-13 10:48:22 +00:00
|
|
|
|
.Nm VGLGetXY ,
|
1999-10-28 15:51:50 +00:00
|
|
|
|
.Nm VGLInit ,
|
|
|
|
|
.Nm VGLLine ,
|
1999-11-08 11:37:46 +00:00
|
|
|
|
.Nm VGLKeyboardInit ,
|
|
|
|
|
.Nm VGLKeyboardEnd ,
|
|
|
|
|
.Nm VGLKeyboardGetCh ,
|
1999-10-28 15:51:50 +00:00
|
|
|
|
.Nm VGLMouseInit ,
|
|
|
|
|
.Nm VGLMouseMode ,
|
|
|
|
|
.Nm VGLMouseSetImage ,
|
|
|
|
|
.Nm VGLMouseSetStdImage ,
|
|
|
|
|
.Nm VGLMouseStatus ,
|
1999-11-08 11:37:46 +00:00
|
|
|
|
.Nm VGLPanScreen ,
|
1999-10-28 15:51:50 +00:00
|
|
|
|
.Nm VGLSetBorder ,
|
|
|
|
|
.Nm VGLSetPalette ,
|
|
|
|
|
.Nm VGLSetPaletteIndex ,
|
1999-11-08 11:37:46 +00:00
|
|
|
|
.Nm VGLSetVScreenSize ,
|
1999-12-13 10:48:22 +00:00
|
|
|
|
.Nm VGLSetXY ,
|
1999-10-28 15:51:50 +00:00
|
|
|
|
.Nm VGLTextSetFontFile
|
2000-04-22 16:17:38 +00:00
|
|
|
|
.Nd Video Graphics Library functions
|
|
|
|
|
.Sh LIBRARY
|
|
|
|
|
.Lb libvgl
|
1997-08-17 21:09:35 +00:00
|
|
|
|
.Sh SYNOPSIS
|
2001-10-01 16:09:29 +00:00
|
|
|
|
.In sys/fbio.h
|
|
|
|
|
.In sys/consio.h
|
|
|
|
|
.In sys/kbio.h
|
|
|
|
|
.In vgl.h
|
1999-10-28 15:51:50 +00:00
|
|
|
|
.Ft int
|
|
|
|
|
.Fn VGLInit "int mode"
|
2001-07-15 07:53:42 +00:00
|
|
|
|
.Ft void
|
1999-10-28 15:51:50 +00:00
|
|
|
|
.Fn VGLEnd "void"
|
2001-07-15 07:53:42 +00:00
|
|
|
|
.Ft void
|
1999-10-28 15:51:50 +00:00
|
|
|
|
.Fn VGLCheckSwitch "void"
|
2001-07-15 07:53:42 +00:00
|
|
|
|
.Ft int
|
1999-10-28 15:51:50 +00:00
|
|
|
|
.Fn VGLTextSetFontFile "char *filename"
|
1999-11-08 11:37:46 +00:00
|
|
|
|
.Ft int
|
|
|
|
|
.Fn VGLKeyboardInit "int code"
|
|
|
|
|
.Ft void
|
|
|
|
|
.Fn VGLKeyboardEnd "void"
|
|
|
|
|
.Ft int
|
|
|
|
|
.Fn VGLKeyboardGetCh "void"
|
2001-07-15 07:53:42 +00:00
|
|
|
|
.Ft int
|
1999-10-28 15:51:50 +00:00
|
|
|
|
.Fn VGLMouseInit "int mode"
|
2001-07-15 07:53:42 +00:00
|
|
|
|
.Ft void
|
1999-10-28 15:51:50 +00:00
|
|
|
|
.Fn VGLMouseMode "int mode"
|
2001-07-15 07:53:42 +00:00
|
|
|
|
.Ft int
|
1999-10-28 15:51:50 +00:00
|
|
|
|
.Fn VGLMouseStatus "int *x" "int *y" "char *buttons"
|
2001-07-15 07:53:42 +00:00
|
|
|
|
.Ft void
|
1999-10-28 15:51:50 +00:00
|
|
|
|
.Fn VGLMouseSetImage "VGLBitmap *AndMask" "VGLBitmap *OrMask"
|
2001-07-15 07:53:42 +00:00
|
|
|
|
.Ft void
|
1999-10-28 15:51:50 +00:00
|
|
|
|
.Fn VGLMouseSetStdImage "void"
|
2001-07-15 07:53:42 +00:00
|
|
|
|
.Ft byte
|
1999-12-13 10:48:22 +00:00
|
|
|
|
.Fn VGLGetXY "VGLBitmap *object" "int x" "int y"
|
2001-07-15 07:53:42 +00:00
|
|
|
|
.Ft void
|
1999-12-13 10:48:22 +00:00
|
|
|
|
.Fn VGLSetXY "VGLBitmap *object" "int x" "int y" "byte color"
|
2001-07-15 07:53:42 +00:00
|
|
|
|
.Ft void
|
1999-10-28 15:51:50 +00:00
|
|
|
|
.Fn VGLLine "VGLBitmap *object" "int x1" "int y1" "int x2" "int y2" "byte color"
|
2001-07-15 07:53:42 +00:00
|
|
|
|
.Ft void
|
1999-10-28 15:51:50 +00:00
|
|
|
|
.Fn VGLBox "VGLBitmap *object" "int x1" "int y1" "int x2" "int y2" "byte color"
|
2001-07-15 07:53:42 +00:00
|
|
|
|
.Ft void
|
1999-10-28 15:51:50 +00:00
|
|
|
|
.Fn VGLFilledBox "VGLBitmap *object" "int x1" "int y1" "int x2" "int y2" "byte color"
|
2001-07-15 07:53:42 +00:00
|
|
|
|
.Ft void
|
1999-10-28 15:51:50 +00:00
|
|
|
|
.Fn VGLEllipse "VGLBitmap *object" "int xc" "int yc" "int a" "int b" "byte color"
|
2001-07-15 07:53:42 +00:00
|
|
|
|
.Ft void
|
1999-10-28 15:51:50 +00:00
|
|
|
|
.Fn VGLFilledEllipse "VGLBitmap *object" "int xc" "int yc" "int a" "int b" "byte color"
|
1999-11-08 11:37:46 +00:00
|
|
|
|
.Ft VGLBitmap *
|
|
|
|
|
.Fn VGLBitmapCreate "int type" "int xsize" "int ysize" "byte *bits"
|
|
|
|
|
.Ft void
|
|
|
|
|
.Fn VGLBitmapDestroy "VGLBitmap *object"
|
|
|
|
|
.Ft int
|
|
|
|
|
.Fn VGLBitmapAllocateBits "VGLBitmap *object"
|
2001-07-15 07:53:42 +00:00
|
|
|
|
.Ft int
|
1999-10-28 15:51:50 +00:00
|
|
|
|
.Fn VGLBitmapCopy "VGLBitmap *src" "int srcx" "int srcy" "VGLBitmap *dst" "int dstx" "int dsty" "int width" "int hight"
|
2001-07-15 07:53:42 +00:00
|
|
|
|
.Ft void
|
1999-10-28 15:51:50 +00:00
|
|
|
|
.Fn VGLBitmapPutChar "VGLBitmap *Object" "int x" "int y" "byte ch" "byte fgcol" "byte bgcol" "int fill" "int dir"
|
2001-07-15 07:53:42 +00:00
|
|
|
|
.Ft void
|
1999-10-28 15:51:50 +00:00
|
|
|
|
.Fn VGLBitmapString "VGLBitmap *Object" "int x" "int y" "char *str" "byte fgcol" "byte bgcol" "int fill" "int dir"
|
2001-07-15 07:53:42 +00:00
|
|
|
|
.Ft void
|
1999-10-28 15:51:50 +00:00
|
|
|
|
.Fn VGLClear "VGLBitmap *object" "byte color"
|
|
|
|
|
.Ft void
|
|
|
|
|
.Fn VGLSetPalette "byte *red" "byte *green" "byte *blue"
|
2001-07-15 07:53:42 +00:00
|
|
|
|
.Ft void
|
1999-10-28 15:51:50 +00:00
|
|
|
|
.Fn VGLSetPaletteIndex "byte color" "byte red" "byte green" "byte blue"
|
2001-07-15 07:53:42 +00:00
|
|
|
|
.Ft void
|
1999-10-28 15:51:50 +00:00
|
|
|
|
.Fn VGLSetBorder "byte color"
|
1999-11-08 11:37:46 +00:00
|
|
|
|
.Ft int
|
|
|
|
|
.Fn VGLSetVScreenSize "VGLBitmap *object" "int vxsize" "int vysize"
|
|
|
|
|
.Ft int
|
1999-12-23 16:56:27 +00:00
|
|
|
|
.Fn VGLPanScreen "VGLBitmap *object" "int x" "int y"
|
2001-07-15 07:53:42 +00:00
|
|
|
|
.Ft void
|
1999-10-28 15:51:50 +00:00
|
|
|
|
.Fn VGLBlankDisplay "int blank"
|
1997-08-17 21:09:35 +00:00
|
|
|
|
.Sh DESCRIPTION
|
1999-10-28 15:51:50 +00:00
|
|
|
|
.Nm Libvgl
|
|
|
|
|
is a library that enables the programmer access to the graphics
|
1997-08-17 21:09:35 +00:00
|
|
|
|
modes supported by the console driver (syscons). The library takes care of
|
|
|
|
|
programming the actual video hardware, and provides a number of simple
|
2000-03-02 09:14:21 +00:00
|
|
|
|
functions to do various graphic operations.
|
|
|
|
|
There is also support for a
|
1999-10-28 15:51:50 +00:00
|
|
|
|
mouse via the standard mouse system in
|
|
|
|
|
.Fx ,
|
|
|
|
|
see
|
|
|
|
|
.Xr mouse 4 ,
|
|
|
|
|
including the ability to transparently have a mouse pointer superimposed on
|
2001-07-15 07:53:42 +00:00
|
|
|
|
the graphic image currently being worked on.
|
1997-10-22 23:12:27 +00:00
|
|
|
|
The library takes care of screen switching by storing the current image in
|
|
|
|
|
memory before switching to another virtual console, and restoring when the
|
2000-03-02 09:14:21 +00:00
|
|
|
|
user switches back.
|
|
|
|
|
This allows several graphic applications at once, but
|
1997-08-17 21:09:35 +00:00
|
|
|
|
on different virtual consoles.
|
2000-12-29 14:08:20 +00:00
|
|
|
|
.Pp
|
1997-08-17 21:09:35 +00:00
|
|
|
|
Below is a short description of the various functions:
|
1999-10-28 15:51:50 +00:00
|
|
|
|
.Pp
|
|
|
|
|
.Fn VGLInit
|
|
|
|
|
initialize the library and set up the graphic mode
|
2000-01-05 15:16:32 +00:00
|
|
|
|
.Va mode .
|
1999-10-28 15:51:50 +00:00
|
|
|
|
.Pp
|
|
|
|
|
.Fn VGLEnd
|
|
|
|
|
terminate graphic mode, and restore the screenmode that was active before
|
1997-08-17 21:09:35 +00:00
|
|
|
|
.Fn VGLInit
|
|
|
|
|
was called.
|
1999-10-28 15:51:50 +00:00
|
|
|
|
.Pp
|
|
|
|
|
.Fn VGLCheckSwitch
|
|
|
|
|
if the program goes into longer periods of processing without doing
|
2001-07-15 07:53:42 +00:00
|
|
|
|
any graphics output, calling this function occasionally will allow
|
1997-08-17 21:09:35 +00:00
|
|
|
|
the system to switch screens.
|
1999-10-28 15:51:50 +00:00
|
|
|
|
.Pp
|
2001-07-15 07:53:42 +00:00
|
|
|
|
.Fn VGLTextSetFontFile
|
1999-10-28 15:51:50 +00:00
|
|
|
|
instruct the char/string functions to use the font in file
|
2000-01-05 15:16:32 +00:00
|
|
|
|
.Pa filename
|
1997-10-22 23:12:27 +00:00
|
|
|
|
instead of the builtin font.
|
1999-10-28 15:51:50 +00:00
|
|
|
|
.Pp
|
1999-11-08 11:37:46 +00:00
|
|
|
|
.Fn VGLKeyboardInit
|
2000-01-05 15:16:32 +00:00
|
|
|
|
set up the keyboard in the
|
|
|
|
|
.Dq raw
|
|
|
|
|
I/O mode and
|
1999-11-08 11:37:46 +00:00
|
|
|
|
specify the key code to be used.
|
2000-01-05 15:16:32 +00:00
|
|
|
|
.Va code
|
1999-11-08 11:37:46 +00:00
|
|
|
|
must be
|
2000-01-05 15:16:32 +00:00
|
|
|
|
.Dv VGL_XLATEKEYS ,
|
|
|
|
|
.Dv VGL_CODEKEYS ,
|
1999-11-08 11:37:46 +00:00
|
|
|
|
or
|
2000-01-05 15:16:32 +00:00
|
|
|
|
.Dv VGL_RAWKEYS .
|
2001-07-15 07:53:42 +00:00
|
|
|
|
When
|
2000-01-05 15:16:32 +00:00
|
|
|
|
.Dv VGL_XLATEKEYS
|
1999-11-08 11:37:46 +00:00
|
|
|
|
is specified, the keyboard translate the raw keyboard scan code into
|
|
|
|
|
a character code.
|
|
|
|
|
If
|
2000-01-05 15:16:32 +00:00
|
|
|
|
.Dv VGL_RAWKEYS
|
1999-11-08 11:37:46 +00:00
|
|
|
|
is used, the raw keyboard scan code is read as is.
|
2000-01-05 15:16:32 +00:00
|
|
|
|
.Dv VGL_CODEKEYS
|
1999-11-08 11:37:46 +00:00
|
|
|
|
is the intermediate key code; each key is assigned a unique code whereas
|
|
|
|
|
more than one raw scan code may be generated when a key is pressed.
|
|
|
|
|
.Pp
|
|
|
|
|
.Fn VGLKeyboardEnd
|
|
|
|
|
when you have finished using the keyboard, call this function.
|
|
|
|
|
.Pp
|
|
|
|
|
.Fn VGLKeyboardGetCh
|
2000-01-05 15:16:32 +00:00
|
|
|
|
read one byte from the keyboard. As the keyboard I/O is in the
|
|
|
|
|
.Dq raw
|
1999-11-08 11:37:46 +00:00
|
|
|
|
input mode, the function will not block even if there is no input data,
|
|
|
|
|
and returns 0.
|
|
|
|
|
.Pp
|
2001-07-15 07:53:42 +00:00
|
|
|
|
.Fn VGLMouseInit
|
2000-03-02 09:14:21 +00:00
|
|
|
|
initialize the mouse.
|
|
|
|
|
The optional on-screen mouse pointer is shown if the
|
2001-07-15 07:53:42 +00:00
|
|
|
|
argument is
|
2000-01-05 15:16:32 +00:00
|
|
|
|
.Dv VGL_MOUSESHOW .
|
1999-10-28 15:51:50 +00:00
|
|
|
|
.Pp
|
|
|
|
|
.Fn VGLMouseMode
|
|
|
|
|
either shows the mouse pointer if the argument is
|
2000-01-05 15:16:32 +00:00
|
|
|
|
.Dv VGL_MOUSESHOW ,
|
1999-10-28 15:51:50 +00:00
|
|
|
|
or hides the mouse pointer if the argument is
|
2000-01-05 15:16:32 +00:00
|
|
|
|
.Dv VGL_MOUSEHIDE .
|
1999-10-28 15:51:50 +00:00
|
|
|
|
.Pp
|
|
|
|
|
.Fn VGLMouseStatus
|
|
|
|
|
returns the current mouse pointer coordinates and button state in
|
2000-01-05 15:16:32 +00:00
|
|
|
|
.Va x , y ,
|
2000-03-02 09:14:21 +00:00
|
|
|
|
buttons.
|
2001-07-15 07:53:42 +00:00
|
|
|
|
The return value reflects if the mouse pointer
|
1997-08-17 21:09:35 +00:00
|
|
|
|
is currently shown on screen or not.
|
1999-10-28 15:51:50 +00:00
|
|
|
|
.Pp
|
|
|
|
|
.Fn VGLMouseSetImage
|
|
|
|
|
with this function it is possible to change the image of the mouse pointer
|
1997-08-17 21:09:35 +00:00
|
|
|
|
on screen.
|
1999-10-28 15:51:50 +00:00
|
|
|
|
.Pp
|
|
|
|
|
.Fn VGLMouseSetStdImage
|
|
|
|
|
this function restores the mouse pointer to the standard arrow.
|
|
|
|
|
.Pp
|
1999-12-13 10:48:22 +00:00
|
|
|
|
.Fn VGLGetXY
|
|
|
|
|
retrieves the color of the pixel located at
|
2000-01-05 15:16:32 +00:00
|
|
|
|
.Va x , y ,
|
1999-12-13 10:48:22 +00:00
|
|
|
|
coordinates of the
|
2000-01-05 15:16:32 +00:00
|
|
|
|
.Va object
|
1999-12-13 10:48:22 +00:00
|
|
|
|
argument, and returns it as a byte value.
|
|
|
|
|
.Pp
|
|
|
|
|
.Fn VGLSetXY
|
|
|
|
|
sets the color of the pixel located at
|
2000-01-05 15:16:32 +00:00
|
|
|
|
.Va x , y ,
|
1999-12-13 10:48:22 +00:00
|
|
|
|
coordinates of the
|
2000-01-05 15:16:32 +00:00
|
|
|
|
.Va object
|
1999-12-13 10:48:22 +00:00
|
|
|
|
argument to
|
2000-01-05 15:16:32 +00:00
|
|
|
|
.Va color
|
1999-12-13 10:48:22 +00:00
|
|
|
|
byte value.
|
|
|
|
|
.Pp
|
2001-07-15 07:53:42 +00:00
|
|
|
|
.Fn VGLLine
|
1999-10-28 15:51:50 +00:00
|
|
|
|
draw a line from
|
2000-01-05 15:16:32 +00:00
|
|
|
|
.Va x1 , y1
|
1997-08-17 21:09:35 +00:00
|
|
|
|
to
|
2000-01-05 15:16:32 +00:00
|
|
|
|
.Va x2 , y2
|
1997-08-17 21:09:35 +00:00
|
|
|
|
in color
|
2000-01-05 15:16:32 +00:00
|
|
|
|
.Va color .
|
1999-10-28 15:51:50 +00:00
|
|
|
|
.Pp
|
|
|
|
|
.Fn VGLBox
|
|
|
|
|
draw a box with upper left hand corner at
|
2000-01-05 15:16:32 +00:00
|
|
|
|
.Va x1 , y1
|
1997-08-17 21:09:35 +00:00
|
|
|
|
and lower right hand corner at
|
2000-01-05 15:16:32 +00:00
|
|
|
|
.Va x2 , y2
|
1997-08-17 21:09:35 +00:00
|
|
|
|
in color
|
2000-01-05 15:16:32 +00:00
|
|
|
|
.Va color .
|
1999-10-28 15:51:50 +00:00
|
|
|
|
.Pp
|
|
|
|
|
.Fn VGLFilledBox
|
|
|
|
|
draw a filled (solid) box with upper left hand corner at
|
2000-01-05 15:16:32 +00:00
|
|
|
|
.Va x1 , y1
|
1997-08-17 21:09:35 +00:00
|
|
|
|
and lower right hand corner at
|
2000-01-05 15:16:32 +00:00
|
|
|
|
.Va x2 , y2
|
1997-08-17 21:09:35 +00:00
|
|
|
|
in color
|
2000-01-05 15:16:32 +00:00
|
|
|
|
.Va color .
|
1999-10-28 15:51:50 +00:00
|
|
|
|
.Pp
|
2001-07-15 07:53:42 +00:00
|
|
|
|
.Fn VGLEllipse
|
|
|
|
|
draw an ellipse centered at
|
2000-01-05 15:16:32 +00:00
|
|
|
|
.Va xc , yc
|
2001-07-15 07:53:42 +00:00
|
|
|
|
make it
|
2000-01-05 15:16:32 +00:00
|
|
|
|
.Va a
|
2001-07-15 07:53:42 +00:00
|
|
|
|
pixels wide, and
|
2000-01-05 15:16:32 +00:00
|
|
|
|
.Va b
|
1997-08-17 21:09:35 +00:00
|
|
|
|
pixels high in color
|
2000-01-05 15:16:32 +00:00
|
|
|
|
.Va color .
|
1999-10-28 15:51:50 +00:00
|
|
|
|
.Pp
|
|
|
|
|
.Fn VGLFilledEllipse
|
2001-07-15 07:53:42 +00:00
|
|
|
|
draw a filled (solid) ellipse centered at
|
2000-01-05 15:16:32 +00:00
|
|
|
|
.Va xc , yc
|
2001-07-15 07:53:42 +00:00
|
|
|
|
make it
|
2000-01-05 15:16:32 +00:00
|
|
|
|
.Va a
|
2001-07-15 07:53:42 +00:00
|
|
|
|
pixels wide, and
|
2000-01-05 15:16:32 +00:00
|
|
|
|
.Va b
|
1997-08-17 21:09:35 +00:00
|
|
|
|
pixels high in color
|
2000-01-05 15:16:32 +00:00
|
|
|
|
.Va color .
|
1999-10-28 15:51:50 +00:00
|
|
|
|
.Pp
|
1999-11-08 11:37:46 +00:00
|
|
|
|
.Fn VGLBitmapCreate
|
2001-07-15 07:53:42 +00:00
|
|
|
|
create a bitmap object and initialize it with the specified
|
|
|
|
|
values and bit data.
|
2000-01-05 15:16:32 +00:00
|
|
|
|
.Va type
|
1999-11-08 11:37:46 +00:00
|
|
|
|
must be
|
2000-01-05 15:16:32 +00:00
|
|
|
|
.Dv MEMBUF
|
1999-11-08 11:37:46 +00:00
|
|
|
|
for the in-memory bitmap.
|
2000-01-05 15:16:32 +00:00
|
|
|
|
.Va bits
|
1999-11-08 11:37:46 +00:00
|
|
|
|
may be NULL so that bitmap data may be associated later.
|
|
|
|
|
.Pp
|
2001-07-15 07:53:42 +00:00
|
|
|
|
There also is a macro,
|
1999-11-08 11:37:46 +00:00
|
|
|
|
.Fn VGLBITMAP_INITIALIZER "type" "xsize" "ysize" "bits"
|
|
|
|
|
to initialize a statically declared bitmap object.
|
|
|
|
|
.Pp
|
|
|
|
|
.Fn VGLBitmapDestroy
|
|
|
|
|
free the bitmap data and the bitmap object.
|
|
|
|
|
.Pp
|
|
|
|
|
.Fn VGLBitmapAllocateBits
|
|
|
|
|
allocate a bit data buffer for the specified object.
|
|
|
|
|
.Pp
|
1999-10-28 15:51:50 +00:00
|
|
|
|
.Fn VGLBitmapCopy
|
|
|
|
|
copy a rectangle of pixels from bitmap
|
2000-01-05 15:16:32 +00:00
|
|
|
|
.Va src
|
2001-07-15 07:53:42 +00:00
|
|
|
|
upper left hand corner at
|
2000-01-05 15:16:32 +00:00
|
|
|
|
.Va srcx , srcy
|
1997-08-17 21:09:35 +00:00
|
|
|
|
to bitmap
|
2000-01-05 15:16:32 +00:00
|
|
|
|
.Va dst
|
2001-07-15 07:53:42 +00:00
|
|
|
|
at
|
2000-01-05 15:16:32 +00:00
|
|
|
|
.Va dstx , dsty
|
1997-08-17 21:09:35 +00:00
|
|
|
|
of the size
|
2000-01-05 15:16:32 +00:00
|
|
|
|
.Va width , height .
|
1999-10-28 15:51:50 +00:00
|
|
|
|
.Pp
|
|
|
|
|
.Fn VGLBitmapPutChar
|
|
|
|
|
write the character
|
2000-01-05 15:16:32 +00:00
|
|
|
|
.Va ch
|
1997-08-17 21:09:35 +00:00
|
|
|
|
at position
|
2000-01-05 15:16:32 +00:00
|
|
|
|
.Va x , y
|
2001-07-15 07:53:42 +00:00
|
|
|
|
in foreground color
|
2000-01-05 15:16:32 +00:00
|
|
|
|
.Va fgcol .
|
2001-07-15 07:53:42 +00:00
|
|
|
|
If
|
2000-01-05 15:16:32 +00:00
|
|
|
|
.Va fill
|
1997-08-17 21:09:35 +00:00
|
|
|
|
is != 0, use the color
|
2000-01-05 15:16:32 +00:00
|
|
|
|
.Va bgcol
|
1997-10-16 09:12:31 +00:00
|
|
|
|
as background otherwise the background is transparent.
|
1997-08-17 21:09:35 +00:00
|
|
|
|
The character is drawn in the direction specified by the argument
|
2000-01-05 15:16:32 +00:00
|
|
|
|
.Va dir .
|
1999-10-28 15:51:50 +00:00
|
|
|
|
.Pp
|
|
|
|
|
.Fn VGLBitmapString
|
|
|
|
|
write the string
|
2000-01-05 15:16:32 +00:00
|
|
|
|
.Va str
|
1997-08-17 21:09:35 +00:00
|
|
|
|
at position
|
2000-01-05 15:16:32 +00:00
|
|
|
|
.Va x , y
|
2001-07-15 07:53:42 +00:00
|
|
|
|
in foreground color
|
2000-01-05 15:16:32 +00:00
|
|
|
|
.Va fgcol .
|
2001-07-15 07:53:42 +00:00
|
|
|
|
If
|
2000-01-05 15:16:32 +00:00
|
|
|
|
.Va fill
|
1997-08-17 21:09:35 +00:00
|
|
|
|
is != 0, use the color
|
2000-01-05 15:16:32 +00:00
|
|
|
|
.Va bgcol
|
1997-10-22 23:12:27 +00:00
|
|
|
|
as background otherwise the background is transparent.
|
1997-08-17 21:09:35 +00:00
|
|
|
|
The string is drawn in the direction specified by the argument
|
2000-01-05 15:16:32 +00:00
|
|
|
|
.Va dir .
|
1999-10-28 15:51:50 +00:00
|
|
|
|
.Pp
|
|
|
|
|
.Fn VGLClear
|
|
|
|
|
clears the entire bitmap to color
|
2000-01-05 15:16:32 +00:00
|
|
|
|
.Va color .
|
1999-10-28 15:51:50 +00:00
|
|
|
|
.Pp
|
|
|
|
|
.Fn VGLSetPalette
|
|
|
|
|
this function sets the palette used, the arguments
|
2000-01-05 15:16:32 +00:00
|
|
|
|
.Va red , green , blue
|
1997-08-17 21:09:35 +00:00
|
|
|
|
should point to byte arrays of 256 positions each.
|
1999-10-28 15:51:50 +00:00
|
|
|
|
.Pp
|
|
|
|
|
.Fn VGLSetPaletteIndex
|
2001-07-15 07:53:42 +00:00
|
|
|
|
set the palette index
|
2000-01-05 15:16:32 +00:00
|
|
|
|
.Va color
|
1997-08-17 21:09:35 +00:00
|
|
|
|
to the specified RGB value.
|
1999-10-28 15:51:50 +00:00
|
|
|
|
.Pp
|
|
|
|
|
.Fn VGLSetBorder
|
|
|
|
|
set the border color to color
|
2000-01-05 15:16:32 +00:00
|
|
|
|
.Va color .
|
1999-10-28 15:51:50 +00:00
|
|
|
|
.Pp
|
1999-11-08 11:37:46 +00:00
|
|
|
|
.Fn VGLSetVScreenSize
|
|
|
|
|
change the virtual screen size of the display. Note that this
|
2001-07-15 07:53:42 +00:00
|
|
|
|
function must be called when our vty is in the foreground.
|
1999-11-08 11:37:46 +00:00
|
|
|
|
And
|
2000-01-05 15:16:32 +00:00
|
|
|
|
.Va object
|
1999-11-08 11:37:46 +00:00
|
|
|
|
must be
|
2000-01-05 15:16:32 +00:00
|
|
|
|
.Va VGLDisplay .
|
1999-11-08 11:37:46 +00:00
|
|
|
|
Passing a in-memory bitmap to this function results in error.
|
|
|
|
|
.Pp
|
|
|
|
|
The desired virtual screen width may not be achievable because
|
|
|
|
|
of the video card hardware. In such case the video driver (and
|
|
|
|
|
underlaying video BIOS) may choose the next largest values.
|
2001-07-15 07:53:42 +00:00
|
|
|
|
Always examine
|
|
|
|
|
.Va object->VXsize
|
|
|
|
|
and
|
|
|
|
|
.Va VYsize
|
|
|
|
|
after calling this function, in order to see how the virtual screen
|
1999-11-08 11:37:46 +00:00
|
|
|
|
is actually set up.
|
|
|
|
|
.Pp
|
|
|
|
|
In order to set up the largest possible virtual screen, you may
|
|
|
|
|
call this function with arbitrary large values.
|
|
|
|
|
.Pp
|
|
|
|
|
.Dl VGLSetVScreenSize(10000, 10000);
|
|
|
|
|
.Pp
|
|
|
|
|
.Fn VGLPanSreen
|
|
|
|
|
change the origin of the displayed screen in the virtual screen.
|
2001-07-15 07:53:42 +00:00
|
|
|
|
Note that this function must be called when our vty is in the
|
|
|
|
|
foreground.
|
2000-01-05 15:16:32 +00:00
|
|
|
|
.Va object
|
1999-11-08 11:37:46 +00:00
|
|
|
|
must be
|
2000-01-05 15:16:32 +00:00
|
|
|
|
.Va VGLDisplay .
|
1999-11-08 11:37:46 +00:00
|
|
|
|
Passing a in-memory bitmap to this function results in error.
|
|
|
|
|
.Pp
|
1999-10-28 15:51:50 +00:00
|
|
|
|
.Fn VGLBlankDisplay
|
2001-08-07 12:47:57 +00:00
|
|
|
|
blank the display if the argument
|
2000-01-05 15:16:32 +00:00
|
|
|
|
.Va blank
|
2001-08-10 17:35:21 +00:00
|
|
|
|
\*(Ne 0.
|
|
|
|
|
This can be done to shut off the screen during display updates that
|
1997-10-22 23:12:27 +00:00
|
|
|
|
the user should first see when it's done.
|
2001-07-26 08:46:47 +00:00
|
|
|
|
.Ss Program termination and signal processing
|
|
|
|
|
It is important to call
|
|
|
|
|
.Fn VGLEnd
|
|
|
|
|
before terminating the program.
|
|
|
|
|
Care must be taken if you install signal handlers and try to call
|
|
|
|
|
.Fn VGLEnd
|
|
|
|
|
and
|
|
|
|
|
.Xr exit 3
|
|
|
|
|
to end the program.
|
|
|
|
|
If a signal is caught while the program is inside
|
|
|
|
|
.Nm libvgl
|
|
|
|
|
functions,
|
|
|
|
|
.Fn VGLEnd
|
|
|
|
|
may not be able to properly restore the graphics hardware.
|
|
|
|
|
.Pp
|
|
|
|
|
The recommended way to handle signals and program termination is to
|
2001-07-26 09:46:08 +00:00
|
|
|
|
have a flag to indicate signal's delivery.
|
|
|
|
|
Your signal handlers set this flag but do not terminate
|
2001-07-26 08:46:47 +00:00
|
|
|
|
the program immediately.
|
|
|
|
|
The main part of the program checks the flag to see if it is
|
2001-08-07 12:47:57 +00:00
|
|
|
|
supposed to terminate, and calls
|
2001-07-26 08:46:47 +00:00
|
|
|
|
.Fn VGLEnd
|
|
|
|
|
and
|
|
|
|
|
.Xr exit 3
|
|
|
|
|
if the flag is set.
|
|
|
|
|
.Pp
|
|
|
|
|
Note that
|
|
|
|
|
.Fn VGLInit
|
|
|
|
|
installs its internal signal handlers for
|
|
|
|
|
.Dv SIGINT , SIGTERM , SIGSEGV ,
|
|
|
|
|
and
|
|
|
|
|
.Dv SIGBUS ,
|
|
|
|
|
and terminates the program at appropriate time,
|
|
|
|
|
after one of these signals is caught.
|
|
|
|
|
If you want to have your own signal handlers for these signals,
|
2001-07-26 09:46:08 +00:00
|
|
|
|
install handlers
|
2001-07-26 08:46:47 +00:00
|
|
|
|
.Em after
|
|
|
|
|
.Fn VGLInit .
|
|
|
|
|
.Pp
|
|
|
|
|
.Dv SIGUSR1
|
|
|
|
|
and
|
|
|
|
|
.Dv SIGUSR2
|
|
|
|
|
are internally used by
|
|
|
|
|
.Nm libvgl
|
|
|
|
|
to control screen switching and the mouse pointer,
|
|
|
|
|
and are not available to
|
|
|
|
|
.Nm libvgl
|
|
|
|
|
client programs.
|
1999-10-28 15:51:50 +00:00
|
|
|
|
.Sh AUTHORS
|
2000-11-14 13:09:12 +00:00
|
|
|
|
.An S\(/oren Schmidt Aq sos@FreeBSD.org
|
1997-08-17 21:09:35 +00:00
|
|
|
|
.Sh HISTORY
|
2001-07-15 07:53:42 +00:00
|
|
|
|
The
|
1999-10-28 15:51:50 +00:00
|
|
|
|
.Nm vgl
|
|
|
|
|
library appeared in
|
1999-10-30 19:29:45 +00:00
|
|
|
|
.Fx 3.0 .
|