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

Batching

Batch as much as possible operations that rely on the same state, because changing the system state (by using the glEnable() and glDisable() calls) is costly. OpenGL does not check internally to see whether a specific feature is already in the state you want. In the exercises in this book, I would frequently set states more often than I likely needed to, so as to ensure the behavior is easily predictable. But for commercial, performance-intensive apps, try to remove any redundant calls in the release build.

Also, batch your drawing calls as much as possible.


  

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