Direct3D with OpenGL interop

Hi everybody, I’m trying to share a texture created in OpenGL with a directX texture. (I’m using directx9). I’m starting from but I’m having some problems because i can’t find no full example code in the web. Has anyone some code in order to list the steps needed for this kind of sharing (what API to call) and above all how to draw in the render function?
The steps I made are that in the opengl texture creation I fill it with values from png file. Then, as in the “BeginGlDraw()” this code binds the framebuffer, I should render the textures on the framebuffer. That is the problem. How can i attach it? In the same way I should draw the textures on the screen? After this it calls “EndGlDraw() and Flush()” methods. In the Flush methods it should “Present” the buffer to the screen. Does this mean that I have to avoid calling the glSwapBuffer?

Tks everybody,

Hi Lorenzo. I’m the one that created that OpenglDxInterop that you referenced. Are you using that library (see the link in the downloads section), or referencing it to create your own? Of course, I would suggest you use the library I’ve provided, just because I fought a lot of issues in trying to figure out how to do this. In response to your questions, it looks like you’re trying to use the texture to ‘link’ to the directx output. Don’t do this. Just render the opengl texture like you normally would if you were using straight up opengl. Then use the GlDx library to do the presentation, and the library will do the rest.

I’m guessing that is just about as clear as mud, so let me know in bite size chunks what isn’t clear, and I’ll do my best to walk you through it.