Which is faster/better?

Just starting out? Need help? Post your questions and find answers here.
cbmeeks
User
User
Posts: 17
Joined: Tue Dec 23, 2003 5:33 pm

Which is faster/better?

Post by cbmeeks »

And why?

Code: Select all

;VERSION 1

Start3D()

Repeat
....
;2D Sprites
DisplaySprite
DisplaySprite
DisplaySprite
.....
;3D Sprites
TransformSprite3D
TransformSprite3D
TransformSprite3D
DisplaySprite3D
DisplaySprite3D
DisplaySprite3D
.....
Until EndOfGame

Stop3D()

OR

Code: Select all

;VERSION 2

Repeat
....
;2D Sprites
DisplaySprite
DisplaySprite
DisplaySprite
.....
;3D Sprites
Start3D()
TransformSprite3D
TransformSprite3D
TransformSprite3D
DisplaySprite3D
DisplaySprite3D
DisplaySprite3D

Stop3D()
.....
Until EndOfGame

Doesn't the Start3D take overhead? I have done both ways and they both seem to work??

Thanks!

cb
cbmeeks
User
User
Posts: 17
Joined: Tue Dec 23, 2003 5:33 pm

Post by cbmeeks »

Come on...anybody?

cb
GPI
PureBasic Expert
PureBasic Expert
Posts: 1394
Joined: Fri Apr 25, 2003 6:41 pm

Post by GPI »

I would say, use Start/Stop3D(). It stand in the manual, that you must use it, so use it.

Maybe on your PC all work, but it could happen, that this will not work on other PC. And then you search eternally...
Dare2
Moderator
Moderator
Posts: 3321
Joined: Sat Dec 27, 2003 3:55 am
Location: Great Southern Land

Post by Dare2 »

lol.

At a guess, start/stop inside a loop would be slower.

Is there a prize for the correct answer?

:)
Fred
Administrator
Administrator
Posts: 18162
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post by Fred »

I suggest to use Start3D/Stop3D inside the main loop as it has been designed to work this way. It's may be a bit slower, but will give correct result on maximum of configurations.
Post Reply