Sign in to follow this  
flateric

Loading Textures with DirectX

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

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