doubts about opengl context

Hello,
I have some doubts.

I should draw some object in this way:

rendering context 1:
if (visibleA) renderA();
if (visibleB) renderB();
FrontView();

rendering context 2:
if (visibleA) renderA();
if (visibleB) renderB();
SideView();

rendering context 3:
if (visibleA) renderA();
if (visibleB) renderB();
TopView();

Every visibleA and visibleB property is relative to one rendering context so I am able to disable A in the second rendering context and draw A in other rendering context.
Every rendering context have a different view about A and B.
Were possible use a single rendering context to do it?
Now my problem is that vbo should be shared or duplicate in rendering context. I would like know what’s the better and simple way to do it.

Were possible use a single rendering context to do it?

I’m more perplexed by the fact that you are using multiple OpenGL contexts for this. You shouldn’t use multiple contexts just to have different views of a scene.

I want to avoid using glViewport and map the screen into different parts. I want to use for each view a GLWidget a component opengl of qt. Maybe I can share the same context between multiple windows and implement my code?

Why do you want to avoid using glViewport? glViewport is much more efficient than multiple contexts for this kind of division of the scene.

I’m not personally familiar with qt but I am aware that it can be used for windowing; it would seem much more efficient (not to mention simpler) to use a single window, single context with multiple viewports than using multiple windows with multiple contexts.

One of the QGLWidget constructors takes a QGLContext* as a parameter, and I can’t see anything in the documentation stating that each widget requires a different context.

However: if you just want to be able to share data (buffers, textures), you should let each widget create its own context and use the [var]shareWidget[/var] parameter to indicate that the contexts should share data.

Efficiency isn’t the only consideration. There are a number of valid reasons for using a separate widget for each view.

Yes I should try to pass the same context at different GLWidget. I want avoid to use glViewport because every view should be resizable. Can widgets that share the same context draw different object?
For example if I have two object A and B and I have three widget (widget1, widget2, widget3) that share the same context can implement this code?

widget1::Paint()
{
DrawA();
}

widget2::Paint()
{
DrawA();
DrawB();
}
widget3::Paint()
{
DrawB();
}