Problems with multiple rendering contexts and windows!

I am trying to make a application with two opengl rendering context´s, but i dont know how! Can someone help?

With Win9x there is a simple rule (is this the platform you use?): one RC active per thread. If you want to use multiple RCs, remeber to call wglMakeCurrent(NULL, NULL) after you finish with one RC, or you are not going to get the other one active in the same thread. You may also need to recreate display lists or texture objects if you are going to use the same in both RCs.
You may try to have a look at my CWGL class which hides some of the problems with RCs. http://shiptech.tuniv.szczecin.pl/~weyna/OpenGL/

I have the same problem.
I removed my display lists but how do you generate different textures.
I have a GLuint texture[2] and call:
glGenTextures(2, texture);
In one view, I display with
glBindTexture(texture[0]);
and in the other one
glBindTexture(texture[1]);
but the second one is still white !

My app architecture is:
A view OpenGLView:

  • OnKeyDown
  • OnTimer
  • OnCreate
  • OnSize
  • OnDraw

A splitter with two panes
each pane is a different OpenGLView

An openGL renderer:

  • InitGL
  • DrawGL
  • TestKeys
  • Tick

In the OpenGLView, I have a pointer to an openGL Renderer (shared by the two views)
each OpenGLView has its own HDC and HRC
passed to DrawGL.

I don’t know what to do… I tried hundreds of things.
SMS ! (save my soul)

Why don’t you use one RC per document ?
Then you can use the specific DC of each view with document RC in wglMakeCurrent.

That’s what I do and it solves a lot of problems when you want to share textures/display lists between two views.

Regards.

Eric