Members - Reputation: 100
Posted 15 February 2012 - 05:01 AM
I'm writing a directx 9 renderer and I've run into this problem: when a IDirect3D9Texture9 object is bound to an ID3DXEffect with SetTexture and the context is lost after a device reset, I can't release the texture successfully. Some unreleased memory block still stay and I can't reset the device. However, if I set the texture to NULL, I'm able to release it and everything works fine.
Is this a known thing, or I'm doing something horrible?
Thanks in advance!
Members - Reputation: 1986
Posted 15 February 2012 - 05:13 AM
EDIT: You should also be calling ID3DXEffect::OnLostDevice() and ID3DXEffect::OnResetDevice(), which probably internally sets the textures to NULL anyway.
Crossbones+ - Reputation: 8526
Posted 15 February 2012 - 05:36 AM
It appears that the gentleman thought C++ was extremely difficult and he was overjoyed that the machine was absorbing it; he understood that good C++ is difficult but the best C++ is well-nigh unintelligible.