File: /~heha/hs/[Download]

GRAPHWIN - A Windows replacement for GRAPHICS.LIB
(better than EASYWIN for old text-mode applications)

German introduction: Siehe Anfang der GRAPHICS.C

This is a wrapper for the GRAPHICS.LIB, for easy transferring your BGI
application to a true Windows application.

Ideal for those the have a mode or less big graphical DOS application
and want to make a real Windows app because of some benefits,
without re-writing the whole code at one time.

Currently, this version does support text mode (poorly tested)
and VGA mode (all functions tested)

Instructions on how to use: See beginning of GRAPHICS.H  

Internal processing and key functions:
 > A bitmap holds the drawing area(s), necessary for redrawing the
   window when revealed (like in all windowing systems)
 > In a "DirectDraw" mode, all drawings are applied both to the real
   window and to the bitmap above; elsewhere, drawings are done to
   the bitmap only, and the bitmap is bltted to the window when idle.
 > The funktion gdiproc() is a universal template for calling all GDI
   drawing functions and draws one time, two times, or (later) 3 times.
 > A bunch of GDI objects (pen, font, background brush) is always
   allocated and to be changed on a call to ChangeGdiObject() in all
   device contexts
 > If graphics mode changes (programmatically), the window size will
   be automatically tracked to avoid useless borders, see WM_GetMinMaxInfo 

Known bugs and no-bugs:
 - No emulation of palette (don't know how to emulate) 
 - Incorrect emulation of background color (due to palette usage)
 - Window size defaults to size of VGA-VGAHI (better: text mode)
 - Incomplete emulation of CONIO (not often used, no objective)
 - Window size adjustment without zoom and/or scroll bars
 - Windows fill patterns differ from GRAPHICS.LIB
 - Emulation of large aspect ratios (e.g. VGALO) is stretched too
 - No Windows fonts available for replacement of .CHR fonts
 - No signal handler callable when closing the window
 - Project should be set to "Warning if duplicate symbols OFF"!

Already implemented features:
 + Main program starts with main(), not WinMain() (=more compatible)
 + Usage of "original" DOS font (WOA=Windows Old Application)
 + Some text mode functions, like clrscr()
 + Caret (=cursor) support - like EASYWIN
 + Support of arrow and function keys - in contrast to EASYWIN!
 + Clean OEM font support, even for key codes
 + Sine table (should be accessible from extern)
 + Direct drawing both into window and into background bitmap
   enables displaying of sequential picture creation (="DirectDraw")
   (if your computer is slow enough:-)
 + Indirect drawing (see above) and bltting when idle is faster,
   sometimes faster than DOS / BGI
 + Full support for planes (of couse not in VGAHI mode)
 + Support of user-definable bitmap size, color depth, and plane count
 + Scaling of output image is prepared
 + Warning when "killing" the program, message text localizable
 + Automatic close of window if main program terminates
   and screen is empty

In the future:
 * "Third Record" into a memory metafile enables redrawing with changing
   background color (= replacement for missing palette) and exporting
   the graphics in a vector format
 * Full CONIO support
 * Support of coloured ANSI sequences
 * Support of non-16bit and/or non-Borland compilers

haftmann#software, 12/02
Detected encoding: ASCII (7 bit)2