Original Post
Hi,
I'm trying to build a render manager which handles the creation and rendering of mesh objects.
The render manager receives the list of mesh objects to draw from the scene manager.
This list is a collection of model instance objects which store a pointer to the mesh as well as the matrices etc to position it.
The thing I'm confused about is that after the render manager creates the mesh objects, should it then give this list to the scene manager so that model instances can copy the pointer to the mesh that they describe?
or should the model instance objects not hold a pointer to the mesh but simply store some id to describe which mesh they want to use and then the render manager can then use this to render the correct mesh?
The second option seems like it would make rendering slower as the render manager would have to sort through the list of meshes to determine which mesh in the list the model instance objects id was describing.
I've also read somebody talk about having a separate object to load the objects but I couldn't see how this would work as the graphics device is needed to load content and only the render manager can know about the graphics device.
thanks so much if somebody can clear this up for me!
I'm trying to build a render manager which handles the creation and rendering of mesh objects.
The render manager receives the list of mesh objects to draw from the scene manager.
This list is a collection of model instance objects which store a pointer to the mesh as well as the matrices etc to position it.
The thing I'm confused about is that after the render manager creates the mesh objects, should it then give this list to the scene manager so that model instances can copy the pointer to the mesh that they describe?
or should the model instance objects not hold a pointer to the mesh but simply store some id to describe which mesh they want to use and then the render manager can then use this to render the correct mesh?
The second option seems like it would make rendering slower as the render manager would have to sort through the list of meshes to determine which mesh in the list the model instance objects id was describing.
I've also read somebody talk about having a separate object to load the objects but I couldn't see how this would work as the graphics device is needed to load content and only the render manager can know about the graphics device.
thanks so much if somebody can clear this up for me!