Borland Graphics Interface

Last updated
Borland Graphics Interface
Written inC++
Platform DOS
Type library or framework

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.

Contents

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 SDL or OpenGL, 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

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 ATI or Cirrus 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 License on GitHub. [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

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

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>intmain(intargc,char*argv[]){inti,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();return0;}

See also

Related Research Articles

Pascal is an imperative and procedural programming language, designed by Niklaus Wirth as a small, efficient language intended to encourage good programming practices using structured programming and data structuring. It is named after French mathematician, philosopher and physicist Blaise Pascal.

Turbo Pascal is a software development system that includes a compiler and an integrated development environment (IDE) for the programming language Pascal running on the operating systems CP/M, CP/M-86, and DOS. It was originally developed by Anders Hejlsberg at Borland, and was notable for its very fast compiling. Turbo Pascal, and the later but similar Turbo C, made Borland a leader in PC-based development tools.

<span class="mw-page-title-main">Allegro (software library)</span> Software library for video game development

Allegro is a software library for video game development. The functionality of the library includes support for basic 2D graphics, image manipulation, text output, audio output, MIDI music, input and timers, as well as additional routines for fixed-point and floating-point matrix arithmetic, Unicode strings, file system access, file manipulation, data files, and 3D graphics. The library is written in the C programming language and designed to be used with C, C++, or Objective-C, with bindings available for Python, Lua, Scheme, D, Go, and other languages. Allegro comes with extensive documentation and many examples.

<span class="mw-page-title-main">IBM 8514</span> IBM graphics card and computer display standard

IBM 8514 is a graphics card manufactured by IBM and introduced with the IBM PS/2 line of personal computers in 1987. It supports a display resolution of 1024 × 768 pixels with 256 colors at 43.5 Hz (interlaced), or 640 × 480 at 60 Hz (non-interlaced). 8514 usually refers to the display controller hardware. However, IBM sold the companion CRT monitor which carries the same designation, 8514.

VESA BIOS Extensions (VBE) is a VESA standard, currently at version 3, that defines the interface that can be used by software to access compliant video boards at high resolutions and bit depths. This is opposed to the "traditional" INT 10h BIOS calls, which are limited to resolutions of 640×480 pixels with 16 colour (4-bit) depth or less. VBE is made available through the video card's BIOS, which installs during boot up some interrupt vectors that point to itself.

<span class="mw-page-title-main">Video Graphics Array</span> Computer display standard and resolution

Video Graphics Array (VGA) is a video display controller and accompanying de facto graphics standard, first introduced with the IBM PS/2 line of computers in 1987, which became ubiquitous in the IBM PC compatible industry within three years. The term can now refer to the computer display standard, the 15-pin D-subminiature VGA connector, or the 640 × 480 resolution characteristic of the VGA hardware.

<span class="mw-page-title-main">Super VGA</span> Graphics display resolution

Super VGA (SVGA) is a broad term that covers a wide range of computer display standards that extended IBM's VGA specification.

<span class="mw-page-title-main">Text-based user interface</span> Type of interface based on outputting to or controlling a text display

In computing, text-based user interfaces (TUI), is a retronym describing a type of user interface (UI) common as an early form of human–computer interaction, before the advent of bitmapped displays and modern conventional graphical user interfaces (GUIs). Like modern GUIs, they can use the entire screen area and may accept mouse and other inputs. They may also use color and often structure the display using box-drawing characters such as ┌ and ╣. The modern context of use is usually a terminal emulator.

Text mode is a computer display mode in which content is internally represented on a computer screen in terms of characters rather than individual pixels. Typically, the screen consists of a uniform rectangular grid of character cells, each of which contains one of the characters of a character set; at the same time, contrasted to graphics mode or other kinds of computer graphics modes.

<span class="mw-page-title-main">Windows Console</span> Infrastructure for console applications in Microsoft Windows

Windows Console is the infrastructure for console applications in Microsoft Windows. An instance of a Windows Console has a screen buffer and an input buffer. It allows console apps to run inside a window or in hardware text mode. The user can switch between the two using the Alt+↵ Enter key combination. The text mode is unavailable in Windows Vista and later. Starting with Windows 10, however, a native full-screen mode is available.

<span class="mw-page-title-main">Video BIOS</span>

Video BIOS is the BIOS of a graphics card in a computer. It initializes the graphics card at the computer's boot time. It also implements INT 10h interrupt and VESA BIOS Extensions (VBE) for basic text and videomode output before a specific video driver is loaded. In UEFI 2.x systems, the INT 10h and the VBE are replaced by the UEFI GOP.

<span class="mw-page-title-main">Video display controller</span> Type of integrated circuit

A video display controller (VDC), also called a display engine or display interface, is an integrated circuit which is the main component in a video-signal generator, a device responsible for the production of a TV video signal in a computing or game system. Some VDCs also generate an audio signal, but that is not their main function. VDCs were used in the home computers of the 1980s and also in some early video picture systems.

UniVBE is a software driver that allows DOS applications written to the VESA BIOS standard to run on almost any display device made in the last 15 years or so.

Borland C++ was a C and C++ IDE released by Borland for MS-DOS and Microsoft Windows. It was the successor to Turbo C++ and included a better debugger, the Turbo Debugger, which was written in protected mode DOS.

conio.h is a C header file used mostly by MS-DOS compilers to provide console input/output. It is not part of the C standard library or ISO C, nor is it defined by POSIX.

<span class="mw-page-title-main">Fiwix</span> Operating system

Fiwix is an operating system kernel based on the UNIX architecture and fully focused on being POSIX compatible. It is designed and developed mainly as a hobbyist operating system, but it also serves for educational purposes. It runs on the i386 hardware platform and is compatible with a good base of existing GNU applications. It follows the UNIX System V application binary interface and is also mostly Linux 2.0 system call ABI compatible.

The ATI Mach line was a series of 2D graphics accelerators for personal computers developed by ATI Technologies. It became an extension to the ATI Wonder series of cards. The first chip in the series was the ATI Mach8. It was essentially a clone of the IBM 8514/A with a few notable extensions such as Crystal fonts. Being one of the first graphics accelerator chips on the market, the Mach8 did not have an integrated VGA core. In order to use the first Mach8 coprocessor cards, a separate VGA card was required. This increased the cost of ownership as one had to purchase two rather than one expansion card for graphics. A temporary solution was presented with the ATI Graphics Ultra/Vantage cards, which combined an ATI 8514 Ultra and VGA Wonder+ into a single card. The Mach32 chip was the follow-up to the Mach8, which finally featured an integrated VGA core, true colour support and a 64-bit datapath to internal memory.

John Bridges is the co-author of the computer program PCPaint and primary developer of the program GRASP for Microtex Industries with Doug Wolfgram. He is also the sole author of GLPro and AfterGRASP. His article entitled "Differential Image Compression" was published in the February 1991 issue of Dr. Dobb's Journal.

<span class="mw-page-title-main">VGA text mode</span> Computer graphics standard from 1987

VGA text mode was introduced in 1987 by IBM as part of the VGA standard for its IBM PS/2 computers. Its use on IBM PC compatibles was widespread through the 1990s and persists today for some applications on modern computers. The main features of VGA text mode are colored characters and their background, blinking, various shapes of the cursor, and loadable fonts. The Linux console traditionally uses hardware VGA text modes, and the Win32 console environment has an ability to switch the screen to text mode for some text window sizes.

References

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