共用方式為


Effect.CompileEffectFromSource Method

Note

This method is available only when developing for Windows.

Compiles an effect from a string containing the effect source code.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Syntax

public static CompiledEffect CompileEffectFromSource (
         string effectFileSource,
         CompilerMacro[] preprocessorDefines,
         CompilerIncludeHandler includeHandler,
         CompilerOptions options,
         TargetPlatform platform
)

Parameters

  • effectFileSource
    String containing the effect source code.
  • preprocessorDefines
    Describes preprocessor definitions used by an effect object.
  • includeHandler
    User-implemented interface to provide callbacks for #include directives during shader compilation.
  • options
    Compilation optimization options.
  • platform
    The target platform for the compilation.

Return Value

The compiled effect.

See Also

Reference

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

Platforms

Windows XP SP2, Windows Vista