本文整理汇总了C++中LPDIRECT3DDEVICE7类的典型用法代码示例。如果您正苦于以下问题:C++ LPDIRECT3DDEVICE7类的具体用法?C++ LPDIRECT3DDEVICE7怎么用?C++ LPDIRECT3DDEVICE7使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了LPDIRECT3DDEVICE7类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Draw
void CGolfer::Draw(LPDIRECT3DDEVICE7 lpDevice)
{
if ((parent==NULL)&&(!box->IsVisible()))return;
D3DMATRIX m=BerechneSchlag();
lpDevice->SetTexture(0,NULL);
lpDevice->SetTransform(D3DTRANSFORMSTATE_WORLD,&m);
mesh->Render(lpDevice,FALSE);
}
示例2: Draw
void CDrescher::Draw(LPDIRECT3DDEVICE7 lpDevice)
{
if (!box2->IsVisible())return;
lpDevice->SetTexture(0,NULL);
D3DMATRIX matrix,m;
D3DUtil_SetTranslateMatrix(matrix,pos.x,pos.y+hoehe,pos.z);
{ // Mähdrescher gemäß Steigung kippen
D3DUtil_SetRotateYMatrix(m,beta);
D3DMath_MatrixMultiply(matrix,m,matrix);
D3DUtil_SetRotateXMatrix(m,alpha);
D3DMath_MatrixMultiply(matrix,m,matrix);
D3DUtil_SetRotateYMatrix(m,-beta);
D3DMath_MatrixMultiply(matrix,m,matrix);
}
D3DUtil_SetRotateYMatrix(m,ang.y);
D3DMath_MatrixMultiply(matrix,m,matrix);
if (schaukelphase>0.0f)
{ // schaukeln
const float mittelpunkt=2.0f;
D3DUtil_SetTranslateMatrix(m,0,0,-mittelpunkt);
D3DMath_MatrixMultiply(matrix,m,matrix);
D3DUtil_SetRotateXMatrix(m,schaukelwinkel());
D3DMath_MatrixMultiply(matrix,m,matrix);
D3DUtil_SetTranslateMatrix(m,0,0,mittelpunkt);
D3DMath_MatrixMultiply(matrix,m,matrix);
}
lpDevice->SetTransform(D3DTRANSFORMSTATE_WORLD,&matrix);
mesh1->Render(lpDevice,FALSE);
// Rolle
D3DUtil_SetRotateXMatrix(m,rolle);
D3DMath_MatrixMultiply(matrix,m,matrix);
lpDevice->SetTransform(D3DTRANSFORMSTATE_WORLD,&matrix);
mesh2->Render(lpDevice,FALSE);
}
示例3: wSetTextureStageState
/// <summary>
/// <c>wSetTextureStageState</c>
/// </summary>
/// <remarks>
/// </remarks>
/// <param name="d3dDevice7"></param>
/// <param name="dwStage"></param>
/// <param name="dwState"></param>
/// <param name="dwValue"></param>
/// <returns></returns>
HRESULT __stdcall wSetTextureStageState(
LPDIRECT3DDEVICE7 d3dDevice7, ULONG dwStage, D3DTEXTURESTAGESTATETYPE dwState, ULONG dwValue)
{
PSTR pszStageSet;
PSTR pszErrorMessage;
HRESULT hResult;
++TotalRenderStateChanges;
pszStageSet = GetStageSet(dwState, dwValue);
InternalFunctionSpew("GameOS_Direct3D", "SetTextureStageState(%d,%s)", dwStage, pszStageSet);
hResult = d3dDevice7->SetTextureStageState(dwStage, dwState, dwValue);
if (FAILED(hResult))
{
if ( hResult != DDERR_SURFACELOST)
{
pszStageSet = GetStageSet(dwState, dwValue);
pszErrorMessage = ErrorNumberToMessage(hResult);
if ( InternalFunctionPause("FAILED (0x%x - %s) - SetTextureStageState(%d,%s)",
hResult, pszErrorMessage, dwStage, pszStageSet) )
ENTER_DEBUGGER;
}
}
return hResult;
}
示例4: Render
//-----------------------------------------------------------------------------
// rendu de la d�chirure spatio temporelle
float CSummonCreature::Render(LPDIRECT3DDEVICE7 m_pd3dDevice)
{
if (ulCurrentTime >= (ulDurationIntro + ulDurationRender + ulDurationOuttro)) return 0.f;
SETTC(m_pd3dDevice, NULL);
SETCULL(m_pd3dDevice, D3DCULL_NONE);
SETZWRITE(m_pd3dDevice, false);
SETTEXTUREWRAPMODE(m_pd3dDevice, D3DTADDRESS_CLAMP);
m_pd3dDevice->SetRenderState(D3DRENDERSTATE_SRCBLEND, D3DBLEND_ONE);
m_pd3dDevice->SetRenderState(D3DRENDERSTATE_DESTBLEND, D3DBLEND_ONE);
SETALPHABLEND(m_pd3dDevice, true);
//-------------------------------------------------------------------------
fTexWrap += 0.02f;
if (fTexWrap >= 1.0f)
{
fTexWrap -= 1.0f;
}
//-------------------------------------------------------------------------
// render intro (opening + rays)
if (ulCurrentTime < ulDurationIntro)
{
if (ulCurrentTime < ulDurationIntro * 0.666f)
{
fSizeIntro = (end + 2) * fOneOnDurationIntro * (1.5f) * ulCurrentTime;
sizeF = 1;
}
else
{
if (bIntro != false)
bIntro = false;
sizeF = (iSize) * (fOneOnDurationIntro * 3) * (ulCurrentTime - ulDurationIntro * 0.666f);
}
}
// do nothing just render
else if (ulCurrentTime < (ulDurationIntro + ulDurationRender))
{
}
// close it all
else if (ulCurrentTime < (ulDurationIntro + ulDurationRender + ulDurationOuttro))
{
//if (sizeF > 0)
{
sizeF = iSize - (iSize) * fOneOnDurationOuttro * (ulCurrentTime - (ulDurationIntro + ulDurationRender));
}
}
SETALPHABLEND(m_pd3dDevice, false);
RenderFissure(m_pd3dDevice);
SETZWRITE(m_pd3dDevice, true);
SETALPHABLEND(m_pd3dDevice, false);
SETTEXTUREWRAPMODE(m_pd3dDevice, D3DTADDRESS_WRAP);
return (fSizeIntro / end);
}
示例5: wMultiplyTransform
/// <summary>
/// <c>wMultiplyTransform</c>
/// </summary>
/// <remarks>
/// </remarks>
/// <param name="d3dDevice7"></param>
/// <param name="dtstTransformStateType"></param>
/// <param name="lpD3DMatrix"></param>
/// <returns></returns>
HRESULT __stdcall wMultiplyTransform(
LPDIRECT3DDEVICE7 d3dDevice7, D3DTRANSFORMSTATETYPE dtstTransformStateType,
LPD3DMATRIX lpD3DMatrix)
{
PSTR pszTransformType;
PSTR pszErrorMessage;
HRESULT hResult;
pszTransformType = GetTransformType(dtstTransformStateType);
InternalFunctionSpew("GameOS_Direct3D", "MultiplyTransform(%s)", pszTransformType);
hResult =
d3dDevice7->MultiplyTransform(
dtstTransformStateType,
lpD3DMatrix);
if (FAILED(hResult))
{
pszTransformType = GetTransformType(dtstTransformStateType);
pszErrorMessage = ErrorNumberToMessage(hResult);
if ( InternalFunctionPause("FAILED (0x%x - %s) - MultiplyTransform()",
hResult, pszErrorMessage, pszTransformType) )
ENTER_DEBUGGER;
}
return hResult;
}
示例6: RenderSquareShadow
void RenderSquareShadow(LPDIRECT3DDEVICE7 lpDevice,float x,float y,float z,float w,float h)
{
WORD wIndices[] = {
0,1,2,
3,2,1,
1,5,3,
3,5,7,
0,4,1,
1,4,5,
0,2,4,
4,2,6,
2,3,6,
6,3,7,
};
D3DLIGHT7 light;
lpDevice->GetLight(0,&light);
D3DVECTOR length=Normalize(light.dvDirection)*(-100);
D3DVERTEX v[8];
v[0] = D3DVERTEX( D3DVECTOR( x-w/2, y, z-h/2 ),D3DVECTOR(0,1,0), 0, 1 );
v[1] = D3DVERTEX( D3DVECTOR( x-w/2, y, z+h/2 ),D3DVECTOR(0,1,0), 0, 0 );
v[2] = D3DVERTEX( D3DVECTOR( x+w/2, y, z-h/2 ),D3DVECTOR(0,1,0), 1, 1 );
v[3] = D3DVERTEX( D3DVECTOR( x+w/2, y, z+h/2 ),D3DVECTOR(0,1,0), 1, 0 );
v[4] = D3DVERTEX( D3DVECTOR( x-w/2, y, z-h/2 )-length,D3DVECTOR(0,1,0), 0, 0 );
v[5] = D3DVERTEX( D3DVECTOR( x-w/2, y, z+h/2 )-length,D3DVECTOR(0,1,0), 0, 0 );
v[6] = D3DVERTEX( D3DVECTOR( x+w/2, y, z-h/2 )-length,D3DVECTOR(0,1,0), 0, 0 );
v[7] = D3DVERTEX( D3DVECTOR( x+w/2, y, z+h/2 )-length,D3DVECTOR(0,1,0), 0, 0 );
RenderShadow(lpDevice,v,8,wIndices,sizeof(wIndices)/sizeof(wIndices[0]));
}
示例7: Draw
void CEi::Draw(LPDIRECT3DDEVICE7 lpDevice)
{
if (!CBoundingTube::IsSphereVisible(pos,EGG_SIZE))return;
D3DMATRIX m,m2;
D3DUtil_SetTranslateMatrix(m,pos);
D3DUtil_SetRotateYMatrix(m2,ang.y);
D3DMath_MatrixMultiply(m,m2,m);
D3DUtil_SetRotateXMatrix(m2,-ang.x+g_PI*0.5f);
D3DMath_MatrixMultiply(m,m2,m);
lpDevice->SetTexture(0,NULL);
lpDevice->SetTransform(D3DTRANSFORMSTATE_WORLD,&m);
lpMesh->Render(lpDevice,FALSE);
}
示例8: 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;
}
示例9: wLightEnable
/// <summary>
/// <c>wLightEnable</c>
/// </summary>
/// <remarks>
/// </remarks>
/// <param name="d3dDevice7"></param>
/// <param name="dwLightIndex"></param>
/// <param name="Enable"></param>
/// <returns></returns>
HRESULT __stdcall wLightEnable(
LPDIRECT3DDEVICE7 d3dDevice7, ULONG dwLightIndex, bool Enable)
{
PSTR pszEnable;
PSTR pszErrorMessage;
HRESULT hResult;
if ( Enable )
pszEnable = "enable";
else
pszEnable = "disable";
InternalFunctionSpew("GameOS_Direct3D", "LightEnable(%d, %s)", dwLightIndex, pszEnable);
hResult = d3dDevice7->LightEnable(dwLightIndex, Enable);
if (FAILED(hResult))
{
if ( Enable )
pszEnable = "enable";
else
pszEnable = "disable";
pszErrorMessage = ErrorNumberToMessage(hResult);
if ( InternalFunctionPause("FAILED (0x%x - %s) - LightEnable(%d, %s)", hResult, pszErrorMessage, dwLightIndex, pszEnable) )
ENTER_DEBUGGER;
}
return hResult;
}
示例10: wDrawPrimitive
/// <summary>
/// <c>wDrawPrimitive</c>
/// </summary>
/// <remarks>
/// </remarks>
/// <param name="d3dDevice7"></param>
/// <param name="dptPrimitiveType"></param>
/// <param name="dvtVertexType"></param>
/// <param name="lpvVertices"></param>
/// <param name="dwVertexCount"></param>
/// <param name="dwFlags"></param>
/// <returns></returns>
HRESULT __stdcall wDrawPrimitive(
LPDIRECT3DDEVICE7 d3dDevice7, D3DPRIMITIVETYPE dptPrimitiveType,
ULONG dvtVertexType, PVOID lpvVertices, ULONG dwVertexCount, ULONG dwFlags)
{
PSTR pszPrimitiveData;
PSTR pszErrorMessage;
HRESULT hResult;
pszPrimitiveData = GetDrawPrimitiveData(
dptPrimitiveType, dvtVertexType, lpvVertices, dwVertexCount, dwFlags);
InternalFunctionSpew("GameOS_Direct3D", "DrawPrimitive( %s)", pszPrimitiveData);
hResult = d3dDevice7->DrawPrimitive(
dptPrimitiveType,
dvtVertexType,
lpvVertices,
dwVertexCount,
dwFlags);
if (FAILED(hResult))
{
if ( hResult != DDERR_SURFACELOST)
{
pszPrimitiveData = GetDrawPrimitiveData(
dptPrimitiveType, dvtVertexType, lpvVertices, dwVertexCount, dwFlags);
pszErrorMessage = ErrorNumberToMessage(hResult);
if ( InternalFunctionPause("FAILED (0x%x - %s) - DrawPrimitive( %s)",
hResult, pszErrorMessage, pszPrimitiveData) )
ENTER_DEBUGGER;
}
}
return hResult;
}
示例11: wLoad
/// <summary>
/// <c>wLoad</c>
/// </summary>
/// <remarks>
/// </remarks>
/// <param name="d3dDevice7"></param>
/// <param name="lpDestTex"></param>
/// <param name="lpDestPoint"></param>
/// <param name="lpSrcTex"></param>
/// <param name="lprcSrcRect"></param>
/// <param name="dwFlags"></param>
/// <returns></returns>
HRESULT __stdcall wLoad(
LPDIRECT3DDEVICE7 d3dDevice7, LPDIRECTDRAWSURFACE7 lpDestTex, LPPOINT lpDestPoint,
LPDIRECTDRAWSURFACE7 lpSrcTex, LPRECT lprcSrcRect, ULONG dwFlags)
{
PSTR pszErrorMessage;
HRESULT hResult;
InternalFunctionSpew("GameOS_Direct3D", "Load(0x%x with 0x%x)", lpDestTex, lpSrcTex);
hResult = d3dDevice7->Load(
lpDestTex,
lpDestPoint,
lpSrcTex,
lprcSrcRect,
dwFlags);
if (FAILED(hResult))
{
if ( hResult != DDERR_SURFACELOST)
{
pszErrorMessage = ErrorNumberToMessage(hResult);
if ( InternalFunctionPause("FAILED (0x%x - %s) - Load(0x%x with 0x%x)",
hResult, pszErrorMessage, lpDestTex, lpSrcTex) )
ENTER_DEBUGGER;
}
}
return hResult;
}
示例12: ResetBlendenderState
/******************************************************************************************************************
함수명 : ResetBlendenderState()
작성자 :
작성일 :
목적 : 렌더링스테이트를 기본상태로 복구한다.
입력 : LPDIRECT3DDEVICE7 pd3dDevice
출력 : void
[일자][수정자] : 수정내용
*******************************************************************************************************************/
void ResetBlendenderState(LPDIRECT3DDEVICE7 pd3dDevice)
{
pd3dDevice->SetTextureStageState(0, D3DTSS_COLORARG1, D3DTA_TEXTURE);
pd3dDevice->SetTextureStageState(0, D3DTSS_COLOROP, D3DTOP_MODULATE);
pd3dDevice->SetTextureStageState(0, D3DTSS_COLORARG2, D3DTA_DIFFUSE);
pd3dDevice->SetTextureStageState(0, D3DTSS_ALPHAARG1, D3DTA_TEXTURE);
pd3dDevice->SetTextureStageState(0, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1);
pd3dDevice->SetTextureStageState(0, D3DTSS_ALPHAARG2, D3DTA_DIFFUSE);
pd3dDevice->SetRenderState(D3DRENDERSTATE_ALPHABLENDENABLE, FALSE);
pd3dDevice->SetRenderState(D3DRENDERSTATE_COLORKEYENABLE, FALSE);
pd3dDevice->SetRenderState(D3DRENDERSTATE_SRCBLEND , D3DBLEND_ONE);
pd3dDevice->SetRenderState(D3DRENDERSTATE_DESTBLEND, D3DBLEND_ZERO);
}
示例13: DrawBillBoard
HRESULT CImageHandler::DrawBillBoard(LPDIRECT3DDEVICE7 lpDevice, D3DVECTOR vTrans, D3DVECTOR vScale, /*D3DVECTOR vRot, */D3DMATERIAL7 mtrl, /*FLOAT fRotRad, */LPDIRECTDRAWSURFACE7 lpddsTextr)
{
if ( lpDevice )
{
if( SUCCEEDED(lpDevice->BeginScene()) )
{
D3DMATRIX matTrans;
D3DMATRIX matScale;
D3DMATRIX matRot;
D3DMATRIX matWorld;
D3DMATRIX matTempWorld;
D3DMATRIX matWorldOriginal;
lpDevice->GetTransform(D3DTRANSFORMSTATE_WORLD, &matWorldOriginal);
vTrans.x = vTrans.x+vScale.x/2-400;
vTrans.y = -vTrans.y-vScale.y/2+300;
D3DUtil_SetTranslateMatrix(matTrans, vTrans);
D3DUtil_SetScaleMatrix(matScale, vScale.x, vScale.y, vScale.z);
// D3DUtil_SetRotationMatrix(matRot, vRot, fRotRad);
D3DMath_MatrixMultiply(/*matTempWorld*/matWorld, matScale, matTrans);
// D3DMath_MatrixMultiply(matWorld, matRot, matTempWorld);
lpDevice->SetTransform(D3DTRANSFORMSTATE_WORLD, &matWorld);
SetBlendRenderState(lpDevice, _BLEND_NORMAL, mtrl);
lpDevice->SetMaterial(&mtrl);
lpDevice->SetTexture(0, lpddsTextr);
lpDevice->DrawPrimitive(D3DPT_TRIANGLESTRIP, D3DFVF_VERTEX, m_avBillBoard, 4, NULL);
// 원상복귀.
ZeroMemory(&mtrl, sizeof(mtrl));
mtrl.diffuse.r = mtrl.diffuse.g = mtrl.diffuse.b = 0.1f;
mtrl.ambient.r = mtrl.ambient.g = mtrl.ambient.b = 1.0f;
lpDevice->SetMaterial(&mtrl);
ResetBlendenderState(lpDevice);
lpDevice->SetTransform(D3DTRANSFORMSTATE_WORLD, &matWorldOriginal);
}
lpDevice->EndScene();
return S_OK;
}
return E_FAIL;
}
示例14: wEnumTextureFormats
/// <summary>
/// <c>wEnumTextureFormats</c>
/// </summary>
/// <remarks>
/// </remarks>
/// <param name="d3dDevice7"></param>
/// <param name="lpd3dEnumPixelProc"></param>
/// <param name="lpArg"></param>
/// <returns></returns>
HRESULT __stdcall wEnumTextureFormats(
LPDIRECT3DDEVICE7 d3dDevice7, LPD3DENUMPIXELFORMATSCALLBACK lpd3dEnumPixelProc, PVOID lpArg)
{
PSTR pszErrorMessage;
HRESULT hResult;
InternalFunctionSpew("GameOS_Direct3D", "EnumTextureFormats()");
hResult = d3dDevice7->EnumTextureFormats(lpd3dEnumPixelProc, lpArg);
if (FAILED(hResult))
{
pszErrorMessage = ErrorNumberToMessage(hResult);
if ( InternalFunctionPause("FAILED (0x%x - %s) - EnumTextureFormats()", hResult, pszErrorMessage) )
ENTER_DEBUGGER;
}
return hResult;
}
示例15: wGetCaps
/// <summary>
/// <c>wGetCaps</c>
/// </summary>
/// <remarks>
/// </remarks>
/// <param name="d3dDevice7"></param>
/// <param name="lpD3DHWDevDesc"></param>
/// <returns></returns>
HRESULT __stdcall wGetCaps(
LPDIRECT3DDEVICE7 d3dDevice7, LPD3DDEVICEDESC7 lpD3DHWDevDesc)
{
PSTR pszErrorMessage;
HRESULT hResult;
InternalFunctionSpew("GameOS_Direct3D", "GetCaps(0x%x)", d3dDevice7);
hResult = d3dDevice7->GetCaps(lpD3DHWDevDesc);
if (FAILED(hResult))
{
pszErrorMessage = ErrorNumberToMessage(hResult);
if ( InternalFunctionPause("FAILED (0x%x - %s) - GetCaps(0x%x)", hResult, pszErrorMessage, d3dDevice7) )
ENTER_DEBUGGER;
}
return hResult;
}