Ogre Version: 14.3.1
Operating System: Windows
Render System: DirectX 11
Hey everyone!
I have a post here discussing the integration of Ogre with WPF, specifically using D3DImage. After successfully initializing Ogre inside D3DImage with DirectX 9, I am now attempting to do the same with DirectX 11.
There are some challenges: the first is that D3DImage does not work directly with DirectX 11. I am currently researching potential solutions. Another issue I encountered is that the DirectX 11 render system in Ogre does not have a getCustomAttribute method for RenderTexture. Every time I tried to use a custom attribute, it would fail with the same generic error:
Code: Select all
Attribute not found. " + name, " RenderTarget::getCustomAttribute"
To address this, I made manual changes to the source code, specifically in the OgreD3D11Texture.cpp class:
Code: Select all
void D3D11RenderTexture::getCustomAttribute(const String& name, void* pData)
{
if (name == "D3DDEVICE")
{
*(ID3D11DeviceN**)pData = mDevice.get();
}
else
{
D3D11RenderTexture::getCustomAttribute(name, pData);
}
}
And in OgreD3D11Texture.h:
Code: Select all
void getCustomAttribute(const String& name, void* pData);
I'm not sure if this is the correct approach, but now, when I execute the following code:
Code: Select all
renderTarget.getCustomAttribute("D3DDEVICE", out surface);
I can successfully obtain a pointer, unlike before.