View Full Version : Multiples OpenGL contexts and Windows...
Groove
11-01-2006, 02:44 AM
Hello,
I am looking for tutorials and samples for Windows applications about the issue of multiple OpenGL contexts and windows. I will create an application using 4 differents views, (front, side, top, 3D) with sometime other windows.
So, if you have good links, I would be thankfull.
Cheers
Kenneth Gorking
11-01-2006, 05:16 AM
You can do that with 1 context and four viewports, which is much simpler and the result is the same.
donBerto
11-01-2006, 07:29 AM
nehe link for what kenneth mentioned:
http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=42
Groove
11-01-2006, 10:37 AM
All right, I should tell you that I am not interested in this way. I need true windows to integrate some buttons and stuff to each views.
Cheers
donBerto
11-01-2006, 10:54 AM
Having multiple rendering contexts can be very expensive. An element you can take away from the nehe tutorial is that you can have as many {child windows, "embedded" windows} as you want but all using a single rendering context. The only difference is that per window, you can change the viewport as well as its setting(s). By going with this approach, it's easy to draw one scene, and in another window, change its perspective and see both things with one draw pass.
Granted, that is just one way to do it.
The alternative with multiple contexts, however, you will need to draw for each context you have. To me that just adds to the expensiveness to having multiple contexts.
I hope that helps.
:: off-topic ::
I need true windows to integrate some buttons and stuff to each views.
Interesting choice of words. :D
Completely off-topic but let me ask you a question: do fake windows exist? How do you distinguish between real and fake? That said, can you not put 'buttons and stuff' on any window, despite it being real or fake?
not meant to be flamebait or anything like that, I just thought it was interesting.
Groove
11-01-2006, 12:25 PM
You're right I don't need one context per Child Window but 2 contexts, one for the main thread and an other for a high quality thread.
Fake windows : The NeHe ways :p
vBulletin, Copyright ©2000-2010, Jelsoft Enterprises Ltd.