Jump to content
 







Main menu
   


Navigation  



Main page
Contents
Current events
Random article
About Wikipedia
Contact us
Donate
 




Contribute  



Help
Learn to edit
Community portal
Recent changes
Upload file
 








Search  

































Create account

Log in
 









Create account
 Log in
 




Pages for logged out editors learn more  



Contributions
Talk
 



















Contents

   



(Top)
 


1 Third-party BGI drivers  





2 Legacy  





3 Example  





4 See also  





5 References  





6 External links  














Borland Graphics Interface






العربية
Deutsch
Français
Italiano
Polski
Русский
Tiếng Vit
 

Edit links
 









Article
Talk
 

















Read
Edit
View history
 








Tools
   


Actions  



Read
Edit
View history
 




General  



What links here
Related changes
Upload file
Special pages
Permanent link
Page information
Cite this page
Get shortened URL
Download QR code
Wikidata item
 




Print/export  



Download as PDF
Printable version
 
















Appearance
   

 






From Wikipedia, the free encyclopedia
 


Borland Graphics Interface
Written inC++
PlatformDOS
Typelibraryorframework

The Borland Graphics Interface, also known as BGI, was a graphics library bundled with several Borland compilers for the DOS operating systems since 1987. BGI was also used to provide graphics for many other Borland products including the Quattro Pro spreadsheet.

The library loaded graphic drivers (*.BGI) and vector fonts (*.CHR) from disk in order to provide device independent graphics support. It was possible for the programmer to embed the graphic driver into the executable file by linking the graphic driver as object code with the aid of a utility provided by the compiler (bgiobj.exe). There were graphic drivers for common graphic adapters and printers of that time, such as CGA, EGA, VGA, Hercules, AT&T 400, MCGA and 3270 PC. There also were BGI drivers for some kinds of plotters.

The last Borland's C++ IDE for DOS is Borland C++ 3.1 (1992). The last C++ environment which supports BGI is Borland C++ 5.02 (1997), which works under Windows but can compile DOS programs. BGI was accessible in C/C++ with graphics.lib / graphics.h, and in Pascal via the graph unit.

BGI was less powerful than modern graphics libraries such as SDLorOpenGL, since it was designed for 2D presentation graphics instead of event-based 3D applications. However, it has been considered simpler to code.[1] BGI and Turbo C++, although obsolete, are still widely used in education in India.[2][3]

Third-party BGI drivers[edit]

Given the popularity of Borland compilers, a few independent software developers produced BGI drivers for non-standard video modes, advanced video cards, plotters, printers, and graphics file output.[4]

In 1994 Jordan Hargraphix Software released SVGA BGI drivers version 5.5 that are compatible with some SVGA hardware like ATIorCirrus Logic cards and VESA VBE-compatible cards. Also there are tweaked VGA drivers for non-standard graphic modes supported by VGA by writing directly into its registers, protected mode driver versions for Turbo Pascal 7.0 and mouse driver (actually cursor handler for unsupported video modes by standard mouse drivers). These drivers were shareware and buying them let receiving their source code and technical support; now they are no longer supported, but on 19 December 2020 Jordan Hargrave kindly released source code under the MIT LicenseonGitHub.[5] Main bugs are lack of aligning bytes support in VESA true-color modes (so the true-color driver is not suitable for Nvidia graphic cards) and video memory bank switching bug in mouse driver (since real mode addressing space is 1 megabyte, but some video modes require up to 4 megabytes of memory, it is split into 64 kilobyte banks).

Legacy[edit]

A BGI-compatible library, named Graph, is included in the Free Pascal Pascal compiler.[6] Several BGI implementations for present-day operating systems are also available (see External links.)

Example[edit]

The following program, written for Borland Turbo C, initialises the graphics and draws 1000 random lines:

#include <graphics.h>
#include <conio.h>
#include <stdlib.h>

int main (int argc, char *argv[])
{
  int i, gd = DETECT, gm;
  initgraph(&gd, &gm, "");
  setbkcolor(BLACK);
  cleardevice();
  outtextxy(0, 0, "Drawing 1000 lines...");
  for (i = 0; i < 1000; i++) {
    setcolor(1 + random(15));
    line(random(getmaxx()), random(getmaxy()), 
         random(getmaxx()), random(getmaxy()));
  }
  getch();
  closegraph();
  return 0;
}

See also[edit]

References[edit]

  1. ^ "Computer Graphics", ISRD Group, 2006. ISBN 0070593760
  • ^ Indian engineering colleges are terrible at approaching technology
  • ^ Why is Turbo C++ still being used in Indian schools and colleges?
  • ^ Freeware BGI drivers, Jordan Hargraphix BGI drivers, Knight Software BGI256
  • ^ SuperVGA BGI Drivers for Turbo C/Turbo Pascal/Borland C++
  • ^ Reference for unit 'Graph': Procedures and functions
  • External links[edit]


    Retrieved from "https://en.wikipedia.org/w/index.php?title=Borland_Graphics_Interface&oldid=1217076377"

    Categories: 
    Borland software
    Graphics libraries
    C (programming language) libraries
    C++ libraries
    Hidden categories: 
    Articles with short description
    Short description is different from Wikidata
     



    This page was last edited on 3 April 2024, at 18:09 (UTC).

    Text is available under the Creative Commons Attribution-ShareAlike License 4.0; additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy. Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc., a non-profit organization.



    Privacy policy

    About Wikipedia

    Disclaimers

    Contact Wikipedia

    Code of Conduct

    Developers

    Statistics

    Cookie statement

    Mobile view



    Wikimedia Foundation
    Powered by MediaWiki