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.