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 15. Combining OpenCL and OpenGL > Basic interoperability example

15.3. Basic interoperability example

Interfacing OpenCL and OpenGL isn’t particularly difficult, but because there are so many data structures and functions involved, it can be hard to keep your code organized. The goal of this section is to present a method for structuring OpenGL-OpenCL code that can be used in different applications. This method will be used throughout this chapter and chapter 16.

To introduce the method, this section will present an application that draws three squares in a 3-D model. This is similar to the three_squares application from appendix B, but the Ch15/basic_interop code uses an OpenCL kernel to set the coordinates and colors of the vertices. This isn’t exciting as 3-D applications go, but once you see how the code works, you’ll be able to extend the method to support more interesting applications.


  

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


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint