DirectX: D3DXComputeTangentFrameEx

Started by
3 comments, last by Cleese852 15 years, 3 months ago
Hellow, I am making a terrain and I need to generate the normal, binormal and tangent for the normal mapping to work. But when I shut down my program I have a memory leak which has to be caused by D3DXComputeTangentFrameEx. If I put the 'D3DXComputeTangentFrameEx'-method in comment I no longer have the leak. So why do I get this when using D3DXComputeTangentFrameEx to generate the normals etc. ? This is the debug output I get: D3DX: MEMORY LEAKS DETECTED: 2 allocations unfreed (131712 bytes) D3DX: Set HKLM\Software\Microsoft\Direct3D\D3DXBreakOnAllocId=0x94f to debug Cheers
Advertisement
I can guarantee the function itself does not produce a memory leak...
Yes that would be logic, but I don't understand how I get that memory leak after using that function :-/
Are you providing the same ID3DXMesh* pointer as both the input and the output? This function creates a new mesh that is a clone of the input mesh, so if you use the same pointer you'll never Release the original mesh (which will cause a leak).
Yes, solved! :)
Thanks!

This topic is closed to new replies.

Advertisement