-*-Text-*-

    Ygl: Run 2d-GL programs with standard X11 routines.
    (C) Fred Hucht 1993-95
    EMail: fred@thp.Uni-Duisburg.DE

Changes from Version 1.0 -> 1.0.1:
---------------------------------
The refresh time and the use of the colormap is now controlled via two 
environment variables (XGL_PRIVATECOLORMAP and XGL_FLUSHTIME) and no 
longer through external variables due to problems with shared 
libraries.  libXgl.a is now a shared library and the linker option 
-lX11 can be omitted.

Changes from Version 1.0.1 -> 1.1:
---------------------------------
The function getorigin returned the position of the upper left corner
in X11 coordinates rather than the position of the lower left corner
in GL coordinates. 

The function "gflush()" is no longer supported. Use sleep(0) to flush
the graphics pipeline instead.

XGL supports doublebuffering via the "Multi-Buffering" server
extension. This extension is new in X11R5 and is included in the lpp
X11dev.src under AIX 3.2. To use doublebuffering you have to link the
"Multi-Buffering" extension into your X-Server (AIXlers, see
/usr/lpp/X11/Xamples/README, "Linking the Sample Extensions into the
Server"). The related GL routines are doubleduffer, swapbuffer and
singlebuffer. 

The following functions are added:
getmcolor, getcolor, gconfig, singlebuffer, swapbuffers, doublebuffer,
getvaluator, getbutton, concave, poly2i, poly2s, polf2i, polf2s

Changes from Version 1.1 -> 1.1.1:
---------------------------------
A bug in qread is fixed that caused too much Expose events (REDRAW) to
be filtered out. XGL filters out all Expose events that are directly
followed by another Expose event for the same window. In versions
prior to 1.1.1, qread filtered out ALL Expose events that were
followed by another Expose event, even for another window.

Changes from Version 1.1.1 -> 1.3:
---------------------------------

The following functions are added:
rmv2s, rmv2i, rdr2i, rdr2s, winclose, strwidth, getheight, getdescender.

The qtest and qread routines can now distinguish between LEFTMOUSE,
MIDDLEMOUSE and RIGHTMOUSE and support MOUSEX and MOUSEY events.

Setting XGL_FLUSHTIME to -1 will put the XServer into synchronous mode
(see XSynchonize). This mode seems to be veeeryyy slooow...

Changes from Version 1.3 -> 2.0:
--------------------------------

BackingStore support added. Set XGL_BACKINGSTORE=1.

RGBmode and support for other visual types is added. Xgl can run in a
per window RGB mode, if the X-Server has a TrueColor visual. Xgl will
always select the appropiate visual for the desired mode, independent
of the default visual, ie:

	Colormap mode <-> PseudoColor or GrayScale visual
	RGB mode      <-> TrueColor visual

Short names for environment variables added:
  XGL_FT  for XGL_FLUSHTIME
  XGL_PCM for XGL_PRIVATECOLORMAP
  XGL_BS  for XGL_BACKINGSTORE

The following functions are added:
 winmove, winposition, ginit, RGBmode, RGBcolor, cmode

Two routines arcx and arcxf that are not part of standard gl are
contributed by michael@thp.Uni-Duisburg.DE. With this routines you can
draw outlined and filled _elliptic_ arcs.

All drawing functions are implemented with floating-point arguments, i.e.:
 pnt2, move2, draw2, rmv2, rdr2, arc, arcf, circ, circf,
 rect, rectf, sbox, sboxf, pmv2, pdr2, rpdr2, poly2, polf2, cmov2.

A bug in prefposition is fixed that caused prefposition to not work...

All routines that talk to the X-Server now check for correct
initialisation. This may slow down Xgl a very little bit. You can
undefine CHECKDISPLAY in header.h get the old method (which is also
used by gl :-).

You can set Xgl_Prefix to 1 in Imakefile and do a

# xmkmf -a;make clean;make

to compile a library named libXglp.a where all function names are
prepended with 'xgl_'. This is to avoid name conflicts if you want to
use Xgl in other projects as the Turbo Pascal for Unix emulator by
Michael Staats (michael@thp.Uni-Duisburg.DE).

Changes from Version 2.0 -> 2.1:
--------------------------------

Name of library changed to Ygl due to a nameing conflict with SUNs XGL
library.

All environment vars now starts with YGL_. The old names remains valid
for compatibility reasons.

Xgl_Prefix -> Ygl_Prefix and all names are prepended with ygl_. Change
file mkprefix to get the old xgl_ prefix.

gversion returns Ygl:X11-x.x (not Xgl:X11-x.x).

Example programs and {Im|M}akefiles revisited.

Button{Press|Release} events are only received when nessesary now.

Bugs in rdr and arc/arcf fixed. They didn't work as expected...

Bug in charstr to RGB windows fixed (core dumped).

Bug in winclose fixed.

Support for StaticGray visual added. Ygl now runs on Monochrome
servers (again) (eg. XFree under Linux).

Colormaps are now only installed when the server has room for them.
This avoids the colormap switches on startup.

The following function is added:
 gRGBcolor.

Changes from Version 2.1 -> 2.2:
--------------------------------

Note that you don't need to recompile the X-Server anymore to use
doublebuffering under AIX 3.2.5 (AIXWindows 1.2.3). You simply have to
add the option "-x mbx" to the X-Servers command line on startup.

Additionaly, the multibuffer routines under AIX are in libXext.a now
(as they should...).

Bug in qread (Alt/Ctrl keys were reported as normal keys) fixed.
Bug in qtest that eventually caused unknown events to block the queue
fixed.

The following function is added:
 ortho2.

Changes from Version 2.2 -> 2.3:
--------------------------------

The following functions are added:
 lrectread, lrectwrite, readsource.

lrectread returns the same array as the GL version.

DirectColor visuals are supported, too, now.

Changes from Version 2.3 -> 2.4:
--------------------------------

The following functions are added:

  rectcopy, cpack, c3s, c3i, c3f, linewidth, rect{read|write}
  getXgc, crect{read|write}

getXgc() is not included in standard GL. It returns a pointer to the 
graphics context just like getXdpy() returns a pointer to the
display. You can for example use it to draw lines etc. xored with the
background: 

#include <X11/X.h>
...
XSetFunction(getXdpy(), getXgc(), GXxor);

crect{read|write} are also not in standard GL. They work the same as
lrect{read|write}, they only {read|write} the data to a char array
instead of a Int32 array. This is to speed up Colormap mode
operations. 

Bug in timer handling fixed which caused flushtimes >= 1 second to be
ignored.

Small bugs in lrect{read|write} fixed.

All rect* and sbox* routines now draw rectangles even when x2 < x1 or
y2 < y1, i.e. rect(10,10,20,20) is the same as rect(20,20,10,10).
circ* and arc* routines now interpret negative radii as zero.

doublebuffer and singlebuffer are now available in the library even
when not compiled with -DMULTIBUF. 

A new example program "smile.f" illustrates how to call Ygl routines
from Fortran under AIX.

Changes from Version 2.4 -> 2.5:
--------------------------------

The following functions are added:
 tie, winpop, winpush, getlwidth, swinopen, getfont, getfontencoding,
 getcpos, winconstraints, noport

Minor changes to qreset, qread, and [I]makefiles.

Bug fixed that might cause getcolor to return the wrong color when
using multiple windows.

Bugs fixed that caused linewidth and fonts not to be per window.

Bug fixed that caused prefposition to measure from top left corner
instead of bottom left corner.

getmcolor returned the X color, not the Ygl color. Fixed.

The rect* and sbox* routines now draw rects inclusive the edges, i.e.
rectf(1,1,2,2) is a 2x2 rect, not a 1x1 rect as before. Old versions
of IBMs GL draw 1x1 rects, but this seems to have been fixed...

Three new environment variables YGL_SINGLEGC, YGL_CMAPVISUAL and
YGL_RGBVISUAL has been added. See the ReadMe file for a description. 

REDRAW events are now queued by default.

Changed example/rgb.c to demonstrate usage of tie and renamed it to
rgbtest.c.
Changed example/lines.c to demonstrate usage of swinopen.

Header file Ygl.h is now installed automatically when using imake.

New define in Imakefile to use (experimental) support for global
standard colormaps (see xstdcmap(1)).

The ReadMe file is now in html format. Use Mosaic or emacs w3-mode (or
other www viewer) to read. The latest version of this ReadMe is
available at the World Wide Web:

   http://www.thp.Uni-Duisburg.DE/Ygl/ReadMe.html.

Changes from Version 2.5 -> 2.6:
--------------------------------

getcpos was wrong when using ortho2. Fixed.

charstr's update of character position was wrong when using ortho2.
Fixed. 

loadXfont crashed when compiled with some non-ansi compilers due to
realloc(NULL,...). Changed.

qdevice/unqdevice couldn't change device list while a mouse button was
pressed due to active pointer grabs. Changed.

linewidth now only changes GCs when linewidth has changed.

Several minor speedups.

ortho2 now detects empty {X|Y}-ranges.

Spurious errors 
"Ygl: X Error: BadColor (invalid Colormap parameter) on 0x2000002"
showed up when quitting programs with private colormap (eg.
example/colormap). Fixed.

Changes from Version 2.6 -> 2.7:
--------------------------------

Functions added:
 getmcolors, getdisplaymode, setbell, ringbell, gl2ppm, frontbuffer,
 backbuffer 

Changed filtering of Expose events. Now even more Expose events for a
window are filtered to minimize redraws.

XMULIB in Imakefile is also used in ibmLib.tmpl :-(. Changed to
THEXMULIB.

Simplified code for handling of tie()s.

gl2ppm is a subroutine that will write out the active [Y]gl window to
a PPM file or pipe it through a shell command. Usage:
    int gl2ppm(char *filename)
popen is used instead of fopen when filename[0] == '|'. For an
example, see examples/lines.c. 

WINCLOSE device changed to WINQUIT due to incompatibility with SGI's
GL. Please change WINCLOSE to WINQUIT in your source code.

A REDRAW event is sent when a window is moved. This is not nessesary
for redrawing but for getting the new origin of the window.
Unfortunally SGI's GL has no unique event for window moves
(ConfigureNotifyEvent)...

Changes from Version 2.7 -> 2.8:
--------------------------------

Functions added:
  getgdesc

Added support for individual key devices, eg. F1KEY, UPARROWKEY and so
on. This was done on public request. 

Replaced XPointer with char*. XPointer isn't defined in X11R4.

Added some explicit type converters at calls to [cm]alloc.

Changed qdevice() and unqdevice() to return error when called before
winopen().

Rewrote qtest() and qread(). Now both use one function. Hope not to have
introduced too much bugs :-)

When routines are called before winopen() or ginit() or after gexit()
that don't work at this point, the error message now includes the
function name. 

Fixed winset() and winclose() to handle invalid window ids correctly.

Fixed [cl ]rectread to work when a window is completely visible again
after it was not completely visible.

Changed gl2ppm to report broken pipes (invalid shell commands and so).

Included FORTRAN bindings for all Ygl functions. The FORTRAN versions
of all functions have an underscore appended, so the FORTRAN compiler
must append a _ to all names. f2c does this, xlf (under AIX 3.2)
requires the option -qextname. See smile_f77.f for an example program.
Set "FortranBindings" to 0 in Imakefile or change Makefile.std if you
don't want these bindings. FORTRAN bindings are not tested because I
have no programs.f to test. If you find bugs, feel free to report them
to me. 

Small change to colormap handling to reduce technicolor effects when
using a private colormap (YGL_PCM=1) on displays not capable of more
than one colormap at a time: Now the default colormap is copied to the
private colormap and all entries in the private colormap count from
the end of the colormap. So a mapcolor(i,r,g,b) changes colorcell
255-i (in 8 bit deep visuals) instead of cell i to reduce overlapping
of private colorcells and cells already in use by other applications.

Extended selection of cmapmode visuals. Now cmapmode can also run on
TrueColor and DirectColor visuals. This is for XServers that only have
True/DirectColor visuals.

Changes from Version 2.8 -> 2.8.1:
----------------------------------

Fixed several bugs in FORTRAN bindings.

Added header file 'config.h'.

Changed gversion() to return -1 if display can't be opened (see
example contrib/tools/xmap.c).

