I think everyone will like this little speed test!
Using only DarkBASIC Pro with this source I achieved 7 fps.
` DarkBASIC Professional Source Code
sync on
sync rate 0
make object cube 1, 10
do
rotate object 1, object angle x ( 1 ) + 1, object angle y ( 1 ) + 1, object angle z ( 1 ) + 1
for a = 1 to 100 step 1
for b = 1 to 100 step 1
for c = 1 to 100 step 1
d = rnd ( 100 )
next c
next b
next a
set cursor 0, 0
print "fps = " + str$( screen fps ( ) )
sync
loop
Using
DarkBASIC Pro with DarkScript I achieved 194 fps! That's way more then what DGSDK and only DarkBASIC put out.
DBP Source:
sync on
sync rate 0
make object cube 1, 10
load script "cube.gm"
do
script function "cubetest"
sync
loop
DarkScript Source:
randseed(1234);
global cubetest = function()
{
RotateObject(1,ObjectAngleX(1)+1,ObjectAngleY(1)+1,ObjectAngleZ(1)+1);
a = 1;
b = 1;
c = 1;
for(; a < 100; a = a + 1)
{
for(; b < 100; b = b + 1)
{
for(; c < 100; c = c + 1)
{
d = randint(0,100);
}
}
}
SetCursor(0,0);
PrintString("fps = " + ScreenFPS().String());
};
Compiled files and source attached to this post. The way I used the 'for' statement above in the DarkScript source is an alternative way of using that keyword as documented in the GameMonkey reference.
[edit]
Here's an alternate way to do the same thing I did above in the DarkScript:
randseed(1234);
global cubetest = function()
{
RotateObject(1,ObjectAngleX(1)+1,ObjectAngleY(1)+1,ObjectAngleZ(1)+1);
a = 1;
b = 1;
c = 1;
for( ; a < 100; )
{
for( ; b < 100; )
{
for( ; c < 100; )
{
d = randint(0,100);
c = c + 1;
}
b = b + 1;
}
a = a + 1;
}
SetCursor(0,0);
PrintString("fps = " + ScreenFPS().String());
// Tossed this line in just to show it's creating
// the random numbers.
PrintString("random = " + d.String());
};
One of my home pc's that I tested this on gets on avg 280 fps with my script version.
Check out my site!