Share via


Effect.FromStream(Device,Stream,Include,String,ShaderFlags,EffectPool,String) Method (Microsoft.DirectX.Direct3D)

Creates an effect from an ASCII or binary effect description.

Definition

Visual Basic Public Shared Function FromStream( _
    ByVal device As Device, _
    ByVal data As StreamLeave Site, _
    ByVal includeFile As Include, _
    ByVal skipConstants As String, _
    ByVal flags As ShaderFlags, _
    ByVal pool As EffectPool, _
    ByRef compilationErrors As String _
) As Effect
C# public static Effect FromStream(
    Device device,
    StreamLeave Site data,
    Include includeFile,
    string skipConstants,
    ShaderFlags flags,
    EffectPool pool,
    out string compilationErrors
);
C++ public:
static EffectFromStream(
    Devicedevice,
    StreamLeave Sitedata,
    IncludeincludeFile,
    StringLeave SiteskipConstants,
    ShaderFlags flags,
    EffectPoolpool,
    [Out] StringLeave Site^% compilationErrors
);
JScript public static function FromStream(
    device : Device,
    data : StreamLeave Site,
    includeFile : Include,
    skipConstants : String,
    flags : ShaderFlags,
    pool : EffectPool,
    compilationErrors : String
) : Effect;

Parameters

device Microsoft.DirectX.Direct3D.Device
The Device that will create the effect.
data System.IO.Stream
A StreamLeave Site object that contains the data used to create the Effect.
includeFile Microsoft.DirectX.Direct3D.Include
Optional Include object to use for handling #include directives. If this value is null, #include directives are either honored when compiling from a file, or cause an error when compiled from a resource or memory.
skipConstants System.String
A string of effect parameters that will be ignored by the effect system. The string must be NULL terminated and needs to contain the name of each application-managed constant separated by a semicolon.
flags Microsoft.DirectX.Direct3D.ShaderFlags
One or more compile options identified by the ShaderFlags enumeration.
pool Microsoft.DirectX.Direct3D.EffectPool
An EffectPool object to use for shared parameters. If this value is null, no parameters are shared.
compilationErrors System.String
String that contains a listing of compilation errors.

Return Value

Microsoft.DirectX.Direct3D.Effect
An Effect that contains the compiled effect.

Remarks

Exceptions

InvalidCallException

The method call is invalid. For example, a method's parameter might contain an invalid value.

InvalidDataException

The data is invalid.

OutOfMemoryExceptionLeave Site

Microsoft Direct3D could not allocate sufficient memory to complete the call.

See Also