Initial. Don't... just don't ask.

This commit is contained in:
Ryan McGrath 2011-02-24 00:22:00 -08:00
commit 00bae13bba
586 changed files with 129057 additions and 0 deletions

255
doc/0-INSTALL Normal file
View file

@ -0,0 +1,255 @@
Installation of Svgalib v1.2.12 or higher.
Table of contents:
0. Introduction
1. Directories
2. Installation
3. SVGALib port to ALPHA AXP hardware
0. Introduction
This is a low level graphics library for Linux, based on VGAlib 1.2 by
Tommy Frandsen. VGAlib supported a number of standard VGA graphics
modes, as well as Tseng ET4000 high resolution 256-color modes.
Nowadays support for even more hardware is given. For details on
supported chipsets, see the file 0-README which is equal to man 7
svgalib (when svgalib is installed).
It supports transparent virtual console switching, that is, you can
switch consoles to and from text and graphics mode consoles using
alt-[function key]. Also, svgalib corrects most of VGAlib's textmode
corruption behaviour by catching SIGSEGV, SIGFPE and SIGILL, and
ensuring that a program is running in the currently visible virtual
console before setting a graphics mode. Svgalib uses SIGUSR1 and SIGUSR2
internally to do so.
When the library is first used by a program at run-time, the chipset is
detected and the appropriate driver is used. This means that a graphics
program will work on any card that is supported by svgalib, if the mode
it uses is supported by the chipset driver for that card. The library
is upwardly compatible with VGAlib.
The set of drawing functions provided by svgalib itself is limited
(mostly unchanged from VGAlib) and unoptimized; you can however use
vga_setpage and graph_mem (which points to the 64K VGA framebuffer) in
a program or graphics library. A fast external framebuffer graphics
library for linear and banked 1, 2, 3 and 4 bytes per pixel modes is
included (it also indirectly supports planar VGA modes). See 'man 7
vgagl' for details.
One obvious application of the library is a picture viewer. Several are
available, along with animation viewers. See the references at the end
of 0-README.
I have added a simple VGA textmode font restoration utility
(restorefont) which may help if you suffer from XFree86 textmode font
corruption. It can also be used to change the textmode font. It's in
the utils/ directory, along with a README and some other textmode
utilities: restoretextmode (which saves/restores textmode registers),
restorepalette, and the script textmode. If you run the savetextmode
script to save textmode information to /tmp, you'll be able to restore
textmode by running the textmode script.
If you have an ET4000 card, you should read the 0-README in the et4000/
directory. You will probably want to replace the ET4000 registers.
1. Directories
doc/ README's and man pages. See the 0-README in this
directory for info on how to read these man pages
without installing svgalib and how to produce nice
printouts.
demos/ Demo and test programs.
utils/ Textmode/font utilities.
src/ Main library source.
src/mouse/ Source for mouse interface.
src/keyboard/ Source for keyboard interface.
gl/ External framebuffer graphics library sources.
support/ DOS-based utility for dumping VGA registers.
et4000/ Notes, utilities and sample registers for ET4000.
mach32/ Notes and a utility for the ATI mach32 driver.
jump/ Configuration files for building DLL shared library.
sharedlib/ Shared library image and stubs.
threeDKit/ Routines to draw 3-dimensional triangles and
3D demos using these.
lrmi-0.5m/ Linux real mode library (used for VESA driver)
including a utility for restoring text mode
I welcome any questions, comments, suggestions, bug-reports, etc.
The source code is rather a mess, but there's hope. The new XFree86-style
driver interface (used by the Cirrus and S3 drivers) and kernel module
graphics that some are experimenting with should provide some momentum.
Harm Hanemaayer
hhanemaa@cs.ruu.nl
Current maintainer is
Matan Ziv-Av <matan@svgalib.org>
2. Installation
If you are happy with the configuration in 'Makefile.cfg' which means
that you want to install an ELF shared library and probably an a.out
shared library for support of some old binaries (and if the svgalib tar
file you got already contains such an precompiled a.out shared library)
just running
make install
as root should take care of proper installation. After installation,
you MUST edit /etc/vga/libvga.config to set the monitor and mouse type.
Depending on your hardware, other setup might be required. Checkout
'man 7 svgalib' for details after you installed svgalib (or see
doc/0-README)
It is a good idea to read and check the configurable section of
Makefile.cfg nevertheless, even if you don't think you have to. Also,
if your are using GLIBC you have to uncomment the definition of
USEGLIBC in Makefile.cfg as glibc is not completely compatible to the
linux libc (at least at compile time).
Let me rephrase this: YOU MUST COMPILE AND INSTALL AS ROOT.
If you don't nothing bad will happen during compilation, but certain
tools won't be able to become SETUID ROOT which is required for
proper operation.
In case you change anything in 'Makefile.cfg' which does not just control
which parts to install and where, you *MUST* issue a 'make clean' prior to
'make install' to remove any already compiled objects and force complete
recompilation.
Edit Makefile.cfg to change installation paths and to select the parts
that should be installed.
If you have an ET4000 card, read 'man 7 svgalib.et4000' and copy the
appropriate register file to et4000.regs. Remember to set the DAC type.
The default behaviour is the following:
Shared libraries are installed in /lib and /usr/local/lib, header files
in /usr/local/include (any old header files in /usr/include are
removed). In the Slackware distribution the linkable libraries are in
/usr/lib, and the utilities in /usr/bin; these are now removed by 'make
install'. Until now just doing make install with Slackware might have
produced duplicate binaries, but fortunately the newer version in
/usr/local/* would have taken precedence in use.
The et4000 registers (et4000.regs) are installed as
/etc/vga/libvga.et4000, but only if this file does not exit yet. The
same goes for the configuration file, libvga.config.
Textmode utilities are installed in /usr/local/bin. These are
restorefont, runx, restorepalette, dumpreg, restoretextmode, textmode,
savetextmode, fix132x43, and mode3.
If you change Makefile.cfg to install the static libraries, static
libraries are compiled, and installed in /usr/local/lib. Note that you
do not need to do this; the shared library is enough.
If you now run 'make demoprogs', the demo programs are created in the
demos/ and threeDKit/ directory. If you
You can remove previously installed files (not the et4000 registers and
config file and manual pages) with 'make uninstall'.
In 1.28 the makefiles were changed. With minimal effort you can compile
it from a separate (even read-only) source tree. Just make a copy of
Makefile and Makefile.cfg into a writable dir, and change srcdir (or
override from environment) to the directory where the source code is.
This feature, as well as the code for ELF compilation was kindly
contributed by Stephen Lee <sl14@crux1.cit.cornell.edu>.
`make static' compiles a static version of svgalib. It is not
automatically installed by default but you can enable that from
Makefile.cfg. Note though, that if you specify installation of the static
libraries in 'Makefile.cfg' a simple 'make install' will compile the
static library first.
If you do not configure Makefile.cfg to install the shared libs, the
demoprogs and utilities are linked against the new static lib
(regardless of one already installed). However, the static libraries are
not build automatically then. You must issue a 'make static' first.
Building elf or a.out shared libraries can easily be configured in the
Makefile.cfg. Be sure to issue a `make clean' after changing the
TARGET_FORMAT setting.
If you specified elf, `make install' will compile the shared libs as
they don't come pre-built. This is nothing to worry about. Compilation
is easy and will not use any user action.
This is not true for a.out and there is a special hack in the makefiles
for this. As svgalib is distributed there is no attempt to recompile the
a.out sharedlibs. Prebuild images are already included.
If you have the required tools-* installed and if you made patches (or
just feel like recompiling) issue a `make clean' and `make shared' to
enforce recompiling of the a.out sharedlibs (from then on even a make
install will update the shared library if sources changed). Issue `make
distclean' after a `make shared' to fall back to the distribution
behaviour.
However, getting the right tools becomes more and more complicated as
it gets less important to give a.out support. Right now you even have to
hand patch the last tools-* release to make it usuable with current
compilers. In general I discourage trying to compile the a.out libs.
Just use the images that come with svgalib.
3. SVGALib port to ALPHA AXP hardware
David Mosberger-Tang <davidm@azstarnet.com> contributed patches to make
SVGALib run on Linux/Alpha namely APECS-based and low-cost PCI boards.
It is known to run with #9 GXE (but all S3-based graphic cards should
work if they are supported). He wrote a patch to make SVGALib run on
Jensen boards. They own EISA slots instead of PCI slots and can not map
video memory as a continous frame buffer. Use this patch with extreme
care (do sync disks before starting compiled software for the first
time!). He also recommends using SVGATextMode in combination with
SVGALib-based software otherwise the library crunches the font
(although the system should not crash). Here is a list of what is not
supported yet:
- vc-switching (due to lack of some signals supported by current ALPHA
kernels but this could be fixed now [He used a 1.3.28 to test])
- font restoring without SVGATextMode (He still works on it)
- clearing screen in mode 320x200x256
- vgagl (will never be ported by me because he thinks it is too much work
and useless in the end)
He tested his patch with an ELSA Winner 1000 but it should even work on
other cards (He recommends to always sync disks, it saves a lot of time
and sweat :-) ).
If you compile it on a machine where __alpha__ is defined, you should
have configured your kernel correctly once. This is due to the fact
that he saw no other possibility to determine the type of ALPHA AXP
hardware you use. During kernel configuration your are asked which
architecture you want to compile it for.
Also important: you must have the right libc compiled for your board
hardware. This is due to the I/O functions in libc. They need to be
compiled especially for your Alpha board. Have a look at
ftp.azstarnet.com for precompiled libc's (although this is not very
reliable, most of the libc-packages are sources).
Note that he feels __not__ responsible for damage to your hardware when
using this software. If you encounter any problems that refer to
Jensen-type hardware you can send an email to me:
If you encounter any problems that refer to Jensen-type hardware you
can send an email to:
Stephan Kanthak <kanthak@i6.informatik.rwth-aachen.de>
Here are some additional comments Michael Weller wrote on the first
ALPHA patches from David Mosberger-Tang:
No reports of other hardware working or not exist yet. This is REAL
ALPHA software. I don't know any installation details. In theory you
just recompile it out of the box (When you are using Linux/Alpha you
are a hacker and should be able to create a shared lib w/o problems). I
don't know any details, in case of problems please contact David.
From what I saw you might have to use static libs. That's no real
problem, a simple 'make static' will create a static lib.
The background mode is said not to work on Dec-ALPHA, so you better
disable it in Makefile.cfg

1036
doc/CHANGES Normal file

File diff suppressed because it is too large Load diff

86
doc/DESIGN Normal file
View file

@ -0,0 +1,86 @@
This file contains some talk about what is involved with a good
register-level graphics driver interface. This is an old file,
you might also consider reading 'man 7 svgalib.faq'
Section 1: Mode Setting
The following describes what happens during a mode set.
A request is made for a mode with given width, height, and color
resolution. Optionally the request can specify a specific pixel size,
scanline offset (line width), and pixel size (e.g. 3 vs. 4 pixels for
24-bit color modes), otherwise the driver chooses defaults for these
properties. It is the intention that requests for resolutions that don't
match an availabe mode timing can still be honoured by choosing a higher
resolution (for example, 700x500 is requested and 800x600 timing is
programmed). The scanline offset should ensure correct drawing of
graphics.
The user-level driver tries to match the requested mode properties with
either fixed modes defined by the selected kernel module driver, or with a
flexible mode timing if the selected kernel module driver supports mode
timing. In the case of fixed modes, the user-level driver must ask the
kernel driver about the supported fixed modes, and in the case of mode
timings, the user-level driver must ask the kernel driver about physical
limits such as the amount of video memory, maximum pixel clocks for each
pixel size, range and mapping of horizontal timing parameters, and the
available pixel clock frequencies. In both cases, modes/timings that fall
outside of the configured monitor specs (probably stored in a file in
/etc) will not be selected. In the case of flexible mode timings, the
highest refresh timing that is possible will be selected.
Once a mode timing or fixed mode is selected, the kernel module driver is
requested to set the mode on the hardware. A mode state is defined which
is a collection of VGA and driver-specific extended register values (byte
values) that describes the mode that the video card is set to. During the
mode set proper, the following actions are performed:
1. The registers values that make up the state are read from the video
card and stored in a state in system memory (this is the state of
the video card before the mode set).
2. An initialization function modifies the values in the state according
to the requested mode. Nothing is written to the card; only the state
in system memory is changed.
3. The actual mode set on the hardware is performed by writing the values
in the state to the corresponding registers on the video card.
A special case is VGA-compatible textmode state, which would normally be
active at the time of a graphics mode set. This mode cannot be initialized
in the way of (2) above. Instead, the mode is saved using (1), and the
resulting state is restored using (3) when textmode needs to be restored.
Another special case is the setting of a mode for which (1) and (2) have
already been performed, and the resulting state has been saved. In this
case the mode can be set accomplished by just (3), provided that certain
hardware-specific settings on the card have not been changed in the time
between (1) and (3) (this would normally be the case).
When a VT switch away from a graphics modes happens, the current hardware
state should be saved, instead of the initialized mode state, since an
application can have changed it (banking, displaystart, accelerator state
etc.). This is subject to all the extended registers being readable, which
may be a problem with some cards (note that for simple mode setting
followed by textmode restoration, this is not a problem since the mode
initialization overwrites most of the delicate extended registers, and the
saved textmode state is largely VGA registers, and doesn't deal with
delicate extended registers). A possible solution would be to have
functions that save and restore or re-initialize the 'drawing' state,
which would include banking, displaystart and accelerator registers. Upon
VT switching back, the mode initialization function would be used followed
by the restoring of the saved drawing state.
Section 2: What should be in the kernel driver.
A decision that has to be made is whether all chipset specific settings
should be handled within the kernel module driver. There's a fair amount
of information required to select a suitable timing, which the user-level
driver will have to request, and it might have to do additional queries
during its evaluation. The abstractions used for this communication will
include a growing number of properties to accomodate new card/chipset
drivers. It is however desirable that the simple loading of a new module
driver is enough to make full use it, without the requirement of having an
updated user-level driver.
Harm Hanemaayer (hhanemaa@cs.ruu.nl)

View file

@ -0,0 +1,216 @@
Here are some tips on writing a new chipset svgalib driver.
They don't require knowledge of direct vga programming, even though that
helps.
The instructions assume:
1- A super vga card, that is a card which is extended, but also fully
compatible to standard vga. Of the cards available today (in the mass market),
all are, with the possible exception of Permedia chipsets.
2- A PCI (or AGP) connected card. This is useful for detection of the card,
and for finding the linear aperture, as well as knowing it is always there.
3- Knowledge of the extended features of the chipset: Usually either as the
spec, or a source of a driver for the chipset (XFree86).
as a start, get the following:
1- vgadoc4b.zip[1] (or a later version), includes information on the vga
hardware registers, as well as on many chipsets.
2- the latest svgalib[2].
3- If the card is supported by XFree86, either the link kit (Xlkit.tgz[3])
if the card is supported by the XF86_SVGA server, or the XFree86 source
([4]), if it is supported by a special server.
1. in the src subdir of the svgalib distribution, cp skeleton.c to some other
name, chipset.c, where chipset is the name of the chipset you intend to
support.
2. now you have to fill the blanks. The functions that need to be are
sk_setpage
sk_saveregs
sk_setregs
sk_initializemode
sk_unlock
sk_test
sk_setdisplaystart
sk_setlogicalwidth
sk_init
3. When that is done, change all sk_ in the driver to chipset_ (where
chipset is the name of the chipset you write the driver for). Then
the driver needs to be integrated into svgalib. The files that need
to be edited are:
Makefile.cfg
src/Makefile
src/driver.h
src/vga.c
src/vga.h
(It's easy to see what changes are needed in those files, by simply
seeing how its done for another driver).
4. Now is the most interesting time - debugging. Usually (in my experience,
in all cases), the driver won't work right immediately. Here are a few
debugging tips:
Setting modes is made of two things: setting the timings, and setting the
memory organisation. You can usually tell which is the problem, by noticing
if the wrong screen is seen as if some/all pixels are not set to the color
they should (memory organisation), or the display looks "stormy" (timings
problem). If the problem is timing problem, a digital monitor taht displays
horizontal and vertical timings helps. If the horizontal freq is right, but
vertical is wrong, then the problem is in the vertical timing. If both horiz
and vert are wrong, then either the clock frequency, or the horizontal
frequency is wrong.
If the problem is in memory organisation, It might work in linear mode, so try
running testlinear and lineart.
If the driver fails to restore text mode properly, then usually starting X
will work. It won't help restoring text mode, but then you might be able
to see the output of the program (using /dev/vcs?, /dev/vcsa?).
The program mode3 (in lrmi-0.6m subdir) might be able to restore text mode,
corrupted by a bad driver.
The same mode3 might be used for debugging as follows: if a mode, say
800x600x256 does not work properly, but mode3 does work, you might try the
following run vgatest, select 11 (for 800x600x256), and while the wrong mode
is displayed, press d (to recieve a registers dump).
then, try mode3 259 ; utils/dumpreg ; mode3, and compare the register dump
of vesa mode 259 (800x600x256), with the output from your driver. Try finding
out what do the bits that are different mean.
Here are some more details on writing the necessary functions:
examples given are from the banshee.c driver, written according to the spec
available from 3dfx, and the (hypotethical) milleniumII.c driver, written
according to the XFree86 source.
_setpage:
This is a simple function. A mistake in this function is indicated by:
all linear programs work fine, while in paged memory examples, the problem
is that blocks (full width * ??? lines) are moved.
For millenium, from freebe (this part is unavailable in X source,
since X uses only linear mode).
{
outw(0x3de,(page<<8)|4);
};
For Banshee:
{
page<<=1;
outl(banshee_io_base+0x2c,(inl(banshee_io_base+0x2c)&0xfff00000)|(page)|(page<<10));
}
_saveregs, _setregs
This functions should save and restore the state of the svga card, such that
it can be restored to a previous state, no matter what we do. A mistake is
indicated by failure to restore text mode properly.
We should save all registers that we change, or might be changed by other
programs (X, SVGATextMode, etc.), here's the banshee_saveregs:
typedef struct {
unsigned int pllCtrl0, pllCtrl1, dacMode, dacAddr,
vidProcCfg, vidScreenSize, vgaInit0,
vgaInit1, vidDesktopStartAddr,vidDesktopOverlayStride;
} *HWRecPtr;
static int banshee_saveregs(unsigned char regs[])
{
HWRecPtr save;
banshee_unlock();
save=(HWRecPtr)(regs+62);
regs[BANSHEEREG_SAVE(0)]=__svgalib_inCR(0x1a);
regs[BANSHEEREG_SAVE(1)]=__svgalib_inCR(0x1b);
save->pllCtrl0=inl(banshee_io_base+0x40);
save->pllCtrl1=inl(banshee_io_base+0x44);
save->dacMode=inl(banshee_io_base+0x4c);
save->dacAddr=inl(banshee_io_base+0x50);
save->vidProcCfg=inl(banshee_io_base+0x5c);
save->vidScreenSize=inl(banshee_io_base+0x98);
save->vgaInit0=inl(banshee_io_base+0x28);
save->vgaInit1=inl(banshee_io_base+0x2c);
save->vidDesktopStartAddr=inl(banshee_io_base+0xe4);
save->vidDesktopOverlayStride=inl(banshee_io_base+0xe8);
return BANSHEE_TOTAL_REGS - VGA_TOTAL_REGS;
}
If we use the X source, it usually in the functions XXXSave and XXXRestore.
It is only needed to translate from XFree86 notation to svgalib notation,
and to remember that while the X functions need to save the vga state (usually
by calling the vga function to do it, in svgalib the chipset_saveregs/setregs
don't need to do that, but only save extended vga info).
For MilleniumII, the interesting X functions are: MGA3026Save and
MGA3026Restore, here a translation of a part of MGA3026Restore to
mill_setregs:
MGA3026Restore:
for (i = 0; i < 6; i++)
outw(0x3DE, (restore->ExtVga[i] << 8) | i);
/* restore DAC regs */
for (i = 0; i < sizeof(MGADACregs); i++)
outMGA1064(MGADACregs[i], restore->DACreg[i]);
translates to (assuming sizeof(MGADACregs)==32)
for (i = 0; i < 6; i++)
outw(0x3DE, (restore[60+i] << 8) | i);
/* restore DAC regs */
for (i = 0; i < 32; i++){
OUTREG8(RAMDAC_OFFSET + MGA1064_INDEX, MGADACregs[i]);
OUTREG8(RAMDAC_OFFSET + MGA1064_DATA, restore[66+i]);
};
_initializemode - This is the trickiest function. If you use the XFree86
source, try to translate the appropriate function from X to svgalib (in
the milleniumII case, MGA1064Init(mode)). For examples of this translation,
see how its done for nv3.c compared to nv/nv3driver.c from X, or apm.c compared
to apm/apm_driver.c.
If you are working from specs, it usually explained in the spec.
_unlock:
simple function. The skeleton includes the vga unlocking part. If you have
specs, they usually explain how to unlock the extended features, if you use
the X source, its usually in the EnterLeave function.
_test - If you are supporting a single chipset of a single manufacturer,
on a PCI/AGP, the skeleton driver includes a test for this, just make sure to
set VENDOR_ID and CARD_ID properly. Otherwise, either the specs explain
how to recognize that you have the right chipset, or its in the function
XXXProbe of the XFree86 source.
_setdisplaystart, _setlogicalwidth:
vga includes this settings, but with limited range (start<65536,
width<2048 bytes). An svga chipset either defines extra bits, for increasing
the range, or completely new registers for these values.
In the first case, the skeleton driver includes setting the vga part, and
the extra bits are either defined in the specs, or in the XXXAdjust function
in XFree86 (see mx.c for example of this). In the second case, remove the
vga setting part from the functions (see for example rage.c).
Note that none of the demo programs test this functions, so if you want to
check if they work, the only example I know of is seejpeg (try to see an image
larger than the screen)
_init
should not need much changes, except for checking memory size (in the spec, or
in XXXProbe), and maybe setting MMIO (if other functions use it).
1- http://home.worldonline.dk/finth
2- http://www.cs.bgu.ac.il/~zivav/svgalib
3- ftp://ftp.xfree86.org/pub/XFree86/current/binaries/Linux-ix86-libc5/Xlkit.tgz
(or mirrors)
4- ftp://ftp.xfree86.org/pub/XFree86/current/source/X333servonly.tgz
(or mirrors)

94
doc/Makefile Normal file
View file

