Sign in to follow this  
Toolmaker

Rendering multiple textures as 1 sprite?

Recommended Posts

Toolmaker    967
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
Zahlman    1682
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
Toolmaker    967
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this