is it possible to share the rendering context between main window/pbuffer and use render_texture ? If i try this, the texture is only pixel garbage. With two different contexts it works.
Can you use wglCopyContext for pbuffer/render_texture to copy state ? My program crashes at wglCopyContext
How do you manage your render state with pbuffer/render_texture ?
You can share contexts between a pbuffer and the main window within certain constraints (the only one I remember is that the pixelformats have to be the same).
If I remember correctly, render-to-texture requires a special pixelformat which is unlikely to be available on the main window, so I guess you can’t share the contexts when using render-to-texture.
ah yes, that makes sense. And the wglCopyContext ? Is that possible ? I mean you can’t do that much wrong using that, but it crashes. Are they also incompatible ?
Never used wglCopyContext, but from MSDN:
“When you call wglCopyContext, make sure that the destination rendering context, hglrcDst, is not current to any thread.”
A possibility for crashing perhaps.
i know, the destination context is not current but it crashes.
How do you manage the different render contexts ? By hand is really error prone, or you have to implement your own state manager
You would have choosen the pbuffer pixelformat with wglChoosePixelFormatARB, but what did you choose the pixel format for the main window with? the standard ChoosePixelFormat? If so, perhaps copy context fails because of that. Just another guess.