Changes from Version 2.8.1 -> 2.9:
----------------------------------

Added noop routine foreground().

Individual key devices introduced in Version 2.8 now reports both
KeyPress and KeyRelease events. See examples/lines.c for an example.

Changed qread() to report only one REDRAW event after a window resize
and window moves. This is done by interpreting both Expose and
ConfigureNotify events as generators for REDRAW events.

Moved header Ygl.h, Yfgl.h and Yglprefix.h to X11 directory.

Changes from Version 2.9 -> 2.9.2:
----------------------------------

swapbuffers() didn't explicitely flush the X pipeline, so sometimes a
swapbuffers() didn't have an immediate effect.

Bug in winopen() fixed that caused Ygl not to work with VisualID=0x0.

Some calls to {r|c|m}alloc() were not checked for out of memory.
Fixed.

Changes from Version 2.9.2 -> 2.9.5:
------------------------------------

Fixed gconfig() to save doublebuffer state when switching cmode and
RGBmode. 

Functions added:
  winX

Note that winX(Display *dpy, Window win) has some limitations:
 o dpy will be ignored. Ygl always uses the environment variable
   DISPLAY.

 o Changing the visual of a window with cmode() or RGBmode()
   (RGBmode();gconfig();) will change the X11 WindowID of the window.
   So after the code  
     ...
     xwin = XCreateWindow(...);
     winX(dpy, xwin);
     RGBmode();
     gconfig();
     ...
   xwin is not valid anymore. You must get the new windowid with
     xwin = getXwid();

