Page 1 of 1

Question about using multiple StartDrawing()/Start3D()

Posted: Thu Feb 24, 2011 4:16 am
by Nituvious
If I use for example:

Code: Select all

Start3D()
	DisplaySprite3D(#SPR_Background_Left3D,-110,0)
	DisplaySprite3D(#SPR_Background_Right3D,402,0)	
Stop3D()
StartDrawing(ScreenOutput())
	DisplaySprite(#SPR_Orange_Circle,x,y)
StopDrawing()
Start3D()
	DisplaySprite3D(#SPR_Foreground_Left3D,-110,0)
	DisplaySprite3D(#SPR_Foreground_Right3D,402,0)	
Stop3D()
inside of my main loop, will this hinder performance? If so, how can I use a 3D sprite functions with the standard sprite library?

Re: Question about using multiple StartDrawing()/Start3D()

Posted: Thu Feb 24, 2011 9:53 am
by STARGĂ…TE
DisplaySprite dont need StartDrawing!

Code: Select all

Start3D()
   DisplaySprite3D(#SPR_Background_Left3D,-110,0)
   DisplaySprite3D(#SPR_Background_Right3D,402,0)   
Stop3D()
DisplaySprite(#SPR_Orange_Circle,x,y)
Start3D()
   DisplaySprite3D(#SPR_Foreground_Left3D,-110,0)
   DisplaySprite3D(#SPR_Foreground_Right3D,402,0)   
Stop3D()
or better, you make a Sprite3D from #SPR_Orange_Circle

Code: Select all

Start3D()
   DisplaySprite3D(#SPR_Background_Left3D,-110,0)
   DisplaySprite3D(#SPR_Background_Right3D,402,0)   
   DisplaySprite3D(#SPR_Orange_Circle,x,y)
   DisplaySprite3D(#SPR_Foreground_Left3D,-110,0)
   DisplaySprite3D(#SPR_Foreground_Right3D,402,0)   
Stop3D()

Re: Question about using multiple StartDrawing()/Start3D()

Posted: Thu Feb 24, 2011 7:11 pm
by Nituvious
Doh! I am actually using functions like Box() and Circle() in place of DisplaySprite() but I can have my program turn them into a sprite. Thank you for the tip!

However, is it still bad to use multiple Start3D()/Stop3D() within my loop?

Re: Question about using multiple StartDrawing()/Start3D()

Posted: Fri Feb 25, 2011 7:01 am
by eesau
Nituvious wrote:Doh! I am actually using functions like Box() and Circle() in place of DisplaySprite() but I can have my program turn them into a sprite. Thank you for the tip!

However, is it still bad to use multiple Start3D()/Stop3D() within my loop?
I wouldn't encourage it because it can usually be avoided. I think there's a performance hit when calling those functions multiple times in a loop.