🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

System or Video memory

Started by
2 comments, last by Strabbi 24 years, 5 months ago
When loading a bitmap file into a directdraw surface, should I use system or video memory or one of each? Video memory surfaces are lost when one alt-tabs away but are faster to draw once loaded again. System memory won''t be lost when one alt-tabs away but are slower to draw (are they?). Or maybe one of each so I can just recreate the video memory surfaces from the system memory surfaces when somebody alt-tabs away. Thoughts?
--If Train A leave San Francisco at 8:30am EST travelling 25mph and Train B leaves Chicago at 1:30pm MST travelling at 40mph, and they're 3000 miles apart when they start, what is the capital of Bulgaria?
Advertisement
I usually will put the BMPs that get blitted the most into the video memory. This is especially handy with tile-based games. You''ll notice a marked improvement if you load all of THAT particular level''s tiles into video memory and blit like that rather than if you did it from system memory. Also, I''ll put the player''s character into video memory since he''s constantly on the screen. Other than that, most everything else is probably okay in system memory. (on the other hand, with the way video cards are, now, you can pretty much put it ALL in video memory... )
If you are just doing plain blting(with stuff that can be done through blt like scaling, colorkeying, etc), then go with video memory. Restoring surface, sure is kinda troublesome(an extra function call? , and would slow the game a bit(if you are restoring a ton), but hey, that''s their fault for multitasking while gaming lol (just joking).

Personally, I do system memory because at times i need to do read/write to the surface itself to create special effects.
There''s really no right or wrong answer here. It''s a design issue. Video memory is great for doing hardware effects (hardware blitting, scaling, etc...). System memory is better when you will be accessing a surface a lot. Also, you normally won''t have all the video memory you would like, so be sure to load the most used bitmaps into the video memory first, then fall back to system memory as needed.

This topic is closed to new replies.

Advertisement