Erratic performance (win32)

Hi!

I’ve made a simple test application using SDL (with mingw32) which
essentially does this:

  • opens a window (not full screen) using current desktop BPP
  • loads several bitmaps (from png files using SDL_image lib.),
  • converts them with SDL_DisplayFormat(),
  • blits them to newly created hardware surfaces,
  • and, finally, blits those to screen (hardware, double buffered) in a
    loop, with SDL_Delay() calls to get a framerate of about 20FPS

This is all good and well, I know all surfaces are (or should be…) in
hardware video memory, because if I don’t use SDL_DisplayFormat() or
don’t copy them to a new hardware surface after loading, the performance
drops (as graphed with Task Manager) significantly.

BUT, with or without hardware surfaces, the performance varies
extraordinary. The cpu load graph in Task Manager goes from about 10%
(which I think should be “normal”, using hardware surfaces and
considering this is an AMD Athlon 1700+ with Radeon8500, with enough
memory and no background programs running), to 45%, every second or two,
forming something like a square wave.

Also, SDL_VideoInfo() returns that hardware alpha blits are not
supported. Since R8500 is not exactly and “old” video card, I “think” it
should support it. (SDL_VideoDriverName() is “directx”, this is on WinXP
with DX9)

Is there a reason, or a workaround for such erratic performance? Maybe I
missed something?

Thanks!