• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

READMEH A D05-Jan-19984.2 KiB8771

graphics.hH A D05-Jan-19987.1 KiB285236

makefile.bccH A D04-Mar-1998453 4118

makefile.mvcH A D09-Aug-2000450 4017

winbgi.cxxH A D18-Aug-199944.7 KiB1,8221,618

README

1This package contains emulation library of Borland Graphics Interface (BGI)
2for Windows-95/NT. This library strictly emulates most of BGI functions
3(except using of non-standard drivers). Also may be mapping of fonts
4is not correct. But as far as sources are also available, you can
5easily customize them for your application. Unfortunately direct work
6with palette colors (setpalette, setbkcolor, write and putimage modes other
7than COPYPUT) is supported only for 256-colors Windows mode.
8Also I have used this library for only few programs (bgidemo is
9certainly the most complex one) so I can't guaranty that all
10functions always work properly. I am also sorry for the lack of
11parameter checking in WinBGI functions. So summarizing all above:
12
13WinBGI advantages:
141) Allows you to run your old Turbo-C DOS applications in 32-bit mode
15   in normal windows. So you can easily overcome all 64Kb limitations
16   and getting 32-bit application by simple recompilation !
17
182) Graphics is much faster with WinBGI (because native Win32 API
19   is used with minimal emulation overhead) in comparison with
20   original application running in DOS session under Windows
21   (especially at my PPro-200 with NT).
22   Also it seems to me that some things (like switching of graphical
23   pages) are not working properly in DOS mode under Windows-NT.
24
253) You can use WinBGI for creating non-event driven graphical applications.
26   For example if you want to write a program which only draws
27   graphic of functions, it is not so easy to do with windows.
28   You have to handle REDRAW messages, create timers to output next
29   graphics iteration... It seems to me that BGI is much more
30   comfortable for this purposes: you just draw lines or points and do
31   not worry about window system at all...
32
33WinBGI shortcomings:
341) Handling of Windows events is done in BGI functions kbhit(). getch()
35   and delay(). So to make your application work properly You should
36   periodically call one of this functions. For example,
37   the following program will not work with WinBGI:
38
39   	initgraph(&hd, &hm, NULL);
40   	while (1) putpixel(random(640), random(480), random(16));
41   	closegraph();
42
43   Correct version of this program is:
44
45   	initgraph(&hd, &hm, NULL);
46   	while (!kbhit()) putpixel(random(640), random(480), random(16));
47   	closegraph();
48
492) To handle REDRAW message WinBGI has to perform drawing twice:
50   at the screen and in the pixmap which can be used while redrawing.
51   I find that speed of drawing is still very fast but if you want to
52   make it even faster you can assign 0 to global variable
53   "bgiemu_handle_redraw". In this case drawing is performed only at
54   the screen but correct redrawing is not possible. If your application
55   makes some kind of animation (constantly updates pictures at the screen)
56   then may be storing image in the pixmap is not necessary, because your
57   application will draw new picture instead of old one.
58
593) Work with palettes is possible only in 256-colors Windows mode.
60   I don't know how to solve this problem with Win32
61   (I am not going to use DirectX).
62
634) It is still not so good tested and not all BGI functionality
64   is precisely simulated. I am hope that current version of WinBGI
65   can satisfy requirements of most simple Turbo-C graphics applications.
66
67By default WinBGI emulates VGA device with VGAHI (640x480) mode.
68Default mode parameter can be changed using "bgiemu_default_mode"
69variable. Special new mode VGAMAX is supported by WinBGI, causing
70creation of maximized window. To use this mode you should either
71change value of "bgiemu_default_mode" variable to VGAMAX and specify
72DETECT device type, or specify VGA device type and VGAMAX mode.
73
74I am using Microsoft Visual C++ 5.0 to compile this application.
75To build library and BGIDEMO example you should only issue command "nmake".
76As a result you will have library "winbgi.lib", header file "graphics.h"
77which you can put in any place you want and bgidemo.exe - example of using
78WinBGI with original Borland BGIDEMO sample from BCC 4.5,
79
80
81WinBGI is shareware. You can do everything you want with this library.
82Certainly I can give you absolutely no warranty but I will be glad
83to answer all your questions and fix bugs which you may be find in WinBGI...
84
85My e-mail address:
86knizhnik@cecmow.enet.dec.com
87