本文整理汇总了C++中LPDIRECT3DDEVICE7::DrawIndexedPrimitiveVB方法的典型用法代码示例。如果您正苦于以下问题:C++ LPDIRECT3DDEVICE7::DrawIndexedPrimitiveVB方法的具体用法?C++ LPDIRECT3DDEVICE7::DrawIndexedPrimitiveVB怎么用?C++ LPDIRECT3DDEVICE7::DrawIndexedPrimitiveVB使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LPDIRECT3DDEVICE7
的用法示例。
在下文中一共展示了LPDIRECT3DDEVICE7::DrawIndexedPrimitiveVB方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DrawUI
void CGras::DrawUI(LPDIRECT3DDEVICE7 lpDevice)
{
if (lpVertices==NULL)return;
if (game->lpTexture[40]==NULL)
{ // Gras Textur nachladen
game->lpTexture[40]=CreateTextureFromResource(lpDevice,game->lpDD,NULL,"grass.bmp",4,FALSE,TRUE);
MakeTransparent(game->lpTexture[40],FALSE); // Gras
}
lpDevice->SetRenderState(D3DRENDERSTATE_LIGHTING,FALSE);
DWORD old;
lpDevice->GetRenderState(D3DRENDERSTATE_CULLMODE,&old);
lpDevice->SetRenderState(D3DRENDERSTATE_CULLMODE,D3DCULL_NONE);
if (Config.alpha)
{
lpDevice->SetTextureStageState(0,D3DTSS_ALPHAARG1,D3DTA_TEXTURE);
lpDevice->SetRenderState(D3DRENDERSTATE_ALPHATESTENABLE,TRUE);
lpDevice->SetRenderState(D3DRENDERSTATE_ALPHAREF,192);
lpDevice->SetRenderState(D3DRENDERSTATE_ALPHAFUNC,D3DCMP_GREATEREQUAL);
}
lpDevice->SetTexture(0,game->lpTexture[40]);
D3DMATRIX m;
D3DUtil_SetIdentityMatrix(m);
lpDevice->SetTransform(D3DTRANSFORMSTATE_WORLD,&m);
for (int i=0;i<vertexbuffers;i++)
lpDevice->DrawIndexedPrimitiveVB(D3DPT_TRIANGLELIST,lpVertices[i],0,vertexnum[i],Indices,vertexnum[i]/4*6,0);
lpDevice->SetRenderState(D3DRENDERSTATE_ALPHATESTENABLE,0);
lpDevice->SetRenderState(D3DRENDERSTATE_LIGHTING,TRUE);
lpDevice->SetRenderState(D3DRENDERSTATE_CULLMODE,old);
}
示例2: wDrawIndexedPrimitiveVB
/// <summary>
/// <c>wDrawIndexedPrimitiveVB</c>
/// </summary>
/// <remarks>
/// </remarks>
/// <param name="d3dDevice7"></param>
/// <param name="d3dptPrimitiveType"></param>
/// <param name="lpd3dVertexBuffer"></param>
/// <param name="dwStartVertex"></param>
/// <param name="dwNumVertices"></param>
/// <param name="lpwIndices"></param>
/// <param name="dwIndexCount"></param>
/// <param name="dwFlags"></param>
/// <returns></returns>
HRESULT __stdcall wDrawIndexedPrimitiveVB(
LPDIRECT3DDEVICE7 d3dDevice7, D3DPRIMITIVETYPE d3dptPrimitiveType,
LPDIRECT3DVERTEXBUFFER7 lpd3dVertexBuffer, ULONG dwStartVertex,
ULONG dwNumVertices, PUSHORT lpwIndices, ULONG dwIndexCount, ULONG dwFlags)
{
LPDIRECT3DVERTEXBUFFER7 pd3dVertexBufferUsed;
PSTR pszErrorMessage;
HRESULT hResult;
InternalFunctionSpew("GameOS_Direct3D", "DrawIndexedPrimitiveVB(0x%x)", lpd3dVertexBuffer);
if (g_pGetDXVB)
{
pd3dVertexBufferUsed = g_pGetDXVB(lpd3dVertexBuffer, d3dDevice7);
}
else
{
pd3dVertexBufferUsed = lpd3dVertexBuffer;
}
hResult = d3dDevice7->DrawIndexedPrimitiveVB(
d3dptPrimitiveType,
pd3dVertexBufferUsed,
dwStartVertex,
dwNumVertices,
lpwIndices,
dwIndexCount,
dwFlags);
if (FAILED(hResult))
{
if ( hResult != DDERR_SURFACELOST)
{
pszErrorMessage = ErrorNumberToMessage(hResult);
if ( InternalFunctionPause(
"FAILED (0x%x - %s) - DrawIndexedPrimitiveVB(0x%x)",
hResult,
pszErrorMessage,
lpd3dVertexBuffer) )
ENTER_DEBUGGER;
}
}
return hResult;
}