Mail Archives: djgpp/1995/11/04/03:31:19
Patrick Steele <psteele AT mail DOT msen DOT com> wrote:
>On Thu, 2 Nov 1995 Broeker AT physik DOT rwth-aachen DOT de wrote:
>
>> In comp.os.msdos.djgpp you write:
>>
>> >On Mon, 30 Oct 1995, Hartmut Schirmer wrote:
>>
>> So where's the problem? Does it really make you any problems to change
>> the source code given above to somthing like this:
>>
>> #ifdef __GNUC__
>> gd = _SOME_BCC2GRX_COMPATIBLE_GD_
>> gm = _SOME_BCC2GRX_COMPATIBLE_GD_
>> set_BGI_mode_whc(&gd, &gm, XRES, YRES, NC);
>> #else
>> gd = _YOUR_OLD_GD_SETUP_;
>> gm = _THE_OLD_MODE_SELECTION_;
>> #endif
>
>But there is no BCC2GRX_COMPATIBLE_MODE... Or maybe I don't understand
>what you were sayin. How would I set up for a VESA compatible
>640x480x256 using BXX2GRX??
>
Just use
int gd, gm;
set_BGI_mode_whc(&gd, &gm, 640, 480, 256);
initgraph(&gd, &gm, "");
and everything will work fine if your GRX is set up for your graphics hardware.
If you've a VESA compatible VGA bios, everything should work without any
addition. Otherwise you may get a bios extension and define
grx1.0x : go32=<other stuff> driver <select for your hw> gw 640 gh 640 nc 256
grx20 : grx20drv= gw 640 gh 480 nc 256
Omit the driver <..> part if you have a VESA video bios.
Now
int gd=DETECT, gm;
initgraph(&gd,&gm,"");
will set up 640x480x256
>> (If I'm not totally mistaken, this would give you a gd/gm pair usable
>> to initgraph() to your desired resolution, independent of the compiler
>> being used. Any corrections on this?)
Remember, Borland didn't define any highres or highcolor mode in the original
BGI api.
There are a lot of different ways to get high resolution modes. You may use
BC++ 3.1 with different BGI drivers on different machines and the BGI drives
will used different gd/gm values.
Using BCC2GRX you may use the following fact:
Every driver (except NATIVE_GRX (-1)) passed to initgraph() will
work like DETECT. Just define a default graphics mode (see above) and
everything should work as expected.
>I may have missed something somewhere. What's this about a GO32
>environment variable?
Read the GRX documentation and check you GRX setup using the modetest
program. If everything works fine, compile the bccbgi.c program coming with
BCC2GRX. The first screen will show you the available mode.
Hope this helps,
Hartmut
--
Hartmut Schirmer | E-Mail: hsc AT techfak DOT uni-kiel DOT d400 DOT de
Automatisierungs- u. Regelungstechnik, | http://www.techfak.uni-kiel.de/~hsc
Technische Fakult"at, Universit"at Kiel, |
Kaiserstr. 2, D-24143 Kiel, Germany, | Phone: +49-431-77572-245 FAX: -285
- Raw text -