Jump to content
  • Advertisement

Archived

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

Isolier

DirectX Surface Management

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

Ok, I have two questions related to DX surface''s: First, in an RTS there are, of course, many little guys running around all over the place. My question is, should each of these guys have there own surface? Because if this is the case, it seems like this is a huge waste of memory. This is, however, is the way Andre Lamothe teaches in his books. Wouldn''t it be better to load each sprite into a surface, then each little guy who uses this sprite can just use that surface, rather than have its own? This leads me to my next question. To really save on memory, would it be better to load your sprite set from a bitmap and rather than splicing each sprite into its own surface, just put everthing into one surface and simply blit from that one surface? What do you guys do? Would doing it this way effect speed in any way? Thanks in advance.

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
I am curious about this too.

Share this post


Link to post
Share on other sites
You are correct on both questions..

For your second question, speed wise, it is probably better to load each sprite to its own surface. But putting everything on one surface isn''t really much slower. But it does save memory when it comes to storing the sprite..

Share this post


Link to post
Share on other sites
Put each sprite on its own surface.
That way a whole sprite can be in the video memory at a time and unused sprites can fall out of video memory at will.

I created a 2d engine in which every frame of every sprite was a separate surface. Blting was exceptionally fast. I don''t know about memory though. I designed it that way and it worked well. It may have been a little wasteful but oh well.

MCSE, MCSD, Sun Certified Java Programmer
Pimp Daddy ;)

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!