I have updated the dll. 2 new commands :-
D3D_Line x1,y1,x2,y2 - Faster version DBP Line command
D3D_Dot x1,y1 - Faster version DBP Dot command
Also changed Point3D command to be D3D_Point.
I intend to prefix all commands with D3D_ in my next version, and update my help files.
Here is some code to test the speed improvements over the native Dot and Line commands.
sync on:sync rate 0:set display mode 1024,768,32
backdrop on:color backdrop 0
initd3d
rem test native commands
randomize 1
starta#=timer()
for x=1 to 1000
for i=1 to 1000
ink rnd(16777215),0
dot rnd(1024),rnd(768)
ink rnd(16777215),0
Line rnd(1024),rnd(768),rnd(1024),rnd(768)
next i
sync
next x
enda#=timer()
rem test D3DFunc.dll commands
randomize 1
startb#=timer()
for x=1 to 1000
for i=1 to 1000
draw color rnd(255),rnd(255),rnd(255),rnd(100)
D3D_dot rnd(1024),rnd(768)
draw color rnd(255),rnd(255),rnd(255),rnd(100)
D3D_Line rnd(1024),rnd(768),rnd(1024),rnd(768)
next i
sync
next x
endb#=timer()
draw color 255,0,0,75
ink rgb(255,255,0),0
nativespeed#=1000/((enda#-starta#)/1000)
D3Dspeed#=1000/((endb#-startb#)/1000)
increase#=D3Dspeed#/nativespeed#
do
text 0,0,"Speed Comparisons - 1000 frames, each drawing 1000 dots and 1000 lines in random colours"
text 0,30,"Native DBP Dot and Line commands - "+str$(nativespeed#)+ " fps"
text 0,45,"D3D Dot and Line commands - "+str$(D3Dspeed#)+ " fps"
text 0,75,"Speed Improvement - "+str$(increase#)+ " times faster"
D3D_Line 0,14,705,14
D3D_Line 0,70,490,70
sync
loop
On my Athlon 2600 with a Radeon 9700 and 1024MB Ram, I get a 6 time speed increase!
Cheers,
Cloggy