Example #1
0
        public void Begin(ISpriteShaderProgram shader)
        {
            if (shader == null)
                throw new ArgumentNullException("shader");

            if (this.drawInProgress)
                throw new InvalidOperationException("Draw already in progress.");

            this.shader = shader;

            this.graphics.BlendEnabled = true;
            this.graphics.SourceBlendFactor = SourceBlendFactor.SourceAlpha;
            this.graphics.DestinationBlendFactor = DestinationBlendFactor.OneMinusSourceAlpha;

            this.graphics.DepthBufferEnabled = true;
            this.graphics.DepthFunction = DepthFunction.LessThanOrEqual;

            this.drawInProgress = true;
        }
Example #2
0
        public void End()
        {
            this.EnsureDrawInProgress();

            this.Flush();

            this.shader = null;
            this.drawInProgress = false;
        }