public void Begin(SpriteSortMode sortMode, BlendState blendState, SamplerState samplerState, DepthStencilState depthStencilState, RasterizerState rasterizerState, Effect effect, Matrix transformMatrix) { if (blendState != null) { fixedBlendState = blendState.fixedBlendState; tintEffectMode = blendState.tintEffectMode; } else { fixedBlendState = FixedBlendState.AlphaBlend; tintEffectMode = TintEffectMode.Normal; } Debug.Assert(samplerState == null); Debug.Assert(depthStencilState == null); Debug.Assert(rasterizerState == null); if (effect != null) { throw new NotSupportedException("Effect on SpriteBatch is not supported by ExEnSilver"); } currentMatrix = transformMatrix; #region Matrix Check // Sprite.Transform assumes that the matrix is affine, check that: Debug.Assert(transformMatrix.M13 == 0f); Debug.Assert(transformMatrix.M14 == 0f); Debug.Assert(transformMatrix.M23 == 0f); Debug.Assert(transformMatrix.M23 == 0f); Debug.Assert(transformMatrix.M31 == 0f); Debug.Assert(transformMatrix.M32 == 0f); Debug.Assert(transformMatrix.M33 == 1f); Debug.Assert(transformMatrix.M34 == 0f); Debug.Assert(transformMatrix.M43 == 0f); Debug.Assert(transformMatrix.M44 == 1f); #endregion }
private BlendState(FixedBlendState fixedBlendState, TintEffectMode mode, string name) { this.fixedBlendState = fixedBlendState; this.tintEffectMode = mode; this.Name = name; }
public void Begin(SpriteSortMode sortMode, BlendState blendState, SamplerState samplerState, DepthStencilState depthStencilState, RasterizerState rasterizerState, Effect effect, Matrix transformMatrix) { if(blendState != null) { fixedBlendState = blendState.fixedBlendState; tintEffectMode = blendState.tintEffectMode; } else { fixedBlendState = FixedBlendState.AlphaBlend; tintEffectMode = TintEffectMode.Normal; } Debug.Assert(samplerState == null); Debug.Assert(depthStencilState == null); Debug.Assert(rasterizerState == null); if(effect != null) throw new NotSupportedException("Effect on SpriteBatch is not supported by ExEnSilver"); currentMatrix = transformMatrix; #region Matrix Check // Sprite.Transform assumes that the matrix is affine, check that: Debug.Assert(transformMatrix.M13 == 0f); Debug.Assert(transformMatrix.M14 == 0f); Debug.Assert(transformMatrix.M23 == 0f); Debug.Assert(transformMatrix.M23 == 0f); Debug.Assert(transformMatrix.M31 == 0f); Debug.Assert(transformMatrix.M32 == 0f); Debug.Assert(transformMatrix.M33 == 1f); Debug.Assert(transformMatrix.M34 == 0f); Debug.Assert(transformMatrix.M43 == 0f); Debug.Assert(transformMatrix.M44 == 1f); #endregion }