Пример #1
0
        /// <summary>
        /// Adds a layer to the effect renderer.
        /// </summary>
        /// <param name="blendState">The layer's blend state.</param>
        /// <param name="effect">The layer's effect</param>
        /// <param name="entity">The layer's entity.</param>
        public void AddLayer(BlendState blendState, Effect effect, Texture2D entity)
        {
            RenderLayer layer = new RenderLayer(entity, blendState);

            layer.Effect = effect;
            layers.Add(layer);
        }
Пример #2
0
        /// <summary>
        /// Adds a layer to the effect renderer.
        /// </summary>
        /// <param name="blendState">The layer's blend state.</param>
        /// <param name="effect">The layer's effect</param>
        public void AddLayer(BlendState blendState, Effect effect)
        {
            RenderLayer layer = new RenderLayer(device, blendState);

            layer.Effect = effect;
            layers.Add(layer);
        }
Пример #3
0
        /// <summary>
        /// Renders all of the layers in the layer queue.
        /// </summary>
        /// <param name="clearColor">The color to clear the graphics device to.</param>
        public void RenderAll(Color clearColor)
        {
            // clear graphics device
            device.SetRenderTarget(null);
            device.Clear(clearColor);

            // render each layer that was drawn to
            spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend);
            for (int i = 0; i < renderQueue.Count; ++i)
            {
                RenderLayer layer = renderQueue[i];
                spriteBatch.Draw(layer.GetTexture(), layer.Destination, Color.White);
            }
            spriteBatch.End();

            // clear out our render queue
            renderQueue.Clear();
        }
Пример #4
0
 /// <summary>
 /// Adds a layer to the effect renderer.
 /// </summary>
 /// <param name="blendState">The layer's blend state.</param>
 /// <param name="effect">The layer's effect</param>
 /// <param name="entity">The layer's entity.</param>
 public void AddLayer(BlendState blendState, Effect effect, Texture2D entity)
 {
     RenderLayer layer = new RenderLayer(entity, blendState);
     layer.Effect = effect;
     layers.Add(layer);
 }
Пример #5
0
 /// <summary>
 /// Adds a layer to the effect renderer.
 /// </summary>
 /// <param name="blendState">The layer's blend state.</param>
 /// <param name="effect">The layer's effect</param>
 public void AddLayer(BlendState blendState, Effect effect)
 {
     RenderLayer layer = new RenderLayer(device, blendState);
     layer.Effect = effect;
     layers.Add(layer);
 }