GLFW Cuda & OpenGL Interop example code


I’ve followed the interop example in both the Cuda By Example book and in the Simple OpenGL sample project on the Nvidia website. However, both examples use freeglut as a general OpenGL library. I’d like to get the same functionality working by using GLFW instead of freeglut.

I first tried to implement this myself as follows:
Some info on my setup: Windows 7, Win32, Visual Studio 2013

I start with the ‘Simple OpenGL’ Visual Studio project from Nvidia and I’m trying to switch it over to use GLFW instead of freeglut. I’m having some issues … I"m still working it.

However, I was hoping to short-circuit my debug of this by finding an example project that demonstrates simple Cuda - to OpenGL interoperability (interop) using GLFW. Can anyone point me to a good resource?

I was able to get a GLFW version of Simple OpenGL to compile - but when it ran, my screens went black. Decided to change course and try to implement a more basic example. Basically, I’m just trying to draw a single indexed triangle using the glDrawElements command. I was able to get this working.

So my problem is solved. It turns out all I had to do we remove the references to freeglut and put in proper paths to glew.h and glfw3.h (and the related libraries). It all worked!

@gboyinfinity, I have a very simple OpenGL/CUDA + GLFW interop example here.

I’ve only been using GLFW+GLAD on Windows but so far it seems like a great framework.