How do I choose an accelerated pixel format under Windows?
Note: many consumer graphics cards cannot accelerate when the display is 24bpp, and many cannot accelerate when the desktop is at 32bpp in high-resolution. I always change to 800×600 x16bpp for my full-screen games. That ensures that the graphics card will have enough memory. Normally, you call ChoosePixelFormat to choose a pixel format. But it’s hard to know whether this will give you an accelerated pixel format. For us gamers, acceleration is the most important thing: we’d be happy to settle for a 16bpp accelerated surface, rather than a 32bpp unaccelerated surface. The following code uses a gamer’s heuristics to choose a suitable pixel format.