lunes, 27 de febrero de 2012 8:08
Hi. I'm now starting to make game apps for Windows using Visual Studio 11. For the beginning, I want to change one of my old game programs, which was for Written for D3D9, to an app. I can upgrade it to D3D11 but first, I want to check out D3D9. Everything works fine but I have a critical problem. I don't know what should I use as a Window Handle (HWND) when creating the device. The method I found is sharing resources between D3D9 and D3D11/DXGI. But is it really possible for an app?
When using DXGI, I found out that the window that the app runs on (seems to be called Immersive Window), is now an interface, not a handle, and the interface doesn't give me handle to the Window it is using. There may be many reasons. First of all, as you've seen, app windows are much different from other windows. Maybe there isn't a "HWND" given by something like CreateWindow() at all. Anyway, even if I had HWND of the app window, I wouldn't risk to use it. You know that there are some Window Managing jobs that D3D9 does. These are surely different for an app window, which D3D9 doesn't know about. So it is not right to use this method.
Another method is sharing resources. Starting with Windows Vista, D3D9 supports resource sharing. You can create a render target/texture on D3D9, and give its sharing handle to D3D11. [Method I found usable: ID3D11Device::OpenSharedResource()]. But I'm still worried if the possible, safe and not weak. Or even am I allowed to use D3D9 for an app. Does anyone know any information around this?