zoukankan      html  css  js  c++  java
  • 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.
  • 相关阅读:
    21 情态动词
    20 动词的用法
    19 完成时/现在完成时和过去完成时的区别
    18 将来时
    17 一般过去时和过去进行时
    16 一般现在时和现在进行时
    15 There / Here be句型
    14 不定量表达法
    13 副词
    12 形容词
  • 原文地址:https://www.cnblogs.com/wonderKK/p/2240300.html
Copyright © 2011-2022 走看看