Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 3 of 3

Thread: Four windows one context vs four windows four contexts? (3dsMax-like app)

  1. #1
    Newbie Newbie
    Join Date
    Oct 2013
    Posts
    2

    Four windows one context vs four windows four contexts? (3dsMax-like app)

    Hi! Im making my level editor and I really want to make it multy-windowed like in 3ds max\unreal ed where u have at least four rendering windows at a time. The thing is that each window has its own state (projection matrix etc..). For now, Im using one context and my rendering routine looks like "set window 1 state" -> "render window 1" -> "set window 2 state" -> "render window 2" ...
    And Im just not sure if I realy have to stick with the single context approach. All of these set state functions may take significant amount of frame time (even when the state of each window was unchanged). On the other hand, if I had 4 contexts doesn't this mean that I must have 4 copies of my scene (which I think is even worse)?
    Could someone advice me the right way?

  2. #2
    Member Regular Contributor
    Join Date
    Jun 2013
    Posts
    490
    "Bulk" data (textures, buffers, display lists, programs) can be shared between contexts using e.g. wglShareLists() or the shareList parameter of glXCreateContext().

    Any differences in state which apply to objects which are shared between contexts (e.g. uniform variables, which are part of the program object), then you'll still need to explicitly set that state whenever you switch contexts.

  3. #3
    Newbie Newbie
    Join Date
    Oct 2013
    Posts
    2
    Quote Originally Posted by GClements View Post
    "Bulk" data (textures, buffers, display lists, programs) can be shared between contexts using e.g. wglShareLists() or the shareList parameter of glXCreateContext().

    Any differences in state which apply to objects which are shared between contexts (e.g. uniform variables, which are part of the program object), then you'll still need to explicitly set that state whenever you switch contexts.
    Thanks for your answer! I'll give it a try

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •