For all QtOpenCL users...

Hi !

I’m using the OpenCL’s Qt “wrapper” and i’m actually experiencing problems with the interoperability between OpenGL and OpenCL since the GL context is only available for specific functions like initializeGL(), paintGL() & resizeGL().
When i try to create an OpenCL memory object from a GL texture (clCreateFromGLTexture2D) in the initializeGL() function (which must have a valid QGLContext since i test my QApplication with QGLFormat::hasOpenGL()), i get this :

create: do not know how to enable sharing
QCLContextGL::createGLTexture2D: "CL_INVALID_CONTEXT" 

Help me plz ! :frowning:

Update : Apparently, i can’t set the properties in order to pass the Render Context (of OpenGL) to OpenCL … (CL_GL_CONTEXT_KHR => wglGetCurrentContext(), CL_WGL_HDC_KHR => wglGetCurrentDC())