OK, we have a winner!!
Here's the code if you want to run your own tests. Select the method to test. Rerun it for each test.
` frame rate test
` By Steve Vink
global method as integer
sync on: sync rate 0
` Get method from user...
while inkey$() = ""
text 5,5, "Copy Bitmap (1), Paste Image(2), or Sprite(3)?"
sync
endwhile
method = val(inkey$())
if method < 1 or method > 3 then method = 1
wait 250
clear entry buffer
makeBitmap()
if method > 1 then makeImage()
set text opaque
draw sprites first
set current bitmap 0
do
select method
case 1
copy bitmap 1,0
endcase
case 2
paste image 1,1,1
endcase
case 3
sprite 1,1,1,1
endcase
endselect
center text 320, 340, str$(screen fps())
sync
if inkey$() <> ""
end
endif
loop
function makeBitmap()
create bitmap 1, 640, 480
cls rgb(64,64,64)
set text font "Arial"
set text size 24
set text transparent
center text 320, 40, "FRAME"
center text 320, 80, "RATE"
center text 320, 120, "TEST"
If method = 1
center text 320, 160, "COPY BITMAP"
endif
If method = 2
center text 320, 160, "PASTE IMAGE"
endif
If method = 3
center text 320, 160, "SPRITE"
endif
endfunction
function makeImage()
set current bitmap 1
get image 1,1,1,640,480,1
endfunction
My results, compared with the fastest are:
1.
PASTE IMAGE - 100%
2.
COPY BITMAP - 81%
3.
SPRITE - 55%
So it looks like I used the worst possible method!
BatVink
