Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.

Mr Cucumber

Moving surfaces in memory

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

What can I do to move a (texture) surface from video to system memory or from system to video? I have looked at the SetSurfaceDesc function but it seems as that only works with system memory surfaces. So is there any fast way to do it without having to release and then recreate it with different memoryflags?

Share this post

Link to post
Share on other sites
As always there are different ways to do it :

1. If you wan''t to move your surface because of texture managment in your application,
(moving currently unused textures from vid-mem to sys-mem , and moving currently needed textures from sys-mem to vid-mem)

you can DX handle this for you (new since Dx7.0),
When creating your texture surfaces do the following :
ddsd.ddsCaps.dwCaps2 = DDSCAPS2_TEXTUREMANAGE;

There are also some hint Values you can set :

the hints are used to tell dx how to exactly manage the textures.
look into the sdk-help for more info on them.

2. The second way (if you don''t want to do texture-managment)
You realy got to create the surface in vid-mem again and blit
the data from the old surface to your new vid-mem surface.
And of cauze don''t forgett to release the old-surface.

There is no other way i know of.

Share this post

Link to post
Share on other sites

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