3 ms·
WinG allowed you to blit a bitmap from user memory directly into a window. It was a bit like the XShm extension from X11, where compatible pixmap data can be co
by bitwize 6y ago
WinG allowed you to blit a bitmap from user memory directly into a window. It was a bit like the XShm extension from X11, where compatible pixmap data can be copied directly into the drawable from client memory.
Normally when you transferred image data from a bitmap in user memory (called a DIB) into a GDI drawable such as a window or bitmap with a call to SetDIBits or StretchDIBits, it's slow because there's a conversion step that has to take place: GDI bitmaps were typically held internally in a planar format (on EGA and VGA anyway), and DIB data was chunky. Also, as DIBs were identical to the BMP format, they were scanned from the bottom up instead of the top down (the first pixel in the DIB pixel buffer was the lower left rather than the upper left). This, I believe, was a holdover from OS/2, because IBM decided they wanted proper Cartesian coordinates in their bitmaps? Needless to say, most users and most video cards do not lay out bitmap image memory in that format.
With the proliferation of 256-color graphics cards, WinG became possible because 256-color modes typically had a chunky format. So you could draw your game screen in a buffer and use the WinG calls to write that buffer directly to the screen. WinG provided for additional DIB formats including top-down, so that memory could simply be copied from the DIB buffer straight from the screen on a blit call. WinG even supported accelerated blitting on cards with hardware acceleration.
The other DirectX predecessor is a bit less well known, and is called DISPDIB.DLL. DISPDIB allowed you to suspend GDI calls to the screen, put the screen in mode 0x13, and draw directly from a DIB into the display, giving you a 320x200, 256-color full-screen display -- just like DOS. The window would also capture all keyboard and mouse input while it was active. Some early pre-DirectX Windows 95 games, including Earthworm Jim and Pitfall: The Mayan Adventure, used DISPDIB.
- pjmlp 6y agoMight have been, sometimes it is ironic how OS/2 gets so much praise, when around this time the APIs were quite similar (given its historical relation). Most likely from devs that never actually coded for OS/2. :) Thanks for the DISPDIB.DLL overview, I wasn't aware of it.
- yjftsjthsd-h 6y ago> sometimes it is ironic how OS/2 gets so much praise, when around this time the APIs were quite similar A lot of the praise I've seen was specifically that OS/2 ran Windows programs better than Windows did.
- pjmlp 6y agoIt did, hence like WINE, people just kept writing Windows software instead of bothering with CSet++, SOM (better than COM actually) or the other development stacks for OS/2. Borland had an OWL like framework for OS/2.