How can I draw more than one view of the same scene?

Answer

You can draw two views into the same window by using the glViewport() call. Set glViewport() to the area that you want the first view, set your scene?s view, and render. Then set glViewport() to the area for the second view, again set your scene?s view, and render.

You need to be aware that some operations don't pay attention to the glViewport, such as SwapBuffers and glClear(). SwapBuffers always swaps the entire window. However, you can restrain glClear() to a rectangular window by using the scissor rectangle.

Your application might only allow different views in separate windows. If so, you need to perform a MakeCurrent operation between the two renderings. If the two windows share a context, you need to change the scene?s view as described above. This might not be necessary if your application uses separate contexts for each window.

All opengl Questions

Ask your interview questions on opengl

Write Your comment or Questions if you want the answers on opengl from opengl Experts
Name* :
Email Id* :
Mob no* :
Question
Or
Comment* :
 





Disclimer: PCDS.CO.IN not responsible for any content, information, data or any feature of website. If you are using this website then its your own responsibility to understand the content of the website

--------- Tutorials ---