I'm currently working with a mesh class so I can easily create mesh objects. Now I want a draw function in my mesh class so when ever i want draw it to the screen I can just call it without any fuss. But i have run in to a dilema and i need some insperation/ other persons perspectiv. To draw a mesh object there is alot of thing you need. You need blend states, rasterizer state, depth stencils ect (lets call them "tools" for futher reference).
Now there is a couple of diffrent ways you can go about it and i wanted your input to choose one.
You can have the object create their own tools. It requires more space, but you dont have to pass pointer around as much.
You create the tools in the GameEngine object and pass pointers to the tools in the draw function parameters. It looks messy and could cost alot of time, but it take up less space.
You create the tools in the GameEngine object and then store pointers to them in the mesh object. Now this save both time and space, however i got the feeling that this could get really messy and caus you alot of trouble easily.
I greatly appriceate any feedback or diffrent solutions. Thank in advance.