Rendering multiple textures as 1 sprite?

Started by
1 comment, last by Toolmaker 19 years, 5 months ago
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

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? :)
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

This topic is closed to new replies.

Advertisement