Exemplo n.º 1
0
void PropsDemo::onResetDevice()
{
	mGfxStats->onResetDevice();
	mTerrain->onResetDevice();
	mWater->onResetDevice();
	HR(mFX->OnResetDevice());
	HR(mGrassFX->OnResetDevice());

	// The aspect ratio depends on the backbuffer dimensions, which can 
	// possibly change after a reset.  So rebuild the projection matrix.
	float w = (float)md3dPP.BackBufferWidth;
	float h = (float)md3dPP.BackBufferHeight;
	gCamera->setLens(D3DX_PI * 0.25f, w/h, 1.0f, 1000.0f);
}
Exemplo n.º 2
0
void StencilMirrorDemo::onResetDevice()
{
	mGfxStats->onResetDevice();
	HR(mFX->OnResetDevice());

	buildProjMtx();
}
Exemplo n.º 3
0
void XFileDemo::onResetDevice()
{
	mGfxStats->onResetDevice();
	HR(mFX->OnResetDevice());

	buildProjMtx();
}
Exemplo n.º 4
0
void AmbientDiffuseDemo::onResetDevice()
{
    mGfxStats->onResetDevice();
    HR(mFX->OnResetDevice());

    buildProjMtx();
}
Exemplo n.º 5
0
void Evolution::onResetDevice()
{
    mGfxStats->onResetDevice();
    HR(mFont->OnResetDevice());

    HR(mFX->OnResetDevice());

    buildProjMtx();
}
Exemplo n.º 6
0
void SolarSysDemo::onResetDevice()
{
	mGfxStats->onResetDevice();
	HR(mFX->OnResetDevice());

	// The aspect ratio depends on the backbuffer dimensions, which can 
	// possibly change after a reset.  So rebuild the projection matrix.
	buildProjMtx();
}
Exemplo n.º 7
0
void Game::onResetDevice()
{
	HR(mFX->OnResetDevice());
	HR(mFont->OnResetDevice());

	gMyGameWorld->OnResetDevice();
	mSprite->OnResetDevice();

	// The aspect ratio depends on the backbuffer dimensions, which can 
	// possibly change after a reset.  So rebuild the projection matrix.
	buildProjMtx();
}
Exemplo n.º 8
0
void TriPickDemo::onResetDevice()
{
	HR(m_FX->OnResetDevice());
	HR(m_pCharacter->GetEffect()->OnResetDevice());
	//Aspect ratio rely on the size of back buffer 
	//Back buffer will change when user change window size, so we need to reset project matrix.
	float w = (float)md3dPP.BackBufferWidth;
	float h = (float)md3dPP.BackBufferHeight;

	g_Camera->setLens(D3DX_PI * 0.25f, w / h, 0.1f, 1000.0f);

}
Exemplo n.º 9
0
//-----------------------------------------------------------------------------
// Name: RestoreDeviceObjects()
// Desc: Restore device-memory objects and state after a device is created or
//       resized.
//-----------------------------------------------------------------------------
HRESULT CMyD3DApplication::RestoreDeviceObjects()
{
    // InitDeviceObjects for file objects (build textures and vertex buffers)
    m_pShinyTeapot->RestoreDeviceObjects( m_pd3dDevice );
    m_pSkyBox->RestoreDeviceObjects( m_pd3dDevice );
    m_pFont->RestoreDeviceObjects();
    m_pEffect->OnResetDevice();
    m_pEffect->SetTexture( "texSphereMap", m_pSphereMap );

    // Set the transform matrices
    FLOAT fAspect = (FLOAT) m_d3dsdBackBuffer.Width / (FLOAT) m_d3dsdBackBuffer.Height;
    D3DXMatrixPerspectiveFovLH( &m_matProject, D3DX_PI * 0.4f, fAspect, 0.5f, 100.0f );
    return S_OK;
}
////////////////////////////////////////////////////////////////
//
// CEffectTemplateImpl::OnResetDevice
//
// Recreate device stuff
//
////////////////////////////////////////////////////////////////
void CEffectTemplateImpl::OnResetDevice ( void )
{
    m_pD3DEffect->OnResetDevice ();
}