@ -0,0 +1,94 @@
include ../Makefile.cfg
srcdir = ..
VPATH = $(srcdir)/doc
SVGALIB1=man7/svgalib.7 man5/libvga.config.5 man5/libvga.et4000.5 \
man5/svgalibrc.5 man7/svgalib.chips.7 \
man7/svgalib.et4000.7 man7/svgalib.mach32.7\
man6/mach32info.6 man3/vga_* man3/keyboard_* man3/mouse_* \
man3/joystick_* man3/currentcontext.3 man3/graph_mem.3 \
man1/convfont.1 man1/dumpreg.1 man1/fix132x43.1 man1/restorefont.1 \
man1/restorepalette.1 man1/restoretextmode.1 man1/runx.1 man1/savetextmode.1 \
man1/setmclk.1 man1/textmode.1\
man1/svgakeymap.1 \
man6/joytest.6 man6/mjoytest.6 man6/printftest.6 man6/svidtune.6 \
man6/eventtest.6 man6/forktest.6 man6/fun.6 man6/keytest.6\
man6/mousetest.6 man6/speedtest.6 man6/spin.6\
man6/testaccel.6 man6/threed.6 man6/vgatest.6 man6/accel.6\
man6/bg_test.6 man6/scrolltest.6 man6/testlinear.6\
man7/svgalib.faq.7 man8/mode3.8 man8/vga_reset.8 man6/lineart.6
VGAGL1=man7/vgagl.7 $(shell ls man3/gl_* | grep -v tri ) man6/testgl.6
THREED1=man7/threedkit.7 man3/gl_*tri* man6/plane.6 man6/wrapdemo.6
SVGALIB=$(subst man,$(srcdir)/doc/man,$(SVGALIB1))
VGAGL=$(subst man,$(srcdir)/doc/man,$(VGAGL1))
THREED=$(subst man,$(srcdir)/doc/man,$(THREED1))
COMPMANPAGES=$(shell cd $(srcdir)/doc; find man? -name "*.gz" -type f -print)
.PHONY: clean ascii dvi ps install gunzip gzip
gunzip:
echo gunzipping manpages
for i in $(COMPMANPAGES); do\
gunzip $$i; \
done
gzip:
echo gzipping manpages
for i in $(SVGALIB1) $(VGAGL1) $(THREED1); do\
gzip $$i; \
done
../0-README: man7/svgalib.7
cat man7/svgalib.7 | nroff -man | col -b > ../0-README
ascii:
cat $(SVGALIB) | grep -v '^\.so ' | nroff -man -T$@ \
| col -b > svgalib.$@
cat $(VGAGL) | grep -v '^\.so ' | nroff -man -T$@ \
| col -b > vgagl.$@
cat $(THREED) | grep -v '^\.so ' | nroff -man -T$@ \
| col -b > 3d.$@
lpr:
cat $(SVGALIB) | grep -v '^\.so ' | nroff -man -Tascii > svgalib.lpr
cat $(VGAGL) | grep -v '^\.so ' | nroff -man -Tascii > vgagl.lpr
cat $(THREED) | grep -v '^\.so ' | nroff -man -Tascii > 3d.lpr
ps dvi:
cat $(SVGALIB) | grep -v '^\.so ' | troff -man -T$@ > svgalib.$@
cat $(VGAGL) | grep -v '^\.so ' | troff -man -T$@ > vgagl.$@
cat $(THREED) | grep -v '^\.so ' | troff -man -T$@ > 3d.$@
install: gzip
mkdir -p $(mandir)/man1 $(mandir)/man3 $(mandir)/man5 \
$(mandir)/man6 $(mandir)/man7 $(mandir)/man8
for i in $(COMPMANPAGES); do\
$(INSTALL_DATA) $(srcdir)/doc/$$i $(mandir)/$$i; \
done
make gunzip
ifdef MAKEWHATIS
@echo "Rebuilding the whatis database (this is slow!)"
@echo "You can comment this out in Makefile.cfg!"
$(MAKEWHATIS)
endif
uninstall:
@echo Removing all svgalib man pages.
@for dir in $(mandir) ; do \
if [ -d $$dir ]; then \
cd $$dir; \
rm -f $(COMPMANPAGES) $(UNCOMANPAGES); \
fi; \
done;\
clean:
# -gzip -9 man?/* 2>/dev/null
rm -f man?/*.bak
rm -f svgalib.ascii vgagl.ascii 3d.ascii
rm -f svgalib.dvi vgagl.dvi 3d.dvi
rm -f svgalib.ps vgagl.ps 3d.ps
rm -f svgalib.lpr vgagl.lpr 3d.lpr

83
doc/README.joystick Normal file
View file

@ -0,0 +1,83 @@
Hi!
I wrote a set of SVGAlibish joystick routines while I played with porting
DOSDoom to SVGAlib.
It is compatible with both the older joystick driver for Linux 1.x and 2.0
and the newer joystick driver that is in recent 2.1.x kernels.
Some of the code is ripped from the userland tools joystick-0.6.7 and
joystick-2.0.6 none of wich has any special license attaced to them.
The files are:
joydev.h: my userland version of the kernel joystick.h
vgajoystick.h: library include file analog to vgakeyboard.h and vgamouse.h
joystick.c: the library routines.
joytest.c: a simple test program/example
I dunno how useful these will be, but I could at least use them in doom. (Not
that joystick control in doom adds anything, I just implemented it for
completeness.)
BUGS:
Only one joystick device at any time (but the new 2.1.x driver will let you
map 4 axis and 4 buttons to one logical device).
The routines:
int joystick_init(const char *joydev, int verbose, FILE *file);
This one inits the joystick routines and opens the device. Returna the
filedescriptor of the joystick device if successfull or -1 if not.
Outputs some messages to stdout id verbose is != 0. If file != NULL it will
try to recalibrate the joystick and output the recalibration instructions to
the struct file pointed to by file.
E.g.
if (-1 == joystick_init("/dev/js0, 1, stdout))
{
printf("Joystick init failed\n");
exit(1);
}
void joystick_close(void);
Shuts down the joystick.
int joystick_update(void);
Reads the joystick and calls the joystick handler if anything events are
availible. Should be called every now and then.
void joystick_sethandler(__joystick_handler jh);
Install a user supplied joystick handler.
A user supplied joystick handler would look like this.
void joystick_handler(int event, int number, char value);
int event - event type:
JOY_EVENTAXIS an axis has moved
JOY_EVENTBUTTONDOWN a button has been pushed
JOY_EVENTBUTTONUP a button has been released
int number - the axis or button number for this event 0=x axis or button 1, etc.
char value - value for axis events (-128 .. 0 .. 127)
void joystick_setdefaulthandler(void);
Restore the default joystick handler.
char joystick_getnumaxes(void);
char joystick_getnumbuttons(void);
Retrun the number of axes/buttons on the joystick.
char joystick_getaxis(int a);
char joystick_getbutton(int b);
Querys the jostick state from the default joystick handler if it is used.
The following macros calls joystick_getaxis() or joystick_getbutton().
joystick_getb1() - Gets button 1
joystick_getb2() - Gets button 2
joystick_getb3() - Gets button 3
joystick_getb4() - Gets button 4
joystick_getx() - Returns the X axis
joystick_gety() - Returns the Y axis
joystick_getz() - Returns the Z axis
That all folks,
Daniel Engström
daniel.engstrom@riksnett.no

172
doc/README.keymap Normal file
View file

@ -0,0 +1,172 @@
** Svgalib keyboard scancode remapping: the Readme **
** Introduction
After a poll on Slashdot.org about keyboard layouts, I decided to switch from
QWERTY to the Dvorak simplified keyboard. (Such is the power of Slashdot!) It
was easy to switch the keymaps used by the console and X and even LILO, but
svgalib programs that used raw keyboard weren't affected since they interpret
the keyboard scancodes into characters themselves - often assuming a standard
US keyboard with QWERTY layout.
In order for my machine to present a ``unified front'' with a single consistent
keyboard layout, I added to svgalib the ability to remap scancodes. This is
done in keyboard_getevents(), before the event handler is called, so it will
work whether or not a program provides its own handler. Programs that do not
use raw keyboard are not affected, so by setting both the console and svgalib
itself to use the same keymap a consistent keyboard layout is available to all
svgalib programs.
** Background
When you press or release a key on your keyboard, it sends a byte of data to
your computer. The top bit indicates whether the key was pressed or released,
and the lower seven bits hold the scancode, a number that uniquely identifies
the key. A program on the computer interprets these scancodes as representing
characters (`A', `%', etc) or actions to be taken (`Page Up', `Back Space') or
modifiers that alter the interpretation of other keys (`Shift', `Alt', etc).
Most programs do not perform this interpretation themselves, but leave it up
to some other piece of software: the system BIOS, or the operating system,
or the graphical user interface system.
On Linux this is normally done by the kernel or by the X server for X clients,
but this doesn't meet the needs of some programs (especially games) which
care more about whether a key is up or down than what it means and treat the
modifiers the same way as other keys. These programs open the keyboard in `raw'
mode and deal directly with scancodes.
The problem comes because these programs often do need to interpret the keys
into characters, or it is important for a certain key to be identifiable to
the user as being associated with a certain key. For instance, a game player
might need to type a description of a saved game or be directed to press a
certain key to activate a game feature. Interpretation of keyboard scancodes
can be difficult since there are many different keyboard layouts which do not
have the same associations between scancodes, modifiers, characters, and
commands. So the author of the program must choose between writing a complex
and customizable conversion routine that can handle any layout the user might
have, and a simple routine that is hard-coded to use a single layout. In the
latter case, users of other keyboard layouts will encounter numerous
discrepancies between what he or she tries to type and what the program
interprets.
** How it works
Svgalib's scancode conversion is meant to at least partially fill this gap by
converting the scancodes that the keyboard produces to equivalent, or nearly
equivalent, scancodes for the keyboard layout that the program expects. The
program then (hopefully) interprets the new scancode into the intended
character.
As an example, let us consider a US keyboard with Dvorak layout and the game
Quake, which expects a US keyboard with QWERTY layout. Both layouts have the
same scancodes for each physical key, but different characters are produced.
For intance, the first row of letters produces the scancodes 16 through 27, but
on QWERTY this produces the charaters qwertyuiop[] while Dvorak produces
',.pyfgcrl/=. Thus when the Dvorak letter `p' is pressed, the scancode 19
is interpreted by Quake as the letter `r', which occupies scancode 19 on the
QWERTY layout.
The solution lies in the fact that svgalib acts as an intermediary between the
keyboard and the program and has the opportunity to present a different
scancode to the program than the keyboard produced. In this case we tell Quake
that the scancode was not 19 but rather 25, which is the letter `p' in the
QWERTY layout, so when Quake interprets the scancode the correct character is
produced.
** The keymap files
In order to know what scancodes to convert to what other scancodes, a keymap
file is read which lists scancodes produced by the keyboard and their
equivalents in the layout expected by the program.
A program called svgakeymap is provided to generate these maps from the
keytable files in /usr/lib/kbd/keytables; you must have perl for it to work.
Creating a keymap file with svgakeymap is easy; to make a map to convert
scancodes from a US Dvorak keyboard to a US QWERTY keyboard as for our example
above:
svgakeymap dvorak us > dvorak-us.keymap
The path and .map and .gz suffixes are automatically added if necessary. If
your keytables are stored elsewhere, specify a complete path. If only one
keytable is specified, a keymap is generated that performs no conversions but
contains the correct key names so you can specify scancodes used by fake
keyboard and mouse events by name instead of by number. If none are specified,
this is done for the standard US QWERTY layout.
dvorak-us.keymap and default.keymap (the US QWERTY layout) are provided with
the svgalib distribution and can serve as an example if you wish to make your
own keymap files manually or create an improved generator.
** Configuration
You can specify a keymap to use for all svgalib programs (keeping in mind that
only those that use raw keyboard are affected) by putting a line like this into
libvga.config or ~/.svgalibrc:
kbd_keymap /etc/vga/dvorak-us.keymap
You must specify a complete path to the keymap file. If no keymap is specified,
no conversion is performed.
You can also override the global keymap by setting the environment variable
SVGALIB_KEYMAP to point to the appropriate keymap file. This can be useful if
some programs support alternate keymaps directly but not others, or if
different users use their own keyboard layouts based on preference.
** Security issues
It can be dangerous to let users arbitrarily reassign keyboard scancodes; for
instance all keys could be routed to an unused scancode, making the console
unusable. To prevent this, put the option kbd_only_root_keymaps into
libvga.config; only keymaps owned by root will be accepted, so the available
keymaps can be limited to safe ones.
** Bugs and limitations
There are no known bugs, but there probably are some. If you find any please
let me know at brion@pobox.com.
Limitations however we definitely have. The scancode conversion performed is
very simple, and can only achieve 100% success when the keyboard layouts being
converted between differ _only_ in arrangement of keys while producing the same
characters from each key. Example: the de facto standard Dvorak keyboard has
the left and right brackets (`[' and `]') on separate keys, with the curly
braces (`{' and `}') produced by those keys when shifted. The standard QWERTY
keyboard produces those characters the same way, the only difference is that
the keys are a row higher on Dvorak; switching the scancodes around results in
proper character interpretation. However the official ANSI standard Dvorak
layout has tho two brackets on _the same key_, one regular and one shifted.
The curly braces similarly have their own key. These cannot be properly mapped
by scancode to the QWERTY keyboard since they produce different characters
in conjunction with modifiers, and the wrong character is produced by the
program.
This could be worked around by interpreting the modifiers in svgalib and
simulating the proper modifier/character keypress/release sequences, but it
would be very complex and would do nothing to help the situation where
characters on the physical keyboard layout do not exist on the target layout
(quite likely when dealing with national or language-specific keyboards);
they cannot be converted into any key sequence since they do not exist.
Ultimately it might be better to set up a ``medium-rare'' keyboard mode where
keys are interpreted into characters but ``raw''-style non-interpreted key
press and release events are available.
** Further information
There isn't really any further information right now unless you want to Use The
Source... More to come in the future. If it does you'll find it at:
Brion Vibber's Svgalib Stuff - http://pobox.com/~brion/linux/svgalib.html
-- brion vibber (brion@pobox.com)
3 July 1998

1
doc/README.lrmi Symbolic link
View file

@ -0,0 +1 @@
../lrmi-0.6m/README

88
doc/README.multi-monitor Normal file
View file

@ -0,0 +1,88 @@
multi-monitor support is still very experimental, and not
very easy to setup. Here's a copy of a message I sent to
the mailing list:
First: only nvidia, 3dfx, sis and i740 cards can be secondary cards,
(though the primary can be anything, including vesa).
Second: as far as I can understand, once both cards are enabled, there
ought to be a resource contention (in hardware) between the cards for
the vga regions (IO 0x3c0-0x3df and MEM 0xa0000-0xbffff). I don't know
how it is supposed to be solved, but in practice, if I ignore it in my
system, it just works.
If anybody else has successfully run svgalib on a secondary card, please
tell me, and if you had to do something different from what I did, a
detailed report to the list might help others.
Here's my setup:
I have two vga cards: AGP (1:0.0) nVidia TNT2 and (PCI0:0f.0) Riva128.
The AGP card is the primary (in the BIOS option "initialize AGP card
first" is selected). My boot sequence includes the following code to
initialize the secondary card:
/usr/local/sbin/vbios.x86emu
/usr/local/sbin/vga_reset
/sbin/setpci -s 00:0f.0 COMMAND=2
the vbios.x86emu is the same as distributed in x86emu-0.6 (from ftp.scitechsoft.com)
except that in debug.h the line
#define CONFIG_ACTIVE_DEVICE 1
is replaced by
#define CONFIG_ACTIVE_DEVICE 0
(so that the active device is not initialized by x86emu).
the setpci line enables memory access (of the drivers supporting
secondary card, nv3 and i740 use only memory mapped IO, sis and banshee
need I/O access as well, so you need COMMAND=3). The COMMAND register
might have other bits set, so you might try to see its value first, and
then set the 0,1 bits.
I have two config files in /etc/vga:
libvga.config.0 - for the scondary card:
novccontrol
secondary
include /etc/vga/libvga.config.common
HorizSync 30 54
VertRefresh 40 120
The novccontrol and secondary options are necessary for a secondary
card. The include statement is for a card with common configurations -
mouse, keyboard, etc.
libvga.config.1 - for the primary:
PCIStart 1 0
include /etc/vga/libvga.config.common
HorizSync 30 115
VertRefresh 40 160
The pcistart option is necessary to make sure that svgalib skips the
first card (in PCI order), and so finds the AGP card.
to run a program on the primary card, in the usual way, I do
export SVGALIB_CARD=1
/svgalib/demos/vgatest
to run a program on the secondary card:
export SVGALIB_CARD=0
/svgalib/demos/vgatest
There are a few differences for a program running on secondary card:
- The program is not aware of VC switches, so you can switch to another
console, and the program will still run (and display).
- The program can't event system (mouse or raw keyboard).
- Standard VGA modes and paged memory modes might have problems.
What this limitations mean is that usual svgalib program might not be
useful for a secondary card. I use the secondary display for
watching TV, movies and slideshows. Eye candy programs (such as
synaesthesia) might also work, after a few changes, but interactive
programs (zgv, games) are unusable right now. I intend to add support
for Vojtech Pavlik's input event system to svgalib-2.0, so that
interactive program will be usable as well.

140
doc/README.patching Normal file
View file

@ -0,0 +1,140 @@
Patching svgalib
Contents
0. Introduction
1. Indenting
2. Structure of the chipset drivers
0. Introduction
Here is some info on writing patches and/or adding support for
further chipsets. The info on the chipset drivers is outdated, but
better than nothing and get you started.
As a side note, other than a.out, ELF does not allow to have some
symbols global to svgalib which are not accessible to user
programs.
Because of that, if possible all the symbols and functions in your
program should be static. Those which can not be static should
have a name like: "__svgalib_*" to mark them as internals s.t.
people using them get what they deserve. Please do only add a new
function to the user interface if it is really unavoidable. Better
add some new parameters to an existing function.
Adding a new function would definitly result in loosing a.out
compatibility thus removing the chance to use new cards and such
with old a.out binaries where the source is not available (doom
comes to mind).
A new function should be really important to outweigh this draw
back.
1. Indenting
Due to some request (and I heard it b4) all the sources were now
automatically indentified.
There were some requests for indent -gnu but it looks painful. I
opted for -kr (there were requests for it as well) as it is not
only nicer but also what is done in the linux-kernel and this is
certainly a program only usable for linux.
I dunno if emacs is confused by -kr, but to be honest this is a
big all-in-one egg-giving-wool-milk-sow (as we say in german), and
you won't tell me that this several megs beast is unable to edit
this and I can't use -kr due to some restrictions of emacs. That
would be really ridiculous. If it is the case just make emacs
better.
The OneModeEntry macro is eaten by indent (I would say it is an
indent bug, I might send a bug report to them), please ensure (if
at all possible) that your code can be passed through indent (use
the INDENT-OFF comments as shown in some sources for
OneModeEntry).
You can use `make indent-gnu' (if you have a recent enough (I use
1.9.1) indent) to switch to your favorite style. But please ensure
your patches fit into this now declared as "official style"
sources. (Use `make indent' to reformat).
Do not use it too often though as most indent's tend to add empty
lines at certain places in the source.
2. Structure of the chipset drivers
The chipset specific registers saving function (saveregs) is only
used directly to save the textmode registers at initialization.
The chipset specific registers restoring function (setregs) is only
used directly to return to textmode, and when setting a VGA mode
after an SVGA mode.
The registers for each mode are stored like the ET4000 modes in
VGAlib 1.2, i.e. the extended registers at the end. The following
functions must be provided in a driver:
saveregs( unsigned char regs[] )
Saves the chipset-specific registers in regs, starting at
array index EXT (after the VGA registers).
setregs( unsigned char regs[] )
Sets the chipset-specific registers stored in regs from
index EXT.
modeavailable( int mode )
Returns nonzero if mode is available (should check video
memory).
getmodeinfo( vga_modeinfo *modeinfo )
Fills in chipset specific field of mode information
structure: maxlogicalwidth, startaddressrange (mask of
significant bits), and maxpixels (video memory divided by
the number of bytes per pixel). haveblit indicates whether
bitblt functions are available.
Note: providing extended info and an aperture with size
>= memory and setting bits 4 and 6 in flags will
automatically enable linear addressing support.
setmode( int mode, int previous_mode )
Sets all registers for a mode; returns nonzero if mode not
available. __vga_setregs can be called to set the VGA
registers.
unlock()
Unlocks chipset-specific registers.
lock()
Lock (protect) chipset-specific registers. Currently not
called.
test()
Identify chipset; initialize (check memory and type) and
return nonzero if detected.
setpage( int page )
Set 64K page number to be mapped at 0xa0000.
init( int force, int par1, ... )
Initialize memory and type; called by test. If force is 1,
the chiptype or the amount of memory can be forced (this
is pretty useless).
The following functions provide for things like page flipping
and hardware scrolling virtual desktops.
setdisplaystart( int address )
Sets the display start address in video memory in pixels.
setlogicalwidth( int width )
Sets the logical scanline length in bytes. Usually a
multiple of 8.
The function getchipset() in vga.c must call the test routine for
the chipset. The chipsetfunctionslist must be have a pointer
to the chipsetfunctions table for the chipset (which is the only
global symbol in a chipset driver). Also, vga.h contains a magic
number for each chipset. Also driver_names[] in vga.c has to
contain a name for each driver at the correct position.

60
doc/README.vesa Normal file
View file

@ -0,0 +1,60 @@
Notes for the VESA driver:
The driver's autodetection is disabled by default, so in order to use it,
the line
chipset VESA
must be added to the config file (usually /etc/vga/libvga.config).
The error:
Int 0x10 is not in rom (xxxx:xxxx)
is usually caused by running linux using loadlin, after loading a dos tsr
that changes the int 10 vector, or after windows 95, that does the same
thing. The solution, is either to use lilo, or run loadlin after a clean
dos boot.
There is a new config file option that affects the vesa driver:
VesaText
If this option is used, the driver sets 80x25 text mode (using vesa bios)
before setting any standard vga mode.
This option was added in order to enable standard vga modes with the vesa
driver on Matrox Millenium, but now it has the following effect:
(read in a fixed width font)
chipset with VesaText without VesaText
CL-GD5446 works leaves a messy font when
returning to text mode
Riva 128 does not restore works
previous used text
font, but reverts to
ROM font.
Matrox
Millenium works does not set standard vga
modes properly.
A list of cards known to work with the VESA driver is:
* Riva128 (both on a STBV128 and a Viper330)
* RivaTNT
* Matrox Millenium 2
* Matrox Mystique
* Matrox Productiva G100
* Matrox Millenium G200
* Neomagic Magicgraph 128XD (in a Dell Inspiron laptop)
* S3 375 Virge/DX ( A "Trident Video Excel 3D Accelerator" )
* S3 Trio3D
* Cirrus Logic GD5446
* Rendition V1000 - Only modes up to 800x600 seem to work
* ATI Expression+ PC2TV 2MB (RageII chipset) - tested only modes up
to 800x600 resolution
* i740 (Diamond Stealth G460)
* Voodoo Banshee
* Alliance Technology AT24
Please note that some of this cards have also failed to work in some
cases, so it is _very_ configuration dependent.
For Matrox cards, the advice is to upgrade to the latest bios from Matrox.

40
doc/TODO Normal file
View file

@ -0,0 +1,40 @@
Be sure to read the svgalib.FAQ man 7 svgalib.faq
Have to decide what exactly is G320x200x256 (VGA Mode 13h or SVGA
packed-pixel). A separate Mode X would be nice too.
A set of functions to handle page-flipping would be nice. (e.g. a
vga_setvideopage() that returns the new video start address)
Support for more chipsets?
Clean up keyword parsing code.
Kernel support for page-flipping.
automatic console restore on device close.
really reliable vc switching.
There are races in the mouse code when the mouse device is closed in the
signal handler on a vc switch. Again, probably kernel support is due.
start marking functions that will become obsolete.
Move away from hard-coded mode numbers:
Think what would happen if a program is compiled to call
vga_setmode(G1280x1024x256) and we change the mode number to
something else... This has happened before. The solution is either
to provide a getmodenum(xres, yres, colordepth, layout) function, or
a setmode(xres, yres, colordepth, layout) function or vow not to
change the definitions of the mode numbers (i.e. new modes can only
be added to the end of the list).
More RamDAC support. The S3 code should have no problem with 868, Trio and
9xx chips except that boards that uses those chips usually uses
newer/unsupported RamDACs as well.
Multiple-adaptor support.
IBM RGB52x >8bpp support.

6
doc/add_driver Normal file
View file

@ -0,0 +1,6 @@
Makefile.cfg DRIVER, DRIVER_TEST
src/Makefile
src/vga.c driverspecs, config names, test
src/vga.h
src/driver.h

111
doc/dual-head-howto Normal file
View file

@ -0,0 +1,111 @@
There is a new config option - "device". After you insert the module, you
see output such as (those lines are available with the command dmesg, or
in the file /var/log/messages, depending on your syslog setup):
svgalib_helper: Initializing, version 1.9.18
svgalib_helper: device1: vendor:1002 id:4c49
device1: region0, base=dd000000 len=16777216 type=0
device1: region1, base=0000d000 len=256 type=1
device1: region2, base=e4000000 len=4096 type=0
svgalib_helper: device2: vendor:12d2 id:0018
device2: region0, base=df000000 len=16777216 type=0
device2: region1, base=e0000000 len=16777216 type=8
svgalib_helper: device3: vendor:102b id:051a
device3: region0, base=e1000000 len=16384 type=0
device3: region1, base=e2000000 len=8388608 type=8
device3: region2, base=e3000000 len=8388608 type=0
svgalib_helper: device4: vendor:102b id:0525
device4: region0, base=d8000000 len=33554432 type=8
device4: region1, base=da000000 len=16384 type=0
device4: region2, base=db000000 len=8388608 type=0
(Of course, the number of cards, and their types will be different).
From which you can see which number each card is assigned. Then you
create a different libvga.config for each card, which contains the
device keyword.
For example In my system I have
/etc/vga/libvga.config.rage:
novccontrol
secondary
device 1
BiosParams 3 29500
include /etc/vga/libvga.config.common
mouse none
HorizSync 30 38
VertRefresh 40 90
/etc/vga/libvga.config.nv3:
helper /dev/svga_helper/2
novccontrol
secondary
include /etc/vga/libvga.config.common
Modeline "6" 14.16 640 776 840 904 240 332 337 625 -hsync -vsync tvmode tvpal
newmode 640 240 65536 1280 2
HorizSync 24 60
VertRefresh 55 75
/etc/vga/libvga.config.mystique:
helper /dev/svga3
novccontrol
secondary
chipset g400
include /etc/vga/libvga.config.common
Modeline "6" 14.16 640 776 840 904 240 332 337 625 -hsync -vsync tvmode
tvpal
newmode 640 240 65536 1280 2
HorizSync 30 37
VertRefresh 30 90
/etc/vga/libvga.config.mga:
Device 4
OverRideEnable
include /etc/vga/libvga.config.common
HorizSync 30 115
VertRefresh 40 160
Some explanations:
When the environment variable SVGALIB_CARD is set, svgalib opens the
config file /etc/vga/libvga.config.$SVGALIB_CARD, instead of the usual
/etc/vga/libvga.config. So, if I want to run zgv on the nv3 card, I do
export SVGALIB_CARD=nv3 ; zgv
The helper keyword can be used similar to the device keyword, to tell
svgalib which device to open.
All cards except for the primary need to use the secondary and
novccontrol keywords. Secondary tells svgalib not to try to use the
standard VGA ports when accessing this card (since only one card can be
accessed with those, and that is the primary). NoVCControl tells svgalib
not to check or try to control the VC, so you can run an svgalib program
on a secondary card, while working normally on the main head, including
switching virtual consoles.
You should use "mouse none", or "mdev" options to make sure no two
programs open the mouse at the same time. (Though it is possible with
most mice, and can give some funny results).
XFree86 likes to disable all PCI video cards that it does not use,
whenever it is started, or switched to, so if you switch in and out of X
on your main card, you need to patch your X server to prevent this
behavior. If you only run X on the main card, and don't return to
text mode, there is no need to patch X.
There are no limitations on the primary card. As you can see, I currently
use nvidia, mystique and rage (mach64) cards as secondaries. Also known to
work are sis, r128 (including radeon), laguna, trident and s3 (trio and up)
cards.
The main issue with secondary cards is initializing them. If your BIOS
initializes them, that's the best (I heard rumors of such BIOSes, but
never something concrete). The next option is x86emu, this almost always
works (on x86 systems). It also works on some other arches, if you use PC
video cards. If even that fails, then C code is available to initialize some
mach64 cards, and old matrox cards (before G100).

80
doc/man1/convfont.1 Normal file
View file

@ -0,0 +1,80 @@
.TH convfont 1 "2 Aug 1997" "Svgalib (>= 1.2.11)" "Svgalib User Manual"
.SH NAME
convfont \- convert font files for svgalib
.SH SYNOPSIS
.BI convfont " fontfile fontheight vgafontfile"
.SH DESCRIPTION
convert the standard format binary fontfile name
.I fontfile
to the codepage format required by
.BR restorefont (1).
The converted font is written to
.IR vgafontfile .
A binary font file of any number of characters up to 256 can be used, although
at least defining the first 128 characters is a good idea. The
.I fontheight
must be in the range
.BR 1 " - " 32 .
The
.I fontfile
file consist of
.I fontheight
bytes stored sequentially (top to bottom) for each character in your
font, starting with the character with code 0.
The format of
.I vgafontfile
is that required by
.BR restorefont (1)
and described there.
This utility is part of svgalib and can be found in the
.I utils/
subdirectory of the original svgalib distribution. However, it is not installed
by default, s.t. it is unclear where you can find it if your svgalib was install
linux distribution.
In case of any such problem, simply get an svgalib distribution from the net. You
don't need to install it. Just
.B make
in the
.I utils/
subdirecty. As of this writing,
.I svgalib-1.2.12.tar.gz
is the latest version and can be retrieved by ftp from
.IR "sunsite.unc.edu" " at " "/pub/Linux/libs/graphics"
and
.IR "tsx-11.mit.edu" " at " "/pub/linux/sources/libs"
which will most probably be mirrored by a site close to you.
.SH SEE ALSO
.BR svgalib (7),
.BR vgagl (7),
.BR libvga.config (5),
.BR dumpreg (1),
.BR fix132x43 (1),
.BR restorefont (1),
.BR restorepalette (1),
.BR restoretextmode (1),
.BR runx (1),
.BR savetextmode (1),
.BR setmclk (1),
.BR textmode (1).
.SH AUTHOR
This manual page was edited by Michael Weller <eowmob@exp-math.uni-essen.de>. The
exact source of the referenced utility as well as of the original documentation is
unknown.
It is very likely that both are at least to some extent are due to
Harm Hanemaayer <H.Hanemaayer@inter.nl.net>.
Occasionally this might be wrong. I hereby
asked to be excused by the original author and will happily accept any additions or corrections
to this first version of the svgalib manual.

54
doc/man1/dumpreg.1 Normal file
View file

@ -0,0 +1,54 @@
.TH dumpreg 1 "2 Aug 1997" "Svgalib (>= 1.2.11)" "Svgalib User Manual"
.SH NAME
dumpreg \- dump the state of the card as the svgalib chipset driver sees it.
.SH SYNOPSIS
.BI dumpreg
.br
.BI "dumpreg < /dev/tty" N
.SH DESCRIPTION
The chipset drivers of svgalib inquire the mode of the graphic card when the application
is started and restore it when the svgalib application quits.
.B dumpreg
prints this information to stdout.
This is useful for debugging or adding modes to a device driver. For example you can
use Xfree86 to setup a given mode timing, then run
.B dumpreg
and use it's stdout to make your chipset driver use exactly this timing.
However, the recent change of svgalib to hunt an own free virtual console does not allow
this, because it will make Xfree86 return to textmode first. You can avoid this by using
the second form where
.I N
is the number of the virtual console on which Xfree86 runs (usually 7) as root.
.SH SEE ALSO
.BR svgalib (7),
.BR vgagl (7),
.BR libvga.config (5),
.BR vga_dumpregs (3),
.BR convfont (1),
.BR fix132x43 (1),
.BR restorefont (1),
.BR restorepalette (1),
.BR restoretextmode (1),
.BR runx (1),
.BR savetextmode (1),
.BR setmclk (1),
.BR textmode (1).
.SH AUTHOR
This manual page was edited by Michael Weller <eowmob@exp-math.uni-essen.de>. The
exact source of the referenced utility as well as of the original documentation is
unknown.
It is very likely that both are at least to some extent are due to
Harm Hanemaayer <H.Hanemaayer@inter.nl.net>.
Occasionally this might be wrong. I hereby
asked to be excused by the original author and will happily accept any additions or corrections
to this first version of the svgalib manual.

91
doc/man1/fix132x43.1 Normal file
View file

@ -0,0 +1,91 @@
.TH fix132x43 1 "2 Aug 1997" "Svgalib (>= 1.2.11)" "Svgalib User Manual"
.SH NAME
fix132x43 \- fix problems with certain (132 column) graphics modes
dump the state of the card as the svgalib chipset driver sees it.
.SH SYNOPSIS
.BI fix132x43 " options"
.SH DESCRIPTION
This program tries to fix problems with extended textmodes on some cards. The problem is that for
132x43 textmode, some BIOS's set the vertical display end register to 349 (350), instead of 343
(344 = 3 * 8 scanlines). Because in Linux textmode video memory is usually filled with old text
that has already scrolled away (this includes the area below the 43rd textmode line, which changes
when the console scrolls), the top half of a constantly changing irrelevant text line is visible
at the bottom of the screen, which is very annoying.
This program sets the VGA Vertical Display End register to the proper value.
This problem is at least present in the BIOS of most Cirrus Logic 542x based cards, and
some WD90C03x based cards.
The
.B LINES
environment variable is used to detect 43 or 44 line consoles.
.SH OPTIONS
You have to specify exactly one of the following options:
.TP
.B -f
Fix problem of annoying changing line of text at bottom of screen.
.TP
.B -v
Switch to 9 line characters (400 line frame, 70 Hz).
.TP
.B -w
Switch to 11 line characters (480 line frame, 60 Hz).
.B fix132x43
does not usually provide this option but it can be enabled in the source of
.BR fix132x43.
.TP
.B -r
Switch to 8 line characters again (350 line frame, 70 Hz).
.PP
This utility is part of svgalib and can be found in the
.I utils/
subdirectory of the original svgalib distribution. However, it is not installed
by default, s.t. it is unclear where you can find it if your svgalib was install
linux distribution.
In case of any such problem, simply get an svgalib distribution from the net. You
don't need to install it. Just
.B make
in the
.I utils/
subdirecty. As of this writing,
.I svgalib-1.2.12.tar.gz
is the latest version and can be retrieved by ftp from
.IR "sunsite.unc.edu" " at " "/pub/Linux/libs/graphics"
and
.IR "tsx-11.mit.edu" " at " "/pub/linux/sources/libs"
which will most probably be mirrored by a site close to you.
.SH SEE ALSO
.BR svgalib (7),
.BR vgagl (7),
.BR libvga.config (5),
.BR convfont (1),
.BR dumpreg (1),
.BR restorefont (1),
.BR restorepalette (1),
.BR restoretextmode (1),
.BR runx (1),
.BR savetextmode (1),
.BR setmclk (1),
.BR textmode (1).
.SH AUTHOR
This manual page was edited by Michael Weller <eowmob@exp-math.uni-essen.de>. The
exact source of the referenced utility as well as of the original documentation is
unknown.
It is very likely that both are at least to some extent are due to
Harm Hanemaayer <H.Hanemaayer@inter.nl.net>.
Occasionally this might be wrong. I hereby
asked to be excused by the original author and will happily accept any additions or corrections
to this first version of the svgalib manual.

125
doc/man1/restorefont.1 Normal file
View file

@ -0,0 +1,125 @@
.TH restorefont 1 "2 Aug 1997" "Svgalib (>= 1.2.11)" "Svgalib User Manual"
.SH NAME
restorefont \- save or restore the SVGA font for textmode.
.SH SYNOPSIS
.BI "restorefont {-r|-w} " filename
.SH DESCRIPTION
The font used by SVGA when in textmode is written to or restored from
.IR filename
using the
.BR vga_gettextfont "(3) and "
.BR vga_puttextfont (3)
functions.
.SH FILE FORMAT
The VGA font file
.I filename
has the following format:
.RS
.BR Offset:
.br
.BR " 0 - 31 " "Character 0"
.br
.BR " ... " " ..."
.br
.BR "8164 - 8195 " "Character 255"
.RE
Each row of a character bitmap is stored as a byte (8 pixels).
The space that is left from the 32-byte buffer for each character
is ignored, e.g. a 16 line font uses only offsets 0 - 15 of each character.
Linux textmode screen resolutions:
.BR 80x25 " 16 line font 400 scanlines"
.br
.BR 80x28 " 14 line font 400 scanlines"
.br
.BR 80x50 " 8 line font 400 scanlines"
The font sizes and resolutions of extended textmodes depend on the
video card type and BIOS:
.BR 132x25 " 14 line font 350 scanlines (ugly)"
.br
.BR 132x25 " 16 line font 400 scanlines"
.br
.BR 132x43 " 8 line font 350 scanlines (use fix132x43 to fix/improve)"
.br
.BR 132x50 " 8 line font 400 scanlines"
.br
Using a font that has less lines per character than the textmode works, but
the characters are smaller. Using a font that is bigger than the textmode
font results in the bottom part of characters being cut off.
The svgalib distribution contains sample fonts with 8, 14 and 16 line characters
in the files
.IR utils/font8 ", " utils/font14 ", and " utils/font16 .
The
.BR convfont
(1) program can be used to convert fonts straightforwardly stored
character-after-character (i.e. each character only uses 8/14/whatever
bytes), to the 32-byte per character format that
.B restorefont
requires.
The purpose of this program is usually to recover from a crashed console due to an
svgalib, Xfree or other program bug. First save the state of the SVGA card when on a
text console. After the crash restore this state. The
.BR savetextmode (1)
and
.BR textmode (1)
script makes this procedure very easy.
The national/fontpak packages, which include kernel patches, allow different
textmode fonts to be used in different virtual consoles. These have been
superseded by the kbd package (in the kernel since ages). See the
.BR setfont (8)
utility of the kbd package as a starting point.
Recent kernels support up to 2 fonts with 512 chars each. Recent versions
of svgalib take this into account and extend the size of the datafile accordingly.
.SH OPTIONS
.TP
.BI "-w " filename
write the font to the file
.IR filename .
.TP
.BI "-r " filename
restore the font from the file
.IR filename .
.SH SEE ALSO
.BR svgalib (7),
.BR vgagl (7),
.BR libvga.config (5),
.BR setfont (8),
.BR vga_gettextfont (3),
.BR vga_puttextfont (3),
.BR dumpreg (1),
.BR convfont (1),
.BR fix132x43 (1),
.BR restoretextmode (1),
.BR restorepalette (1),
.BR runx (1),
.BR savetextmode (1),
.BR setmclk (1),
.BR textmode (1).
.SH AUTHOR
This manual page was edited by Michael Weller <eowmob@exp-math.uni-essen.de>. The
exact source of the referenced utility as well as of the original documentation is
unknown.
It is very likely that both are at least to some extent are due to
Harm Hanemaayer <H.Hanemaayer@inter.nl.net>.
Occasionally this might be wrong. I hereby
asked to be excused by the original author and will happily accept any additions or corrections
to this first version of the svgalib manual.

107
doc/man1/restorepalette.1 Normal file
View file

@ -0,0 +1,107 @@
.TH restorepalette 1 "2 Aug 1997" "Svgalib (>= 1.2.11)" "Svgalib User Manual"
.SH NAME
restorepalette \- set the color palette for textmode.
.SH SYNOPSIS
.BI "restorepalette [" filename ]
.SH DESCRIPTION
.B restorepalette
without arguments sets the standard VGA palette. This can be useful
if it is somehow messed up.
With a
.I filename
argument a custom palette can be loaded (feature added by Charles Blake
<chuckb@alice.wonderland.caltech.edu>).
This allow a user to set up a file that looks like this one
(These color map definitions are the same as the default VGA ones.
Alter to suite personal tastes). The first column contains the number of
the color to set, then follow three integers in range 0 - 63 (lowest to
highest intensity) for red, green, blue.
.RS
.B " 0 0 0 0 # black"
.br
.B " 1 0 0 42 # blue"
.br
.B " 2 0 42 0 # green"
.br
.B " 3 0 42 42 # cyan"
.br
.B " 4 42 0 0 # red"
.br
.B " 5 42 0 42 # magenta"
.br
.B " 6 42 21 0 # brown"
.br
.B " 7 42 42 42 # white"
.br
.B " 8 21 21 21 # bright black"
.br
.B " 9 21 21 63 # bright blue"
.br
.B "10 21 63 21 # bright green"
.br
.B "11 21 63 63 # bright cyan"
.br
.B "12 63 21 21 # bright red"
.br
.B "13 63 21 63 # bright magenta"
.br
.B "14 63 63 21 # bright brown"
.br
.B "15 63 63 63 # bright white"
.RE
The inline comments are the
only kind of allowed, as I use a little
.BR fscanf (3)
trick to get them. Blank lines
are ok, but not pure comment lines. See the comments in my code, also.
This allows people to set up custom palettes for use in virtual console text
modes. I use it all the time. When combined with a color-syntax editor like
jed-0.97+ or color-ls, etc., being able to choose your own text-mode palette is
quite a bonus. I set mine up via
.B restorepalette /etc/palette
in my
.IR /etc/rc .
If the program is given the correct permissions, then individual users can
have
.B restorepalette ~/.palette
or some such thing in their shell startup
files.
Of course, it shouldn't be done when starting remote shells or when
under X, so some kind of test that
.B TERM
is a virtual console is needed for that case.
.SH SEE ALSO
.BR svgalib (7),
.BR vgagl (7),
.BR libvga.config (5),
.BR vga_setpalvec (3),
.BR dumpreg (1),
.BR convfont (1),
.BR fix132x43 (1),
.BR restorefont (1),
.BR restoretextmode (1),
.BR runx (1),
.BR savetextmode (1),
.BR setmclk (1),
.BR textmode (1).
.SH AUTHOR
This manual page was edited by Michael Weller <eowmob@exp-math.uni-essen.de>. The
exact source of the referenced utility as well as of the original documentation is
unknown.
It is very likely that both are at least to some extent are due to
Harm Hanemaayer <H.Hanemaayer@inter.nl.net>.
Occasionally this might be wrong. I hereby
asked to be excused by the original author and will happily accept any additions or corrections
to this first version of the svgalib manual.

View file

@ -0,0 +1,66 @@
.TH restoretextmode 1 "2 Aug 1997" "Svgalib (>= 1.2.11)" "Svgalib User Manual"
.SH NAME
restoretextmode \- save or restore the SVGA registers for textmode.
.SH SYNOPSIS
.BI "restoretextmode {-r|-w} " filename
.SH DESCRIPTION
The state of the SVGA is written to or restored from
.IR filename
using the
.BR vga_gettextmoderegs "(3) and "
.BR vga_settextmoderegs (3)
functions.
As of this writing this file is 385 bytes long but this might change with future versions.
Please do not fiddle with the contents of the file except when you know what you do. It
might even result in hardware damage. Because of that, you should think twice to make
this command available to all users on your system.
The purpose of this program is usually to recover from a crashed console due to an
svgalib, Xfree or other program bug. First save the state of the SVGA card when on a
text console. After the crash restore this state. The
.BR savetextmode (1)
and
.BR textmode (1)
script makes this procedure very easy.
.SH OPTIONS
.TP
.BI "-w " filename
write the SVGA state to the file
.IR filename .
.TP
.BI "-r " filename
restore the SVGA state from the file
.IR filename .
.SH SEE ALSO
.BR svgalib (7),
.BR vgagl (7),
.BR libvga.config (5),
.BR vga_gettextmoderegs (3),
.BR vga_settextmoderegs (3),
.BR dumpreg (1),
.BR convfont (1),
.BR fix132x43 (1),
.BR restorefont (1),
.BR restorepalette (1),
.BR runx (1),
.BR savetextmode (1),
.BR setmclk (1),
.BR textmode (1).
.SH AUTHOR
This manual page was edited by Michael Weller <eowmob@exp-math.uni-essen.de>. The
exact source of the referenced utility as well as of the original documentation is
unknown.
It is very likely that both are at least to some extent are due to
Harm Hanemaayer <H.Hanemaayer@inter.nl.net>.
Occasionally this might be wrong. I hereby
asked to be excused by the original author and will happily accept any additions or corrections
to this first version of the svgalib manual.

104
doc/man1/runx.1 Normal file
View file

@ -0,0 +1,104 @@
.TH runx 1 "2 Aug 1997" "Svgalib (>= 1.2.11)" "Svgalib User Manual"
.SH NAME
runx \- try to overcome problems of Xfree96 restoring textmode using svgalib.
.SH SYNOPSIS
.BI runx
.SH DESCRIPTION
If XFree86 corrupts your textmode font, try putting
.BR restorefont (1)
in your path and use the shell script
.B runx
to run X.
.B runx
saves the VGA font data in
.IR /tmp/fontdata ,
and restores it when you exit X.
The
.B runx
script actually is:
.RS
.B #!/bin/sh
.br
.B echo Saving font in /tmp/fontdata
.br
.B restorefont -w /tmp/fontdata
.br
.B startx
.br
.B echo Restoring font from /tmp/fontdata
.br
.B restorefont -r /tmp/fontdata
.RE
Note that this doesn't help with syncing problems.
A more rigorous alternative is to run the
.BR savetextmode (1)
script before running X, and
.BR textmode (1)
after. This will restore the textmode registers and the VGA palette in addition to the VGA font.
Assuming that
.BR savetextmode (1)
and
.BR textmode (1)
are in your
.BR PATH
the
.B runx
script would then look like:
.RS
.B #!/bin/sh
.br
.B echo Saving SVGA state
.br
.B savetextmode
.br
.B startx
.br
.B echo restoring SVGA state
.br
.B textmode
.RE
.PP
This utility is part of svgalib and can be found in the
.I utils/
subdirectory of the original svgalib distribution. However, it is not installed
by default, s.t. it is unclear where you can find it if your svgalib was install
by a linux distribution.
However, this is no big deal as it was printed out above already ;-).
.SH SEE ALSO
.BR svgalib (7),
.BR vgagl (7),
.BR libvga.config (5),
.BR convfont (1),
.BR dumpreg (1),
.BR restorefont (1),
.BR restorepalette (1),
.BR restoretextmode (1),
.BR fix132x43 (1),
.BR savetextmode (1),
.BR setmclk (1),
.BR textmode (1).
.SH AUTHOR
This manual page was edited by Michael Weller <eowmob@exp-math.uni-essen.de>. The
exact source of the referenced utility as well as of the original documentation is
unknown.
It is very likely that both are at least to some extent are due to
Harm Hanemaayer <H.Hanemaayer@inter.nl.net>.
Occasionally this might be wrong. I hereby
asked to be excused by the original author and will happily accept any additions or corrections
to this first version of the svgalib manual.

71
doc/man1/savetextmode.1 Normal file
View file

@ -0,0 +1,71 @@
.TH savetextmode 1 "2 Aug 1997" "Svgalib (>= 1.2.11)" "Svgalib User Manual"
.SH NAME
savetextmode, textmode \- save or restore the complete SVGA status for textmode.
.SH SYNOPSIS
.B savetextmode
.br
.B textmode
.SH DESCRIPTION
These are simple scripts to save the SVGA register state when in textmode to the
files
.IR /tmp/fontdata " and " /tmp/textregs
or to restore it from these files.
The actual utilities used are
.BR restorefont (1),
.BR restoretextmode "(1), and "
.BR restorepalette (1).
The purpose of these scripts program is usually to recover from a crashed console due to an
svgalib, Xfree or other program bug.
You do this by being a smart guy and running
.B savetextmode
right after booting of your machine,
.B prior
to any problems. Then, in case the SVGA state is hosed and you sit in front of a blank or
useless console, change VC (maybe login) to get to a shell. Or exist the currently running
program with
.BR <Ctrl>-C ", "
.BR <Ctrl>-<Alt>-<Backspace> ,
or whatever applies. Once you got a shell, run
.B textmode
and it will hopefully render your console useable again.
To make it clear: You do all this while not seeing anything on your console screen, you
enter this information blindly or after logging in from a network. Also, if the keyboard is
left in raw mode, nothing can really help you as you cannot enter anything which a shell
will understand.
.SH FILES
.I /tmp/fontdata
.br
.I /tmp/textregs
.SH SEE ALSO
.BR svgalib (7),
.BR vgagl (7),
.BR libvga.config (5),
.BR dumpreg (1),
.BR convfont (1),
.BR fix132x43 (1),
.BR restorefont (1),
.BR restoretextmode (1),
.BR restorepalette (1),
.BR runx (1),
.BR setmclk (1),
.SH AUTHOR
This manual page was edited by Michael Weller <eowmob@exp-math.uni-essen.de>. The
exact source of the referenced utility as well as of the original documentation is
unknown.
It is very likely that both are at least to some extent are due to
Harm Hanemaayer <H.Hanemaayer@inter.nl.net>.
Occasionally this might be wrong. I hereby
asked to be excused by the original author and will happily accept any additions or corrections
to this first version of the svgalib manual.

90
doc/man1/setmclk.1 Normal file
View file

@ -0,0 +1,90 @@
.TH setmclk 1 "2 Aug 1997" "Svgalib (>= 1.2.11)" "Svgalib User Manual"
.SH NAME
setmclk \- adjust the memory timing of certain Cirrus cards.
.SH SYNOPSIS
.BI setmclk
.SH DESCRIPTION
This program sets the
.B memory clock
of Cirrus 5424/26/28 cards.
The first three values could be set by utility programs that
came with my card (AVGA3), but somewhat higher values seem to work (on my
card at least). It may be that better and more recent Cirrus cards use a
higher value as boot-up default. It should depend on DRAM speed, but it
seems to be more dependant on the card logic.
I have the impression that many Cirrus 542x cards suffer from horrible
BIOS version/DRAM timing misconfigurations. Perhaps even some versions of
MS-Windows drivers change the MCLK register. In any case, the boot-up BIOS
default (0x1c) may be inappropriately low for the type of DRAM timing most
cards use.
Using a higher memory clock gives a very significant performance improvement;
with high dot clock modes (like 640x480x16M or 1150x900x256) performance can
be more than twice that of the standard 50 MHz clock. This goes for both
(VLB) framebuffer access and accelerated features (bitblt). This also helps
XFree86 server performance, but only if the XFree86 Cirrus driver doesn't
set the memory clock register (it should work for XFree86 1.3 and 2.0).
Use at your own risk!
Note that the
.B dot clock
is something entirely different. There does not
seem to be much correlation between the two (i.e. if a high dot clock gives
screen problems, using a high memory clock is not likely to fix it, other
than improving speed).
The actual
.B memory clock
is hard compiled into the program. It defaults to 0x1c. You can change this value
and some suggestiong come in th source of the utility.
This utility is part of svgalib and can be found in the
.I utils/
subdirectory of the original svgalib distribution. However, it is not installed
by default, s.t. it is unclear where you can find it if your svgalib was install
linux distribution.
In case of any such problem, simply get an svgalib distribution from the net. You
don't need to install it. Just
.B make
in the
.I utils/
subdirecty. As of this writing,
.I svgalib-1.2.12.tar.gz
is the latest version and can be retrieved by ftp from
.IR "sunsite.unc.edu" " at " "/pub/Linux/libs/graphics"
and
.IR "tsx-11.mit.edu" " at " "/pub/linux/sources/libs"
which will most probably be mirrored by a site close to you.
.SH SEE ALSO
.BR svgalib (7),
.BR vgagl (7),
.BR libvga.config (5),
.BR convfont (1),
.BR dumpreg (1),
.BR restorefont (1),
.BR restorepalette (1),
.BR restoretextmode (1),
.BR runx (1),
.BR savetextmode (1),
.BR fix132x43 (1),
.BR textmode (1).
.SH AUTHOR
This manual page was edited by Michael Weller <eowmob@exp-math.uni-essen.de>. The
exact source of the referenced utility as well as of the original documentation is
unknown.
It is very likely that both are at least to some extent are due to
Harm Hanemaayer <H.Hanemaayer@inter.nl.net>.
Occasionally this might be wrong. I hereby
asked to be excused by the original author and will happily accept any additions or corrections
to this first version of the svgalib manual.

41
doc/man1/svgakeymap.1 Normal file
View file

@ -0,0 +1,41 @@
.TH svgakeymap 1 "3 July 1998" "Svgalib 1.3.0" "Svgalib User Manual"
.SH NAME
svgakeymap \- generates keymaps for svgalib
.SH SYNOPSIS
.BI "svgakeymap [" "physical_table" " [" program_table "]] > " output.keymap
.SH DESCRIPTION
Generates a keymap conversion file for
.BR svgalib (7)
from two keytable definitions. Keytables are searched for in
.I /usr/lib/kbd/keytables
and are automatically filtered through
.BR gzip (1)
if necessary.
If only one keytable is specified, a keymap is generated that performs no
conversion but contains the proper key names for that layout. If no keytables
are specified, the standard US QWERTY keyboard is used.
The generated keymap is sent to the standard output and may be redirected
or piped in any creative manner you wish.
.SH FILES
.I /usr/lib/kbd/keytables/*.map[.gz]
.RS
The system keytable files used by
.BR loadkeys "(1)."
.RE
.SH BUGS
Can get confused if there is more than one key with a given name or if names
do not match properly between keytables. Keymaps may require manual editing.
.SH AUTHOR
Brion Vibber <brion@pobox.com>
.SH SEE ALSO
.BR libvga.config (5)
.IR README.keymap " from the svgalib distribution"

1
doc/man1/textmode.1 Normal file
View file

@ -0,0 +1 @@
.so man1/savetextmode.1

View file

@ -0,0 +1 @@
.so man3/gl_getcontext.3

View file

@ -0,0 +1,48 @@
.TH gl_allocatecontext 3 "2 Aug 1997" "Svgalib (>= 1.2.11)" "Svgalib User Manual"
.SH NAME
gl_allocatecontext \- allocate a graphics context
.SH SYNOPSIS
.B #include <vgagl.h>
.BI "GraphicsContext *gl_allocatecontext(void);"
.SH DESCRIPTION
Allocate a graphics context. This is preferred to
hardcoding a context variable in a program since the
latter is incompatible with a future vgagl version that
have additional context fields.
.SH SEE ALSO
.BR svgalib (7),
.BR vgagl (7),
.BR svgalib.conf (5),
.BR threedkit (7),
.BR testgl (1),
.BR plane (1),
.BR wrapdemo (1),
.BR currentcontext (3),
.BR gl_allocatecontext (3),
.BR gl_copyboxfromcontext (3),
.BR gl_copyboxtocontext (3),
.BR gl_getcontext (3),
.BR gl_setcontext (3),
.BR gl_setcontextheight (3),
.BR gl_setcontextvga (3),
.BR gl_setcontextvgavirtual (3),
.BR gl_setcontextvirtual (3),
.BR gl_setcontextwidth (3).
.SH AUTHOR
This manual page was edited by Michael Weller <eowmob@exp-math.uni-essen.de>. The
exact source of the referenced demo as well as of the original documentation is
unknown.
It is very likely that both are at least to some extent are due to
Harm Hanemaayer <H.Hanemaayer@inter.nl.net>.
Occasionally this might be wrong. I hereby
asked to be excused by the original author and will happily accept any additions or corrections
to this first version of the svgalib manual.

66
doc/man3/gl_bcircle.3 Normal file
View file

@ -0,0 +1,66 @@
.TH gl_bcircle 3 "4 Dec 1999" "Svgalib (>= 1.4.1)" "Svgalib User Manual"
.SH NAME
gl_bcircle \- draw a filled or unfilled Bresenham circle
.SH SYNOPSIS
.B #include <vgagl.h>
.BI "void gl_bcircle(int " x ", int " y ", int " r ", int " c ", int " fill ");"
.SH DESCRIPTION
Draw a Bresenham circle of radius
.I r
in color
.I c ,
centered at
.I ( x ", " y ).
.I Fill
should be 0 for a hollow circle, or any other value for a solid color.
This function differs from gl_circle (3) and gl_fillcircle (3) in that it
looks good in 320 x 200 screen modes. The modified algorithm was provided
by Chris Atenasio <chris@svgalib.org>, and is based upon Bresenham's
formula.
Note that the "circle" is technically an ellipse, and is actually wider
than it is tall. Therefore,
.I r
is equal to the circle's height, but is less than its width. This
distortion is necessary to accomodate the 8:5 aspect ratio (e.g., 320 x
200).
I don't recommend using this function in standard 4:3 screen modes (e.g.,
640 x 480 and higher). Furthermore, care must be taken so that a circle
drawn with this function isn't copied to a screen with a different aspect
ratio. Otherwise, the result may be undesirable.
.SH SEE ALSO
.BR svgalib (7),
.BR vgagl (7),
.BR svgalib.conf (5),
.BR threedkit (7),
.BR testgl (1),
.BR plane (1),
.BR wrapdemo (1),
.BR gl_circle (3),
.BR gl_clearscreen (3),
.BR gl_colorfont (3),
.BR gl_disableclipping (3),
.BR gl_enableclipping (3),
.BR gl_fillbox (3),
.BR gl_fillcircle (3),
.BR gl_hline (3),
.BR gl_line (3),
.BR gl_setclippingwindow (3),
.BR gl_setpalette (3),
.BR gl_setpalettecolor (3),
.BR gl_setpalettecolors (3),
.BR gl_setpixel (3),
.BR gl_setpixelrgb (3),
.BR gl_setrgbpalette (3),
.BR gl_setwritemode (3).
.SH AUTHOR
This manual page was written by Jay Link <jlink@svgalib.org>.

53
doc/man3/gl_circle.3 Normal file
View file

@ -0,0 +1,53 @@
.TH gl_circle 3 "2 Aug 1997" "Svgalib (>= 1.2.11)" "Svgalib User Manual"
.SH NAME
gl_circle \- draw a circle
.SH SYNOPSIS
.B #include <vgagl.h>
.BI "void gl_circle(int " x ", int " y ", int " r ", int " c );
.SH DESCRIPTION
Draw a circle of radius
.I r
in color
.IR c ,
centered at
.RI ( x ", " y ).
.SH SEE ALSO
.BR svgalib (7),
.BR vgagl (7),
.BR svgalib.conf (5),
.BR threedkit (7),
.BR testgl (1),
.BR plane (1),
.BR wrapdemo (1),
.BR gl_clearscreen (3),
.BR gl_colorfont (3),
.BR gl_disableclipping (3),
.BR gl_enableclipping (3),
.BR gl_fillbox (3),
.BR gl_hline (3),
.BR gl_line (3),
.BR gl_setclippingwindow (3),
.BR gl_setpalette (3),
.BR gl_setpalettecolor (3),
.BR gl_setpalettecolors (3),
.BR gl_setpixel (3),
.BR gl_setpixelrgb (3),
.BR gl_setrgbpalette (3),
.BR gl_setwritemode (3).
.SH AUTHOR
This manual page was edited by Michael Weller <eowmob@exp-math.uni-essen.de>. The
exact source of the referenced demo as well as of the original documentation is
unknown.
It is very likely that both are at least to some extent are due to
Harm Hanemaayer <H.Hanemaayer@inter.nl.net>.
Occasionally this might be wrong. I hereby
asked to be excused by the original author and will happily accept any additions or corrections
to this first version of the svgalib manual.

39
doc/man3/gl_clearscreen.3 Normal file
View file

@ -0,0 +1,39 @@
.TH gl_clearscreen 3 "2 Aug 1997" "Svgalib (>= 1.2.11)" "Svgalib User Manual"
.SH NAME
gl_clearscreen \- clear the screen
.SH SYNOPSIS
.B #include <vgagl.h>
.BI "void gl_clearscreen(int " c );
.SH DESCRIPTION
Fill the entire screen with color
.IR c .
.SH SEE ALSO
.BR svgalib (7),
.BR vgagl (7),
.BR svgalib.conf (5),
.BR threedkit (7),
.BR testgl (1),
.BR plane (1),
.BR wrapdemo (1),
.BR currentcontext (3),
.BR gl_circle (3),
.BR gl_fillbox (3),
.BR gl_hline (3),
.BR gl_line (3).
.SH AUTHOR
This manual page was edited by Michael Weller <eowmob@exp-math.uni-essen.de>. The
exact source of the referenced demo as well as of the original documentation is
unknown.
It is very likely that both are at least to some extent are due to
Harm Hanemaayer <H.Hanemaayer@inter.nl.net>.
Occasionally this might be wrong. I hereby
asked to be excused by the original author and will happily accept any additions or corrections
to this first version of the svgalib manual.

45
doc/man3/gl_colorfont.3 Normal file
View file

@ -0,0 +1,45 @@
.TH gl_colorfont 3 "2 Aug 1997" "Svgalib (>= 1.2.11)" "Svgalib User Manual"
.SH NAME
gl_colorfont \- change the color of a font
.SH SYNOPSIS
.B #include <vgagl.h>
.BI "void gl_colorfont(int " fw ", int " fh ", int " c ", void *" fp );
.SH DESCRIPTION
Set all nonzero pixels in the expanded font
.I fp
with 256 characters of size
.IR fw " and " fh
each to color
.IR c .
.SH SEE ALSO
.BR svgalib (7),
.BR vgagl (7),
.BR svgalib.conf (5),
.BR threedkit (7),
.BR testgl (1),
.BR plane (1),
.BR wrapdemo (1),
.BR gl_colorfont (3),
.BR gl_expandfont (3),
.BR gl_font8x8 (3),
.BR gl_setfontcolors (3),
.BR gl_write (3),
.BR gl_writen (3).
.SH AUTHOR
This manual page was edited by Michael Weller <eowmob@exp-math.uni-essen.de>. The
exact source of the referenced demo as well as of the original documentation is
unknown.
It is very likely that both are at least to some extent are due to
Harm Hanemaayer <H.Hanemaayer@inter.nl.net>.
Occasionally this might be wrong. I hereby
asked to be excused by the original author and will happily accept any additions or corrections
to this first version of the svgalib manual.

View file

@ -0,0 +1,52 @@
.TH gl_compileboxmask 3 "2 Aug 1997" "Svgalib (>= 1.2.11)" "Svgalib User Manual"
.SH NAME
gl_compileboxmask \- compress a masked bitmap
.SH SYNOPSIS
.B #include <vgagl.h>
.BI "void gl_compileboxmask(int " w ", int " h ", void *" sdp ", void *" ddp );
.SH DESCRIPTION
Convert the rectangular masked bitmap of size
.RI ( w ", " h ") at " sdp
to a compressed format that allows faster drawing, which is
stored at
.IR ddp .
Allocating
.IR w " * " h
bytes for the compiled
version is usually enough; an upper limit should be
.RI ( w " + 2) * " h .
Compiled bitmaps are only supported in linear 256 color modes.
.SH SEE ALSO
.BR svgalib (7),
.BR vgagl (7),
.BR svgalib.conf (5),
.BR threedkit (7),
.BR testgl (1),
.BR plane (1),
.BR wrapdemo (1),
.BR gl_compileboxmask (3),
.BR gl_compiledboxmasksize (3),
.BR gl_getbox (3),
.BR gl_putbox (3),
.BR gl_putboxpart (3),
.BR gl_putboxmask (3),
.BR gl_putboxmaskcompiled (3).
.SH AUTHOR
This manual page was edited by Michael Weller <eowmob@exp-math.uni-essen.de>. The
exact source of the referenced demo as well as of the original documentation is
unknown.
It is very likely that both are at least to some extent are due to
Harm Hanemaayer <H.Hanemaayer@inter.nl.net>.
Occasionally this might be wrong. I hereby
asked to be excused by the original author and will happily accept any additions or corrections
to this first version of the svgalib manual.

View file

@ -0,0 +1,46 @@
.TH gl_compiledboxmasksize 3 "2 Aug 1997" "Svgalib (>= 1.2.11)" "Svgalib User Manual"
.SH NAME
gl_compiledboxmasksize \- compute the size of a compiled masked box
.SH SYNOPSIS
.B #include <vgagl.h>
.BI "int gl_compiledboxmasksize(int " w ", int " h ", void *" sdp );
.SH DESCRIPTION
Returns the size of the compiled version of the masked
bitmap of size
.RI ( w ", " h )
at
.I sdp
that would be generated by
.BR compileboxmask(3).
Compiled bitmaps are only supported in linear 256 color modes.
.SH SEE ALSO
.BR svgalib (7),
.BR vgagl (7),
.BR svgalib.conf (5),
.BR threedkit (7),
.BR testgl (1),
.BR plane (1),
.BR wrapdemo (1),
.BR gl_compileboxmask (3),
.BR gl_putbox (3),
.BR gl_putboxmask (3),
.BR gl_putboxmaskcompiled (3).
.SH AUTHOR
This manual page was edited by Michael Weller <eowmob@exp-math.uni-essen.de>. The
exact source of the referenced demo as well as of the original documentation is
unknown.
It is very likely that both are at least to some extent are due to
Harm Hanemaayer <H.Hanemaayer@inter.nl.net>.
Occasionally this might be wrong. I hereby
asked to be excused by the original author and will happily accept any additions or corrections
to this first version of the svgalib manual.

51
doc/man3/gl_copybox.3 Normal file
View file

@ -0,0 +1,51 @@
.TH gl_copybox 3 "2 Aug 1997" "Svgalib (>= 1.2.11)" "Svgalib User Manual"
.SH NAME
gl_copybox \- copy a rectangular screen area
.SH SYNOPSIS
.B #include <vgagl.h>
.BI "void gl_copybox(int " x1 ", int " y1 ", int " w ", int " h
.BI ", int "x2 ", int " y2 );
.SH DESCRIPTION
Copy the rectangular area at
.BR (x1 ", " y1 )
of size
.BR (w ", " h ),
to
.BR (x2 ", " y2 )
(screencopy).
.SH SEE ALSO
.BR svgalib (7),
.BR vgagl (7),
.BR svgalib.conf (5),
.BR threedkit (7),
.BR testgl (1),
.BR plane (1),
.BR wrapdemo (1),
.BR gl_copyboxfromcontext (3),
.BR gl_copyboxtocontext (3),
.BR gl_copyscreen (3),
.BR gl_fillbox (3),
.BR gl_getbox (3),
.BR gl_putbox (3),
.BR gl_putboxmask (3),
.BR gl_putboxmaskcompiled (3),
.BR gl_putboxpart (3),
.BR gl_scalebox (3),
.SH AUTHOR
This manual page was edited by Michael Weller <eowmob@exp-math.uni-essen.de>. The
exact source of the referenced demo as well as of the original documentation is
unknown.
It is very likely that both are at least to some extent are due to
Harm Hanemaayer <H.Hanemaayer@inter.nl.net>.
Occasionally this might be wrong. I hereby
asked to be excused by the original author and will happily accept any additions or corrections
to this first version of the svgalib manual.

View file

@ -0,0 +1,57 @@
.TH gl_copyboxfromcontext 3 "2 Aug 1997" "Svgalib (>= 1.2.11)" "Svgalib User Manual"
.SH NAME
gl_copyboxfromcontext \- copy rectangular area from another context
.SH SYNOPSIS
.B #include <vgagl.h>
.BI "void gl_copyboxfromcontext(GraphicsContext *" gc ", int " x1 ", int "
.IB y1 ", int " w ", int " h ", int " x2 ", int " y2 );
.SH DESCRIPTION
Copy the rectangular area at
.RI ( x1 ", " y1 )
in the context
.IR gc
of size
.RI ( w ", " h )
to position
.RI ( x2 ", " y2 )
in the current context.
This is more efficient than
.BR copyboxtocontext (3).
.SH SEE ALSO
.BR svgalib (7),
.BR vgagl (7),
.BR svgalib.conf (5),
.BR threedkit (7),
.BR testgl (1),
.BR plane (1),
.BR wrapdemo (1),
.BR gl_copybox (3),
.BR gl_copyboxtocontext (3),
.BR gl_copyscreen (3),
.BR gl_fillbox (3),
.BR gl_getbox (3),
.BR gl_getcontext (3),
.BR gl_putbox (3),
.BR gl_putboxmask (3),
.BR gl_putboxmaskcompiled (3),
.BR gl_putboxpart (3),
.BR gl_rgbcolor (3).
.SH AUTHOR
This manual page was edited by Michael Weller <eowmob@exp-math.uni-essen.de>. The
exact source of the referenced demo as well as of the original documentation is
unknown.
It is very likely that both are at least to some extent are due to
Harm Hanemaayer <H.Hanemaayer@inter.nl.net>.
Occasionally this might be wrong. I hereby
asked to be excused by the original author and will happily accept any additions or corrections
to this first version of the svgalib manual.

View file

@ -0,0 +1,52 @@
.TH gl_copyboxtocontext 3 "2 Aug 1997" "Svgalib (>= 1.2.11)" "Svgalib User Manual"
.SH NAME
gl_copyboxtocontext \- copy a rectangular area to another context
.SH SYNOPSIS
.B #include <vgagl.h>
.BI "void gl_copyboxtocontext(int " x1 ", int " y1 ", int " w ", int " h
.BI ", GraphicsContext *" gc ", int " x2 ", int " y2 );
.SH DESCRIPTION
Copy the rectangular area at
.RI ( x1 ", " y1 )
of size
.RI ( w ", " h )
to position
.RI ( x2 ", " y2 )
in the context
.IR gc .
If possible use
.BR copyboxfromcontext (3).
.SH SEE ALSO
.BR svgalib (7),
.BR vgagl (7),
.BR svgalib.conf (5),
.BR threedkit (7),
.BR testgl (1),
.BR plane (1),
.BR wrapdemo (1),
.BR gl_copybox (3),
.BR gl_copyboxfromcontext (3),
.BR gl_copyscreen (3),
.BR gl_getbox (3),
.BR gl_putbox (3),
.BR gl_putboxmask (3),
.BR gl_putboxmaskcompiled (3),
.BR gl_putboxpart (3).
.SH AUTHOR
This manual page was edited by Michael Weller <eowmob@exp-math.uni-essen.de>. The
exact source of the referenced demo as well as of the original documentation is
unknown.
It is very likely that both are at least to some extent are due to
Harm Hanemaayer <H.Hanemaayer@inter.nl.net>.
Occasionally this might be wrong. I hereby
asked to be excused by the original author and will happily accept any additions or corrections
to this first version of the svgalib manual.

45
doc/man3/gl_copyscreen.3 Normal file
View file

@ -0,0 +1,45 @@
.TH gl_copyscreen 3 "2 Aug 1997" "Svgalib (>= 1.2.11)" "Svgalib User Manual"
.SH NAME
gl_copyscreen \- copy the screen contents of contexts
.SH SYNOPSIS
.B #include <vgagl.h>
.BI "void gl_copyscreen(GraphicsContext *" gc );
.SH DESCRIPTION
Copy the current graphics context contents (screen data) to
the specified graphics context (the physical screen, for
example). Contexts are assumed to be identical in size.
.SH SEE ALSO
.BR svgalib (7),
.BR vgagl (7),
.BR svgalib.conf (5),
.BR threedkit (7),
.BR testgl (1),
.BR plane (1),
.BR wrapdemo (1),
.BR currentcontext (3),
.BR gl_allocatecontext (3),
.BR gl_clearscreen (3),
.BR gl_copybox (3),
.BR gl_copyboxfromcontext (3),
.BR gl_copyboxtocontext (3),
.BR gl_fillbox (3),
.BR gl_getbox (3),
.BR gl_putbox (3).
.SH AUTHOR
This manual page was edited by Michael Weller <eowmob@exp-math.uni-essen.de>. The
exact source of the referenced demo as well as of the original documentation is
unknown.
It is very likely that both are at least to some extent are due to
Harm Hanemaayer <H.Hanemaayer@inter.nl.net>.
Occasionally this might be wrong. I hereby
asked to be excused by the original author and will happily accept any additions or corrections
to this first version of the svgalib manual.

View file

@ -0,0 +1,36 @@
.TH gl_disableclipping 3 "2 Aug 1997" "Svgalib (>= 1.2.11)" "Svgalib User Manual"
.SH NAME
gl_disableclipping \- disables clipping
.SH SYNOPSIS
.B #include <vgagl.h>
.BI "void gl_disableclipping(void);"
.SH DESCRIPTION
Disable clipping. This is the default.
.SH SEE ALSO
.BR svgalib (7),
.BR vgagl (7),
.BR svgalib.conf (5),
.BR threedkit (7),
.BR testgl (1),
.BR plane (1),
.BR wrapdemo (1),
.BR gl_enableclipping (3),
.BR gl_setclippingwindow (3).
.SH AUTHOR
This manual page was edited by Michael Weller <eowmob@exp-math.uni-essen.de>. The
exact source of the referenced demo as well as of the original documentation is
unknown.
It is very likely that both are at least to some extent are due to
Harm Hanemaayer <H.Hanemaayer@inter.nl.net>.
Occasionally this might be wrong. I hereby
asked to be excused by the original author and will happily accept any additions or corrections
to this first version of the svgalib manual.

View file

@ -0,0 +1,41 @@
.TH gl_enableclipping 3 "2 Aug 1997" "Svgalib (>= 1.2.11)" "Svgalib User Manual"
.SH NAME
gl_enableclipping \- enables clipping
.SH SYNOPSIS
.B #include <vgagl.h>
.BI "void gl_enableclipping(void);"
.SH DESCRIPTION
Enable automatic clipping in most functions. No, I don't know
which ones. However, it works for most.
.BR gl_copybox (3)
is report to do no clipping.
Go figure.
.SH SEE ALSO
.BR svgalib (7),
.BR vgagl (7),
.BR svgalib.conf (5),
.BR threedkit (7),
.BR testgl (1),
.BR plane (1),
.BR wrapdemo (1),
.BR gl_disableclipping (3),
.BR gl_setclippingwindow (3).
.SH AUTHOR
This manual page was edited by Michael Weller <eowmob@exp-math.uni-essen.de>. The
exact source of the referenced demo as well as of the original documentation is
unknown.
It is very likely that both are at least to some extent are due to
Harm Hanemaayer <H.Hanemaayer@inter.nl.net>.
Occasionally this might be wrong. I hereby
asked to be excused by the original author and will happily accept any additions or corrections
to this first version of the svgalib manual.

View file

@ -0,0 +1,71 @@
.TH gl_enablepageflipping 3 "2 Aug 1997" "Svgalib (>= 1.2.11)" "Svgalib User Manual"
.SH NAME
gl_enablepageflipping \- enables automatic page flipping
.SH SYNOPSIS
.B #include <vgagl.h>
.BI "int gl_enablepageflipping(GraphicsContext *" gc );
.SH DESCRIPTION
Enable page flipping or triple buffering in
.BR gl_copyscreen (3)
if the physical context
.I gc
can do it.
Returns 3 if triple
buffering will be used, 2 for page flipping, 0 if page
flipping is not possible (due to video memory/mode
limitations).
When pageflipping is enabled, the
.BR gl_screenoffset (3)
is ignored in
.BR gl_copyscreen (3).
The idea is that you draw your picture in
.I gc
and copy it to the screen by consecutive
.BR gl_copyscreen (3)
calls. Each of these will choose a free buffer in the screen and
adjust the display start accourdingly.
The current context must by the VGA when
.BR gl_copyscreen (3)
is called in this situation.
.SH SEE ALSO
.BR svgalib (7),
.BR vgagl (7),
.BR svgalib.conf (5),
.BR threedkit (7),
.BR testgl (1),
.BR plane (1),
.BR wrapdemo (1),
.BR gl_copybox (3),
.BR gl_copyboxfromcontext (3),
.BR gl_copyboxtocontext (3),
.BR gl_copyscreen (3),
.BR gl_getbox (3),
.BR gl_putbox (3),
.BR gl_setcontext (3),
.BR gl_setcontextheight (3),
.BR gl_setcontextvga (3),
.BR gl_setcontextvgavirtual (3),
.BR gl_setcontextvirtual (3),
.BR gl_setcontextwidth (3).
.SH AUTHOR
This manual page was edited by Michael Weller <eowmob@exp-math.uni-essen.de>. The
exact source of the referenced demo as well as of the original documentation is
unknown.
It is very likely that both are at least to some extent are due to
Harm Hanemaayer <H.Hanemaayer@inter.nl.net>.
Occasionally this might be wrong. I hereby
asked to be excused by the original author and will happily accept any additions or corrections
to this first version of the svgalib manual.

53
doc/man3/gl_expandfont.3 Normal file
View file

@ -0,0 +1,53 @@
.TH gl_expandfont 3 "2 Aug 1997" "Svgalib (>= 1.2.11)" "Svgalib User Manual"
.SH NAME
gl_expandfont \- expand a packed pixel font
.SH SYNOPSIS
.B #include <vgagl.h>
.BI "void gl_expandfont(int " fw ", int " fh ", int " c ", void *" sfp ", void *" dfp );
.SH DESCRIPTION
Convert a bit-per-pixel font at
.IR sfp
with 256 characters of size
.RI ( fw ", " fh )
to an expanded font of character pixmaps, stored at
.I dfp
(size will be 256 *
.IR fw " * " fw
.RB " * " BYTESPERPIXEL ).
All non-zero pixels are set to color
.IR c .
It is possible to use non expanded fonts (but it is slower) when
the
.BR "FONT_COMPRESSED gl_setwritemode" (3)
flag is set.
.SH SEE ALSO
.BR svgalib (7),
.BR vgagl (7),
.BR svgalib.conf (5),
.BR testgl (1),
.BR gl_colorfont (3),
.BR gl_font8x8 (3),
.BR gl_setfont (3),
.BR gl_setfontcolors (3),
.BR gl_setwritemode (3),
.BR gl_write (3),
.BR gl_writen (3).
.SH AUTHOR
This manual page was edited by Michael Weller <eowmob@exp-math.uni-essen.de>. The
exact source of the referenced demo as well as of the original documentation is
unknown.
It is very likely that both are at least to some extent are due to
Harm Hanemaayer <H.Hanemaayer@inter.nl.net>.
Occasionally this might be wrong. I hereby
asked to be excused by the original author and will happily accept any additions or corrections
to this first version of the svgalib manual.

44
doc/man3/gl_fillbox.3 Normal file
View file

@ -0,0 +1,44 @@
.TH gl_fillbox 3 "2 Aug 1997" "Svgalib (>= 1.2.11)" "Svgalib User Manual"
.SH NAME
gl_fillbox \- fill a rectangular area
.SH SYNOPSIS
.B #include <vgagl.h>
.BI "void gl_fillbox(int " x ", int " y ", int " w ", int " h ", int " c );
.SH DESCRIPTION
Fill a rectangular area at position
.RI ( x ", " y )
with size
.RI ( w ", " h )
of the screen with a single color
.IR c .
.SH SEE ALSO
.BR svgalib (7),
.BR vgagl (7),
.BR svgalib.conf (5),
.BR testgl (1),
.BR currentcontext (3),
.BR gl_clearscreen (3),
.BR gl_getbox (3),
.BR gl_putbox (3),
.BR gl_putboxmask (3),
.BR gl_putboxmaskcompiled (3),
.BR gl_putboxpart (3),
.BR gl_scalebox (3).
.SH AUTHOR
This manual page was edited by Michael Weller <eowmob@exp-math.uni-essen.de>. The
exact source of the referenced demo as well as of the original documentation is
unknown.
It is very likely that both are at least to some extent are due to
Harm Hanemaayer <H.Hanemaayer@inter.nl.net>.
Occasionally this might be wrong. I hereby
asked to be excused by the original author and will happily accept any additions or corrections
to this first version of the svgalib manual.

46
doc/man3/gl_fillcircle.3 Normal file
View file

@ -0,0 +1,46 @@
.TH gl_fillcircle 3 "4 Dec 1999" "Svgalib (>= 1.4.1)" "Svgalib User Manual"
.SH NAME
gl_fillcircle \- draw a filled circle
.SH SYNOPSIS
.B #include <vgagl.h>
.BI "void gl_fillcircle(int " x ", int " y ", int " r ", int " c );
.SH DESCRIPTION
Draw a filled circle of radius
.I r
in color
.I c ,
centered at
.I ( x ", " y ).
.SH SEE ALSO
.BR svgalib (7),
.BR vgagl (7),
.BR svgalib.conf (5),
.BR threedkit (7),
.BR testgl (1),
.BR plane (1),
.BR wrapdemo (1),
.BR gl_circle (3),
.BR gl_clearscreen (3),
.BR gl_colorfont (3),
.BR gl_disableclipping (3),
.BR gl_enableclipping (3),
.BR gl_fillbox (3),
.BR gl_hline (3),
.BR gl_line (3),
.BR gl_setclippingwindow (3),
.BR gl_setpalette (3),
.BR gl_setpalettecolor (3),
.BR gl_setpalettecolors (3),
.BR gl_setpixel (3),
.BR gl_setpixelrgb (3),
.BR gl_setrgbpalette (3),
.BR gl_setwritemode (3).
.SH AUTHOR
This manual page was written by Jay Link <jlink@svgalib.org>. The function
itself is based upon the original gl_circle (3).

49
doc/man3/gl_font8x8.3 Normal file
View file

@ -0,0 +1,49 @@
.TH gl_font8x8 3 "2 Aug 1997" "Svgalib (>= 1.2.11)" "Svgalib User Manual"
.SH NAME
gl_font8x8 \- a packed 8x8 pixel font
.SH SYNOPSIS
.B #include <vgagl.h>
.BI "extern unsigned char *" gl_font8x8 ;
.SH DESCRIPTION
.I gl_font8x8
contains a packed pixel font with 8x8 pixels per character which you can
use in your
.B vgagl
programs. Before you can use it, you might need to expand it with
.BR gl_expandfont (3),
though.
It is possible to use non expanded fonts (but it is slower) when
the
.BR "FONT_COMPRESSED gl_setwritemode" (3)
flag is set.
.SH SEE ALSO
.BR svgalib (7),
.BR vgagl (7),
.BR svgalib.conf (5),
.BR testgl (1),
.BR gl_colorfont (3),
.BR gl_expandfont (3),
.BR gl_setfont (3),
.BR gl_setfontcolors (3),
.BR gl_setwritemode (3),
.BR gl_write (3),
.BR gl_writen (3).
.SH AUTHOR
This manual page was edited by Michael Weller <eowmob@exp-math.uni-essen.de>. The
exact source of the referenced demo as well as of the original documentation is
unknown.
It is very likely that both are at least to some extent are due to
Harm Hanemaayer <H.Hanemaayer@inter.nl.net>.
Occasionally this might be wrong. I hereby
asked to be excused by the original author and will happily accept any additions or corrections
to this first version of the svgalib manual.

45
doc/man3/gl_freecontext.3 Normal file
View file

@ -0,0 +1,45 @@
.TH gl_freecontext 3 "2 Aug 1997" "Svgalib (>= 1.2.11)" "Svgalib User Manual"
.SH NAME
gl_freecontext \- free a virtual screen
.SH SYNOPSIS
.B #include <vgagl.h>
.BI "void gl_freecontext(GraphicsContext *" gc );
.SH DESCRIPTION
Free the space allocated for the virtual screen in the
given context
.I gc
which should better be a virtual context.
.SH SEE ALSO
.BR svgalib (7),
.BR vgagl (7),
.BR svgalib.conf (5),
.BR threedkit (7),
.BR testgl (1),
.BR currentcontext (3),
.BR gl_allocatecontext (3),
.BR gl_copyscreen (3),
.BR gl_getcontext (3),
.BR gl_setcontext (3),
.BR gl_setcontextheight (3),
.BR gl_setcontextvga (3),
.BR gl_setcontextvgavirtual (3),
.BR gl_setcontextvirtual (3),
.BR gl_setcontextwidth (3).
.SH AUTHOR
This manual page was edited by Michael Weller <eowmob@exp-math.uni-essen.de>. The
exact source of the referenced demo as well as of the original documentation is
unknown.
It is very likely that both are at least to some extent are due to
Harm Hanemaayer <H.Hanemaayer@inter.nl.net>.
Occasionally this might be wrong. I hereby
asked to be excused by the original author and will happily accept any additions or corrections
to this first version of the svgalib manual.

51
doc/man3/gl_getbox.3 Normal file
View file

@ -0,0 +1,51 @@
.TH gl_getbox 3 "2 Aug 1997" "Svgalib (>= 1.2.11)" "Svgalib User Manual"
.SH NAME
gl_getbox \- copy a rectangular pixmap from the screen to a buffer
.SH SYNOPSIS
.B #include <vgagl.h>
.BI "void gl_getbox(int " x ", int " y ", int " w ", int " h ", void *" dp );
.SH DESCRIPTION
Copy a rectangular bitmap at position
.RI ( x ", " y )
with size
.RI ( w ", " h )
from the screen to a buffer
.IR dp .
Pixmaps are in row-major order. The destination pixmap has the size
.IR w " * " h " * "
.BR BYTESPERPIXEL .
.SH SEE ALSO
.BR svgalib (7),
.BR vgagl (7),
.BR svgalib.conf (5),
.BR threedkit (7),
.BR testgl (1),
.BR gl_compileboxmask (3),
.BR gl_compiledboxmasksize (3),
.BR gl_copybox (3),
.BR gl_copyboxfromcontext (3),
.BR gl_copyboxtocontext (3),
.BR gl_putbox (3),
.BR gl_putboxmask (3),
.BR gl_putboxmaskcompiled (3),
.BR gl_putboxpart (3),
.BR gl_scalebox (3).
.SH AUTHOR
This manual page was edited by Michael Weller <eowmob@exp-math.uni-essen.de>. The
exact source of the referenced demo as well as of the original documentation is
unknown.
It is very likely that both are at least to some extent are due to
Harm Hanemaayer <H.Hanemaayer@inter.nl.net>.
Occasionally this might be wrong. I hereby
asked to be excused by the original author and will happily accept any additions or corrections
to this first version of the svgalib manual.

69
doc/man3/gl_getcontext.3 Normal file
View file

@ -0,0 +1,69 @@
.TH gl_getcontext 3 "2 Aug 1997" "Svgalib (>= 1.2.11)" "Svgalib User Manual"
.SH NAME
gl_getcontext, currentcontext \- get the current graphics contents.
.SH SYNOPSIS
.B #include <vgagl.h>
.BI "void gl_getcontext(GraphicsContext *" gc );
.BI "extern GraphicsContext " currentcontext ;
/* this is already in vgagl.h */
.SH DESCRIPTION
Save the current context in the structure variable
.IR gc .
You can also get the current context from the global
variable
.IR currentcontext ;
However, simply access single elements in this structure
with the macros given in
.BR vgagl (7)
but do not copy
.I currentcontext
in another structure. This is because the size of the structure
might change and your program does not know it when it will be
linked dynamically to future svgalib versions.
Instead use
.BR gl_allocatecontext (3)
to allocate such a structure, fill it with
.B gl_getcontext
and release it with
.BR free (3)
after usage.
.SH SEE ALSO
.BR svgalib (7),
.BR vgagl (7),
.BR svgalib.conf (5),
.BR threedkit (7),
.BR testgl (1),
.BR plane (1),
.BR wrapdemo (1),
.BR gl_allocatecontext (3),
.BR gl_copyboxfromcontext (3),
.BR gl_copyboxtocontext (3),
.BR gl_freecontext (3),
.BR gl_setcontext (3),
.BR gl_setcontextheight (3),
.BR gl_setcontextvga (3),
.BR gl_setcontextvgavirtual (3),
.BR gl_setcontextvirtual (3),
.BR gl_setcontextwidth (3).
.SH AUTHOR
This manual page was edited by Michael Weller <eowmob@exp-math.uni-essen.de>. The
exact source of the referenced demo as well as of the original documentation is
unknown.
It is very likely that both are at least to some extent are due to
Harm Hanemaayer <H.Hanemaayer@inter.nl.net>.
Occasionally this might be wrong. I hereby
asked to be excused by the original author and will happily accept any additions or corrections
to this first version of the svgalib manual.

