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.
  • 相关阅读:
    为系统添加语言包
    除掉任务栏上的隐藏小按钮
    叠加多个无线网络
    在win7中通过手机投放媒体
    开关WI-Fi显示列表
    hibernate(二)对象的三种状态、一级缓存、多对一、inverse、cascade
    hibernate(一)helloworld、api、事务、配置文件、映射文件
    SQL Server2019安装
    Windows server2012搭建FTP服务器
    Gradle的使用教程
  • 原文地址:https://www.cnblogs.com/wonderKK/p/2240300.html
Copyright © 2011-2022 走看看