View Full Version : only one window??? the same Modelview Matrixes...

07-10-2001, 12:07 PM
I wonder if there is a problem to use more than one window with OpenGL
at the same time?? Ive created a class that shows a head in different
angles. But when I try to use them, they all have the same modelviewMatrix
and projectionMatrix, even though its three different objects.

when I create my objects I do like this:

m_pMain3DFrame = new CDirectCanvas(this, -1, wxPoint(5,5), wxSize(250,250),MAIN);
m_pUpper3DFrame = new CDirectCanvas(this, -1, wxPoint(260,5), wxSize(122,122),UPPER);
m_pLower3DFrame = new CDirectCanvas(this, -1, wxPoint(260,133), wxSize(122,122),LOWER);

and the result of this is that the two upper OpenGL objects have the
same Matrixes as the last one.

What is wrong, or what do I have to do??


07-10-2001, 01:21 PM
If you are using 3 physically distinct windows, you need a physically distinct rendering context for each, and must make them current for each as you work in each. I can't tell from the code you posted if this is being done, but it sounds like it is not.

07-11-2001, 07:32 AM
Thanks Dfrey,

But to be honest, I dont get what you are talking about... But Im sure I havnt done that. Where can I read more about that?? Ill look for it in the redbook. Do you have any examples for that??? Or where do you do that...?



07-11-2001, 08:20 AM
Now that I look again at that code you posted above, I'm beginning to think that maybe you aren't using Windows, which is what I was first thinking. What OS are you using? Linux? Be? Windows? Other? This is important because the particular function used to set the current context is different for each.

[This message has been edited by DFrey (edited 07-11-2001).]

07-11-2001, 10:31 AM
Im using wxWindows libraries (both windows and linux), but Im running on windows at the moment.

I was looking a little at what you said. In each window I create, I think I create a rendering context, where I do my paintings...

well, thanks anyway, hope youve got some more for me...