Sign in with
Sign up | Sign in

Windows XP: Old School 2D And The Limits of WM_PAINT

2D, Acceleration, And Windows: Aren't All Graphics Cards Equal?
By , Igor Wallossek

Say what you want about Windows XP, but the hardware acceleration of GDI works flawlessly to this very day, and is more than enough for many types of applications. What XP cannot do, however, is convey 2.5D layer techniques onto modern 3D graphics cards. As described in the preceding section, rendering of window contents occurs directly from the applications themselves.

A typical 2D application, for which nobody buys an expensive graphics cardA typical 2D application, for which nobody buys an expensive graphics card

This limitation won’t bother those who concentrate their efforts on any single desktop application window. The most typical application of such technology occurs in SDI (single device interface) runtime environments. But things get a little more uncomfortable when many windows are open and visible on the desktop. Who wouldn’t be glad to adopt an improved layering technique that supports menus, better device performance, and enhanced handling of windows on multiple monitors? Who wouldn’t want to leave window blur or repeat effects behind, and realize better 2D graphics performance?

Windows as card games: Repeat effects running XPWindows as card games: Repeat effects running XP

Although pure 2D performance from vector drawing programs such as Corel Draw or CAD applications work well enough (ironically enough, because hardware acceleration of GDI functions isn’t supported), we run smack into the limitations of WM_PAINT’s capabilities. When the XP GUI gets overloaded with animations, soft shadows, transparent windows, and other graphical elements, it pushes the limits of what its 2D graphics can handle.

WM_Paint hangs or updates only sporadically, when the system runs under heavy load. Redraw events must wait in line for their turn at processing.WM_Paint hangs or updates only sporadically, when the system runs under heavy load. Redraw events must wait in line for their turn at processing.

Many users discovered that it’s best to display windows only in outline form when moving them around, and skipping animated menus altogether. In general, conserving graphical resources proves to be a good philosophy on the XP desktop. Unfortunately, many snazzy graphics themes quickly found their way into the bit bucket once the initial euphoria of the operating system's launch blew over, as systems lost their ability to render everything without errors or significant delays.

Microsoft quickly noticed that its 2D graphics solution, which it included with all Windows versions up until and including XP, needed to be replaced. Likewise, the increasing availability of ever-faster 3D graphics cards, along with steadily decreasing prices for discrete GPUs, made it clear that times (and systems) were changing.

Typical example of a 3D graphics card in 2005: The Radeon X1800Typical example of a 3D graphics card in 2005: The Radeon X1800At this point, it’s also important to note that hardware acceleration in XP didn’t work with the native resolutions available from ATI's 780G onboard graphics, either. The result was windows that'd appear slowly, affecting even basic Web browsing performance. Subsequent driver revisions helped alleviate those issues. But even today, the 780G still doesn’t run optimally, in stark contrast to the 740G. But now that XP is fading into obscurity, perhaps this digression should do the same...

Next up comes Windows Vista, which is perhaps Microsoft’s most polarizing operating system (along with Windows ME). Regardless of whether you love or hate Vista, it was no longer possible to delay certain technical advances any longer.

Summary

  • 2D Hardware acceleration works flawlessly for GDI commands
  • No hardware acceleration for 2.5D layer capabilities, resulting in a slow user interface
  • Repeated redrawing of changed window contents costs time, and affects performance
React To This Article