Created
August 31, 2014 06:53
-
-
Save fkaa/5a8a6610c128e98b568c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifdef __APPLE__ | |
CGLContextObj kCGLContext = CGLGetCurrentContext(); | |
CGLShareGroupObj kCGLShareGroup = CGLGetShareGroup(kCGLContext); | |
cl_context_properties prop[] = { | |
CL_CONTEXT_PROPERTY_USE_CGL_SHAREGROUP_APPLE, (cl_context_properties)kCGLShareGroup, | |
CL_CONTEXT_PLATFORM, (cl_context_properties)platform, | |
0 | |
}; | |
#elif __WIN32 | |
cl_context_properties prop[] = { | |
CL_GL_CONTEXT_KHR, (cl_context_properties)wglGetCurrentContext(), | |
CL_WGL_HDC_KHR, (cl_context_properties)wglGetCurrentContext(), | |
CL_CONTEXT_PLATFORM, (cl_context_properties)platform, | |
0 | |
}; | |
#elif __linux__ | |
cl_context_properties prop[] = { | |
CL_GL_CONTEXT_KHR, (cl_context_properties)glXGetCurrentContext(), | |
CL_GLX_DISPLAY_KHR, (cl_context_properties)glXGetCurrentDisplay(), | |
CL_CONTEXT_PLATFORM, (cl_context_properties)(platforms[0])(), | |
0 | |
}; | |
#else | |
Log::e("No support for this platform, sorry!"); | |
#endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment