![opengl 4.4 drivers opengl 4.4 drivers](https://www.cnx-software.com/wp-content/uploads/2020/02/Raspberry-Pi-4-Vulkan.jpg)
One simple example: In GLSL shader you can create a 2D zero vector like that: vec2(0.0,0.0), you may try also to write one value: vec2(0.0) and with this code some drivers will treat it as previous version while others will return error and render nothing. GPUs and their drivers have a lot of implementation details and differences so in general you need to get used to such issues. This way you can have as many distinct renderings on single window/render target as you want. You do the same for the rest of your viewports and at the end you get one window with few different renderings, each with its own parameters. OpenGL will automatically scale the rendering so it fits into the given viewport. When you want to render your 3D views you cal glViewport with position and size of your first 3D-subwindow and run typical GL commands to draw here.
![opengl 4.4 drivers opengl 4.4 drivers](https://i.stack.imgur.com/DKoqv.png)
When you drag your split bar you remember its new position and so on. You remember your current split position and you manage Mouse events, so when you hover over the split bar you may change mouse cursor to resizing one, etc. In typical rendering it may seem to have no sense - you just create some window or render target and draw on it, right? I'd say that 95+% of apps works that way.īut let's say your're writing an app like 3DS MAX, where you have you window split into 4 distinct renderings. You've got two good answers already but they may be hard to understand for a beginner so I'll tell you why do we really need glViewport function.