Jump to content
  • Advertisement
Sign in to follow this  
Four

Multple ViewPorts

This topic is 4724 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 have wnat to create multiple view ports. I am doing this by using gluViewPort() to set coordinates of each view port. and draw e.g. Psudocode gluViewPort() draw() glutSwapBuffers() gluViewPort() draw() glutSwapBuffers() ... What happens is when the redraw function is called I only see whats drawn for a fraction of a second, then nothing until next redraw command. How can I have multiple view ports? Thanks in advance!

Share this post


Link to post
Share on other sites
Advertisement
I don't exactly know how glut does it but you don't want to swap the back buffer after you draw only part of the frame. Draw into the area you need and then when you are done drawing them all flip the back buffer with the front buffer.

Share this post


Link to post
Share on other sites
You should swap the buffers only AFTER everything has been drawn in your scene... to create multiple viewports you are using the right way (it's the same way I do that! :D ), simply, swap buffer after every viewport has been drawn! :P

Share this post


Link to post
Share on other sites
I agree with you BladeWise..

And Four, I have a nice interactive program that would help you learn more about viewports...

But I'm still not sure where I should be posting the series of those tutorials...

Share this post


Link to post
Share on other sites
I have made a C# implementation to support multiple viewports... it's a testing part fopr my simple 3D engine... I create a viewport class, and for each viewport object I associated a Camera object, everytime I render all the stuff, I simply set the viewport, the Camera view/projection, and then render the scene... Since I supposed every viewport could have a different backcolor, could use or not backface culling, textures and lights, I set these informations every time I render it... obviusly you could avoid the context refresh, if it's not needed! :D

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!