It works for me if i create the texture in initialization, but not if i render to it cyclically.
I also have some doubts about about some parts in there, it tells me to glBindTexture(pbo).
glGenBuffers() and glGenTextures() creates names that it can’t distinguish, e.g. creating two textures gives [1, 2] and creating two buffers also gives [1, 2]. So i wonder if this part is correct?
Also, i wonder what i need to do once at initialization and what i need to do cyclically to update the texture? To my understanding i can only do cudaGLRegisterBufferObject() once and the rest must be done each time i want to update the texture.
Is a call to glBindTexture() with a PBO correct / valid?
What can i do once and what do i need to do cyclically?
You could take at look at postProcessGL SDK example.
Also there is another way to do this and this is to create a framebufferobject and bind the color-attachment as a texture. Then you could render to the framebufferobject and use the texture after you are done with the rendering. Relevant keywords, to find this, are: framebufferobject and texturebuffer.