本文整理汇总了C++中LPDIRECT3DDEVICE8::DrawIndexedPrimitiveUP方法的典型用法代码示例。如果您正苦于以下问题:C++ LPDIRECT3DDEVICE8::DrawIndexedPrimitiveUP方法的具体用法?C++ LPDIRECT3DDEVICE8::DrawIndexedPrimitiveUP怎么用?C++ LPDIRECT3DDEVICE8::DrawIndexedPrimitiveUP使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LPDIRECT3DDEVICE8
的用法示例。
在下文中一共展示了LPDIRECT3DDEVICE8::DrawIndexedPrimitiveUP方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: max
void RageDisplay_D3D::DrawQuadStripInternal( const RageSpriteVertex v[], int iNumVerts )
{
// there isn't a quad strip primitive in D3D, so we have to fake it with indexed triangles
int iNumQuads = (iNumVerts-2)/2;
int iNumTriangles = iNumQuads*2;
int iNumIndices = iNumTriangles*3;
// make a temporary index buffer
static vector<uint16_t> vIndices;
unsigned uOldSize = vIndices.size();
unsigned uNewSize = max(uOldSize,(unsigned)iNumIndices);
vIndices.resize( uNewSize );
for( uint16_t i=(uint16_t)uOldSize/6; i<(uint16_t)iNumQuads; i++ )
{
vIndices[i*6+0] = i*2+0;
vIndices[i*6+1] = i*2+1;
vIndices[i*6+2] = i*2+2;
vIndices[i*6+3] = i*2+1;
vIndices[i*6+4] = i*2+2;
vIndices[i*6+5] = i*2+3;
}
g_pd3dDevice->SetVertexShader( D3DFVF_RageSpriteVertex );
SendCurrentMatrices();
g_pd3dDevice->DrawIndexedPrimitiveUP(
D3DPT_TRIANGLELIST, // PrimitiveType
0, // MinIndex
iNumVerts, // NumVertices
iNumTriangles, // PrimitiveCount,
&vIndices[0], // pIndexData,
D3DFMT_INDEX16, // IndexDataFormat,
v, // pVertexStreamZeroData,
sizeof(RageSpriteVertex) // VertexStreamZeroStride
);
}
示例2: Draw
void Draw( int iMeshIndex ) const
{
const MeshInfo& meshInfo = m_vMeshInfo[iMeshIndex];
g_pd3dDevice->SetVertexShader( D3DFVF_RageModelVertex );
g_pd3dDevice->DrawIndexedPrimitiveUP(
D3DPT_TRIANGLELIST, // PrimitiveType
meshInfo.iVertexStart, // MinIndex
meshInfo.iVertexCount, // NumVertices
meshInfo.iTriangleCount, // PrimitiveCount,
&m_vTriangles[0]+meshInfo.iTriangleStart,// pIndexData,
D3DFMT_INDEX16, // IndexDataFormat,
&m_vVertex[0], // pVertexStreamZeroData,
sizeof(m_vVertex[0]) // VertexStreamZeroStride
);
}