/// <summary>
/// Adds a new render state to the stack. The passed matrix is prepended to the modelview matrix;
/// the alpha value is multiplied with the current alpha; the blend mode replaces the existing
/// mode (except 'BlendMode.Auto', which will cause the current mode to prevail).
/// </summary>
public void PushState(Matrix matrix, float alpha, uint blendMode)
{
RenderState previousState = _stateStackTop;
if (_stateStackSize == _stateStackIndex + 1)
{
_stateStack.Add(new RenderState());
_stateStackSize++;
}
_stateStackTop = _stateStack[++_stateStackIndex];
_stateStackTop.Setup(previousState, matrix, alpha, blendMode);
}