zoukankan      html  css  js  c++  java
  • 02、创建顶点缓冲

    利用Vertex绘制三角型

    玩家对输入内容的反映速度要求很高,一旦反映慢了就会影响视觉感受。
    消息处之后直接调用Render()函数, 充分利用闲置CPU进行图形绘制。   
    while (msg.message != WM_QUIT)
    {
      if (PeekMessage(&msg, NULL, 0U0U, PM_REMOVE))
     {
        TranslateMessage(&msg);
         DispatchMessage(&msg);
       }

      else
       Render();
    }


    使用FVF(自由顶点格式)绘制三角。其实格式就是D3D的顺序格式定义
    struct CUSTOMVERTEX
    {
      FLOAT x, y, z, rhw;
      DWORD color;
    }
    ;
    #define D3DFVF_CUSTOMVERTEX (D3DFVF_XYZRHW | D3DFVF_DIFFUSE)

    如果把把顺序换位个回出现问题
    struct CUSTOMVERTEX
    {
      FLOAT rhw, x, y, z;
      DWORD color;
    }
    ;
    #define D3DFVF_CUSTOMVERTEX (D3DFVF_XYZRHW | D3DFVF_DIFFUSE)








    创建顶点缓冲 Code
  • 相关阅读:
    统计代码测试覆盖率-Python
    第一篇
    svn统计代码行数(增量)
    android多渠道打包
    解决Error:All flavors must now belong to a named flavor dimension. Learn more at...
    Cannot set the value of read-only property 'outputFile' for ApkVariantOutputImpl_Decorated{...
    解决Android编译时出现aapt.exe finished with non-zero exit value 1
    自定义Json解析工具
    Process 'command 'D:jdk8jdkinjava.exe'' finished with non-zero exit value 2
    C:Program FilesJavajdk1.7.0_79injava.exe'' finished with non-zero exit value 1
  • 原文地址:https://www.cnblogs.com/gleam/p/1162903.html
Copyright © 2011-2022 走看看