I have just recently begun playing around with XNA and couldn’t find anything on the web regarding this question. Is there a way to tell if SpriteBatch.Begin (and conversely End) has been called on a particular SpriteBatch object?
At the moment, I am using only one essentially global SpriteBatch object for the system, mainly because that seems to be the preferred method from the articles I have been reading. I’m assuming that creating a SpriteBatch instance for each object would cause too much overhead. Anyways, I am having problems with keeping SpriteBatch.Begin/End synchronized. In particular when drawing objects can contain other drawing objects. If I could test whether Begin/End has been called then my problems go away. I suppose I could try something like subclassing the SpriteBatch class but it seems to me like this operation is so basic that there has to be a built in way to tell. I just haven’t been able to figure out how.
Thanks for any insight you can provide!