summaryrefslogtreecommitdiff
path: root/boost/compute/interop/opengl
diff options
context:
space:
mode:
authorDongHun Kwak <dh0128.kwak@samsung.com>2017-09-13 11:24:46 +0900
committerDongHun Kwak <dh0128.kwak@samsung.com>2017-09-13 11:25:39 +0900
commit4fadd968fa12130524c8380f33fcfe25d4de79e5 (patch)
treefd26a490cd15388d42fc6652b3c5c13012e7f93e /boost/compute/interop/opengl
parentb5c87084afaef42b2d058f68091be31988a6a874 (diff)
downloadboost-upstream/1.65.0.tar.gz
boost-upstream/1.65.0.tar.bz2
boost-upstream/1.65.0.zip
Imported Upstream version 1.65.0upstream/1.65.0
Change-Id: Icf8400b375482cb11bcf77440a6934ba360d6ba4 Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
Diffstat (limited to 'boost/compute/interop/opengl')
-rw-r--r--boost/compute/interop/opengl/context.hpp6
-rw-r--r--boost/compute/interop/opengl/opengl_texture.hpp2
2 files changed, 6 insertions, 2 deletions
diff --git a/boost/compute/interop/opengl/context.hpp b/boost/compute/interop/opengl/context.hpp
index c35fedddfa..077c86036b 100644
--- a/boost/compute/interop/opengl/context.hpp
+++ b/boost/compute/interop/opengl/context.hpp
@@ -75,6 +75,10 @@ inline context opengl_create_shared_context()
for(size_t i = 0; i < platforms.size(); i++){
const platform &platform = platforms[i];
+ // check whether this platform supports OpenCL/OpenGL sharing
+ if (!platform.supports_extension(cl_gl_sharing_extension))
+ continue;
+
// load clGetGLContextInfoKHR() extension function
GetGLContextInfoKHRFunction GetGLContextInfoKHR =
reinterpret_cast<GetGLContextInfoKHRFunction>(
@@ -92,7 +96,7 @@ inline context opengl_create_shared_context()
#if defined(__linux__)
CL_GL_CONTEXT_KHR, (cl_context_properties) glXGetCurrentContext(),
CL_GLX_DISPLAY_KHR, (cl_context_properties) glXGetCurrentDisplay(),
- #elif defined(WIN32)
+ #elif defined(_WIN32)
CL_GL_CONTEXT_KHR, (cl_context_properties) wglGetCurrentContext(),
CL_WGL_HDC_KHR, (cl_context_properties) wglGetCurrentDC(),
#endif
diff --git a/boost/compute/interop/opengl/opengl_texture.hpp b/boost/compute/interop/opengl/opengl_texture.hpp
index c1f3f4f441..ae095d22a9 100644
--- a/boost/compute/interop/opengl/opengl_texture.hpp
+++ b/boost/compute/interop/opengl/opengl_texture.hpp
@@ -51,7 +51,7 @@ public:
{
cl_int error = 0;
- #ifdef CL_VERSION_1_2
+ #ifdef BOOST_COMPUTE_CL_VERSION_1_2
m_mem = clCreateFromGLTexture(context,
flags,
texture_target,