<br><div class="gmail_quote">On Thu, Feb 14, 2008 at 10:32 AM, Thomas Boucher &lt;<a href="mailto:thomas.boucher@student.ecp.fr">thomas.boucher@student.ecp.fr</a>&gt; wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

I am currently part of a MMORPG project in python, using Twisted<br>
and python-ogre.</blockquote><div><br>Hey, me too!&nbsp; I wonder if anyone else out there is doing this -- it seems like a natural combination of technologies.<br><br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
 - First run python-ogre in the main loop. At a time, this loop launches<br>
the twisted reactor in another thread</blockquote><div><br>Everyone I&#39;ve spoken to has recommended not using threads with Twisted.<br>&nbsp;<br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
 - So I tried not to run Twisted in another thread, by using the way<br>
described here [2]. Twisted is given the main loop and the<br>
rendering is done frame by frame with the coiterate. It works sometimes,<br>
the renderOneFrame in the coiterration is not really working.</blockquote><div><br>I hadn&#39;t seen that discussion thread before, and I&#39;m not that familiar with coiteration.<br><br>What I&#39;m currently doing is this:<br>
<br>def renderFrame():<br>&nbsp;&nbsp;&nbsp; ogre.WindowEventUtilities.messagePump()<br>&nbsp;&nbsp;&nbsp; root.renderOneFrame()<br><br> renderSystem._initRenderTargets()<br>root.clearEventTimes()<br>renderTask = task.LoopingCall(renderFrame)<br>renderTask.start(0.01, False)<br>
reactor.run()<br><br>I do my keyboard and mouse capture in a frame listener which I register with Ogre.<br><br>It works, but I&#39;ve only done a little bit of network activity (e.g. an IRC client).<br><br>If any Twisted experts would care to comment on the above code, I&#39;d appreciate it.<br>
<br>I&#39;m also wondering what would be the advantages of using a coiterator...?<br><br></div></div>-- <br> Bernie Roehl<br> Mail: <a href="mailto:broehl@gmail.com">broehl@gmail.com</a>