1
doc/man3/gl_getpalette.3 Normal file
View file

@ -0,0 +1 @@
.so man3/gl_getpalettecolor.3

View file

@ -0,0 +1,62 @@
.TH gl_getpalettecolor 3 "2 Aug 1997" "Svgalib (>= 1.2.11)" "Svgalib User Manual"
.SH NAME
gl_getpalettecolor, gl_getpalettecolors, gl_getpalette \- read the color palette
.SH SYNOPSIS
.B #include <vgagl.h>
.BI "void gl_getpalettecolor(int " c ", int *" r ", int *" g ", int *" b );
.br
.BI "void gl_getpalettecolors(int " s ", int " n ", void *" dp );
.br
.BI "void gl_getpalette(void *" dp );
.SH DESCRIPTION
.B gl_getpalettecolor
gets red, green and blue values (in the range 0 - 63) of
color
.I c
from the color-lookup-table, and stores
them as integers in the memory locations pointed to by
.IR r ", " g " and " b .
.B gl_getpalettecolors
gets RGB values of
.I n
colors starting at
.IR s ,
which are stored
as a table of groups of three bytes each at
.IR dp .
.B gl_getpalette
is equivalent to
.BR "getpalettecolors(0, 256, " dp ).
.BR vga_ext_set (3)
might change the range of the colors returned to 0 - 255.
.SH SEE ALSO
.BR svgalib (7),
.BR vgagl (7),
.BR svgalib.conf (5),
.BR threedkit (7),
.BR testgl (1),
.BR vga_ext_set (3),
.BR gl_setpalette (3),
.BR gl_setpalettecolor (3),
.BR gl_setpalettecolors (3).
.SH AUTHOR
This manual page was edited by Michael Weller <eowmob@exp-math.uni-essen.de>. The
exact source of the referenced demo as well as of the original documentation is
unknown.
It is very likely that both are at least to some extent are due to
Harm Hanemaayer <H.Hanemaayer@inter.nl.net>.
Occasionally this might be wrong. I hereby
asked to be excused by the original author and will happily accept any additions or corrections
to this first version of the svgalib manual.

