Jump to content
  • Advertisement
Sign in to follow this  
Helo7777

D3DXCreateTextureFromFileInMemory memory ownership

This topic is 2471 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi all,

When using D3DXCreateTextureFromFileInMemory(), Does DirectX make a copy of the data passed to it? The reason I ask is because I retrieve a file from an archive, pass the loaded data into D3DXCreateTextureFromFileInMemory(), then delete the loaded data (assuming DirectX makes its own copy). After I delete the data my application runs very slow. However, if I don't delete the data then the application runs fine.

Share this post


Link to post
Share on other sites
Advertisement
That function will create a texture, and copy the data into the texture. So the memory does not need to be persistent after the function call.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!