Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Chapter 9. Integrating with GUI > Starting rendering loops in separate threads

Starting rendering loops in separate threads

We may not be delighted with the rendering speed of 25 fps; it means that OSG can use at most 1/25 of one second for the rendering work. And when there are more objects to render or more tasks to finish in the callbacks, the frame rate will continue to drop down and makes the whole process inefficient.

One solution is to use an independent thread for OSG traversals and drawing commands. Of course, the OpenThreads library, which is included in the core OSG source code, is the best choice for implementing such a job. But as we are working with Qt too, we will try the the Qt threading class here. The code will be based on the Integrating OSG with Qt recipe and only have a few modifications.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial