0% found this document useful (0 votes)
114 views6 pages

Bgi

This document discusses graphics programming using BGI, mode 13h, and VESA. It focuses on using BGI and describes some common mistakes made by programmers when initializing BGI. It also discusses using Jordan Hargraphix Software's SuperVGA/Tweak BGI drivers and HGXMOUSE TSR to enable more colors and mouse support in different graphics modes.

Uploaded by

ramesh_samy143
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
114 views6 pages

Bgi

This document discusses graphics programming using BGI, mode 13h, and VESA. It focuses on using BGI and describes some common mistakes made by programmers when initializing BGI. It also discusses using Jordan Hargraphix Software's SuperVGA/Tweak BGI drivers and HGXMOUSE TSR to enable more colors and mouse support in different graphics modes.

Uploaded by

ramesh_samy143
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Part III Advanced Graphics Programming

Graphics Programming can be classified into: 1. Graphics with BGI 2. Mode 13h Programming 3. VESA Programming

28

Without leadership a nation falls.

Graphics with BGI

BGI stands for Borland Graphics Interface. Working with BGI refers to working with driver files (with BGI extension). So we are in need of BGI files that are to be initialized with initgraph( ) function. Programming with BGI is considered to be quite old. In my experience, BGI is used only by Indian Programmers! Other International Programmers use mode 13h. Even though BGI is slow, we can do lots of graphics with it. It will be highly beneficial for the beginners.

28.1 Common Mistake!


int gdriver = DETECT, gmode; initgraph( &gdriver, &gmode, "c:\\tc\\bgi");

One of the common mistakes very often committed by Indian Programmers is to use DETECT macro with initgraph( ) as shown above. First of all we must know what DETECT will do in a program: it automatically detects the systems graphics adapter and chooses the mode that provides the highest resolution for that adapter. So we must understand that DETECT may detect a mode, which we might not expect! And it will be a very serious problem! If you write a program for 640x480 resolution, and if DETECT detects a mode that has only 320x200 resolution, you cannot see a part of the image. It is a costly mistake! So the right declaration for a bug free program is:
int gdriver = VGA, gmode = VGAHI; initgraph( &gdriver, &gmode, "c:\\tc\\bgi");

Another problem with DETECT is that even if you have SVGA it will detect VGA.

28.2 More Colors


When BGI was introduced by the Borland people, they only had VGA (and other older adapters like EGA etc.). So they supplied the graphics package with BGI drivers that could drive the contemporary video adapter like VGA, EGA etc. At that time almost all the systems got VGA. VGA could support only limited number of colors(16 & 256). So programmers who used BGI preferred 16 color mode of VGA, as it gives good resolution (640x480). Nowadays, we have SVGA. SVGA could even support 224 (about 16 million) colors! So if we have BGI driver that supports SVGA, we can obtain the quality of Windows desktop screen in DOS Windows! But Borland doesnt provide BGI driver to support SVGA. Fortunately we have other commercial

142 A to Z of C
packages to support SVGA. Jordan Hargraphix Softwares SuperVGA/Tweak BGI drivers are the widely used drivers.

28.3 Jordan Hargraphix Softwares SuperVGA/Tweak BGI drivers


Jordan Hargraphix Softwares SuperVGA/Tweak BGI drivers are the best according to .But it is a shareware, if you use it, you must send fees to my knowledge. It is found on CD the author! Using Jordan Hargraphix Softwares SuperVGA/Tweak BGI drivers, we can obtain even 224 colors! But before that, you must set the Windows screen properties to desired number of colors. In other words, if you set the screen to the maximum of 256 colors, you cannot get more colors in DOS Box using Jordan Hargraphix Softwares SuperVGA/Tweak BGI drivers. Jordan Hargraphix Softwares SuperVGA/Tweak BGI drivers currently support the following Modes: SuperVGA 16-color 0) Standard EGA/VGA 320x200x16 1) Standard EGA/VGA 640x200x16 2) Standard EGA/VGA 640x350x16 3) Standard VGA 640x480x16 4) SuperVGA/VESA 800x600x16 5) SuperVGA/VESA 1024x768x16 6) SuperVGA/VESA 1280x1024x16 SuperVGA 256-color 0) Standard VGA/MCGA 320x200x256 1) 256k Svga/VESA 640x400x256 2) 512k Svga/VESA 640x480x256 3) 512k Svga/VESA 800x600x256 4) 1024k Svga/VESA 1024x768x256 5) 256k Svga 640x350x256 6) 1280k+ VESA 1280x1024x256 SuperVGA 32768-color 0) 320x200x32768 1) 640x350x32768 2) 640x400x32768 3) 640x480x32768 4) 800x600x32768 5) 1024x768x32768 6) 1280x1024x32768

A to Z of C 143
SuperVGA 65536-color 0) 320x200x65536 1) 640x350x65536 2) 640x400x65536 3) 640x480x65536 4) 800x600x65536 5) 1024x768x65536 6) 1280x1024x65536 SuperVGA 24-bit color 0) 320x200x24-bit 1) 640x350x24-bit 2) 640x400x24-bit 3) 640x480x24-bit 4) 800x600x24-bit 5) 1024x768x24-bit 6) 1280x1024x24-bit Tweaked 16-color 0) 704x528x16 1) 720x540x16 2) 736x552x16 3) 752x564x16 4) 768x576x16 5) 784x588x16 6) 800x600x16 Tweaked 256-color 0) 320x400x256 1) 320x480x256 2) 360x480x256 3) 376x564x256 4) 400x564x256 5) 400x600x256 6) 320x240x256 7) 360x350x256

144 A to Z of C
S3 Accelerator 16/256/32768-color 0) 640x480x256 1) 800x600x256 2) 1024x768x256 3) 800x600x16 4) 1024x768x16 5) 1280x960x16 6) 1280x1024x16 7) 640x480x32768 Turbo C++3.0s setcolor( ) function was not written with upward compatibility. setcolor( ) function receives integer value as color value. So setcolor( ) function cannot work if we provide a long value (a value above 32767, say 50000). Inorder to make the setcolor( ) function to work, Jordan Hargraphix Softwares graphics functions use certain ! rules. More details and documentation are found on CD

28.4 Jordan Hargraphix Softwares HGXMOUSE TSR


HGXMOUSE TSR is another good product from Jordan Hargraphix Software. Its also a . You have shareware, i.e, if you use it you must send fees to the author. It is available in CD to load your mouse driver before you load HGXMOUSE TSR. The reason is HGXMOUSE TSR is not a replacement for your mouse driver, but an extension to it. The question is why we need HGXMOUSE TSR. Your mouse driver may not be aware of certain video modes. So in those video modes, you wont get mouse support. HGXMOUSE TSR, thus enhances the performance of your mouse driver. Jordan Hargraphix Softwares SuperVGA/Tweak BGI drivers are fully integrated with the TSR, and will provide automatic mouse support in all modes if the TSR and mouse driver are loaded. Following are the important features of HGXMOUSE TSR. Support for the mouse cursor in 16, 256, 32k, 64k and true color SuperVGA modes, as well as tweaked 16 and 256 color modes. Support for a graphical text mode cursor (ala Norton) Support for the hardware cursor on systems that support it. (Cirrus 54xx, S3, Paradise) Easy to use API so you can use the mouse cursor in your own programs. (without needing to use Jordan Hargraphix Softwares SuperVGA/Tweak BGI drivers). Large cursor support (currently up to 32x32). Ability to set the cursor foreground and background colors. Bitmap cursor support (multicolored mouse cursors).

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy