Bagikan melalui


Effect Constructor

Initializes a new instance of this class.

Overload List

Name Description
Effect (GraphicsDevice, Byte[], CompilerOptions, EffectPool) Initializes a new instance of this class from a compiled effect, specifying the compiled effect as a byte array.
Effect (GraphicsDevice, Effect) Initializes a new instance of this class, specifying the graphics device to associate with this effect and the effect to clone.
Effect (GraphicsDevice, Stream, CompilerOptions, EffectPool) Initializes a new instance of this class from a compiled effect, specifying the compiled effect as a stream.
Effect (GraphicsDevice, Stream, Int32, CompilerOptions, EffectPool) Initializes a new instance of this class from a compiled effect, specifying the compiled effect as a stream, as well as the number of bytes in the stream.
Effect (GraphicsDevice, String, CompilerOptions, EffectPool) Initializes a new instance of this class from a compiled effect, specifying the compiled effect by file name.

Tip

In most cases, it is preferrable to initialize a new instance of an effect using the ContentManager.Load<Effect> method rather than using the Effect constructors. For an example of initializing an effect with this method, please see How to: Create and Apply Custom Effects.

See Also

Tasks

How to: Create and Apply Custom Effects

Reference

Effect Class
Effect Members
Microsoft.Xna.Framework.Graphics Namespace