We are developing an app with fltk as our UI tool and we’re planning to use panda3d for rendering. I’m having trouble finding how to get panda to render into a GL window already created by another part of the code. Is there some way to do this without modifying the panda souirce? Thank you for your help…
– Lee Campbell
Panda is not currently set up to do this. It would be possible to add support for this, but you’d have to be comfortable mucking about in C++. Are you interested?
I’ve used fltk myself. It’s a really nice toolkit.
So anyhow, there’s no way to do this without modifying the panda source. Currently, the design of panda is such that when you call panda’s “make_window” routine, it creates a window from scratch. What we’d need to do is add a function that lets you create a panda output device, but using an existing window as a host.
I need to ask David, our lead programmer, about this. David - I’ve seen this request before. Do you think we should do something about it?
One way would be to create an “client opengl graphics pipe,” which assumes that it’s your responsibility to create an opengl-capable window, and it’s your responsibility to supply some sort of equivalent of “wglMakeCurrent.” It would then render into the supplied window. This would make panda compatible with any widget set that can create an opengl widget.
Actually, it might be more useful to shoehorn this into existing pipes.
Thanks for your replies. When we glanced at the code, pipes looked like a good place to start. Essentially, a thing called a gl context would have to be passed. Open Inventor can pass this as a void*, I believe. Things can get hairier when the window is resized or maximized; opengl needs to be told about the change. Maybe anyone crazy enough to want to do this will take the responsibility for requesting an update after window resize…
If you decide to implement this, campbell, then talk to me first. I can give you a fairly detailed outline of everything that needs to be written.