Page 1 of 1

Using Start3D() outside of main loop

Posted: Sun Oct 23, 2011 6:31 pm
by Nituvious
Are there any bad things that can happen if I use Start3D() OUTSIDE of the main loop?
For example, what is the difference between:

Code: Select all

Start3D();
repeat;
	; do something
until endResult.l;
Stop3D();
VS

Code: Select all

repeat
	Start3D();
	;do something
	Stop3D();
until endResult.l
I don't notice anything bad happening when I start and end outside of the main loop, but I really would like to know how the PB guru's do it.

Re: Using Start3D() outside of main loop

Posted: Sun Oct 23, 2011 8:09 pm
by PMV
what do you want to do? :lol:
Stop3D() needs to be called before FlipBuffers().
And FlipBuffers() is normally inside of a main-loop. :wink:

MFG PMV

Re: Using Start3D() outside of main loop

Posted: Sun Oct 23, 2011 8:30 pm
by Nituvious
Well, I don't want to take a performance hit from having it start and stop within my main loop opposed to only calling it once before and after the loop.

Re: Using Start3D() outside of main loop

Posted: Sun Oct 23, 2011 8:52 pm
by Shield
It needs to be called for every frame, you just have to go with it. :wink:
The graphics API equivalent requires it.

Re: Using Start3D() outside of main loop

Posted: Sun Oct 23, 2011 9:35 pm
by Nituvious
Ah, alright. :D

Re: Using Start3D() outside of main loop

Posted: Sun Oct 23, 2011 9:40 pm
by Shield
Also, there is no real performance hit anyway as long as you only call it once per frame. :)

Re: Using Start3D() outside of main loop

Posted: Sun Oct 23, 2011 11:53 pm
by PMV
Nituvious wrote:Well, I don't want to take a performance hit from having it start and stop within my main loop opposed to only calling it once before and after the loop.
I dont want to use RenderWorld(), too ... because in my game this call needs
over 5ms up to open end. :mrgreen: