Sign in to follow this  

Overlapping viewports - can this be done?

This topic is 4109 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm trying to use a second viewport that overlaps the first viewport. My code does this: Switches to the first viewport. Clears it. Presents on it. Switch to the second viewport. Clears it. Presents on it. Needless to say, of course, there is epileptic seizure inducing flicker on the second viewport because of the double clears. Any suggestions? Brandon

Share this post


Link to post
Share on other sites
Present doesn't "Present" just the current viewport. Present makes the entire backbuffer the image that's on the screen now. As such, you should only be calling Present once per-frame.

I think what you're trying to do is something like this:

BeginScene()
SetViewport(1)
Clear()
Draw stuff on this viewport
SetViewport(2)
Clear()
Draw stuff on this viewport
EndScene()
Present()

Also, keep in mind that Clear clears the entire surface, and is not limited by the current viewport.

Hope this helps.

Share this post


Link to post
Share on other sites

This topic is 4109 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this