What is more faster ...

Blitz3D Forums/Blitz3D Programming/What is more faster ...

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Little correction with lockbuffer and read/write operation

Graphics3D 800,600,32,2
SetBuffer BackBuffer()
Global nicolas

nicolas = CreateImage(512,512)

bk = CreateBank(512*512*4)

colorrgb = 210 Or (100 Shl 8) Or (10 Shl 16)

start = MilliSecs()
LockBuffer ImageBuffer(nicolas)
For x=1 To 512
For y=1 To 512
test=ReadPixelFast ( x,y,ImageBuffer(nicolas))
WritePixelFast x,y,colorrgb,ImageBuffer(nicolas)
Next
Next
UnlockBuffer ImageBuffer(nicolas)
Print MilliSecs()-start


start = MilliSecs()
For y=0 To 511
For x=0 To 511
test=PeekInt (bk,(y*512+x )*4)
PokeInt bk,(y*512+x )*4,colorrgb
Next
Next
Print MilliSecs()-start



WaitKey()