本文整理汇总了C++中LPDIRECT3DDEVICE7::Clear方法的典型用法代码示例。如果您正苦于以下问题:C++ LPDIRECT3DDEVICE7::Clear方法的具体用法?C++ LPDIRECT3DDEVICE7::Clear怎么用?C++ LPDIRECT3DDEVICE7::Clear使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LPDIRECT3DDEVICE7
的用法示例。
在下文中一共展示了LPDIRECT3DDEVICE7::Clear方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: wClear
/// <summary>
/// <c>wClear</c>
/// </summary>
/// <remarks>
/// </remarks>
/// <param name="d3dDevice7"></param>
/// <param name="dwCount"></param>
/// <param name="lpRects"></param>
/// <param name="dwFlags"></param>
/// <param name="dwColor"></param>
/// <param name="dvZ"></param>
/// <param name="dwStencil"></param>
/// <returns></returns>
HRESULT __stdcall wClear(
LPDIRECT3DDEVICE7 d3dDevice7, ULONG dwCount, LPD3DRECT lpRects, ULONG dwFlags,
ULONG dwColor, D3DVALUE dvZ, ULONG dwStencil)
{
PSTR pszClearArea;
PSTR pszErrorMessage;
HRESULT hResult;
pszClearArea = GetClearArea(dwCount, lpRects, dwFlags);
InternalFunctionSpew("GameOS_Direct3D", "Clear(%s)", pszClearArea);
hResult = d3dDevice7->Clear(
dwCount,
lpRects,
dwFlags,
dwColor,
dvZ,
dwStencil);
if (FAILED(hResult))
{
if ( hResult != DDERR_SURFACELOST)
{
pszClearArea = GetClearArea(dwCount, lpRects, dwFlags);
pszErrorMessage = ErrorNumberToMessage(hResult);
if ( InternalFunctionPause("FAILED (0x%x - %s) - Clear(%s)", hResult, pszErrorMessage, pszClearArea) )
ENTER_DEBUGGER;
}
}
return hResult;
}
示例2: Prog_Loop
//////////////////////////////////////////////////////////////////////////////
//MAIN GAME LOOP
//////////////////////////////////////////////////////////////////////////////
void Prog_Loop()
{
//set up the vertex positions
vert[0].sx=(float) (cos(angle)*240.0+320.0);
vert[0].sy=(float) (sin(angle)*240.0+240.0);
vert[0].sz=(float) (sin(angle)*240.0+240.0);
vert[1].sx=(float) (cos(angle+PI/2)*240.0+320.0);
vert[1].sy=(float) (sin(angle+PI/2)*240.0+240.0);
vert[1].sz=(float) (sin(angle+PI/2)*240.0+240.0);
vert[2].sx=(float) (cos(angle-PI/2)*240.0+320.0);
vert[2].sy=(float) (sin(angle-PI/2)*240.0+240.0);
vert[2].sz=(float) (sin(angle-PI/2)*240.0+240.0);
vert[3].sx=(float) (cos(angle-PI)*240.0+320.0);
vert[3].sy=(float) (sin(angle-PI)*240.0+240.0);
vert[3].sz=(float) (sin(angle-PI)*240.0+240.0);
//add to the angle for next time
angle+=PI/90;
//clear the viewport to black
lpd3ddev->Clear(0,NULL,D3DCLEAR_TARGET,0,0,0);
//start the scene
lpd3ddev->BeginScene();
//draw the triangle
lpd3ddev->DrawPrimitive(D3DPT_TRIANGLESTRIP,D3DFVF_TLVERTEX,vert,4,0);
//end the scene
lpd3ddev->EndScene();
//flip
lpddsPrime->Flip(NULL,DDFLIP_WAIT);
}