OK, a quick check shows drawimage in bmx is MUCH slower than B3D/B2D but maybe that's what people are trying to tell me. Using pixmaps as if they were B2D 'standard' images is something I'll need to check.
I still think I am missing something though.
What are 'standard' images used for in bmx if they are slower than B3D equivalent and not designed to be changed?
What other objects (rather than png, jpg etc) should I be using to get a decent draw speed.
For info here are the 2 tests...
BMX
Graphics 640,480
Incbin "kilt.png"
Incbin "man.png"
man = LoadImage("incbin::man.png")
kilt = LoadImage("incbin::kilt.png")
While Not KeyDown(key_escape)
start_time=MilliSecs()
For x = 10 To 600 Step 6
For y = 10 To 480 Step 6
DrawImage man,x,y
DrawImage kilt,x,y+40
Next
Next
End_time=MilliSecs()
total_time = end_time - start_time
DrawText "Total time : " + total_time,0,0
Flip
Cls
FlushMem
Wend
End
Results : 625ms/610ms (debug/non-debug)
B3D
Graphics 640,480
SetBuffer BackBuffer()
man = LoadImage("man.png")
kilt = LoadImage("kilt.png")
While Not KeyHit(1)
start_time=MilliSecs()
For x = 10 To 600 Step 6
For y = 10 To 480 Step 6
DrawImage man,x,y
DrawImage kilt,x,y+40
Next
Next
End_time=MilliSecs()
total_time = end_time - start_time
Text 0,0,"Total time : " + total_time
Flip
Cls
Wend
End
Results : 280/260
bmx
Graphics 640,480
Incbin "kilt.png"
Incbin "man.png"
man = LoadImage("incbin::man.png")
kilt = LoadImage("incbin::kilt.png")
DrawImage man,0,0
DrawImage kilt,0,40
new_man=CreateImage(32,100)
GrabImage new_man,0,0
cls
While Not KeyDown(key_escape)
start_time=MilliSecs()
For x = 10 To 600 Step 6
For y = 10 To 480 Step 6
DrawImage new_man,x,y
' DrawImage kilt,x,y+40
Next
Next
End_time=MilliSecs()
total_time = end_time - start_time
DrawText "Total time : " + total_time,0,0
Flip
Cls
flushmem
Wend
end
Results : 424/418
B3D
Graphics 640,480
SetBuffer BackBuffer()
man = LoadImage("man.png")
kilt = LoadImage("kilt.png")
DrawImage man,0,0
DrawImage kilt,0,40
new_man=CreateImage(32,100)
GrabImage new_man,0,0
Cls
While Not KeyHit(1)
start_time=MilliSecs()
For x = 10 To 600 Step 6
For y = 10 To 480 Step 6
DrawImage new_man,x,y
; DrawImage kilt,x,y+40
Next
Next
End_time=MilliSecs()
total_time = end_time - start_time
Text 0,0,"Total time : " + total_time
Flip
Cls
Wend
End
Results : 195/182 (same results using imagebuffers).
man = 32*100 stickman
kilt = 32*32 rectangle.
Maybe I'm not testing apples for apples.
What 'objects' should I be using in BMX to get similar results?
<edit> I realise these tests are simply measuring draw time
but, in the end, that's probably the issue.
<edit> Create the composite sprite from pixmaps. Trying to drawpixmap caused my system to sloooowwww (124610ms was the only measurement I saw for a loop).
Converting to an image worked but, obviously, produced similar results to the single drawimage test.