interop.qbk 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. [/===========================================================================
  2. Copyright (c) 2013-2015 Kyle Lutz <kyle.r.lutz@gmail.com>
  3. Distributed under the Boost Software License, Version 1.0
  4. See accompanying file LICENSE_1_0.txt or copy at
  5. http://www.boost.org/LICENSE_1_0.txt
  6. =============================================================================/]
  7. [section:interop Interoperability]
  8. Boost.Compute provides a number of facilities to ease interoperability with
  9. other C and C++ libraries including [@http://en.wikipedia.org/wiki/OpenGL
  10. OpenGL], [@http://opencv.org/ OpenCV], [@http://eigen.tuxfamily.org Eigen],
  11. [@http://qt-project.org/ Qt], and [@http://vtk.org/ VTK].
  12. All of the interop headers are located in the `<boost/compute/interop/...>`
  13. directory.
  14. [section OpenGL]
  15. OpenGL is a standard API for 3D graphics and closely related to OpenCL.
  16. Boost.Compute provides an easy way to create a shared OpenCL/OpenGL context
  17. via the [funcref boost::compute::opengl_create_shared_context
  18. opengl_create_shared_context()] function. This creates a Boost.Compute
  19. [classref boost::compute::context context] object which can be used to create
  20. OpenCL memory buffers corresponding to OpenGL memory objects (such as VBOs).
  21. This allows for OpenCL kernels to read and write data which is then used
  22. directly for rendering with OpenGL.
  23. Boost.Compute provides a few classes to manage OpenGL objects and make them
  24. accessible to OpenCL. These include [classref boost::compute::opengl_buffer
  25. opengl_buffer] (for OpenGL memory objects) and [classref
  26. boost::compute::opengl_texture opengl_texture] (for OpenGL texture objects).
  27. Control of shared OpenCL/OpenGL memory objects is transfered between OpenCL and
  28. OpenGL using the [funcref boost::compute::opengl_enqueue_acquire_gl_objects
  29. opengl_enqueue_acquire_gl_objects()] and [funcref
  30. boost::compute::opengl_enqueue_release_gl_objects
  31. opengl_enqueue_release_gl_objects()] functions.
  32. See the OpenCL documentation for the
  33. [@https://www.khronos.org/registry/cl/sdk/1.2/docs/man/xhtml/cl_khr_gl_sharing.html
  34. cl_khr_gl_sharing] extension for more information.
  35. [endsect] [/ opengl]
  36. [endsect] [/ interop ]