DrawDibDraw performance

I am writing an application that runs at a high frame rate and is using excessive CPU just for painting.

I traced the problem down to the function DrawDibDraw, which is a Windows API function.

Searching around on the web suggests that passing 32-bit bitmaps to this function yields better performance. I tried changing the TemporaryImage class to always use ARGB, but that resulted in my main window not being painted.

Am I missing something obvious? Is there some straightforward way around this?

Check if your main window is opaque. If not, make it opaque cause on Win XP at least, redrawing the juce window takes a LOT of CPU because windows will redraw everything beneath the juce window (since it isn’t opaque).

Thanks-but I’ve already got everything marked as opaque.

I guess I’ll have to figure out some way to do less painting.

Doing less painting is always a good idea, though I’ve never had a problem with drawdibdraw before. I guess it could depend on your graphics system.