Hi Michael,
You should probably use the latest version from Github. The latest
release is really outdated.
- Almar
On 21-07-14 14:07, GooMike wrote:
> Hi Almar,
>
> Thanks for your prompt answer.
>
> I have not these objects in the FrameBuffer class, and not the function resize()?
> I have put in PS the help(fbo)
>
> I am using /Library/Python/2.7/site-packages/vispy-0.2.1-py2.7.egg/vispy/
>
> In the same spirit I have tried in Canvas::init():
> self.colorBuff = gloo.Texture2D()
> self.colorBuff.set_shape((20,30,3))
> self.depthBuff = gloo.RenderBuffer()
> self.depthBuff.set_shape((20,30))
> self._fbo = gloo.FrameBuffer(self.colorBuff, self.depthBuff)
>
> without success?
>
> Am I using a too old version?
>
> Another point, I would like to quit the application on some events, but it didn't work, it seems that exceptions are blocked or their action
>
> def on_key_press(self, event):
> print('on_key_press: %s' % event.text)
> if event.text == 'x':
> sys.exit()
> elif event.text == 'q':
> app.quit()
>
>>> on_key_press: x
> Traceback (most recent call last):
> File "can.py", line 339, in on_key_press
> sys.exit()
> SystemExit
> Error invoking callback for event: <KeyEvent blocked=False handled=False key=<Key 'X'> modifiers=() native=None source=<__main__.Canvas object at 0x1068728d0> sources=[<__main__.Canvas object at 0x1068728d0>] text=x type=key_press>
>
> If I try to use app.quit(), it crashed with a segmentation fault:
>>> on_key_press: q
> Segmentation fault
>
> Any idea?
>
> Many thanks in advance,
>
> Regards,
>
> Michaël
>
> PS: Help on FrameBuffer in module vispy.gloo.framebuffer object:
>
> class FrameBuffer(vispy.gloo.globject.GLObject)
> | Representation of a frame buffer object (a.k.a. FBO).
> | FrameBuffers allow off-screen rendering instead of to the screen.
> | This is for instance used for special effects and post-processing.
> |
> | Method resolution order:
> | FrameBuffer
> | vispy.gloo.globject.GLObject
> | __builtin__.object
> |
> | Methods defined here:
> |
> | __init__(self, color=None, depth=None, stencil=None)
> |
> | attach_color(self, object, level=0)
> | Attach a RenderBuffer of Texture instance to collect
> | color output for this FrameBuffer. Pass None for object
> | to detach the attachment. If a texture is given,
> | level specifies the mipmap level (default 0).
> |
> | attach_depth(self, object, level=0)
> | Attach a RenderBuffer of Texture instance to collect
> | depth output for this FrameBuffer. Pass None for object
> | to detach the attachment. If a texture is given,
> | level specifies the mipmap level (default 0).
> |
> | attach_stencil(self, object)
> | Attach a RenderBuffer instance to collect stencil output for
> | this FrameBuffer. Pass None for object to detach the
> | attachment.
> |
> | set_size(self, width, height)
> | Convenience function to set the space allocated for all
> | attachments in use.
> |
> | ----------------------------------------------------------------------
> | Data descriptors defined here:
>
> | color_attachment
> | Get the color attachement.
> |
> | depth_attachment
> | Get the depth attachement.
> |
> | stencil_attachment
> | Get the stencil attachement.
> |
> | ----------------------------------------------------------------------
> | Methods inherited from vispy.gloo.globject.GLObject:
> |
> | __del__(self)
> | Delete the object from OpenGl memory.
> |
> | __enter__(self)
> | Entering context
> |
> | __exit__(self, type, value, traceback)
> | Leaving context
> |
> | activate(self)
> | Activate the object (a GL context must be available).
> | Note that the object can also be activated (and automatically
> | deactivated) by using it as a context manager.
> |
> | deactivate(self)
> | Deactivate the object.
> |
> | delete(self)
> | Delete the object from OpenGl memory.
> |
> | ----------------------------------------------------------------------