/// <summary> /// Creates a new instance of <see cref="UIBatch"/>. /// </summary> /// <param name="device">A valid instance of <see cref="GraphicsDevice"/>.</param> public UIBatch(GraphicsDevice device) : base(device, UIEffect.Bytecode, UIEffect.BytecodeSRgb, ResourceBufferInfo.CreateDynamicIndexBufferInfo("UIBatch.VertexIndexBuffers", MaxIndicesCount, MaxVerticesCount), VertexPositionColorTextureSwizzle.Layout) { // Create a 1x1 pixel white texture whiteTexture = GraphicsDevice.GetSharedWhiteTexture(); }
/// <summary> /// Creates a new instance of <see cref="UIBatch"/>. /// </summary> /// <param name="device">A valid instance of <see cref="GraphicsDevice"/>.</param> public UIBatch(GraphicsDevice device) : base(device, UIEffect.Bytecode, ResourceBufferInfo.CreateDynamicIndexBufferInfo("UIBatch.VertexIndexBuffers", MaxIndicesCount, MaxVerticesCount), VertexPositionColorTextureSwizzle.Layout) { // Create the two ui effects uiSeparateAlphaEffect = new Effect(GraphicsDevice, UIEffectSeparateAlpha.Bytecode) { Name = "SeparatedAlphaBatchEffect" }; uiSeparateAlphaParameterCollectionGroup = new EffectParameterCollectionGroup(device, uiSeparateAlphaEffect, new[] { Parameters }); // Create a 1x1 pixel white texture whiteTexture = GraphicsDevice.GetSharedWhiteTexture(); }