ADC Home > Reference Library > Technical Q&As > Legacy Documents > Graphics & Imaging >
Important: This document is part of the Legacy section of the ADC Reference Library. This information should not be used for new development.
Current information on this Reference Library topic can be found here:
NOTE: This Technical Q&A has been retired. Please see the Technical Q&As page for current documentation. |
|
Q: I am trying to do rendering in a cooperative thread while another thread is doing something else. I thought I would yield from within a rendering loop, but it seems the rendering loop gets executed only once no matter how lengthy the rendering is. Could someone give me some suggestions? A: The current version of QuickDraw 3D is not thread safe so I would not recommend that you do this. Also QuickDraw itself is not thread safe, so it would be dangerous to even have two threads that do any drawing at all. However, if you are doing QD3D stuff in one thread and no drawing in the other thread, you could potentially get 3D to yield time by installing a view idle handler. I haven't not tried this from a threaded application, but you may want to give it a go. Here is a small snippet that shows how you'd define and install the view idle method:
Note that you'll be called more often from the wireframe renderer than the interactive renderer. Your mileage may vary so you'll need to play around with this stuff. [Jul 11 1997] |
|