On Mon, Aug 29, 2011 at 1:31 AM, Nicolas Rougier <[email protected]>wrote:
> I would add also that OpenGL and threads are not quite friendly. In a > previous attempt (with glut and previous version of python) I had to > proxy all OpenGL calls so everything ran ok. That is exactly why I propose a polling solution. The secondary thread just blocks permanently on stdin (i.e. a call to raw_input), and each time it reads a line, it sticks it in a lockless queue. The programmer can then just check to see if any input is in the queue from the main thread - no need for OpenGL to know or care about the presence of multiple threads. I don't have a python implementation handy at the moment, but my original C++ proof of concept is here: http://www.gamedev.net/topic/538714-asynchronous-console-input/page__view__findpost__p__4477263 -- Tristam MacDonald System Administrator, Suffolk University Math & CS Department http://swiftcoder.wordpress.com/ -- You received this message because you are subscribed to the Google Groups "pyglet-users" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/pyglet-users?hl=en.
