Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ SetRenderState()

void Microsoft.Xna.Framework.Graphics.SpriteBatch.SetRenderState ( )
inlineprivate

Definition at line 731 of file SpriteBatch.cs.

732 {
733 if (blendState != null)
734 {
735 _parent.BlendState = blendState;
736 }
737 else
738 {
739 _parent.BlendState = BlendState.AlphaBlend;
740 }
741 if (depthStencilState != null)
742 {
743 _parent.DepthStencilState = depthStencilState;
744 }
745 else
746 {
747 _parent.DepthStencilState = DepthStencilState.None;
748 }
749 if (rasterizerState != null)
750 {
751 _parent.RasterizerState = rasterizerState;
752 }
753 else
754 {
755 _parent.RasterizerState = RasterizerState.CullCounterClockwise;
756 }
757 if (samplerState != null)
758 {
760 }
761 else
762 {
763 _parent.SamplerStates[0] = SamplerState.LinearClamp;
764 }
765 Viewport viewport = _parent.Viewport;
766 float num = ((viewport.Width > 0) ? (1f / (float)viewport.Width) : 0f);
767 float num2 = ((viewport.Height > 0) ? (-1f / (float)viewport.Height) : 0f);
768 Matrix matrix = default(Matrix);
769 matrix.M11 = num * 2f;
770 matrix.M22 = num2 * 2f;
771 matrix.M33 = 1f;
772 matrix.M44 = 1f;
773 matrix.M41 = -1f;
774 matrix.M42 = 1f;
775 matrix.M41 -= num;
776 matrix.M42 -= num2;
780 }
static readonly BlendState AlphaBlend
Definition BlendState.cs:36
unsafe EffectTechnique CurrentTechnique
Definition Effect.cs:34
static readonly RasterizerState CullCounterClockwise

References Microsoft.Xna.Framework.Graphics.GraphicsResource._parent, Microsoft.Xna.Framework.Graphics.BlendState.AlphaBlend, Microsoft.Xna.Framework.Graphics.SpriteBatch.blendState, Microsoft.Xna.Framework.Graphics.RasterizerState.CullCounterClockwise, Microsoft.Xna.Framework.Graphics.Effect.CurrentTechnique, Microsoft.Xna.Framework.Graphics.SpriteBatch.depthStencilState, Microsoft.Xna.Framework.Graphics.SpriteBatch.effectMatrixTransform, Microsoft.Xna.Framework.Graphics.Viewport.Height, Microsoft.Xna.Framework.Graphics.SamplerState.LinearClamp, Microsoft.Xna.Framework.Graphics.DepthStencilState.None, Microsoft.Xna.Framework.Graphics.EffectTechnique.Passes, Microsoft.Xna.Framework.Graphics.SpriteBatch.rasterizerState, Microsoft.Xna.Framework.Graphics.SpriteBatch.samplerState, Microsoft.Xna.Framework.Graphics.GraphicsDevice.SamplerStates, Microsoft.Xna.Framework.Graphics.SpriteBatch.SetPlatformRenderState(), Microsoft.Xna.Framework.Graphics.EffectParameter.SetValue(), Microsoft.Xna.Framework.Graphics.SpriteBatch.spriteEffect, Microsoft.Xna.Framework.Graphics.SpriteBatch.transformMatrix, Microsoft.Xna.Framework.Graphics.GraphicsDevice.Viewport, and Microsoft.Xna.Framework.Graphics.Viewport.Width.

Referenced by Microsoft.Xna.Framework.Graphics.SpriteBatch.Begin(), and Microsoft.Xna.Framework.Graphics.SpriteBatch.End().