View file

@ -0,0 +1 @@
.so man3/gl_getpalettecolor.3

47
doc/man3/gl_getpixel.3 Normal file
View file

@ -0,0 +1,47 @@
.TH gl_getpixel 3 "2 Aug 1997" "Svgalib (>= 1.2.11)" "Svgalib User Manual"
.SH NAME
gl_getpixel \- return the color of a pixel
.SH SYNOPSIS
.B #include <vgagl.h>
.BI "int gl_getpixel(int " x ", int " y );
.SH DESCRIPTION
Returns the color of pixel at position
.RI ( x ", " y )
in the format used in the screen memory.
The color -1 is returned for points outside the clipping window.
.SH SEE ALSO
.BR svgalib (7),
.BR vgagl (7),
.BR svgalib.conf (5),
.BR threedkit (7),
.BR testgl (1),
.BR gl_getbox (3),
.BR gl_getpalette (3),
.BR gl_getpalettecolor (3),
.BR gl_getpalettecolors (3),
.BR gl_getpixelrgb (3),
.BR gl_rgbcolor (3),
.BR gl_setpalette (3),
.BR gl_setpalettecolor (3),
.BR gl_setpalettecolors (3),
.BR gl_setpixel (3),
.BR gl_setpixelrgb (3).
.SH AUTHOR
This manual page was edited by Michael Weller <eowmob@exp-math.uni-essen.de>. The
exact source of the referenced demo as well as of the original documentation is
unknown.
It is very likely that both are at least to some extent are due to
Harm Hanemaayer <H.Hanemaayer@inter.nl.net>.
Occasionally this might be wrong. I hereby
asked to be excused by the original author and will happily accept any additions or corrections
to this first version of the svgalib manual.

