?/TD>
Microsoft DirectX 9.0

ID3DXEffect::Begin Method


Begins the application of the technique.

Syntax

HRESULT Begin(      

    UINT* pPasses,     DWORD Flags );

Parameters

pPasses
[out] Pointer to a value indicating the number of passes needed to render the current technique.
Flags
[in] DWORD that determines if state modified by an effect is saved and restored. The default value 0 specifies that ID3DXEffect::Begin and ID3DXEffect::End will save and restore all state modified by the effect (including pixel and vertex shader constants). This flag parameter can be set to one or both of the following flags.
  • D3DXFX_DONOTSAVESTATE - Device state is not saved and restored.
  • D3DXFX_DONOTSAVESHADERSTATE - Shader device state is not saved and restored.

Return Value

If the method succeeds, the return value is D3D_OK.

If the method fails, the return value can be one of the following values.

D3DERR_INVALIDCALLThe method call is invalid. For example, a method's parameter may have an invalid value.
D3DXERR_INVALIDDATAThe data is invalid.


Remarks

This method returns the number of passes needed to render the technique. The application must incrementally call ID3DXEffect::Pass for each pass before drawing the geometry to which the effect needs to be applied. After all passes are rendered, ID3DXEffect::End must be called.

See Also

ID3DXEffect::End, ID3DXEffect::Pass


© 2002 Microsoft Corporation. All rights reserved.