PDA

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



tapahob
10-30-2013, 04:16 PM
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?

GClements
10-30-2013, 05:59 PM
"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.

tapahob
10-30-2013, 06:13 PM
"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