41
doc/man3/gl_getpixelrgb.3 Normal file
View file

@ -0,0 +1,41 @@
.TH gl_getpixelrgb 3 "2 Aug 1997" "Svgalib (>= 1.2.11)" "Svgalib User Manual"
.SH NAME
gl_getpixelrgb \- store color components of a pixel
.SH SYNOPSIS
.B #include <vgagl.h>
.BI "void gl_getpixelrgb(int " x ", int " y ", int *" r ", int *" g ", int *" b );
.SH DESCRIPTION
Store color components from pixel at
.RI ( x ", " y )
ranging from 0 to 255 into integers pointed to by
.IR r ", " g " and " b .
.SH SEE ALSO
.BR svgalib (7),
.BR vgagl (7),
.BR svgalib.conf (5),
.BR threedkit (7),
.BR testgl (1),
.BR plane (1),
.BR wrapdemo (1),
.BR gl_getpixel (3),
.BR gl_rgbcolor (3),
.BR gl_setpixel (3),
.BR gl_setpixelrgb (3).
.SH AUTHOR
This manual page was edited by Michael Weller <eowmob@exp-math.uni-essen.de>. The
exact source of the referenced demo as well as of the original documentation is
unknown.
It is very likely that both are at least to some extent are due to
Harm Hanemaayer <H.Hanemaayer@inter.nl.net>.
Occasionally this might be wrong. I hereby
asked to be excused by the original author and will happily accept any additions or corrections
to this first version of the svgalib manual.

47
doc/man3/gl_hline.3 Normal file
View file

@ -0,0 +1,47 @@
.TH gl_hline 3 "9 Feb 2000" "Svgalib (>= 1.4.2)" "Svgalib User Manual"
.SH NAME
gl_hline \- draw a horizontal line
.SH SYNOPSIS
.B #include <vgagl.h>
.BI "void gl_hline(int " x1 ", int " y ", int " x2 ", int " c );
.SH DESCRIPTION
Draw a horizontal line from point
.RI ( x1 ", " y )
to
.RI ( x2 ", " y )
in color
.IR c .
x1 must not be larger than x2. If x2<x1 the function does nothing.
.SH SEE ALSO
.BR svgalib (7),
.BR vgagl (7),
.BR svgalib.conf (5),
.BR threedkit (7),
.BR testgl (1),
.BR plane (1),
.BR wrapdemo (1),
.BR gl_circle (3),
.BR gl_clearscreen (3),
.BR gl_fillbox (3),
.BR gl_line (3),
.BR gl_setpixel (3),
.BR gl_setpixelrgb (3),
.BR gl_setwritemode (3).
.SH AUTHOR
This manual page was edited by Michael Weller <eowmob@exp-math.uni-essen.de>. The
exact source of the referenced demo as well as of the original documentation is
unknown.
It is very likely that both are at least to some extent are due to
Harm Hanemaayer <H.Hanemaayer@inter.nl.net>.
Occasionally this might be wrong. I hereby
asked to be excused by the original author and will happily accept any additions or corrections
to this first version of the svgalib manual.

56
doc/man3/gl_line.3 Normal file
View file

@ -0,0 +1,56 @@
.TH gl_line 3 "21 Aug 1999" "Svgalib (>= 1.2.11)" "Svgalib User Manual"
.SH NAME
gl_line \- draw a line
.SH SYNOPSIS
.B #include <vgagl.h>
.BI "void gl_line(int " x1 ", int " y1 ", int " x2 ", int " y2 ", int " c );
.SH DESCRIPTION
Draw a line from point
.RI ( x1 ", " y1 )
to
.RI ( x2 ", " y2 )
inclusively in color
.IR c .
You should not assume that the same drawing trajectory is used when you exchange start and
end points.
To use this program one first sets up a mode with a regular
vga_setmode call and vga_setpage(0), with possibly a
vga_setlinearaddressing
call. Then a call to gl_setcontextvga(mode) is made. This makes the
information about the mode available to gl_line.
The pixels are placed directly into video memory using inline coded
commands.
.SH SEE ALSO
.BR svgalib (7),
.BR vgagl (7),
.BR svgalib.conf (5),
.BR threedkit (7),
.BR testgl (1),
.BR plane (1),
.BR wrapdemo (1),
.BR gl_circle (3),
.BR gl_clearscreen (3),
.BR gl_hline (3),
.BR gl_setpixel (3),
.BR gl_setpixelrgb (3),
.BR gl_setcontextvga (3).
.SH AUTHOR
This manual page was edited by Michael Weller <eowmob@exp-math.uni-essen.de>. The
exact source of the referenced demo as well as of the original documentation is
unknown. This page was modified by Don Secrest <secrest@uiuc.edu>.
It is very likely that both are at least to some extent are due to
Harm Hanemaayer <H.Hanemaayer@inter.nl.net>.
Occasionally this might be wrong. I hereby
asked to be excused by the original author and will happily accept any additions or corrections
to this first version of the svgalib manual.

70
doc/man3/gl_printf.3 Normal file
View file

@ -0,0 +1,70 @@
.TH gl_printf 3 "22 Feb 1997" "Svgalib 1.3.0" "Svgalib User Manual"
.SH NAME
gl_printf \- write formatted output in graphic mode
.SH SYNOPSIS
.B #include <vgagl.h>
.BI "int gl_printf(int " x ", int " y ", const char *" fmt ", ...);"
.SH DESCRIPTION
.B gl_printf
writes, like
.B printf(3)
a formatted string to position
.RI ( x ", " y )
using the currently selected font. If one or both of
.IR x " and " y
is negative, the text printing continues at the last position. The
special characters
.BR \eb ", " \er ", "
.BR \en ", " \ea ", "
.BR \et " and " \ev
have the usual effects.
Printing wraps at the screen borders. Nevertheless, behaviour is undefined
if not a single characters fits on the screen or if the initial position
is outside the screen.
The kind of text draw operation is set with
.BR gl_setwritemode (3).
.B BEWARE!
Prior to the of use of
.BR gl_printf (3)
you must set a font.
A good default initialization sequence is:
.B gl_setfont(8, 8, gl_font8x8);
.br
.B gl_setwritemode(FONT_COMPRESSED + WRITEMODE_OVERWRITE);
.br
.B gl_setfontcolors(0, vga_white());
.br
.SH RETURN VALUE
The number of characters printed.
.SH BUGS
For compatibility reasons this function is not contained in a.out
libraries.
.SH SEE ALSO
.BR printf (3),
.BR svgalib (7),
.BR vgagl (7),
.BR gl_colorfont (3),
.BR gl_expandfont (3),
.BR gl_font8x8 (3),
.BR gl_setfont (3),
.BR gl_setfontcolors (3),
.BR gl_setwritemode (3),
.BR gl_write (3),
.BR gl_writechar (3),
.BR printftest (6).
.SH AUTHOR
This function and manual page was written by Trek <trek00@freenet.hut.fi>
<trek@mediaservice.net>.

52
doc/man3/gl_putbox.3 Normal file
View file

@ -0,0 +1,52 @@
.TH gl_putbox 3 "2 Aug 1997" "Svgalib (>= 1.2.11)" "Svgalib User Manual"
.SH NAME
gl_putbox \- copy a pixmap to a rectangular area
.SH SYNOPSIS
.B #include <vgagl.h>
.BI "void gl_putbox(int " x ", int " y ", int " w ", int " h ", void *" dp );
.SH DESCRIPTION
Copy the contents of a memory buffer
.I dp
to a rectangular bitmap at position
.RI ( x ", " y )
with size
.RI ( w ", " h ).
Pixmaps are in row-major order. The source pixmap memory has the size
.IR w " * " h " * "
.BR BYTESPERPIXEL .
.SH SEE ALSO
.BR svgalib (7),
.BR vgagl (7),
.BR svgalib.conf (5),
.BR threedkit (7),
.BR testgl (1),
.BR gl_compileboxmask (3),
.BR gl_compiledboxmasksize (3),
.BR gl_copybox (3),
.BR gl_copyboxfromcontext (3),
.BR gl_copyboxtocontext (3),
.BR gl_fillbox (3),
.BR gl_getbox (3),
.BR gl_putboxmask (3),
.BR gl_putboxmaskcompiled (3),
.BR gl_putboxpart (3),
.BR gl_scalebox (3).
.SH AUTHOR
This manual page was edited by Michael Weller <eowmob@exp-math.uni-essen.de>. The
exact source of the referenced demo as well as of the original documentation is
unknown.
It is very likely that both are at least to some extent are due to
Harm Hanemaayer <H.Hanemaayer@inter.nl.net>.
Occasionally this might be wrong. I hereby
asked to be excused by the original author and will happily accept any additions or corrections
to this first version of the svgalib manual.

58
doc/man3/gl_putboxmask.3 Normal file
View file

@ -0,0 +1,58 @@
.TH gl_putboxmask 3 "2 Aug 1997" "Svgalib (>= 1.2.11)" "Svgalib User Manual"
.SH NAME
gl_putboxmask \- copy a masked pixmap to a rectangular area
.SH SYNOPSIS
.B #include <vgagl.h>
.BI "void gl_putboxmask(int " x ", int " y ", int " w ", int " h ", void *" dp );
.SH DESCRIPTION
Copy the contents of a memory buffer
.I dp
to a rectangular bitmap at position
.RI ( x ", " y )
with size
.RI ( w ", " h ).
This function works like
.BR gl_putbox ,
but does not write pixmap pixels of color zero. If the same pixmap is used often
you should consider using the faster
.BR gl_putboxmaskcompiled (3).
Pixmaps are in row-major order. The source pixmap memory has the size
.IR w " * " h " * "
.BR BYTESPERPIXEL .
.SH SEE ALSO
.BR svgalib (7),
.BR vgagl (7),
.BR svgalib.conf (5),
.BR threedkit (7),
.BR testgl (1),
.BR gl_compileboxmask (3),
.BR gl_compiledboxmasksize (3),
.BR gl_copybox (3),
.BR gl_copyboxfromcontext (3),
.BR gl_copyboxtocontext (3),
.BR gl_fillbox (3),
.BR gl_getbox (3),
.BR gl_putbox (3),
.BR gl_putboxmaskcompiled (3),
.BR gl_putboxpart (3),
.BR gl_scalebox (3).
.SH AUTHOR
This manual page was edited by Michael Weller <eowmob@exp-math.uni-essen.de>. The
exact source of the referenced demo as well as of the original documentation is
unknown.
It is very likely that both are at least to some extent are due to
Harm Hanemaayer <H.Hanemaayer@inter.nl.net>.
Occasionally this might be wrong. I hereby
asked to be excused by the original author and will happily accept any additions or corrections
to this first version of the svgalib manual.

View file

@ -0,0 +1,55 @@
.TH gl_putboxmaskcompiled 3 "2 Aug 1997" "Svgalib (>= 1.2.11)" "Svgalib User Manual"
.SH NAME
gl_putboxmaskcompiled \- copy a compiled masked pixmap to a rectangular area
.SH SYNOPSIS
.B #include <vgagl.h>
.BI "void gl_putboxmaskcompiled(int " x ", int " y ", int " w ", int " h ", void *" dp );
.SH DESCRIPTION
Copy the contents of a memory buffer
.I dp
to a rectangular bitmap at position
.RI ( x ", " y )
with size
.RI ( w ", " h ).
This function works like
.BR gl_putbox ,
but does not write pixmap pixels of color zero. Also, for faster operation the
pixmap was compiled with
.BR gl_compileboxmask (3)
first.
.SH SEE ALSO
.BR svgalib (7),
.BR vgagl (7),
.BR svgalib.conf (5),
.BR threedkit (7),
.BR testgl (1),
.BR gl_compileboxmask (3),
.BR gl_compiledboxmasksize (3),
.BR gl_copybox (3),
.BR gl_copyboxfromcontext (3),
.BR gl_copyboxtocontext (3),
.BR gl_fillbox (3),
.BR gl_getbox (3),
.BR gl_putbox (3),
.BR gl_putboxmask (3),
.BR gl_putboxpart (3),
.BR gl_scalebox (3).
.SH AUTHOR
This manual page was edited by Michael Weller <eowmob@exp-math.uni-essen.de>. The
exact source of the referenced demo as well as of the original documentation is
unknown.
It is very likely that both are at least to some extent are due to
Harm Hanemaayer <H.Hanemaayer@inter.nl.net>.
Occasionally this might be wrong. I hereby
asked to be excused by the original author and will happily accept any additions or corrections
to this first version of the svgalib manual.

60
doc/man3/gl_putboxpart.3 Normal file
View file

@ -0,0 +1,60 @@
.TH gl_putboxpart 3 "2 Aug 1997" "Svgalib (>= 1.2.11)" "Svgalib User Manual"
.SH NAME
gl_putboxpart \- copy a partial pixmap to a rectangular area
.SH SYNOPSIS
.B #include <vgagl.h>
.BI "void gl_putboxpart(int " x ", int " y ", int " w ", int " h
.BI ", int " bw ", int " bh ", void *" dp
.BI ", int " xo ", int " yo );
.SH DESCRIPTION
Copy the contents of a memory buffer
.I dp
to a rectangular bitmap at position
.RI ( x ", " y )
with size
.RI ( w ", " h ).
However, only a part of size
.RI ( bw ", " bh )
starting at offset
.RI ( xo ", " yo )
in the pixmap is copied.
Pixmaps are in row-major order. The source pixmap memory has the size
.IR w " * " h " * "
.BR BYTESPERPIXEL .
.SH SEE ALSO
.BR svgalib (7),
.BR vgagl (7),
.BR svgalib.conf (5),
.BR threedkit (7),
.BR testgl (1),
.BR gl_compileboxmask (3),
.BR gl_compiledboxmasksize (3),
.BR gl_copybox (3),
.BR gl_copyboxfromcontext (3),
.BR gl_copyboxtocontext (3),
.BR gl_fillbox (3),
.BR gl_getbox (3),
.BR gl_putbox (3),
.BR gl_putboxmask (3),
.BR gl_putboxmaskcompiled (3),
.BR gl_scalebox (3).
.SH AUTHOR
This manual page was edited by Michael Weller <eowmob@exp-math.uni-essen.de>. The
exact source of the referenced demo as well as of the original documentation is
unknown.
It is very likely that both are at least to some extent are due to
Harm Hanemaayer <H.Hanemaayer@inter.nl.net>.
Occasionally this might be wrong. I hereby
asked to be excused by the original author and will happily accept any additions or corrections
to this first version of the svgalib manual.

40
doc/man3/gl_rgbcolor.3 Normal file
View file

@ -0,0 +1,40 @@
.TH gl_rgbcolor 3 "2 Aug 1997" "Svgalib (>= 1.2.11)" "Svgalib User Manual"
.SH NAME
gl_rgbcolor \- return pixel value corresponding to an rgb color
.SH SYNOPSIS
.B #include <vgagl.h>
.BI "int gl_rgbcolor(int " r ", int " g ", int " b );
.SH DESCRIPTION
Returns pixel value used in the current context that corresponds with the given color
components. Used by
.BR setpixelrgb (3).
.SH SEE ALSO
.BR svgalib (7),
.BR vgagl (7),
.BR svgalib.conf (5),
.BR threedkit (7),
.BR testgl (1),
.BR gl_circle (3),
.BR gl_clearscreen (3),
.BR gl_fillbox (3),
.BR gl_hline (3),
.BR gl_line (3),
.BR gl_setpixel (3),
.BR gl_setpixelrgb (3).
.SH AUTHOR
This manual page was edited by Michael Weller <eowmob@exp-math.uni-essen.de>. The
exact source of the referenced demo as well as of the original documentation is
unknown.
It is very likely that both are at least to some extent are due to
Harm Hanemaayer <H.Hanemaayer@inter.nl.net>.
Occasionally this might be wrong. I hereby
asked to be excused by the original author and will happily accept any additions or corrections
to this first version of the svgalib manual.

46
doc/man3/gl_scalebox.3 Normal file
View file

@ -0,0 +1,46 @@
.TH gl_scalebox 3 "2 Aug 1997" "Svgalib (>= 1.2.11)" "Svgalib User Manual"
.SH NAME
gl_scalebox \- scale a pixmap
.SH SYNOPSIS
.B #include <vgagl.h>
.BI "void gl_scalebox(int " w1 ", int " h1 ", void *" sdp ", int " w2 ", int " h2 ", void *" ddp );
.SH DESCRIPTION
Scale the bitmap of size
.RI ( w1 ", " h1 )
at
.I sdp
to size
.RI ( w2 ", " h2 )
and store it at
.IR ddp ,
which must be a large enough buffer.
The pixel size of the current graphics context is used.
.SH SEE ALSO
.BR svgalib (7),
.BR vgagl (7),
.BR svgalib.conf (5),
.BR threedkit (7),
.BR testgl (1),
.BR gl_copybox (3),
.BR gl_copyboxfromcontext (3),
.BR gl_copyboxtocontext (3),
.BR gl_getbox (3),
.BR gl_putbox (3).
.SH AUTHOR
This manual page was edited by Michael Weller <eowmob@exp-math.uni-essen.de>. The
exact source of the referenced demo as well as of the original documentation is
unknown.
It is very likely that both are at least to some extent are due to
Harm Hanemaayer <H.Hanemaayer@inter.nl.net>.
Occasionally this might be wrong. I hereby
asked to be excused by the original author and will happily accept any additions or corrections
to this first version of the svgalib manual.

View file

@ -0,0 +1,38 @@
.TH gl_setclippingwindow 3 "2 Aug 1997" "Svgalib (>= 1.2.11)" "Svgalib User Manual"
.SH NAME
gl_setclippingwindow \- set the clipping window
.SH SYNOPSIS
.B #include <vgagl.h>
.BI "void gl_setclippingwindow(int " x1 ", int " y1 ", int " x2 ", int " y2 );
.SH DESCRIPTION
Set the clipping window to the rectangle with top-left
corner
.RI ( x1 ", " y1 )
and bottom-right corner
.RI ( x2 ", " y2 )
(inclusively).
.SH SEE ALSO
.BR svgalib (7),
.BR vgagl (7),
.BR svgalib.conf (5),
.BR threedkit (7),
.BR testgl (1),
.BR gl_disableclipping (3),
.BR gl_enableclipping (3).
.SH AUTHOR
This manual page was edited by Michael Weller <eowmob@exp-math.uni-essen.de>. The
exact source of the referenced demo as well as of the original documentation is
unknown.
It is very likely that both are at least to some extent are due to
Harm Hanemaayer <H.Hanemaayer@inter.nl.net>.
Occasionally this might be wrong. I hereby
asked to be excused by the original author and will happily accept any additions or corrections
to this first version of the svgalib manual.

43
doc/man3/gl_setcontext.3 Normal file
View file

@ -0,0 +1,43 @@
.TH gl_setcontext 3 "2 Aug 1997" "Svgalib (>= 1.2.11)" "Svgalib User Manual"
.SH NAME
gl_setcontext \- set a previously saved context
.SH SYNOPSIS
.B #include <vgagl.h>
.BI "void gl_setcontext(GraphicsContext *" gc );
.SH DESCRIPTION
Restore a previously saved context (make it the current
context).
.SH SEE ALSO
.BR svgalib (7),
.BR vgagl (7),
.BR svgalib.conf (5),
.BR threedkit (7),
.BR testgl (1),
.BR plane (1),
.BR wrapdemo (1),
.BR currentcontext (3),
.BR gl_allocatecontext (3),
.BR gl_freecontext (3),
.BR gl_getcontext (3),
.BR gl_setcontextheight (3),
.BR gl_setcontextvga (3),
.BR gl_setcontextvgavirtual (3),
.BR gl_setcontextvirtual (3),
.BR gl_setcontextwidth (3).
.SH AUTHOR
This manual page was edited by Michael Weller <eowmob@exp-math.uni-essen.de>. The
exact source of the referenced demo as well as of the original documentation is
unknown.
It is very likely that both are at least to some extent are due to
Harm Hanemaayer <H.Hanemaayer@inter.nl.net>.
Occasionally this might be wrong. I hereby
asked to be excused by the original author and will happily accept any additions or corrections
to this first version of the svgalib manual.

View file

@ -0,0 +1 @@
.so man3/gl_setcontextwidth.3

View file

@ -0,0 +1,64 @@
.TH gl_setcontextvga 3 "21 Aug 1999" "Svgalib (>= 1.2.11)" "Svgalib User Manual"
.SH NAME
gl_setcontextvga \- set the context to the physical screen
.SH SYNOPSIS
.B #include <vgagl.h>
.BI "int gl_setcontextvga(int " mode );
.SH DESCRIPTION
Set the graphics context to the physical screen of a
vga mode (as defined in
.BR vga_setmode (3)).
The mode must be set with
.BR vga_setmode (3)
prior to using any of the drawing functions.
.B vgagl
does not take care of that.
The function returns 0 for success and non-zero if the mode is not supported by the
hardware.
The only thing you can do with a planar (mode X-like)
256 color mode is aligned
.BR gl_putbox ,
and use it as a target for
.BR gl_copyscreen .
In all of the svga modes this program makes a description of the vga
mode available to the vgagl functions. The 256 color svgamodes are
handled properly by this program.
.SH SEE ALSO
.BR svgalib (7),
.BR vgagl (7),
.BR svgalib.conf (5),
.BR threedkit (7),
.BR testgl (1),
.BR currentcontext (3),
.BR gl_allocatecontext (3),
.BR gl_copyboxfromcontext (3),
.BR gl_copyboxtocontext (3),
.BR gl_copyscreen (3),
.BR gl_freecontext (3),
.BR gl_line (3),
.BR gl_getcontext (3),
.BR gl_setcontext (3),
.BR gl_setcontextheight (3),
.BR gl_setcontextvgavirtual (3),
.BR gl_setcontextvirtual (3),
.BR gl_setcontextwidth (3).
.SH AUTHOR
This manual page was edited by Michael Weller <eowmob@exp-math.uni-essen.de>. The
exact source of the referenced demo as well as of the original documentation is
unknown. This page was modified by Don Secrest <secrest@uiuc.edu>.
It is very likely that both are at least to some extent are due to
Harm Hanemaayer <H.Hanemaayer@inter.nl.net>.
Occasionally this might be wrong. I hereby
asked to be excused by the original author and will happily accept any additions or corrections
to this first version of the svgalib manual.

View file

