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.
  • 相关阅读:
    Ajax调用asp.net后台代码
    浅谈Swift集合类型
    强大的swift字符串
    swift的运算符
    Swift的基本类型和流程控制
    Router和History (路由控制)-backbone
    jq里attr和prop的区别
    文本超出盒子的内容用省略号代替
    利用html5中的localStorage获取网页被访问的次数
    html5的本地存储localStorage和sessionStorage
  • 原文地址:https://www.cnblogs.com/wonderKK/p/2240300.html
Copyright © 2011-2022 走看看