if you use the 2D Drawing commands, always make sure to lock your pixels first.
want an example to why?
`// set disp mode to 640x480xWindowed
type _TIME
old as float
cur as float
ela as float
endtype
dim time(2) as _TIME
time(1).old = timer()
for i=0 to 640
dot i,240
next i
line 0,241,640,241
box 0,0,640,10
circle 320,50,20
for i=0 to 640
nullreturn=point(i,240)
next i
time(1).cur = timer()
time(1).ela = time(1).cur - time(1).old / 1000.00
cls
time(2).old = timer()
lock pixels
for i=0 to 640
dot i,240
next i
line 0,241,640,241
box 0,0,640,10
circle 320,50,20
for i=0 to 640
nullreturn=point(i,240)
next i
unlock pixels
time(2).cur = timer()
time(2).ela = time(2).cur - time(2).old / 1000.00
cls
set cursor 0,0
print "Original = "+str$(time(1).ela)+"sec"
print "Locked = "+str$(time(2).ela)+"sec"
thats why, and you can gain even more speed by accessing the data pointer of the screen yourself...
just remember each data length is actually
(PXWIDTH+PXPITCH)*(BPP/8) = DATA LENGTH
so something like,
pxcache=0
for i=0 to 480
pxcache=pxcache+i
for j=0 to 640
pxcache=pxcache+j
if j=640 then pxcache=pxcache+pxpitch
*(pxpointer+pxcache) = databyte(j,i)
next j
next i
Detonating a nuclear device within the city limits results in a $500 fine!
900mhz|256mb|FX5200Ti 52.16|Dx9|WXP-Pro