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