How to pass CUDA data array to opengl texture?
if cuda has a unsigned char array called B.
how can i pass B array to opengl texture? i have no ideas.
Now i using this methos,but seem not like a good method.
1.copy B array to local memory.
(using cudaMemcpy(B_local, B, sizeof(unsigned char)sizexsizey*3, cudaMemcpyDeviceToHost);
2.gluBuild2DMipmaps(GL_TEXTURE_2D, 3, sizex, sizey,GL_RGB, GL_UNSIGNED_BYTE,B_local);
3.it works but seem low performance