In my game, I have a base Note class, and various subclasses of Note. In addition, I have a NoteCollection class which contains a collection of these Note objects and draws them to the screen. Normally, I'd just do something like this in NoteCollection:
public override Draw(GameTime gametime) {
...
spriteBatch.Begin(...);
foreach(Note n in notes)
n.Draw(gameTime);
spriteBatch.End();
...
}
However, some of these Note subclasses also need to draw 3D primitives in their Draw() methods. I imagine setting vertex buffers in the middle of a SpriteBatch Begin()/End() block isn't a good idea (I've tried it, anyways). What would be nice would be a SpriteBatch.Pause() method that would save the state of the SpriteBatch, and then you could resume drawing your sprites with, say, a SpriteBatch.Resume(). But alas, there's no much methods.
In short, is there any way to go about this? I'd rather not call SpriteBatch.End()/Begin() from each Note.Draw(), as it'd be really slow and I wouldn't necessarily know what parameters the original outside Begin() was called with.
EDIT: Even though I'm using 3D primitives, my game is still in 2D. All of the Z-coordinates of my vertices are 0.