Exemplo n.º 1
0
        /// <summary>
        /// Draws a fullscreen quad with the specified effect and parameters.
        /// </summary>
        /// <param name="device">The device.</param>
        /// <param name="effect">The effect.</param>
        /// <param name="effectParameterCollectionGroup">The shader parameter updater.</param>
        /// <exception cref="System.ArgumentNullException">effect</exception>
        public static void DrawQuad(this GraphicsDevice device, Effect effect, EffectParameterCollectionGroup effectParameterCollectionGroup)
        {
            if (effect == null)
            {
                throw new ArgumentNullException("effect");
            }

            // Apply the effect
            effect.Apply(device, effectParameterCollectionGroup, false);

            // Draw a full screen quad
            device.DrawQuad();

            // Unapply
            effect.UnbindResources(device);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Draws a fullscreen quad with the specified effect and parameters.
        /// </summary>
        /// <param name="device">The device.</param>
        /// <param name="effect">The effect.</param>
        /// <param name="parameterCollections">The parameter collections.</param>
        /// <exception cref="System.ArgumentNullException">effect</exception>
        public static void DrawQuad <TList>(this GraphicsDevice device, Effect effect, TList parameterCollections) where TList : class, IEnumerable <ParameterCollection>
        {
            if (effect == null)
            {
                throw new ArgumentNullException("effect");
            }

            // Apply the effect
            effect.Apply(device, parameterCollections, false);

            // Draw a full screen quad
            device.DrawQuad();

            // Unapply
            effect.UnbindResources(device);
        }