one of my friends is on a Game Dev course in collage and his final exam is to make a game, hes allowed help on art assets and specific parts of an engine (in this case the graphics) so long as he designs and programs the player interaction and gameplay, So I'm writing him a Renderer (in XNA as its what he'd prefer to use)
The game will essentially be a vertical scrolling bullet-hell shooter, that said efficient drawing of multiple similar units is a must, so I've turned to hardware instancing but I'm a bit hesitant to continue to approach it the way I that I have.
I've set up a basic entity / component system to build around. The DrawComponents on creation register themselves with the DrawManager, which then sorts them via the model and texture they reference. When drawing time comes around it checks if there are the same number of instances as the last frame or if there is an instance buffer at all.
if there is not the same number of instances or there isnt a buffer then a new DynamicVertexBuffer is made and filled up (if there was a buffer it is disposed before doing this), if there was a suitable buffer then its data is simple regathered and set (for instances which may have moved or rotated or whatever).
It feels a bit dirty creating a new buffer whenever I need it resized but there doesn't seem to be a way to resize it. I'm not getting any performance issues I'm just wondering if there might be a preferred way to approach hardware instancing for objects which may or may not exist consistently?
Thanks in Advanced,