Jump to content


Multiples OpenGL contexts and Windows...


5 replies to this topic

#1 Groove

    New Member

  • Members
  • PipPip
  • 26 posts

Posted 01 November 2006 - 10: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

#2 Kenneth Gorking

    Senior Member

  • Members
  • PipPipPipPip
  • 907 posts

Posted 01 November 2006 - 01:16 PM

You can do that with 1 context and four viewports, which is much simpler and the result is the same.
"Stupid bug! You go squish now!!" - Homer Simpson

#3 donBerto

    Senior Member

  • Members
  • PipPipPipPip
  • 369 posts

Posted 01 November 2006 - 03:29 PM

nehe link for what kenneth mentioned:

http://nehe.gamedev....n.asp?lesson=42
Imagine.

#4 Groove

    New Member

  • Members
  • PipPip
  • 26 posts

Posted 01 November 2006 - 06:37 PM

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

#5 donBerto

    Senior Member

  • Members
  • PipPipPipPip
  • 369 posts

Posted 01 November 2006 - 06:54 PM

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 ::

Groove said:

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.
Imagine.

#6 Groove

    New Member

  • Members
  • PipPip
  • 26 posts

Posted 01 November 2006 - 08: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





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users