Original Post
So a little backstory.. I was having problems with class relationships and such, trying to keep my code clean. The topic can be found here. I also came across someone else with a similar problem here. So I borrowed a bit of an idea from Noggs:
Then I did what all half decent software developers do, I tried to expand on it:

I posted this in a new thread as I forsee there will be some problems with the concept.. Namely:
Because I've never tried that before.. who knows. So anyway the point of the post.. I have a few questions: How expensive will the virtual calls be because of the IRenderable interface and dynamic binding of the objects in the vector/stack? Will allocating new stacks and adding them to the vector be a costly operation? I've not worked too much with the STL I've usually rolled my own data structures but now I've become a bit more wise in not re-inventing the wheel - thats for the masochists out there, although I am glad I've done it at least for the experience and knowledge of how they work.
[Edited by - aqez on June 9, 2010 10:22:08 PM]
Quote:
Original post by Noggs
Do some research on a command buffer approach. Essentially you submit rendering jobs (e.g. "render mesh" including shader params, materials, etc) to a command queue. This queue can then be sorted and grouped by material etc to optimize the draw calls. One advantage of this approach is that multiple processes can submit to the queue at the same time.
Then I did what all half decent software developers do, I tried to expand on it:

I posted this in a new thread as I forsee there will be some problems with the concept.. Namely:
std::Vector<std::Stack<IRenderable*>> renderVector;Because I've never tried that before.. who knows. So anyway the point of the post.. I have a few questions: How expensive will the virtual calls be because of the IRenderable interface and dynamic binding of the objects in the vector/stack? Will allocating new stacks and adding them to the vector be a costly operation? I've not worked too much with the STL I've usually rolled my own data structures but now I've become a bit more wise in not re-inventing the wheel - thats for the masochists out there, although I am glad I've done it at least for the experience and knowledge of how they work.
[Edited by - aqez on June 9, 2010 10:22:08 PM]