`
yiyeqinghuasoon
  • 浏览: 644937 次
文章分类
社区版块
存档分类
最新评论

IDirect3DDevice9::SetTexture 方法

 
阅读更多

原文:Assigns a texture to a stage for a device.

译文:分配一个纹理到一个设备层

语法(Syntax)

HRESULTSetTexture(

DWORDStage, 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.

分享到:
评论

相关推荐

    ColorFill_D3D11Texture2D.rar

    对ID3D11Texture2D实现颜色填充(对D3D11实现IDirect3DDevice9::ColorFill效果) 运行环境VS2019 编Rlease x86版本

    拉伸IDirect3DSurface9

    我如何将一个IDirect3DSurface9拉伸到另一个?功能IDirect3DDevice9 :: StretchRect无法在屏幕外的表面上使用。

    D3D游戏程序设计入门

    Direct3D 的IDirect3DDevice9::Clear 方法。图1.1 显示了应用程序、Direct3D 和图形设备之间的关 系。 图1.1 图1.1中Direct3D所表示的是Direct3D中已定义的,供程序员使用的Direct3D接口和函数的集合。 这些接口和...

    E_D3D9 Beta3模块源码

    资源介绍:。以下更改相对于 E_D3D9 1.0正式版:。1:[!]"E_D3D9" 改名为“E_...9:[+]IDirect3DDevice9Video。10:[+]IDirect3DAuthenticatedChannel9。11:[+]IDirect3DCryptoSession9。12:[+]IDirectInput8。13:[+]IDi

    D3D8 hook 游戏屏幕写入文字

    可以在D3D8的游戏中写入自己的文字。hook 了IDirect3DDevice8::EndScene 来实现屏幕写字。希望对这方面感兴趣的童鞋有所帮助。 该示例由PowerBasic编写,很容易读懂。

    用Direct3D设计淡入淡出的效果(演示程序)

    在纹理和顶点混合的初期,我们可以调用IDirect3DDevice9::SetTextureStageState函数来进行操作。下面是这个函数的声明: HRESULT SetTextureStageState( DWORD Stage, D3DTEXTURESTAGESTATETYPE Type, DWORD ...

    DIRECTX.9.0.3D游戏开发编程基础.pdf

    3.4.2 IDirect3DDevice9::DrawIndexedPrimitive 3.4.3 Begin/End Scene 3.5 D3DX几何体 3.6 例程:三角形、立方体、茶壶、D3DXCreate* 3.7 小结 第4章 颜色 4.1 颜色表示 4.2 顶点颜色 4.3 着色 4.4 例程:...

    006-【直播】D3D绘制一个圆(郁金香).c

    d3d9 画平面圆 void DrawCircle( IDirect3DDevice9* pd3dDevice, int xCenter, int yCenter, int nRadius, D3DCOLOR FrameColor)

    Direct3D中实现图元的鼠标拾取

    Direct3D中实现图元的鼠标拾取

    易语言D3D模块源码

    9:[+]IDirect3DDevice9Video 10:[+]IDirect3DAuthenticatedChannel9 11:[+]IDirect3DCryptoSession9 12:[+]IDirectInput8 13:[+]IDirectInputDevice8 其中DIDATAFORMAT参考了Delphi的JEDI后处理的.若有更好的方法...

    idirect卫星通信系统 产品及技术优势介绍

    3. iDirect 全球网络管理系统(NMS) 4. iDirect 虚拟网络运营商(VNO)、用户网络检察员(CNO) 5. iDirect 与移动通信 6. iDirect 系统其它方面的优势 6.1 小站安装容易 6.2 Rx CRC 关联 6.3 自动波束(网络)切换...

    Introduction to 3D Game Programming with DirectX 9.0

    3.4.2 IDirect3DDevice9::DrawIndexedPrimitive 80 3.4.3 Begin/End Scene 81 3.5 D3DX几何体 81 3.6 例程:三角形、立方体、茶壶、D3DXCreate* 83 3.7 小结 87 第4章 颜色 89 4.1 颜色表示 89 4.2 顶点颜色...

    d3d8to9:D3D8伪驱动程序,可将API调用和字节码着色器转换为等效的D3D9

    关于某些源代码文件包含的内容的快速概述: 文件描述 主要D3D8入口点Direct3DCreate8定义 IDirect3D8接口的实现,包括设备创建 IDirect3DDevice8接口的实现,包括着色器转换 否则将在d3d8.h中找到所有使用过的D3D8...

    易语言-E_D3D9 Beta3模块

    9:[+]IDirect3DDevice9Video 10:[+]IDirect3DAuthenticatedChannel9 11:[+]IDirect3DCryptoSession9 12:[+]IDirectInput8 13:[+]IDirectInputDevice8 其中DIDATAFORMAT参考了Delphi的JEDI后处理的.若有更好的方法...

    directx 3d 实例

    IDirect3DDevice9 *g_pD3DDevice = NULL; // Sky vertex structure, fvf, vertex buffer, and texture typedef struct { float x, y, z, rhw; float u, v; } sSkyVertex; #define SKYFVF (D3DFVF_XYZRHW | D3DFVF...

    C/C++文档.chm

    2011年2月7日 - 顶点着色器例子——Diffuse Lighting(《龙书》) #include "d3dUtility.h" // // Globals // IDirect3DDevice9* Device = 0; const int Width = 640;

    NVIDIA Cg 2.2 February 2010

    IDirect3DDevice9 pDev 然后Initialization CG(参考initCG函数定义) Step2 1:注册CgFX状态 从固定管线接管纹理状态 根据cgfx文件名创建Effect对象 cgD3D9RegisterStates myCgContext ; CGcontext myCgContext ...

    Hook D3D9.dll代码

    Hook D3d9.dll 中的IDirect3D9 IDirect3DTexture9等接口

    directx3d hlslSurface Effects.

    directx hlsl Surface Effects.this effect is easy sample.

Global site tag (gtag.js) - Google Analytics