hеllo.
I'm trying to use an interop with opengl and opencl in qt.
this is my code:
GLuint id = 0;
glGenBuffers(1, &id);
glBindBuffer(GL_ARRAY_BUFFER, id);
glBufferData(GL_ARRAY_BUFFER, lSize, NULL, GL_STATIC_DRAW);
int err;
cl::BufferGL buff;
buff= cl::BufferGL(context, CL_MEM_WRITE_ONLY, id, &err);
glBindBuffer(GL_ARRAY_BUFFER, 0);
vertexBufferObject = id;
GLuint id = 0;
glGenBuffers(1, &id);
glBindBuffer(GL_ARRAY_BUFFER, id);
glBufferData(GL_ARRAY_BUFFER, lSize, NULL, GL_STATIC_DRAW);
int err;
cl::BufferGL buff;
buff= cl::BufferGL(context, CL_MEM_WRITE_ONLY, id, &err);
glBindBuffer(GL_ARRAY_BUFFER, 0);
vertexBufferObject = id;
To copy to clipboard, switch view to plain text mode
I get always the same error:
-60: CL_INVALID_GL_OBJECT.
i omitted the construction of the gl/cl context code, but I'm was try this without qt and all works fine.
When i use the code in qt i get the error.
What can be?
the threads and contexts that are used in qt?
How i can resolve?
But I wish understand and use my own library, rather than use an already done library .
thanks.
Bookmarks