Using Start3D() outside of main loop

Advanced game related topics
Nituvious
Addict
Addict
Posts: 1030
Joined: Sat Jul 11, 2009 4:57 am
Location: United States

Using Start3D() outside of main loop

Post 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.
▓▓▓▓▓▒▒▒▒▒░░░░░
PMV
Enthusiast
Enthusiast
Posts: 727
Joined: Sat Feb 24, 2007 3:15 pm
Location: Germany

Re: Using Start3D() outside of main loop

Post 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
Nituvious
Addict
Addict
Posts: 1030
Joined: Sat Jul 11, 2009 4:57 am
Location: United States

Re: Using Start3D() outside of main loop

Post 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.
▓▓▓▓▓▒▒▒▒▒░░░░░
User avatar
Shield
Addict
Addict
Posts: 1021
Joined: Fri Jan 21, 2011 8:25 am
Location: 'stralia!
Contact:

Re: Using Start3D() outside of main loop

Post by Shield »

It needs to be called for every frame, you just have to go with it. :wink:
The graphics API equivalent requires it.
Last edited by Shield on Sun Oct 23, 2011 9:39 pm, edited 1 time in total.
Image
Blog: Why Does It Suck? (http://whydoesitsuck.com/)
"You can disagree with me as much as you want, but during this talk, by definition, anybody who disagrees is stupid and ugly."
- Linus Torvalds
Nituvious
Addict
Addict
Posts: 1030
Joined: Sat Jul 11, 2009 4:57 am
Location: United States

Re: Using Start3D() outside of main loop

Post by Nituvious »

Ah, alright. :D
▓▓▓▓▓▒▒▒▒▒░░░░░
User avatar
Shield
Addict
Addict
Posts: 1021
Joined: Fri Jan 21, 2011 8:25 am
Location: 'stralia!
Contact:

Re: Using Start3D() outside of main loop

Post by Shield »

Also, there is no real performance hit anyway as long as you only call it once per frame. :)
Image
Blog: Why Does It Suck? (http://whydoesitsuck.com/)
"You can disagree with me as much as you want, but during this talk, by definition, anybody who disagrees is stupid and ugly."
- Linus Torvalds
PMV
Enthusiast
Enthusiast
Posts: 727
Joined: Sat Feb 24, 2007 3:15 pm
Location: Germany

Re: Using Start3D() outside of main loop

Post 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:
Post Reply