Jump to content
  • Advertisement
Sign in to follow this  
luasitdown

picture in picture

This topic is 4844 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

Advertisement
Let me clarify that a bit. You can get the main viewport like this:

gD3dDevice->GetViewport( &m_mainViewport );

then make a copy for your picture in picture and set it to a size and screen position:

// Create a PIP viewport
m_pipViewport=m_mainViewport;

// Make it a set size
m_pipViewport.Width=256;
m_pipViewport.Height=256;

// Position
m_pipViewport.X=64;
m_pipViewport.Y=64;

In your render loop set the main viewport using SetViewport and render as normal. Then set the viewport to the PIP viewport and change camera etc whatever you want to do - and render again. Note you only have to clear the z buffer before rendering this.

That works fine although render to texture may be better depending on use.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!