Blit between 2 hDCs

Hi guys

Ok since I normally use DirectX and GDI+ it would be a bit odd for me to come here…but Im hoping someone here can help me out. I have an application (MS Flightsim X) where im trying to copy the bits from a ID3D9 surface to a image that is mapped to a 3D surface. The only link i have to this image is via its hDC. Original intended use was for drawing with GDI+ on that image. GDI+ is becoming too slow for my purposes…I tried BitBlt() and it turned things into a slideshow from 30 fps down to 0.1 fps for just a 512x400 image and it fried my graphics card.

So…is there anything OpenGL provides or a way someone else here knows of that i can Blit between 2 hDCs without turning things into a slideshow?

Thanks
J.Bleeker

OpenGL doesn’t know anything about HDCs.

Is there a way i can make my own bit block transfer between HDCs that can be faster than GDI BitBlt()?

There is this: http://www.opengl.org/registry/specs/NV/DX_interop.txt GL_NV_DX_interoop and http://www.opengl.org/registry/specs/NV/DX_interop2.txt GL_NV_DX_interoop2 for GL and DX interoperations, but it is NVIDIA only. It allows for seamless operation between D3D and OpenGL. Btw, why are you not staying within the realm of D3D to do all the rendering? (Essentially this: c++ - Texture from Surface in DirectX 8.1 - Stack Overflow although the link says D3D8.1 the solution is for D3D9).

You also could try to SetPixelFormat on the window you need to read from and use glBlifFramebuffer while using separate read/draw HDCs with wglMakeCurrentRead. I say could because setting pixelformat on a window that already is friendly with DX will almost certainly fail. Id try that if i was desperate though.