Questions about multiple viewports

Started by
1 comment, last by harveypekar 13 years ago
Hey everyone,

sorry about asking a question that should be clear from documentation, but right now I'm tired of banging my head against the wall.

Anyway, I'm implementing a GUi app that uses GL for multiple widgets, using windows but looking forward for crossplatform. I use QT, but decided to prototype further using my own widget as Qt borks as soon as I try to implement global resources (shaders et al) and right now, I'm just trying to understand what's going on.

From digging through the anecdotal evidence online, I realize I have two options:

Either use only one context (created on the main window handle) and call glViewport on rendering.
Or, use multiple contexts, and use wglShareLists to share shaders, textures, and VBO's.

I''m very unexperienced in GL, so I'm unable to judge the pro's and cons of either way. Can anyone tell me what the standard way of doing this would be?
Advertisement

Can anyone tell me what the standard way of doing this would be?

1. Use glViewport to split the window.... or
2. Use wglShareLists to share VBO's etc between multiple contexts.

Use method 1 if you want more than one viewport within the same Qt control.
Use method 2 if you want each viewport in it's own window.

Thanks, I got it working with multiple contexts now. I ended up writing my custom Opengl widget for Qt, because it doesn't really allow easy sharing with external contexts.

This topic is closed to new replies.

Advertisement