WinG
|
In computing, WinG (pronounced Win Gee) was an API to provide fast graphics performance on Windows 3.1. It was later built-in to Windows 95.
The original Windows GDI (Graphics Device Interface) was designed with static images in mind, making its animation capabilities very limited. The GDI provides an interface to the graphics hardware that is device independent, that is, a program written using the GDI will work on all graphics and printer hardware, provided suitable Windows GDI drivers for the hardware are installed on the system. This means that graphics cannot be written to the physical framebuffer on the graphics hardware directly and must be written to a logical graphics "device context" (DC) provided by the GDI, which is then translated by the GDI and the device drivers to suit the target hardware device and is written to its physical frame buffer in an appropriate manner.
The major limitation of the GDI DC was that they were write-only. Data, once written, could not be retrieved. This was because the contents of the DC was device dependent, and data read from it would make no sense to the programmer. In order to do animation using the GDI DC, all of the animation frames needed to be manipulated in system memory and then each frame needed to be copied into a GDI DC for display on the graphics device. This was a very slow process.
WinG introduced a new type of DC called a WinGDC, which allowed programmers to both read and write to it directly using Device Independent Bitmaps (DIBs). Effectively, it gave programmers the ability to do with Windows what they'd been doing without hardware access limitations in DOS for years. Programmers could write DIBs to the WinGDC, yet would still have access to the individual bits of the image data. This meant that fast graphics algorithms could be written to allow fast scrolling, overdraw, dirty rectangles, double buffering, and other animation techniques. WinG also provided much better performance when blitting graphics data to physical graphics device memory. Since WinG used the DIB format, it was possible to mix original GDI API calls and WinG calls.
WinG would also perform a graphics hardware/driver profiling test on the first execution of the program in order to determine the best way to manipulate the graphics hardware. This test showed a window full of red curved lines, sections of which would wobble as performance was tested. Once WinG had determined the fastest calls that did not cause graphics corruption, a profile would be saved so that the test would not need to be performed again.
WinG was largely superseded by the more advanced DirectX libraries.