• Live Writer 测试


    尝试下图片

    cute_panda

    尝试下代码,好像要装插件才行,用了这个CodeFormatterPlugin2.0.0.1

    //--------------------------------------------------------------------------------------
    // This callback function is called by OnFrameRender
    // It performs HW Instancing
    //--------------------------------------------------------------------------------------
    void OnRenderHWInstancing( IDirect3DDevice9* pd3dDevice, double fTime, float fElapsedTime )
    {
    HRESULT hr;
    UINT iPass, cPasses;
    V( pd3dDevice->SetVertexDeclaration( g_pVertexDeclHardware ) );
    // Stream zero is our model, and its frequency is how we communicate the number of instances required,
    // which in this case is the total number of boxes
        V( pd3dDevice->SetStreamSource( 0, g_pVBBox, 0, sizeof( BOX_VERTEX ) ) );
    V( pd3dDevice->SetStreamSourceFreq( 0, D3DSTREAMSOURCE_INDEXEDDATA | g_NumBoxes ) );
    // Stream one is the Instancing buffer, so this advances to the next value
    // after each box instance has been drawn, so the divider is 1.
        V( pd3dDevice->SetStreamSource( 1, g_pVBInstanceData, 0, sizeof( BOX_INSTANCEDATA_POS ) ) );
    V( pd3dDevice->SetStreamSourceFreq( 1, D3DSTREAMSOURCE_INSTANCEDATA | 1ul ) );
    V( pd3dDevice->SetIndices( g_pIBBox ) );
    // Render the scene with this technique
    // as defined in the .fx file
        V( g_pEffect->SetTechnique( g_HandleTechnique ) );
    V( g_pEffect->Begin( &cPasses, 0 ) );
    for( iPass = 0; iPass < cPasses; iPass++ )
    {
    V( g_pEffect->BeginPass( iPass ) );
    // Render the boxes with the applied technique
            V( g_pEffect->SetTexture( g_HandleTexture, g_pBoxTexture ) );
    // The effect interface queues up the changes and performs them
    // with the CommitChanges call. You do not need to call CommitChanges if
    // you are not setting any parameters between the BeginPass and EndPass.
            V( g_pEffect->CommitChanges() );
    V( pd3dDevice->DrawIndexedPrimitive( D3DPT_TRIANGLELIST, 0, 0, 4 * 6, 0, 6 * 2 ) );
    V( g_pEffect->EndPass() );
    }
    V( g_pEffect->End() );
    V( pd3dDevice->SetStreamSourceFreq( 0, 1 ) );
    V( pd3dDevice->SetStreamSourceFreq( 1, 1 ) );
    }


  • 相关阅读:
    am335x gpio控制
    递归删除子目录下所有.la后缀文件
    linphone 在am335x的编译过程
    linphone 调试信息
    【POJ 3020】Antenna Placement(二分图匹配)
    【POJ 1062】昂贵的聘礼(最短路)
    【POJ 2485】Highways(Prim最小生成树)
    【Gym 100947E】Qwerty78 Trip(组合数取模/费马小定理)
    解决already defined in .obj 的问题(定义/声明的区别)
    C语言+SDL2 图形化编程
  • 原文地址:https://www.cnblogs.com/lai3d/p/1574177.html
Copyright © 2020-2023  润新知