Jump to content
  • Advertisement
Sign in to follow this  
Erevis

Flyweight Resources and SDL

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

Hello all,

I need some insight on resource management when using SDL. First of all, my resource manager has the classic feature: request for a resource, if it exists return a handle to the existing resource else create the resouce - store it - and return a handle. The problem comes here: I have Surface resources but each sprite using a Surface may need to blit it to the screen with a different alpha value. If I change the Surface's alpha then the other sprites using the same surface will blit using that alpha. Changing alpha each time a sprite blits its' surface doesn't sound very appealing because it can cause a certain amount of overhead.

So, any suggestions?

Share this post


Link to post
Share on other sites
Advertisement
Sounds like you already know what to do and just don't want to because it might be slow. That sounds like the obvious, simplest answer to me so you should just try it and if afterwards you find it to be too slow, try something else. My bet is that it's not too slow at all and your time would be best spent doing the simplest thing here and moving on.

Share this post


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

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