原文:Assigns a texture to a stage for a device.
译文:分配一个纹理到一个设备层
语法(Syntax)
HRESULT SetTexture(
DWORD Stage, IDirect3DBaseTexture9 *pTexture );
参数(Parameters)
Stage
- [in] Stage identifier to which the texture is set. Stage identifiers are zero-based. The maximum number of stages supported is determined from two caps: D3DCAPS.MaxSimultaneousTextureStages and D3DCAPS9.MaxTextureBlendingStages.
Displacement Mapping uses a special stage index, called D3DDDMAPSAMPLER.
Vertex Textures use a special stage index called D3DVERTEXTEXTURESAMPLER.
[in(用户给出参数的值)]标志要设置纹理的设备层,从0开始.支持的最大设备层数由两个标志决定:
D3DCAPS.MaxSimultaneousTextureStages 和 D3DCAPS9.MaxTextureBlendingStages.
位移映射 使用特殊的层索引,称为 D3DDDMAPSAMPLER
顶点文理 使用特殊的层索引,称为 D3DVERTEXTEXTURESAMPLER
pTexture
- [in] Pointer to an IDirect3DBaseTexture9 interface, representing the texture being set.
- IDirect3DBaseTexture9的指针,代表要设置的纹理
返回值(Return Value)
If the method succeeds, the return value is D3D_OK.
If the method fails, the return value can be D3DERR_INVALIDCALL.
如果该方法成功,返回值是D3D_OK
如果该方法失败,返回值可能是D3DERR_INVALICALL
备注(Remarks)
IDirect3DDevice9::SetTexture is not allowed if the texture is created with a pool type of D3DPOOL_SCRATCH. IDirect3DDevice9::SetTexture is not allowed with a pool type of D3DPOOL_SYSTEMMEM texture unless DevCaps is set with D3DDEVCAPS_TEXTURESYSTEMMEMORY.
IDirect3DDevice9::SetTexture 不允许(调用)若文理是以D3DPOOL_SCRATCH类型池创建的话.
同样D3DPOOL_SYSTEMMEM池类型创建的纹理也不允许,除非DevCaps设置为D3DDEVCAPS_TEXTURESYSTEMMEMORY.