Pixmap Oddity

BlitzMax Forums/BlitzMax Programming/Pixmap Oddity

Tachyon(Posted 2007) [#1]
Consider this:
Graphics 800,600,0,60
Local Now:Int, Last:Int
Local pix:TPixmap = LoadPixmap("C:\Program Files\BlitzMax\samples\digesteroids\graphics\title.png")
Repeat
   Cls
   Now = MilliSecs()
   DrawPixmap pix,0,0
   Last = MilliSecs() - Now
   DrawText "Millisecs: " + Last,0,500
   Flip 1
Until KeyDown(KEY_ESCAPE)

This draws a large pixmap in a window, and on my machine it takes around 4ms to draw. Now if I change the first line to:
Graphics 800,600,32,60

This will make the app go full screen and the draw time goes up to 16-17ms. Now that would seem to be correct because 16-17ms is right around the 60hz refresh rate, but notice I am calculating draw time before flipping, which should give me the just the time it took to draw this pixmap, not the time for the entire loop. Also note if you change the whole thing to a TImage/DrawImage routine, it does not show this odd time difference between fullscreen/windowed.

[edit] If I change the refresh rate to "85" the ms draw time drops, proving that Pixmap drawing is linked to the refresh rate, but only in full-screen, not windowed. ?!?

[edit] Change to "Flip 0" and the draw time drops way down to 3-4ms, again seeming to confirm that DrawPixmap is linked to refresh rate.