How to split a window in openGL?

I want to split the window into 2 parts. In each part I can do another thing. How can I do this in openGL?

(Actually, my problem is that I already drew a picture in the window. Now I want to get some “space” out of it so that I can draw something else. The original image already occupied the whole window).

I appreciate if anyone can help.

Thank.

+3
source share
3 answers

You can use the command for this glScissor. With glScissor, you would split the screen in the window coordinates and display it in parts. scissors protect part of the already processed output from being overwritten.

glScissor , -. , .

( GLUT) , .

+4

glViewport: man glViewport

+5

There is a drawing tutorial with several views on the NeHe website:

http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=42

I hope it is somewhat useful.

+3
source

Source: https://habr.com/ru/post/1737673/


All Articles