[vtkusers] VTK in a MultiTouch Environment

Clinton Stimpson clinton at elemtech.com
Sat Oct 24 12:06:51 EDT 2009


On 10/23/2009 06:33 AM, Christopher Denter wrote:
> Hello.
>
>> What is exactly is your "FBO"?  It it a PyMT object?  Any information
>> that you have about its internals would help the discussion.
>
> Yes, it is a PyMT object. You use it like this:
>
> >>> with fboobject:
> >>>     do_the_drawing()
>
> What this does is bind the FBO (which is an OpenGL Framebuffer), 
> execute all the drawing code in the with-block and then unbind it 
> again. You can then access the things you drew via the fboobject.
> It has a color buffer and a depth buffer.
>
> See this: http://github.com/tito/pymt/blob/master/pymt/graphx/fbo.py
>
>> There must be a better way.
>
> I sincerely hope there is, but I will need your help to find it.
>
>> The SetWindowInfo() method just converts a string into an address and
>> passes it to SetWindowId().  So for SetRootWindow(), you would need to
>> add a method called SetRootWindowInfo() to vtkCarbonRenderWindow that
>> takes a char *, converts the string to an address, and passes it to
>> SetRootWindow().  It would be an almost exact copy of the
>> SetWindowInfo() method.
>
> I may be wrong here, but I think one of the problems we were unable to 
> solve was actually *getting* the string that contains the address of 
> the HIView.

I had a look at the pyglet source code and there is no HIView.  It is 
doing it the old way (before Mac OSX 10.2/3 days)  before HIViews came 
around.
But vtkCarbonRenderWindow does have support for HIView-less Carbon 
windows.  You just call vtkCarbonRenderWindow::SetRootWindow(...) with 
the Window, and you have to manage the size & position within the Carbon 
Window yourself with SetSize() and SetPosition().  This is how its done 
in Tk where there are/were no HIViews.
But this probably has limitations when it comes to adding other GUI 
elements within the window, so for real GUI apps, pyglet should really 
use Carbon HIViews or Cocoa NSViews.  But the impression I got from the 
pyglet documentation is that it only supports full screen windows or 
floating windows and no child windows/views.

Clint




More information about the vtkusers mailing list