//primitives public virtual void begin(IRenderTarget target, GLSortMode mode) { if (_begin) { throw new InvalidOperationException("You must call end before you can call begin again."); } if (_stateStack.Count > 0) { throw new InvalidOperationException("State stack was not empty."); } if (_clipStack.Count > 0) { throw new InvalidOperationException("Clipping stack was not empty."); } if (_effectStack.Count > 0) { throw new InvalidOperationException("Effect stack was not empty."); } _target = target; _begin = true; _sortMode = mode; _renderableIndex = 0; _clipping = AxisAlignedBox2.Null; _effect = null; //_currentMatrix = Matrix3.Identity; _state = GLState.empty; _target.enable(); //check other settings }