Jump to content
  • Advertisement
Sign in to follow this  
Daggerbot

[D3D9] Texture management...

This topic is 3325 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

I've been reading up on IDirect3DDevice9::CreateTexture, and I'm not too clear on how textures are managed. In my program, when switching between full screen and windowed modes, the current device is released, then a new one is created. Will all existing textures be destroyed as well because they were created by a device that no longer exists? Or are they owned by the adapter that they were created on? This would make more sense to me, but the documentation wasn't very clear on this. Any help is appreciated.

Share this post


Link to post
Share on other sites
Advertisement
If you create the textures with D3DPOOL_MANAGED, the device will keep a copy of the texture in system memory, and also in video memory (provided there's enough space there, I think it'll swap in and out as required if not)

with D3DPOOL_MANAGED, you don't need to release or recreate any textures when you need to reset the device, be it from resolution/format changes or alt-tabbing. The device will just reload them from system memory.

If you use any of the other pool types, the texture will need to be released and recreated on a reset.

You shouldn't need to be releasing the device when switching between fullscreen and windows, you can just call ->Reset on the device with the new presentation parameters (eg d3dPres.Windowed = TRUE;)

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!