New environment variable YGL_PARENTWID or YGL_PWID introduced. See the
ReadMe file for further details.

Ygl was distributed in terms of the GNU GENERAL PUBLIC LICENSE. Since
version 2.9.5, Ygl is distributed in terms of the GNU LIBRARY GENERAL
PUBLIC LICENSE. See the file LICENSE for further details.

Ygl has no private XErrorHandler anymore, as the default error handler
gives more information and it's o.k. to exit() when a X error occures.

Changes from Version 2.9.5 -> 3.0.0:
------------------------------------

Added dithering to RGBmode. Dithering is controlled by the environment
variable YGL_DITHERSIZE or shorter YGL_DSZ. With this variable you can
specify the size of the dither matrix. The default value is 4, leading
to a 4x4 dither matrix. Valid values range from 0 to 6. On a normal 8
bit TrueColor visual ({3,3,2} bits {red,green,blue}) you obtain
113x113x49 = 625681 different "colors" with YGL_DSZ=4, leading to an
effective screen depth of approx. 19 bits. The other values and the
effective screendepths are:

         |  8 bit (3-3-2)  | 12 bit (4-4-4)  |  16 bit (6-5-5)
  YGL_DSZ| # colors (bits) | # colors (bits) |  # colors (bits)
  -------------------------------------------------------------
    0,1  |      256 ( 8  ) |     4096 (12  ) |     65536 (16  )
     2   |    10933 (13.4) |   226981 (17.8) |   3953125 (21.9)
     3   |   114688 (16.8) |  2515456 (21.3) |  44531200 (25.4)
     4   |   625681 (19.3) | 13997521 (23.7) | 249232081 (27.9)
     5   |  2354176 (21.2) | 53157376 (25.7) | 949029376 (29.8)
     6   |  6976981 (22.7) |158340421 (27.2) |2831006341 (31.4)

