In computing, WinG (pronounced Win Gee) is an application programming interface that is a port of Windows 95's Device Independent Bitmaps to provide faster graphics performance on Windows 3.x operating environments, and was initially positioned as a way to help game developers more easily port their DOS games to Microsoft Windows, although it was quickly discontinued in favor of DirectX.
The original Windows Graphics Device Interface (GDI) 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 DCs was that they were write-only. Data, once written, could not be retrieved. This was because the contents of the DC were 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 was a technology being built by Chris Hecker in the research group, and at the time it was one of the small Microsoft Skunkworks projects, very low profile and off-the-wall. Basically it was fixing broken Windows drivers to make them run faster and more acceptably. Using it, we were actually able to create a video API that could run DOOM almost as fast under Windows as it did in DOS.||”|
Microsoft announced WinG at the 1994 Game Developers Conference, demonstrating it with a port by id Software of Doom. WinG was shipped on September 21, 1994. WinG, while interesting, failed to deliver any innovation that wasn't already built into Windows 95 - and didn't forward the development of hardware innovation and full access to hardware capability that was needed. As a result, WinG was deprecated and DirectX was built.
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) with the wingdib.drv driver. 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 out-of-the-box support (i.e. as a separate API to Win32) was dropped in Windows 98 Second Edition (which integrated DirectX 6), as it did absolutely nothing but pass through to the Win32 APIs that it was wrapping. WinG DLLs were sometimes distributed with an application, at which point it merely became a matter of copying the files wing.dll, wing32.dll, wingde.dll, wingdib.drv and wngpal.wnd to the system32 directory (for 32 bit Windows) or SysWOW64 directory (for 64 bit Windows) to regain system-wide support.
List of applications using WinG API
- Adobe Photoshop 3.0 (1994)
- SimTower (1994)
- The Lion King (1994)
- SimCity 2000 (Windows 16-bit) (1995)
- Comix Zone (1995)
- Dark Seed II (1995)
- Doom (1995)
- Dust: A Tale of the Wired West (1995)
- Fury3 (1995)
- Monopoly (Westwood Studios) (1995)
- P.T.O. II (1995)
- Sid Meier's Colonization (1995)
- Woodruff and the Schnibble of Azimuth (1995)
- Alone in the Dark: Ghosts in Town (1996)
- Noir: A Shadowy Thriller (1996)
- Sid Meier's Civilization II (1996)
- The Rise & Rule of Ancient Empires (1996)
- Time Gate: Knight's Chase (1996)
- Titanic: Adventure Out of Time (1996)
- Adobe Photoshop 4.0 (1997)
- Microsoft Bob (1995)
- Map editor for Warcraft II: Tides of Darkness
- Hecker, Chris (1 June 1997). "A Whirlwind Tour of WinG". Gamasutra. Retrieved 2009-01-19.
- Colayco, Bob (7 March 2000). "Alex St. John Interview". firingsquad.com. Retrieved 2009-01-19.
- Wilson, Johnny L.; Brown, Ken; Lombardi, Chris; Weksler, Mike; Coleman, Terry (July 1994). "The Designer's Dilemma: The Eighth Computer Game Developers Conference". Computer Gaming World. pp. 26–31.
- Eisler, Craig (February 20, 2006). "DirectX Then and Now (Part 1)". Craig's Musings. Retrieved 2008-01-19.
- "HOWTO: How to Mix GDI and WinG (MSKB125928)". Knowledge Base. Microsoft. Retrieved 2009-01-19.