• Advertisement
Sign in to follow this  

Loading Textures with DirectX

This topic is 4144 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, I am pretty new to DirectX! At the moment I develop a 2D game in DirectX9 and load all my textures/bitmaps with "D3DXCreateTextureFromFileEx()" - which works fine for me - for now! Now I know that gfxcards memory range from 8-256MB and I know that DirectX can manage the memory of the texture automaticly. Question: will "D3DXCreateTextureFromFileEx()" do the job for me if the texture is loaded into system memory or gfxcard memory? Or did I need to keep an eye on my texturememory with "GetAvailableTextureMem()" and do a memory-resource manager? Thanks for any tip and help! -Andy

Share this post


Link to post
Share on other sites
Advertisement
Well really it is all managed for you. There is no need for you to worry about this since you are making a relatively resource-light 2D game.

Dave

Share this post


Link to post
Share on other sites
If you create the texture in the D3DPOOL_MANAGED pool, then D3D will manage the memory for you. Resources in the managed pool have a copy in video memory and in gfx memory (Which may be AGP or true VRAM, there's no way to force one or the other, it's up to the driver). When gfx memory runs low, D3D will swap stuff out of gfx memory using a least-recently-used algorithm. There's a bit of info about it on The MSDN.

Share this post


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

  • Advertisement