CreateVertexBuffer和CreateIndexBuffer

CreateVertexBuffer的形参说明

HRESULT CreateVertexBuffer(
  UINT Length,
  DWORD Usage,
  DWORD FVF,
  D3DPOOL Pool,
  IDirect3DVertexBuffer9** ppVertexBuffer,
  HANDLE* pSharedHandle
);
­
length:
指定缓冲区的大小,以字节为单位。

Usage:
指定顶点缓冲区的属性,可以设置成0:
FVF:
这个就用到了我们上面创建的灵活顶点格式

Pool:
指定顶点缓冲区的内存类型。我们采用的是D3DPOOL_DEFAULT,意思是顶点缓冲区尽可能存在显存中。其他参数详细请参见SDK文档。
ppVertexBuffer:

自己定义的IDirect3DVertexBuffer9的指针
pSharedHandle:
它是一个保留的参数可以设置为NULL。

 

 

IDirect3DDevice9::CreateIndexBuffer

Creates an index buffer.

HRESULT CreateIndexBuffer( UINT Length,定点缓存长度 DWORD Usage,指定关于如何使用顶点缓存的一些附加属性 D3DFORMAT Format,指定索引大小 D3DPOOL Pool,内存池 IDirect3DIndexBuffer9** ppIndexBuffer,接收索引缓存的指针 HANDLE* pSharedHandle ); 
Parameters
Length
[in] Size of the index buffer, in bytes.
Usage
[in] Usage can be 0, which indicates no usage value. However, if usage is desired, use a combination of one or more D3DUSAGE constants. It is good practice to match the usage parameter in CreateIndexBuffer with the behavior flags in CreateDevice. For more information, see Remarks.
Format
[in] Member of the D3DFORMATenumerated type, describing the format of the index buffer. For more information, see Remarks. The valid settings are the following:
D3DFMT_INDEX16
Indices are 16 bits each.
D3DFMT_INDEX32
Indices are 32 bits each.
Pool
[in] Member of the D3DPOOLenumerated type, describing a valid memory class into which to place the resource.
ppIndexBuffer
[out, retval] Address of a pointer to an IDirect3DIndexBuffer9interface, representing the created index buffer resource.
pSharedHandle
[in] Reserved. Set this parameter to NULL.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值