@ -0,0 +1,55 @@
.TH gl_setcontextvgavirtual 3 "2 Aug 1997" "Svgalib (>= 1.2.11)" "Svgalib User Manual"
.SH NAME
gl_setcontextvgavirtual \- set the context to a virtual mode
.SH SYNOPSIS
.B #include <vgagl.h>
.BI "int gl_setcontextvgavirtual(int " mode );
.SH DESCRIPTION
Allocate a virtual screen in system memory identical to
the graphics mode (as defined in
.BR vga_setmode (3)),
and make that the current graphics context.
The function returns 0 for success and non-zero if the mode is not supported by the
hardware.
The only thing you can do with a planar (mode X-like)
256 color mode is aligned
.BR gl_putbox ,
and use it as a target for
.BR gl_copyscreen .
.SH SEE ALSO
.BR svgalib (7),
.BR vgagl (7),
.BR svgalib.conf (5),
.BR threedkit (7),
.BR testgl (1),
.BR currentcontext (3),
.BR gl_allocatecontext (3),
.BR gl_copyboxfromcontext (3),
.BR gl_copyboxtocontext (3),
.BR gl_copyscreen (3),
.BR gl_freecontext (3),
.BR gl_getcontext (3),
.BR gl_setcontext (3),
.BR gl_setcontextheight (3),
.BR gl_setcontextvga (3),
.BR gl_setcontextvirtual (3),
.BR gl_setcontextwidth (3).
.SH AUTHOR
This manual page was edited by Michael Weller <eowmob@exp-math.uni-essen.de>. The
exact source of the referenced demo as well as of the original documentation is
unknown.
It is very likely that both are at least to some extent are due to
Harm Hanemaayer <H.Hanemaayer@inter.nl.net>.
Occasionally this might be wrong. I hereby
asked to be excused by the original author and will happily accept any additions or corrections
to this first version of the svgalib manual.

View file

@ -0,0 +1,54 @@
.TH gl_setcontextvirtual 3 "2 Aug 1997" "Svgalib (>= 1.2.11)" "Svgalib User Manual"
.SH NAME
gl_setcontextvirtual \- define a virtual context
.SH SYNOPSIS
.B #include <vgagl.h>
.BI "void gl_setcontextvirtual(int " w ", int " h ", int " bpp ", int " bitspp ", void *" vbuf );
.SH DESCRIPTION
Define the current graphics context to have a width of
.I w
pixels, height
.IR h ", " bpp
bytes per pixel,
.I bitspp
significant
color bits per pixel (8, 15, 16 or 24), with the framebuffer
at
.IR vbuf .
A 4 bytes per pixel context, with 24 significant
color bits is also valid.
.SH SEE ALSO
.BR svgalib (7),
.BR vgagl (7),
.BR svgalib.conf (5),
.BR threedkit (7),
.BR testgl (1),
.BR currentcontext (3),
.BR gl_allocatecontext (3),
.BR gl_copyboxfromcontext (3),
.BR gl_copyboxtocontext (3),
.BR gl_copyscreen (3),
.BR gl_freecontext (3),
.BR gl_getcontext (3),
.BR gl_setcontext (3),
.BR gl_setcontextheight (3),
.BR gl_setcontextvga (3),
.BR gl_setcontextvgavirtual (3),
.BR gl_setcontextwidth (3).
.SH AUTHOR
This manual page was edited by Michael Weller <eowmob@exp-math.uni-essen.de>. The
exact source of the referenced demo as well as of the original documentation is
unknown.
It is very likely that both are at least to some extent are due to
Harm Hanemaayer <H.Hanemaayer@inter.nl.net>.
Occasionally this might be wrong. I hereby
asked to be excused by the original author and will happily accept any additions or corrections
to this first version of the svgalib manual.

View file

@ -0,0 +1,50 @@
.TH gl_setcontextwidth 3 "2 Aug 1997" "Svgalib (>= 1.2.11)" "Svgalib User Manual"
.SH NAME
gl_setcontextwidth, gl_setcontextheight \- set the dimension of a context
.SH SYNOPSIS
.B #include <vgagl.h>
.BI "void gl_setcontextwidth(int " w );
.br
.BI "void gl_setcontextheight(int " h );
.SH DESCRIPTION
Set the size of the current virtual context, effectively clipping everything to the
top left corner of
size
.RI ( w ", " h ).
.SH SEE ALSO
.BR svgalib (7),
.BR vgagl (7),
.BR svgalib.conf (5),
.BR threedkit (7),
.BR testgl (1),
.BR plane (1),
.BR wrapdemo (1),
.BR currentcontext (3),
.BR gl_allocatecontext (3),
.BR gl_disableclipping (3),
.BR gl_enableclipping (3),
.BR gl_freecontext (3),
.BR gl_getcontext (3),
.BR gl_setcontext (3),
.BR gl_setcontextvga (3),
.BR gl_setcontextvgavirtual (3),
.BR gl_setcontextvirtual (3),
.BR gl_setdisplaystart (3).
.SH AUTHOR
This manual page was edited by Michael Weller <eowmob@exp-math.uni-essen.de>. The
exact source of the referenced demo as well as of the original documentation is
unknown.
It is very likely that both are at least to some extent are due to
Harm Hanemaayer <H.Hanemaayer@inter.nl.net>.
Occasionally this might be wrong. I hereby
asked to be excused by the original author and will happily accept any additions or corrections
to this first version of the svgalib manual.

View file

@ -0,0 +1,48 @@
.TH gl_setdisplaystart 3 "2 Aug 1997" "Svgalib (>= 1.2.11)" "Svgalib User Manual"
.SH NAME
gl_setdisplaystart \- set the start of the screen are displayed
.SH SYNOPSIS
.B #include <vgagl.h>
.BI "vga gl_setdisplaystart(int " x ", int " y );
.SH DESCRIPTION
Set the physical display start address to the pixel at
.RI ( x ", " y ).
Can be used for hardware scrolling, or for page flipping
(e.g.
.B setdisplaystart(0, HEIGHT)
displays from the second
page). Make sure the scanline width
.RB ( BYTEWIDTH )
in bytes
of the current context corresponds with the physical
screen.
Note also that the display start cannot be set to completely arbitrary points, see
.BR vga_setdisplaystart (3).
.SH SEE ALSO
.BR svgalib (7),
.BR vgagl (7),
.BR svgalib.conf (5),
.BR threedkit (7),
.BR testgl (1),
.BR vga_setdisplaystart (3),
.BR gl_copyscreen (3),
.BR gl_setscreenoffset (3).
.SH AUTHOR
This manual page was edited by Michael Weller <eowmob@exp-math.uni-essen.de>. The
exact source of the referenced demo as well as of the original documentation is
unknown.
It is very likely that both are at least to some extent are due to
Harm Hanemaayer <H.Hanemaayer@inter.nl.net>.
Occasionally this might be wrong. I hereby
asked to be excused by the original author and will happily accept any additions or corrections
to this first version of the svgalib manual.

47
doc/man3/gl_setfont.3 Normal file
View file

@ -0,0 +1,47 @@
.TH gl_setfont 3 "2 Aug 1997" "Svgalib (>= 1.2.11)" "Svgalib User Manual"
.SH NAME
gl_setfont \- set the text font to be used
.SH SYNOPSIS
.B #include <vgagl.h>
.BI "void gl_setfont(int " fw ", int " fh ", void *" fp );
.SH DESCRIPTION
Use the font stored as character bitmaps at
.IR fp ,
with characters of size
.RI ( fw ", " fh ),
as the basic font for write
operations. Note that the font included in the library must
be expanded first, because it is stored bit-per-pixel;
this is not required if the
.B FONT_COMPRESSED
.BR gl_setwritemode (3)
flag is set.
.SH SEE ALSO
.BR svgalib (7),
.BR vgagl (7),
.BR svgalib.conf (5),
.BR threedkit (7),
.BR testgl (1),
.BR gl_colorfont (3),
.BR gl_expandfont (3),
.BR gl_font8x8 (3),
.BR gl_setfontcolors (3),
.BR gl_write (3),
.BR gl_writen (3).
.SH AUTHOR
This manual page was edited by Michael Weller <eowmob@exp-math.uni-essen.de>. The
exact source of the referenced demo as well as of the original documentation is
unknown.
It is very likely that both are at least to some extent are due to
Harm Hanemaayer <H.Hanemaayer@inter.nl.net>.
Occasionally this might be wrong. I hereby
asked to be excused by the original author and will happily accept any additions or corrections
to this first version of the svgalib manual.

View file

@ -0,0 +1,43 @@
.TH gl_setfontcolors 3 "2 Aug 1997" "Svgalib (>= 1.2.11)" "Svgalib User Manual"
.SH NAME
gl_setfontcolors \- set the font colors
.SH SYNOPSIS
.B #include <vgagl.h>
.BI "void gl_setfontcolors(int " bg ", int " fg );
.SH DESCRIPTION
Set the background and foreground colors for the compressed
font write mode which is set with
.BR gl_setwritemode (3).
.SH SEE ALSO
.BR svgalib (7),
.BR vgagl (7),
.BR svgalib.conf (5),
.BR threedkit (7),
.BR testgl (1),
.BR plane (1),
.BR wrapdemo (1),
.BR gl_colorfont (3),
.BR gl_expandfont (3),
.BR gl_font8x8 (3),
.BR gl_setfont (3),
.BR gl_setwritemode (3),
.BR gl_write (3),
.BR gl_writen (3).
.SH AUTHOR
This manual page was edited by Michael Weller <eowmob@exp-math.uni-essen.de>. The
exact source of the referenced demo as well as of the original documentation is
unknown.
It is very likely that both are at least to some extent are due to
Harm Hanemaayer <H.Hanemaayer@inter.nl.net>.
Occasionally this might be wrong. I hereby
asked to be excused by the original author and will happily accept any additions or corrections
to this first version of the svgalib manual.

1
doc/man3/gl_setpalette.3 Normal file
View file

@ -0,0 +1 @@
.so man3/gl_setpalettecolor.3

View file

@ -0,0 +1,61 @@
.TH gl_setpalettecolor 3 "2 Aug 1997" "Svgalib (>= 1.2.11)" "Svgalib User Manual"
.SH NAME
gl_setpalettecolor, gl_setpalettecolors, gl_setpalette \- set the color palette
.SH SYNOPSIS
.B #include <vgagl.h>
.BI "void gl_setpalettecolor(int " c ", int " r ", int " g ", int " b );
.br
.BI "void gl_setpalettecolors(int " s ", int " n ", void *" sp );
.br
.BI "void gl_setpalette(void *" sp );
.SH DESCRIPTION
.B gl_setpalettecolor
sets red, green and blue values (in the range 0 - 63) of
color
.I c
from the color-lookup-table to
.IR r ", " g " and " b .
.B gl_setpalettecolors
sets RGB values of
.I n
colors starting at
.IR s ,
which are stored
as a table of groups of three bytes each at
.IR sp .
.B gl_setpalette
is equivalent to
.BR "setpalettecolors(0, 256, " sp ).
.BR vga_ext_set (3)
might change the range of the colors to be set to 0 - 255.
.SH SEE ALSO
.BR svgalib (7),
.BR vgagl (7),
.BR svgalib.conf (5),
.BR threedkit (7),
.BR testgl (1),
.BR vga_ext_set (3),
.BR gl_getpalette (3),
.BR gl_getpalettecolor (3),
.BR gl_getpalettecolors (3).
.SH AUTHOR
This manual page was edited by Michael Weller <eowmob@exp-math.uni-essen.de>. The
exact source of the referenced demo as well as of the original documentation is
unknown.
It is very likely that both are at least to some extent are due to
Harm Hanemaayer <H.Hanemaayer@inter.nl.net>.
Occasionally this might be wrong. I hereby
asked to be excused by the original author and will happily accept any additions or corrections
to this first version of the svgalib manual.

View file

@ -0,0 +1 @@
.so man3/gl_setpalettecolor.3

56
doc/man3/gl_setpixel.3 Normal file
View file

@ -0,0 +1,56 @@
.TH gl_setpixel 3 "2 Aug 1997" "Svgalib (>= 1.2.11)" "Svgalib User Manual"
.SH NAME
gl_setpixel, gl_setpixelrgb \- draw a pixel
.SH SYNOPSIS
.B #include <vgagl.h>
.BI "void gl_setpixel(int " x ", int " y ", int " c ),
.br
.BI "void gl_setpixelrgb(int " x ", int " y ", int " r ", int " g ", int " b );
.SH DESCRIPTION
.B gl_setpixel
draws a single pixel at position
.RI ( x ", " y )
in color
.IR c .
The lower
8, 15, 16 or 24 bits of the color are significant, depending
on the number of colors the current mode supports.
.B gl_setpixelrgb
draws a single pixel at position
.RI ( x ", " y )
with color components
.IR r ", " g ", and " b ,
ranging from 0 to 255. In 256 color mode, only
meaningful if the RGB palette is set
.RB ( gl_setrgbpalette (3)).
.SH SEE ALSO
.BR svgalib (7),
.BR vgagl (7),
.BR svgalib.conf (5),
.BR threedkit (7),
.BR testgl (1),
.BR gl_circle (3),
.BR gl_fillbox (3),
.BR gl_hline (3),
.BR gl_line (3),
.BR gl_rgbcolor (3),
.BR gl_setrgbpalette (3).
.SH AUTHOR
This manual page was edited by Michael Weller <eowmob@exp-math.uni-essen.de>. The
exact source of the referenced demo as well as of the original documentation is
unknown.
It is very likely that both are at least to some extent are due to
Harm Hanemaayer <H.Hanemaayer@inter.nl.net>.
Occasionally this might be wrong. I hereby
asked to be excused by the original author and will happily accept any additions or corrections
to this first version of the svgalib manual.

View file

@ -0,0 +1 @@
.so man3/gl_setpixel.3

View file

@ -0,0 +1,46 @@
.TH gl_setrgbpalette 3 "2 Aug 1997" "Svgalib (>= 1.2.11)" "Svgalib User Manual"
.SH NAME
gl_setrgbpalette \- set a 256-color RGB palette
.SH SYNOPSIS
.B #include <vgagl.h>
.BI "void gl_setrgbpalette(void)"
.SH DESCRIPTION
Sets 256-color RGB palette (bits 0 - 2 blue, 3 - 5 green,
6 - 7 red).
Call this prior to using
.BR gl_getpixelrgb (3),
.BR gl_rgbcolor "(3), or "
.BR gl_setpixelrgb (3)
in 256 color modes.
.SH SEE ALSO
.BR svgalib (7),
.BR vgagl (7),
.BR svgalib.conf (5),
.BR threedkit (7),
.BR testgl (1),
.BR plane (1),
.BR wrapdemo (1),
.BR gl_getpixelrgb (3),
.BR gl_rgbcolor (3),
.BR gl_setpalette (3),
.BR gl_setpalettecolor (3),
.BR gl_setpalettecolors (3),
.BR gl_setpixelrgb (3).
.SH AUTHOR
This manual page was edited by Michael Weller <eowmob@exp-math.uni-essen.de>. The
exact source of the referenced demo as well as of the original documentation is
unknown.
It is very likely that both are at least to some extent are due to
Harm Hanemaayer <H.Hanemaayer@inter.nl.net>.
Occasionally this might be wrong. I hereby
asked to be excused by the original author and will happily accept any additions or corrections
to this first version of the svgalib manual.

View file

@ -0,0 +1,43 @@
.TH gl_setscreenoffset 3 "2 Aug 1997" "Svgalib (>= 1.2.11)" "Svgalib User Manual"
.SH NAME
gl_setscreenoffset \- set a memory offset for copyscreen
.SH SYNOPSIS
.B #include <vgagl.h>
.BI "void gl_setscreenoffset(int " o );
.SH DESCRIPTION
Set the offset in pixels into video memory for
.BR copyscreen (3)
and
.BR copyboxtocontext (3),
.BR copyboxfromcontext (3)
and thus
allows for page-flipping. Must be a
multiple of the scanline width in bytes. It is reset to
zero after the completion of
.BR copyscreen (3).
.SH SEE ALSO
.BR svgalib (7),
.BR vgagl (7),
.BR svgalib.conf (5),
.BR threedkit (7),
.BR testgl (1),
.BR gl_copyboxfromcontext (3),
.BR gl_copyboxtocontext (3),
.BR gl_copyscreen (3),
.BR gl_enablepageflipping (3).
.SH AUTHOR
This manual page was edited by Michael Weller <eowmob@exp-math.uni-essen.de>. The
exact source of the referenced demo as well as of the original documentation is
unknown.
It is very likely that both are at least to some extent are due to
Harm Hanemaayer <H.Hanemaayer@inter.nl.net>.
Occasionally this might be wrong. I hereby
asked to be excused by the original author and will happily accept any additions or corrections
to this first version of the svgalib manual.

View file

@ -0,0 +1,65 @@
.TH gl_setwritemode 3 "22 Feb 1998" "Svgalib (>= 1.2.11)" "Svgalib User Manual"
.SH NAME
gl_setwritemode \- set the font writemode flags
.SH SYNOPSIS
.B #include <vgagl.h>
.BI "void gl_setwritemode(int " m );
.SH DESCRIPTION
Sets the writemode flags for the font routines. It must be the sum of exactly
one choice out of the following two groups:
.PD 0
.TP
.B WRITEMODE_MASKED
.TP
.BR WRITEMODE_OVERWRITE " (default)"
.PD
If
.B WRITEMODE_MASKED
is set, only foreground pixels of the font
are used for write operations; the screen background is not
erased.
.PD 0
.TP
.B FONT_COMPRESSED
.TP
.BR FONT_EXPANDED " (default)"
.PD
If
.B FONT_COMPRESSED
is set, text writes will use the compressed
bit-per-pixel font rather than the expanded font (which would be slightly faster).
.SH SEE ALSO
.BR svgalib (7),
.BR vgagl (7),
.BR svgalib.conf (5),
.BR threedkit (7),
.BR testgl (1),
.BR gl_colorfont (3),
.BR gl_expandfont (3),
.BR gl_font8x8 (3),
.BR gl_hline (3),
.BR gl_line (3),
.BR gl_setfont (3),
.BR gl_setfontcolors (3),
.BR gl_write (3),
.BR gl_writen (3).
.SH AUTHOR
This manual page was edited by Michael Weller <eowmob@exp-math.uni-essen.de>. The
exact source of the referenced demo as well as of the original documentation is
unknown.
It is very likely that both are at least to some extent are due to
Harm Hanemaayer <H.Hanemaayer@inter.nl.net>.
Occasionally this might be wrong. I hereby
asked to be excused by the original author and will happily accept any additions or corrections
to this first version of the svgalib manual.

91
doc/man3/gl_striangle.3 Normal file
View file

@ -0,0 +1,91 @@
.TH gl_striangle 3 "2 Aug 1997" "Svgalib (>= 1.2.11)" "Svgalib User Manual"
.SH NAME
gl_striangle \- draw a solid colored triangle
.SH SYNOPSIS
.B #include <triangle.h>
.BI "void gl_striangle(int " x0 ", int " y0 ", int " x1 ", int " y1
.BI ", int "x2 ", int " y2 ", int " color ", int " bf );
.SH DESCRIPTION
Draws a non-interpolated (solid) triangle between the three points 0, 1 and 2
with the color
.IR color .
The
.I bf
value is used to tell the routine not to draw
the triangle if it is facing the other way.
.I bf
tells
which way the triangle should be facing to be drawn.
since you will more than likely require both
combinations.
.IB bf " = 0"
disables drawing when the points are arranged clockwise,
.IB bf " = 1"
disables drawing when the points are arranged counter clockwise.
.IB bf " = -1"
will probably always draw the triangle.
Beware, these functions are not a direct part of the svgalib library.
Instead their source is part of svgalib and can be found in the
.I threeDkit/
subdirectory of the original svgalib distribution. However, it is not
installed in the system by default, s.t. it is unclear where you can find it
if your svgalib was installed by some
linux distribution.
In case of any such problem, simply get an svgalib distribution from the net. Yo
don't need to install it. Just
.B make
in the
.I threeDkit/
subdirectory. As of this writing,
.I svgalib-1.2.12.tar.gz
is the latest version and can be retrieved by ftp from
.IR "sunsite.unc.edu" " at " "/pub/Linux/libs/graphics"
and
.IR "tsx-11.mit.edu" " at " "/pub/linux/sources/libs"
which will most probably be mirrored by a site close to you.
The functions are defined in the
.IR tri.o " and " triangl.o
files (or their resp. sources) which you must link to your program.
.SH SEE ALSO
.BR vgagl (7),
.BR svgalib (7),
.BR threedkit (7),
.BR gl_swtriangle (3),
.BR gl_triangle (3),
.BR gl_trigetcolorlookup (3),
.BR gl_trisetcolorlookup (3),
.BR gl_trisetdrawpoint (3),
.BR gl_wtriangle (3),
.BR plane (6),
.BR wrapdemo (6).
.SH AUTHOR
This manual page was edited by Michael Weller <eowmob@exp-math.uni-essen.de>. The
demos, the initial documentation and the whole threedkit stuff was done by
Paul Sheer <psheer@icon.co.za>.
Paper mail:
.RS
Paul Sheer
.br
P O BOX 890507
.br
Lyndhurst
.br
Johannesburg 2106
.br
South Africa
.RE
Donations (by check or postal order) will be appreciated and will encourage
further development of this software. However this is strictly on a voluntary
basis where this software falls under the GNU LIBRARY GENERAL PUBLIC LICENSE.

116
doc/man3/gl_swtriangle.3 Normal file
View file

