[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] 2D opengl engine



hi mike

We were interested on
implementing a event handling systems and classes that would respond to
these events in a similar way as Macromedia Flash or Director sprites
system do. For this we have developed a event handler that receives the
events from wx and sends them to the objects that are intersected by the
mouse. This is of course a wx based system and it wouldnt work for
pygame or GLUT.

We have decided that we should release the drawing part of it so that
people using pygame or glut could benefit from this work. At first we
tried to create a event handling system that would work for all systems
with little change but we couldnt find a way to do this.
So we stripped down the event handling system and the mouse related
classes so that the only thing left is the core basic shapes and the
rendering system.


...

Somewhat tangential to your announcement, but since you mention that you're struggling with it, you may find that the event system in OpenGLContext gives you some ideas. It works with PyGame, GLUT or wxPython (with partial support for Tkinter). The key is that it implements a fairly complete event system itself, and then provides shims between the host GUI and that system. The event system has both global event types (e.g. keyboard events) and location-aware ones (e.g. mouse events) that have access to the node-path through the scenegraph leading to the geometry involved.

Nothing to do with Flash or Director, though, and it's all perspectival-3D focused... but might be useful as a bit of example code anyway.

interesting. i havent paid much attention to openglcontext since it didnt work with my current version of python but i will definitelly have a deeper look into it.


thanks for your tip


-- enrike