/// <summary> /// Initializes a new instance of the <see cref="SpriteBatch" /> class. /// </summary> /// <param name="graphicsDevice">The graphics device.</param> /// <param name="bufferElementCount">The maximum number element that can be batched in one time.</param> /// <param name="batchCapacity">The batch capacity default to 64.</param> public SpriteBatch(GraphicsDevice graphicsDevice, int bufferElementCount = 1024, int batchCapacity = 64) : base(graphicsDevice, Bytecode, BytecodeSRgb, StaticQuadBufferInfo.CreateQuadBufferInfo("SpriteBatch.VertexIndexBuffer", true, bufferElementCount, batchCapacity), VertexPositionColorTextureSwizzle.Layout) { DefaultDepth = 200f; // For signed distance field thumbnail rendering textureSpriteFontEffect = new EffectInstance(new Effect(graphicsDevice, SpriteSignedDistanceFieldFontShader.Bytecode) { Name = "TextureSpriteFontEffect" }); }
/// <summary> /// Creates a new instance of <see cref="Sprite3DBatch"/>. /// </summary> /// <param name="device"></param> /// <param name="bufferElementCount">The maximum number element that can be batched in one time.</param> /// <param name="batchCapacity">The batch capacity default to 64.</param> public Sprite3DBatch(GraphicsDevice device, int bufferElementCount = 1024, int batchCapacity = 64) : base(device, SpriteBatch.Bytecode, SpriteBatch.BytecodeSRgb, StaticQuadBufferInfo.CreateQuadBufferInfo("Sprite3DBatch.VertexIndexBuffer", false, bufferElementCount, batchCapacity), VertexPositionColorTextureSwizzle.Layout) { }
/// <summary> /// Initializes a new instance of the <see cref="SpriteBatch" /> class. /// </summary> /// <param name="graphicsDevice">The graphics device.</param> /// <param name="bufferElementCount">The maximum number element that can be batched in one time.</param> /// <param name="batchCapacity">The batch capacity default to 64.</param> public SpriteBatch(GraphicsDevice graphicsDevice, int bufferElementCount = 1024, int batchCapacity = 64) : base(graphicsDevice, Bytecode, StaticQuadBufferInfo.CreateQuadBufferInfo("SpriteBatch.VertexIndexBuffer", true, bufferElementCount, batchCapacity), VertexPositionColorTextureSwizzle.Layout) { DefaultDepth = 200f; }