• Advertisement
Sign in to follow this  

Rendering multiple textures as 1 sprite?

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

I'm kinda lost here, so getting some feedback is nice. The case is, I wrote a basic CD3DSprite class to handle most of my sprites stuffage. However, the problem arises that some game objects exist of 2 or more sprites. For instance, my asteroids ship has the ship sprite and a shield sprite(Which only gets drawn when shields > 0). As for now, I had to overload my render function, and render the object myself. Kinda sloppy if you ask me. Currently I just want to have a way of keeping the rendering encapsulated, so it will become easier to render multiple textures as a whole. However, I can't seem to come up with a proper design. What do you guys recommend? So far I thought of using a vector and placing all the textures into it, along with a little state, such as DISPLAY and HIDE and a modulationcolor. Any other ideas? Toolmaker

Share this post


Link to post
Share on other sites
Advertisement
All objects can be rendered by asking them what sprites they require, and rendering each of those sprites. Yes?

Assuming that works, does the light come on for ya? :)

Share this post


Link to post
Share on other sites
I'm takign the approach where each object renders itself. The objects hold a shared pointer that contain the sprite data.

I think I go with my vector approach and see how that works out. But first I'll commit my current code to the SVN repository(After reinstalling it. Reinstalled my server last week).

Toolmaker

Share this post


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

  • Advertisement