# using openGL to create a plot (contour-like)

**URL:** <https://forums.developer.nvidia.com/t/using-opengl-to-create-a-plot-contour-like/1619>\
**Category:** CUDA Programming and Performance\
**Created:** [October 12, 2007, 3:03am UTC](https://forums.developer.nvidia.com/t/using-opengl-to-create-a-plot-contour-like/1619 "2007-10-12T03:03:23Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![paulius](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@paulius](https://forums.developer.nvidia.com/u/paulius)\
**Post date:** [October 12, 2007, 5:35pm UTC](https://forums.developer.nvidia.com/t/using-opengl-to-create-a-plot-contour-like/1619/2 "2007-10-12T17:35:54Z")

</div>

You’ll have to set up interop between CUDA and OpenGL. Here’s what you probably want to do.

create a pixel buffer object (PBO) that will be the texture source  
register the PBO with CUDA  
for each frame:  
map the PBO to CUDA  
launch the kernel to process PBO memory  
unmap the PBO from CUDA  
update the texture associated with the PBO  
draw a quad (dimensions same as the data your displaying) with the texture

I have a very ugly Win32 multiwindow app that uses cuda to generate textures for quads. It’s got some very bad windows-programming practices in it, but if you want, drop me a note and I can send the source to you (I don’t want to post it publicly due to the aforementioned ugliness).

Paulius

---

_[View the full topic](https://forums.developer.nvidia.com/t/using-opengl-to-create-a-plot-contour-like/1619)._