Note that dithering costs speed. You may set YGL_DSZ=0 to disable
dithering. If you are lucky and have a 24 bit TrueColor visual, YGL_DSZ
is automatically set to zero.
Affected routines: RGBcolor(), gRGBcolor(), cpack(), c3s(), c3i(),
c3f().
See examples/rgbtest.c for an example.

Added menu stuff. New functions: defpup(), newpup(), addtopup(),
dopup(), freepup(), setpup(). See examples/popup.c for details.

Added C++ support to Ygl.h.

Fixed bugs in FORTRAN bindings. Unfortunately some of the FORTRAN names
are not truncated to 6 chars due to nameing conflicts, SH*T. FORTRAN
bindings must be lowercase...
 double_  -> doublebuffer_
 gRGBcol_ -> grgbcol_
 RGBcol_  -> rgbcol_
 RGBmod_  -> rgbmod_
 loadXf_  -> loadxf_
 getXdpy_ -> getxdpy_
 getXwid_ -> getxwid_
 getXgc_  -> getxgc_

Fixed bug in gl2ppm() that caused it to fail under newer versions of
AIX32.

getXwid() returned Window* instead of Window, getXgc() returned GC*
instead of GC. Fixed.

Added winX() to FORTRAN bindings.

Fixed cooperation of FORTRAN bindings and YGL_PREFIX.

Changed behaviour of prefposition() and winposition(). The given
values now describe the position of the drawing area, not the position
of the window incl. window manager decorations.

A RGBmode window is now a child of the initially created colormap mode
window. This simplified changing to RGBmode. Ygl now uses the property
WM_COLORMAP_WINDOWS to tell the window manager, which colormaps are to
be installed. This also fixed a bug when a subwindow of a cmap window
was a RGB window. To toggle the colormaps is this case, use the window
manager function f.colormap in twm or f.next_cmap in mwm (see your
window manager manual for details).

Added the function getXdid(). getXdid() returns the window id of the
drawable. This id differs from getXwin() when using RGBmode or
doublebuffering.
