[Bf-committers] Blender-xembed patch review

Benoit Bolsee benoit.bolsee at online.be
Sun Aug 24 19:36:52 CEST 2008


I reviewed the blenderplayer plugin patch as discussed on IRC. I think
that the global variable hack is very uggly but it should not cause
problem as the blenderplayer is single threaded and each plugin instance
will launch a separate blenderplayer. 

However, the principle of running the blenderplayer in an embedded
window is generic enough to be exported in the interface. Here is one

Add a GHOST_ISystem::beginEmbeddedWindow() where you pass the parent
window ID. This interface is common to X11 and Windows so it must be
designed in a way that it is good also for Windows. I guess there is an
equivalent feature in Windows but I don't know how it works.

On the blenderplayer side, you can introduce a
GPG_Application::starEmbeddedWindow() that you will call from the main()
if you have the -i option; it will call
GHOST_ISystem::beginEmbeddedWindow(). This way, you don't need to patch
GHOST_WindowX11::setClientSize() as it won't be called.

On the X11 side, it seems consistent to add a new parameter to
GHOST_ISystem::createWindows() to pass the window ID (called from
beginEmbeddedWindow()) and of course the same new parameter to the
GHOST_WindowX11 constructor. It's better than having new functions as
these functions are doing things that remain valid for the embedded

I'd prefer to see the ghost interface changed in this way rather then
having a global variable hacking the normal window mode.


More information about the Bf-committers mailing list