Jump to content


How to create multi-windows in openGL


5 replies to this topic

#1 chingching

    Member

  • Members
  • PipPip
  • 38 posts

Posted 08 March 2006 - 05:29 AM

My project is about generating path in a house. I think to create a window that user walk-thru in the house, while another window beside is for user to see the path generated that he/she walking thru, from top view of house. I'm not sure is it concern with multithreading, if yes, then I think it would be a problem for me, as I've not so much knowledge about it...
Any idea for me? Thanks you all...:worthy:

#2 Mjolnir

    Member

  • Members
  • PipPip
  • 42 posts

Posted 08 March 2006 - 06:43 AM

At first I thought you needed multiple viewports in the same window, but that path could be simply plotted in a semi-transparent/blended rectangle at a corner of the window (sort of a HUD, having switched to 2D/ortho mode, of course).

#3 Reedbeta

    DevMaster Staff

  • Administrators
  • 4782 posts
  • LocationBellevue, WA

Posted 08 March 2006 - 06:43 AM

Multithreading is not necessary to do this, though it can help improve performance. It depends on how you set up your renderer. Usually in an OpenGL program there is a main loop that calls a render function each frame. You will just have to call two, one for each of the windows. Note that each window will have its own rendering context, so you will have to use wglMakeCurrent to switch between them.
reedbeta.com - developer blog, OpenGL demos, and other projects

#4 TheNut

    Senior Member

  • Moderators
  • 1397 posts
  • LocationThornhill, ON

Posted 08 March 2006 - 01:07 PM

Why not just do all rendering in the same window? You have two view states, one perspective and one orthographic. First render your 3D perspective view of the house and then switch to an orthogonal view projection to render your birds-eye view somewhere else in the window. Not only is this easier, but having everything in one window has many benefits too.
http://www.nutty.ca - Being a nut has its advantages.

#5 chingching

    Member

  • Members
  • PipPip
  • 38 posts

Posted 08 March 2006 - 05:29 PM

Ya...thanks you guys...I'll try to get more detail about the ideas that you all provided...thanks a lot...really appreciate it...:worthy:

#6 SigKILL

    Valued Member

  • Members
  • PipPipPip
  • 200 posts

Posted 08 March 2006 - 05:57 PM

Use wglShareLists() to share textures/vbos/etc. between the different contexes if you have multiple windows.

-si





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users