Panda and GtkGLExt: using an existing GL window

I was wondering whether there is a way to use an output area created not by Panda3D, but some external source. I can get the GL drawable/context/window/how are all these things called, but I do not know of any way to supply it to Panda. I suppose source modification is needed, but I don’t really understand, how the GraphicsOutput classes work (especially HOW they pass the “GL space” to the rest of the engine).

An example (in Python) how it interfaces with pure OpenGL is at http://www.bonifazi.eu/appunti/Draw.py. The only thing that is need is to use Panda instead of plain OpenGL methods to draw it. Mainloop integration is no problem. Thank you for any help.

You can’t create a GL context externally to Panda; Panda needs to control the context creation. But that doesn’t mean you can’t render onto some other window created outside of Panda.

When you create a Panda window, you use a WindowProperties to control the size, position, whatnot of the window. The WindowProperties structure has a set_parent_window() parameter. Store the HANDLE to an existing window here (on Win32), or the pointer to an existing window here (on OSX), in either case cast to a size_t. Then Panda will create its window as a child of the window you specify, meaning it will appear to be rendering directly on top of your other window.

David