Skip to main content
gamedev.net
🔒 Locked

Multiple device-presents

Started by theMadHatter Aug 25, 2006 at 1:48 PM 5 replies 500+ views
Original Post
theMadHatter
theMadHatter
I was wondering if there was a trick to make muiltiple presents look good. As in pd3dDevice->Present(...) I have two right after another. One is the background and one is a stickfigure infront of it. The background's vector has a z value of 1.0 and the stickfigure has one of 0.0. So that should make the stickfigure come out on top. Well it does, but sometime it like flickers off screen and can stay off for up to ten seconds. Is there any trick to getting this right or am I going to have to do this another way? Thanks.
don
don
I'm sort of curious as to why you are calling Present twice.

For each frame, just draw the scene to the back buffer, then draw your stick figure, then make a single call to Present to copy the contents of the back buffer to the front buffer.

Mastaba
Mastaba
Draw the background, then the stick figure, then Present. Present is the last thing you do when you are ready to show the completed frame.
theMadHatter
theMadHatter
Alright.
I know, but I was just wondering if there was a way to use present twice.
blaze02
blaze02
Quote:
Original post by theMadHatter
Alright.
I know, but I was just wondering if there was a way to use present twice.


There are a few uses for multiplie devices. But the rule of thumb is: if you can, just use one device and just call Present once per frame.

The only reason I can think of for multiple devices is threaded texture loading without using a threaded device. You can also use multiple devices for multiple windows, but a taking full advantage of the swap chain is a better idea.

But for your thread title, I have no idea how multiple device presents would even begin to work :(

haha, g'luck
Evil Steve
Evil Steve
When you present your backbuffer, what was on the screen is completely oblitterated (Assuming you're using D3DSWAPEFFECT_DISCARD, which you should be unless you have a good reason not to), and is replaced with what you just rendered.

So if you present twice in a row on the same device, you show what you rendered, then you show undefined content. And if you render, present, render, present, you're effectively just showing 2 frames in succession, they won't get overlaid on top of each other unless you're rendering to a texture or something else fancy.
theMadHatter
theMadHatter
Okay.
Thanks all.
Thing is I'm having a hard time using my device for all my classes.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.