Sign in to follow this  
Daggerbot

[D3D9] Texture management...

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
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this