summaryrefslogtreecommitdiff
path: root/boost/compute/interop
diff options
context:
space:
mode:
Diffstat (limited to 'boost/compute/interop')
-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,