OpenGL interoperability Writing to a screen buffer

I would like to map an OpenGL screen buffer to CUDA so that I can directly modify the data contained in the buffer. Esentially I want to create the buffer and map it for use in CUDA, call my kernel which manually specifies the color for each pixel in the buffer and then once the kernel is finished executing I want to call swapBuffers() (or something similar) to display the buffer that I just modified. I wil NOT be using OpenGL to draw anything to the buffer… no triangles, no points. The only place where the buffer will be touched is in my CUDA kernel. OpenGL will only be used to display the buffer to the screen. I was hoping that someone could provide a quick summary of the steps required to achieve this or point me toward somewhere that already has it. Incase it matters, I will be using GLUT.

I have looked at the OpenGL examples given on the CUDA webpage, but they seem to be doing a lot more with the OpenGL interoperability than I want to do and I am having a hard time seperating out the necessary steps from the stuff which does not need to be done.

Thank you.

The postProcessGL example does exactly what you want. Just leave out the rendering part.

Peter