[Bf-committers] BGE: Can we have a centralized call KX_KetsjiEngine::OnResize() (please :)

Benoit Bolsee benoit.bolsee at online.be
Thu Feb 5 10:10:37 CET 2009

On Wed, 4 Feb 2009 19:47:23 -0500 Dalai Felinto <dfelinto at gmail.com>
> So we have a way to initialize class such as the videoTexture (and the
> Dome/fisheye) in the KetsjiEmbed.cpp, a way to handle its end 
> in the ~KX_KetsjiEngine, and I would like to have a way to 
> call their internal onResize() methods (in my case updating 
> the m_viewport and the m_imagesize) when the BGE is resized.
> > Can you elaborate a bit on what would 
> KX_KetsjiEngine::OnResize() do 
> > and how it would be called?
> KX_KetsjiEngine::OnResize()
>    m_dome->resize(viewport);
>    2dfilter->setTexUpdate(true)
>    videotexture->??
>    shadow_buffers->resize_the _glImage(); //just an example
> (...)

Callback method is fine but this is certainly not the way to do it.
First create a KX_KetsjiEngine::RegisterOnResizeCallback(function,param)
so that each module can register its callback function. When the
viewport is resized, the BGE gets a ghost notification (I guess) and
calls KX_KetsjiEngine::OnResize(), which walks through the registered
callback functions and calls them one by one. 

   for (i=0; i<callbacks.size(); i++)
      callbacks[i]->function(viewport, callbacks[i]->param);

More information about the Bf-committers mailing list