@ -0,0 +1,116 @@
.TH gl_swtriangle 3 "2 Aug 1997" "Svgalib (>= 1.2.11)" "Svgalib User Manual"
.SH NAME
gl_swtriangle \- draw a solid pixmap mapped on a triangle
.SH SYNOPSIS
.B #include <triangle.h>
.B typedef struct {
.br
.BI " unsigned char *" bitmap1 ;
.br
.BI " unsigned char *" bitmap2 ;
.br
.BI " int " bf ;
.br
.BI "} " TD_tridata ;
.BI "void gl_swtriangle(int " x0 ", int " y0 ", int " xd0 ", int " yd0
.BI ", int " x1 ", int " y1 ", int " xd1 ", int " yd1
.BI ", int " x2 ", int " y2 ", int " xd2 ", int " yd2 ", int " c ", TD_tridata *" tri );
.SH DESCRIPTION
Draws a triangle at points 0, 1, 2 by mapping the pixmaps defined
in the
.B TD_triangle
structure into the triangle.
The
.IR xd " and " yd
values represent the triangle on the
bitmap and the
.IR x " and " y
values represent the triangle
on the screen.
.I bitmap1
defines the back side of the triangle,
.I bitmap2
the front.
The
.I bf
value is used to tell the routine to draw the backside
if it is facing the other way.
.I bf
tells
which way the triangle should be facing to show the front,
since you will more than likely require both
combinations.
.IB bf " = 2"
defines the back to be drawn when the points are arranged clockwise,
.IB bf " = 3"
defines the back to be drawn when the points are arranged counter clockwise,
.IB bf " = -1"
will probably always draw the front.
Beware, these functions are not a direct part of the svgalib library.
Instead their source is part of svgalib and can be found in the
.I threeDkit/
subdirectory of the original svgalib distribution. However, it is not
installed in the system by default, s.t. it is unclear where you can find it
if your svgalib was installed by some
linux distribution.
In case of any such problem, simply get an svgalib distribution from the net. Yo
don't need to install it. Just
.B make
in the
.I threeDkit/
subdirectory. As of this writing,
.I svgalib-1.2.12.tar.gz
is the latest version and can be retrieved by ftp from
.IR "sunsite.unc.edu" " at " "/pub/Linux/libs/graphics"
and
.IR "tsx-11.mit.edu" " at " "/pub/linux/sources/libs"
which will most probably be mirrored by a site close to you.
The functions are defined in the
.IR tri.o " and " triangl.o
files (or their resp. sources) which you must link to your program.
.SH SEE ALSO
.BR vgagl (7),
.BR svgalib (7),
.BR threedkit (7),
.BR gl_striangle (3),
.BR gl_wtriangle (3),
.BR gl_triangle (3),
.BR gl_trigetcolorlookup (3),
.BR gl_trisetcolorlookup (3),
.BR gl_trisetdrawpoint (3),
.BR plane (6),
.BR wrapdemo (6).
.SH AUTHOR
This manual page was edited by Michael Weller <eowmob@exp-math.uni-essen.de>. The
demos, the initial documentation and the whole threedkit stuff was done by
Paul Sheer <psheer@icon.co.za>.
Paper mail:
.RS
Paul Sheer
.br
P O BOX 890507
.br
Lyndhurst
.br
Johannesburg 2106
.br
South Africa
.RE
Donations (by check or postal order) will be appreciated and will encourage
further development of this software. However this is strictly on a voluntary
basis where this software falls under the GNU LIBRARY GENERAL PUBLIC LICENSE.

105
doc/man3/gl_triangle.3 Normal file
View file

@ -0,0 +1,105 @@
.TH gl_triangle 3 "2 Aug 1997" "Svgalib (>= 1.2.11)" "Svgalib User Manual"
.SH NAME
gl_triangle \- draw a triangle with interpolated colors
.SH SYNOPSIS
.B #include <triangle.h>
.BI "void gl_triangle(int " x0 ", int " y0 ", int " z0 ", int " x1 ", int " y1
.BI ", int " z1 ", int " x2 ", int " y2 ", int " z2 ", int " bf );
.SH DESCRIPTION
Draws a triangle between the three points 0, 1 and 2.
.IR z0 ", " z1 " and " z2
are the colors at those points. Hence,
if you set the palette to a grayscale, the triangle
will have an interpolated gray shade.
If you are using
more than 8 bit color, the
.I z
values will be
interpreted as an index to a lookup table of at most
4096 entries long. Each entry is of type
.BR long .
You can set the entries with the function
.BR gl_trisetcolorlookup (3).
The
.I bf
value is used to tell the routine not to draw
the triangle if it is facing the other way.
.I bf
tells
which way the triangle should be facing to be drawn.
since you will more than likely require both
combinations.
.IB bf " = 0"
disables drawing when the points are arranged clockwise,
.IB bf " = 1"
disables drawing when the points are arranged counter clockwise.
.IB bf " = -1"
will probably always draw the triangle.
Beware, these functions are not a direct part of the svgalib library.
Instead their source is part of svgalib and can be found in the
.I threeDkit/
subdirectory of the original svgalib distribution. However, it is not
installed in the system by default, s.t. it is unclear where you can find it
if your svgalib was installed by some
linux distribution.
In case of any such problem, simply get an svgalib distribution from the net. Yo
don't need to install it. Just
.B make
in the
.I threeDkit/
subdirectory. As of this writing,
.I svgalib-1.2.12.tar.gz
is the latest version and can be retrieved by ftp from
.IR "sunsite.unc.edu" " at " "/pub/Linux/libs/graphics"
and
.IR "tsx-11.mit.edu" " at " "/pub/linux/sources/libs"
which will most probably be mirrored by a site close to you.
The functions are defined in the
.IR tri.o " and " triangl.o
files (or their resp. sources) which you must link to your program.
.SH SEE ALSO
.BR vgagl (7),
.BR svgalib (7),
.BR threedkit (7),
.BR gl_striangle (3),
.BR gl_swtriangle (3),
.BR gl_trigetcolorlookup (3),
.BR gl_trisetcolorlookup (3),
.BR gl_trisetdrawpoint (3),
.BR gl_wtriangle (3),
.BR plane (6),
.BR wrapdemo (6).
.SH AUTHOR
This manual page was edited by Michael Weller <eowmob@exp-math.uni-essen.de>. The
demos, the initial documentation and the whole threedkit stuff was done by
Paul Sheer <psheer@icon.co.za>.
Paper mail:
.RS
Paul Sheer
.br
P O BOX 890507
.br
Lyndhurst
.br
Johannesburg 2106
.br
South Africa
.RE
Donations (by check or postal order) will be appreciated and will encourage
further development of this software. However this is strictly on a voluntary
basis where this software falls under the GNU LIBRARY GENERAL PUBLIC LICENSE.

View file

@ -0,0 +1 @@
.so man3/gl_trisetcolorlookup.3

View file

@ -0,0 +1,85 @@
.TH gl_trisetcolorlookup 3 "2 Aug 1997" "Svgalib (>= 1.2.11)" "Svgalib User Manual"
.SH NAME
gl_trisetcolorlookup, gl_trigetcolorlookup \- manages a color lookup table for shadowing
.SH SYNOPSIS
.B #include <triangle.h>
.BI "void gl_trisetcolorlookup(int " i ", long " color );
.br
.BI "long gl_trigetcolorlookup(int " i );
.SH DESCRIPTION
.B gl_trisetcolorlookup
sets the color of an index
.I i
in the table used in more than 256 color modes to interpolate tables.
Note that it is your responsibility to set all the intermediate color values.
You can use this function to create the index table,
but remember not to let
.I i
go over 4096.
.B gl_trigetcolorlookup
retrieves a previously set value from the table.
Beware, these functions are not a direct part of the svgalib library.
Instead their source is part of svgalib and can be found in the
.I threeDkit/
subdirectory of the original svgalib distribution. However, it is not
installed in the system by default, s.t. it is unclear where you can find it
if your svgalib was installed by some
linux distribution.
In case of any such problem, simply get an svgalib distribution from the net. Yo
don't need to install it. Just
.B make
in the
.I threeDkit/
subdirectory. As of this writing,
.I svgalib-1.2.12.tar.gz
is the latest version and can be retrieved by ftp from
.IR "sunsite.unc.edu" " at " "/pub/Linux/libs/graphics"
and
.IR "tsx-11.mit.edu" " at " "/pub/linux/sources/libs"
which will most probably be mirrored by a site close to you.
The functions are defined in the
.IR tri.o " and " triangl.o
files (or their resp. sources) which you must link to your program.
.SH SEE ALSO
.BR vgagl (7),
.BR svgalib (7),
.BR threedkit (7),
.BR gl_striangle (3),
.BR gl_swtriangle (3),
.BR gl_triangle (3),
.BR gl_trisetdrawpoint (3),
.BR gl_wtriangle (3),
.BR plane (6),
.BR wrapdemo (6).
.SH AUTHOR
This manual page was edited by Michael Weller <eowmob@exp-math.uni-essen.de>. The
demos, the initial documentation and the whole threedkit stuff was done by
Paul Sheer <psheer@icon.co.za>.
Paper mail:
.RS
Paul Sheer
.br
P O BOX 890507
.br
Lyndhurst
.br
Johannesburg 2106
.br
South Africa
.RE
Donations (by check or postal order) will be appreciated and will encourage
further development of this software. However this is strictly on a voluntary
basis where this software falls under the GNU LIBRARY GENERAL PUBLIC LICENSE.

View file

@ -0,0 +1,87 @@
.TH gl_trisetdrawpoint 3 "2 Aug 1997" "Svgalib (>= 1.2.11)" "Svgalib User Manual"
.SH NAME
gl_trisetdrawpoint \- set a triangle drawing function
.SH SYNOPSIS
.B #include <triangle.h>
.BI "void gl_trisetdrawpoint(void (" setpixelfunc ") (int " x ", int " y ", int " color ") );
.SH DESCRIPTION
If this function is called with
.I setpixelfunc
non-zero, then the function
.I setpixelfunc
is used from
there after to draw each pixel (instead of the usual
direct screen buffer writes).
This function need never
be used, except if you want to use your own pixel
drawing function for extra effects. If you use
this feature, you can be assured that none of the
triangle routines will access the hardware,
enabling portability to other environments.
Beware, these functions are not a direct part of the svgalib library.
Instead their source is part of svgalib and can be found in the
.I threeDkit/
subdirectory of the original svgalib distribution. However, it is not
installed in the system by default, s.t. it is unclear where you can find it
if your svgalib was installed by some
linux distribution.
In case of any such problem, simply get an svgalib distribution from the net. Yo
don't need to install it. Just
.B make
in the
.I threeDkit/
subdirectory. As of this writing,
.I svgalib-1.2.12.tar.gz
is the latest version and can be retrieved by ftp from
.IR "sunsite.unc.edu" " at " "/pub/Linux/libs/graphics"
and
.IR "tsx-11.mit.edu" " at " "/pub/linux/sources/libs"
which will most probably be mirrored by a site close to you.
The functions are defined in the
.IR tri.o " and " triangl.o
The functions are defined in the
.IR tri.o " and " triangl.o
files (or their resp. sources) which you must link to your program.
.SH SEE ALSO
.BR vgagl (7),
.BR svgalib (7),
.BR threedkit (7),
.BR gl_striangle (3),
.BR gl_swtriangle (3),
.BR gl_triangle (3),
.BR gl_trigetcolorlookup (3),
.BR gl_trisetcolorlookup (3),
.BR gl_wtriangle (3),
.BR plane (6),
.BR wrapdemo (6).
.SH AUTHOR
This manual page was edited by Michael Weller <eowmob@exp-math.uni-essen.de>. The
demos, the initial documentation and the whole threedkit stuff was done by
Paul Sheer <psheer@icon.co.za>.
Paper mail:
.RS
Paul Sheer
.br
P O BOX 890507
.br
Lyndhurst
.br
Johannesburg 2106
.br
South Africa
.RE
Donations (by check or postal order) will be appreciated and will encourage
further development of this software. However this is strictly on a voluntary
basis where this software falls under the GNU LIBRARY GENERAL PUBLIC LICENSE.

67
doc/man3/gl_write.3 Normal file
View file

@ -0,0 +1,67 @@
.TH gl_write 3 "2 Aug 1997" "Svgalib (>= 1.2.11)" "Svgalib User Manual"
.SH NAME
gl_write, gl_writen \- write a text string
.SH SYNOPSIS
.B #include <vgagl.h>
.BI "void gl_write(int " x ", int " y ", char *" s );
.br
.BI "void gl_writen(int " x ", int " y ", int " n " ,char *" s );
.SH DESCRIPTION
.B gl_write
writes the zero terminated string
.I s
to position
.RI ( x ", " y )
using the currently selected font.
.B gl_writen
works similarly, but writes exactly
.I n
characters, thus allowing to use the character 0.
The kind of text draw operation is set with
.BR gl_setwritemode (3).
.B BEWARE!
Prior to the of use of
.BR gl_write "(3) and " gl_writen (3)
you must set a font.
A good default initialization sequence is:
.B gl_setfont(8, 8, gl_font8x8);
.br
.B gl_setwritemode(FONT_COMPRESSED + WRITEMODE_OVERWRITE);
.br
.B gl_setfontcolors(0, vga_white());
.br
.SH SEE ALSO
.BR svgalib (7),
.BR vgagl (7),
.BR svgalib.conf (5),
.BR threedkit (7),
.BR testgl (1),
.BR gl_printf (3),
.BR gl_colorfont (3),
.BR gl_expandfont (3),
.BR gl_font8x8 (3),
.BR gl_setfont (3),
.BR gl_setfontcolors (3),
.BR gl_setwritemode (3).
.SH AUTHOR
This manual page was edited by Michael Weller <eowmob@exp-math.uni-essen.de>. The
exact source of the referenced demo as well as of the original documentation is
unknown.
It is very likely that both are at least to some extent are due to
Harm Hanemaayer <H.Hanemaayer@inter.nl.net>.
Occasionally this might be wrong. I hereby
asked to be excused by the original author and will happily accept any additions or corrections
to this first version of the svgalib manual.

1
doc/man3/gl_writen.3 Normal file
View file

@ -0,0 +1 @@
.so man3/gl_write.3

131
doc/man3/gl_wtriangle.3 Normal file
View file

@ -0,0 +1,131 @@
.TH gl_wtriangle 3 "2 Aug 1997" "Svgalib (>= 1.2.11)" "Svgalib User Manual"
.SH NAME
gl_wtriangle \- draw a shadowed pixmap mapped on a triangle
.SH SYNOPSIS
.B #include <triangle.h>
.B typedef struct {
.br
.BI " unsigned char *" bitmap1 ;
.br
.BI " unsigned char *" bitmap2 ;
.br
.BI " int " bf ;
.br
.BI "} " TD_tridata ;
.BI "void gl_wtriangle(int " x0 ", int " y0 ", int " xd0 ", int " yd0 ", int " z0
.BI ", int " x1 ", int " y1 ", int " xd1 ", int " yd1 ", int " z1
.BI ", int " x2 ", int " y2 ", int " xd2 ", int " yd2 ", int " z2 ", TD_tridata *" tri );
.SH DESCRIPTION
Draws a triangle at points 0, 1, 2 by mapping the pixmaps defined
in the
.B TD_triangle
structure into the triangle.
The
.IR xd " and " yd
values represent the triangle on the
bitmap and the
.IR x " and " y
values represent the triangle
on the screen. The
.I z
values represent an additional
value which will be added to the color that is looked
up from the pixmap data. Once again, if the
current context is more than 8 bits then the result
is interpreted as an index to the same lookup table. See
.BR gl_triangle (3)
for more details on shadowing.
.B gl_wtriangle
is used to draw wrapped surfaces
.B with
shadowing interpolation. The function
.BR gl_swtriangle (3)
does it without shadowing.
.I bitmap1
defines the back side of the triangle,
.I bitmap2
the front.
The
.I bf
value is used to tell the routine to draw the backside
if it is facing the other way.
.I bf
tells
which way the triangle should be facing to show the front,
since you will more than likely require both
combinations.
.IB bf " = 2"
defines the back to be drawn when the points are arranged clockwise,
.IB bf " = 3"
defines the back to be drawn when the points are arranged counter clockwise,
.IB bf " = -1"
will probably always draw the front.
Beware, these functions are not a direct part of the svgalib library.
Instead their source is part of svgalib and can be found in the
.I threeDkit/
subdirectory of the original svgalib distribution. However, it is not
installed in the system by default, s.t. it is unclear where you can find it
if your svgalib was installed by some
linux distribution.
In case of any such problem, simply get an svgalib distribution from the net. Yo
don't need to install it. Just
.B make
in the
.I threeDkit/
subdirectory. As of this writing,
.I svgalib-1.2.12.tar.gz
is the latest version and can be retrieved by ftp from
.IR "sunsite.unc.edu" " at " "/pub/Linux/libs/graphics"
and
.IR "tsx-11.mit.edu" " at " "/pub/linux/sources/libs"
which will most probably be mirrored by a site close to you.
The functions are defined in the
.IR tri.o " and " triangl.o
files (or their resp. sources) which you must link to your program.
.SH SEE ALSO
.BR vgagl (7),
.BR svgalib (7),
.BR threedkit (7),
.BR gl_striangle (3),
.BR gl_swtriangle (3),
.BR gl_triangle (3),
.BR gl_trigetcolorlookup (3),
.BR gl_trisetcolorlookup (3),
.BR gl_trisetdrawpoint (3),
.BR plane (6),
.BR wrapdemo (6).
.SH AUTHOR
This manual page was edited by Michael Weller <eowmob@exp-math.uni-essen.de>. The
demos, the initial documentation and the whole threedkit stuff was done by
Paul Sheer <psheer@icon.co.za>.
Paper mail:
.RS
Paul Sheer
.br
P O BOX 890507
.br
Lyndhurst
.br
Johannesburg 2106
.br
South Africa
.RE
Donations (by check or postal order) will be appreciated and will encourage
further development of this software. However this is strictly on a voluntary
basis where this software falls under the GNU LIBRARY GENERAL PUBLIC LICENSE.

1
doc/man3/graph_mem.3 Normal file
View file

@ -0,0 +1 @@
.so man3/vga_getgraphmem.3

View file

@ -0,0 +1 @@
.so man3/joystick_getaxis.3

View file

@ -0,0 +1 @@
.so man3/joystick_getaxis.3

View file

@ -0,0 +1 @@
.so man3/joystick_getaxis.3

View file

@ -0,0 +1 @@
.so man3/joystick_getaxis.3

49
doc/man3/joystick_close.3 Normal file
View file

@ -0,0 +1,49 @@
.TH joystick_close 3 "14 April 1998" "Svgalib 1.3.0" "Svgalib User Manual"
.SH NAME
joystick_close \- close a joystick
.SH SYNOPSIS
.B "#include <vgajoystick.h>"
.BI "void joystick_close(int " joydev );
.SH DESCRIPTION
closes the joystick
.I joydev
which was opened with
.BR joystick_init (3).
.IB joydev " = -1"
closes all currently open joystick devices. Note that any calibration data is lost if you
close a joystick.
.SH CAVEATS
This function is only available in ELF versions of svgalib. Due to backwards
compatibility issues it cannot be used with shared a.out libs.
.SH SEE ALSO
.BR svgalib (7),
.BR vgagl (7),
.BR libvga.config (5),
.BR joytest (6),
.BR mjoytest (6),
.BR joystick_init (3),
.BR joystick_update (3),
.BR joystick_sethandler (3),
.BR joystick_setdefaulthandler (3),
.BR joystick_getnumaxes (3),
.BR joystick_getnumbuttons (3),
.BR joystick_getaxis (3),
.BR joystick_getbutton (3),
.BR joystick_button1 (3),
.BR joystick_getb1 (3),
.BR joystick_x (3),
.BR joystick_getx (3).
.SH AUTHOR
The svgalib joystick handler was mostly done by Daniel Engstr\\"om <daniel.engstrom@riksnett.no>.
Multiple joystick, VC switching support and code to glue it into svgalib by Michael Weller
<eowmob@exp-math.uni-essen.de>. Part of the code is based on code from C. Smith and
Vojtech Pavlik.

139
doc/man3/joystick_getaxis.3 Normal file
View file

@ -0,0 +1,139 @@
.TH joystick_getaxis 3 "14 April 1998" "Svgalib 1.3.0" "Svgalib User Manual"
.SH NAME
joystick_getaxis, joystick_getbutton \- query the current state of a joystick.
.SH SYNOPSIS
.B "#include <vgajoystick.h>"
.BI "char joystick_getaxis(int " joydev ", int " a );
.br
.BI "char joystick_getbutton(int " joydev ", int " b );
.SH DESCRIPTION
These functions query the current state of the joystick
.IR joydev .
Actually this is the state found during the last call
to
.BR joystick_update (3)
with the default joystick event handler active.
.BI "joystick_getaxis(" joydev ", " a )
return the current state of the given axis (usually it is
.BR "x - 0" ", " "y - 1" ", " "z - 1" ", ...)"
in range
.BR "-128 .. 127" .
Some effort is made such that the center position is close to
.BR 0 .
Note that especially the version 0.* protocol joystick calibration is very bad. You won't usually
see the extrem values on the extreme position. Also, the center position will be close to zero but
often not be exactly zero and return values will also vary slightly from call to call even when
the user did not move the joystick.
.BI "joystick_getbutton(" joydev ", " b )
returns the state of a button. It returns 1 for pressed button and 0 else. Note that no hardware
checks for button clicks. The button press is only detected during a call to
.BR joystick_update (3)
(at least in the 0.* protocol).
.B NOTE:
The functions simply return the data passed to the default joystick event handler!
For your convenience, the following stortcuts have been established by use of the preprocessor:
.RS
.BI joystick_button1( i )
for
.BI joystick_getbutton( i ,
.BR 0) .
.br
.BI joystick_button2( i )
for
.BI joystick_getbutton( i ,
.BR 1) .
.br
.BI joystick_button3( i )
for
.BI joystick_getbutton( i ,
.BR 2) .
.br
.BI joystick_button4( i )
for
.BI joystick_getbutton( i ,
.BR 3) .
.RE
.RS
.BI joystick_x( i )
for
.BI joystick_getaxis( i ,
.BR 0) .
.br
.BI joystick_y( i )
for
.BI joystick_getaxis( i ,
.BR 1) .
.br
.BI joystick_z( i )
for
.BI joystick_getaxis( i ,
.BR 2) .
.RE
.RS
.B joystick_getb1()
for
.BR "joystick_getbutton(0, 0)" .
.br
.B joystick_getb2()
for
.BR "joystick_getbutton(0, 1)" .
.br
.B joystick_getb3()
for
.BR "joystick_getbutton(0, 2)" .
.br
.B joystick_getb4()
for
.BR "joystick_getbutton(0, 3)" .
.RE
.RS
.B joystick_getx()
for
.BR "joystick_getaxis(0, 0)" .
.br
.B joystick_gety()
for
.BR "joystick_getaxis(0, 1)" .
.br
.B joystick_getz()
for
.BR "joystick_getaxis(0, 2)" .
.RE
.SH CAVEATS
This function is only available in ELF versions of svgalib. Due to backwards
compatibility issues it cannot be used with shared a.out libs.
.SH SEE ALSO
.BR svgalib (7),
.BR vgagl (7),
.BR libvga.config (5),
.BR joytest (6),
.BR mjoytest (6),
.BR joystick_init (3),
.BR joystick_close (3),
.BR joystick_update (3),
.BR joystick_sethandler (3),
.BR joystick_setdefaulthandler (3),
.BR joystick_getnumaxes (3),
.BR joystick_getnumbuttons (3).
.SH AUTHOR
The svgalib joystick handler was mostly done by Daniel Engstr\\"om <daniel.engstrom@riksnett.no>.
Multiple joystick, VC switching support and code to glue it into svgalib by Michael Weller
<eowmob@exp-math.uni-essen.de>. Part of the code is based on code from C. Smith and
Vojtech Pavlik.

View file

@ -0,0 +1 @@
.so man3/joystick_getaxis.3

View file

@ -0,0 +1 @@
.so man3/joystick_getaxis.3

View file

@ -0,0 +1 @@
.so man3/joystick_getaxis.3

View file

@ -0,0 +1 @@
.so man3/joystick_getaxis.3

View file

@ -0,0 +1 @@
.so man3/joystick_getaxis.3

Some files were not shown because too many files have changed in this diff Show more