void Renderer::Exit()
{
	DeleteObject( g_hFont );

	if ( m_pD3DDevice )
	{
		m_pD3DDevice->SetPixelShader( NULL );
		m_pD3DDevice->SetVertexShader( NULL );
	}

	if ( g_pPosNormalColUVDeclaration )
		g_pPosNormalColUVDeclaration->Release();

	if ( g_pPosColUVDeclaration )
		g_pPosColUVDeclaration->Release();

	if ( g_pPosNormalDeclaration )
		g_pPosNormalDeclaration->Release();

	Shader::ReleaseAllShaders();

	if ( g_pCubeIbuffer )
		g_pCubeIbuffer->Release();
	if ( g_pCubeVbuffer )
		g_pCubeVbuffer->Release();

// 	if ( g_backBuffer )
// 		g_backBuffer->Release();

// 	if ( g_oldDepthBuffer )
// 		g_oldDepthBuffer->Release();

	if ( g_matrixStack )
		g_matrixStack->Release();

	if ( g_scratchTexture )
	{
		g_scratchTexture->Release();
		g_scratchTexture = NULL;
	}

	if ( m_pTextureFont )
	{
		m_pTextureFont->Release();
		m_pTextureFont = NULL;
	}

	if ( g_depthBuffer )
		g_depthBuffer->Release();
}
Exemple #2
0
DXPointLight::~DXPointLight()
{
	if( shadowmap )
	{
		shadowmap->Release();
		shadowmap = 0;
	}

	if( blur )
	{
		blur->Release();
		blur = 0;
	}

	if( blurdeclforpoint )
	{
		if( 0 == blurdeclforpoint->Release() )
			blurdeclforpoint = 0;
	}
}
Exemple #3
0
DXDirectionalLight::~DXDirectionalLight()
{
	if( shadowmap )
	{
		shadowmap->Release();
		shadowmap = 0;
	}

	if( blur )
	{
		blur->Release();
		blur = 0;
	}

	if( blurdeclforpointfordirectional )
	{
		if( 0 == blurdeclforpointfordirectional->Release() )
			blurdeclforpointfordirectional = 0;
	}
}
void Cleanup()
{
	// release fonts
	if (gpFont)
	{
		gpFont->Release();
		gpFont = NULL;
	}

	// release models
	if (gpTeapot)
	{
		gpTeapot->Release();
		gpTeapot = NULL;
	}

	// release shaders
	if (gpEnvironmentMappingShader)
	{
		gpEnvironmentMappingShader->Release();
		gpEnvironmentMappingShader = NULL;
	}

	if (gpNoEffect)
	{
		gpNoEffect->Release();
		gpNoEffect = NULL;
	}

	if (gpGrayScale)
	{
		gpGrayScale->Release();
		gpGrayScale = NULL;
	}

	if (gpSepia)
	{
		gpSepia->Release();
		gpSepia = NULL;
	}

	// release textures
	if (gpStoneDM)
	{
		gpStoneDM->Release();
		gpStoneDM = NULL;
	}

	if (gpStoneSM)
	{
		gpStoneSM->Release();
		gpStoneSM = NULL;
	}

	if (gpStoneNM)
	{
		gpStoneNM->Release();
		gpStoneNM = NULL;
	}

	if (gpSnowENV)
	{
		gpSnowENV->Release();
		gpSnowENV = NULL;
	}

	// Release the fullscreen quad
	if (gpFullscreenQuadDecl)
	{
		gpFullscreenQuadDecl->Release();
		gpFullscreenQuadDecl = NULL;
	}

	if (gpFullscreenQuadVB)
	{
		gpFullscreenQuadVB->Release();
		gpFullscreenQuadVB = NULL;
	}

	if (gpFullscreenQuadIB)
	{
		gpFullscreenQuadIB->Release();
		gpFullscreenQuadIB = NULL;
	}

	// release the render target
	if (gpSceneRenderTarget)
	{
		gpSceneRenderTarget->Release();
		gpSceneRenderTarget = NULL;
	}

	// release D3D
	if (gpD3DDevice)
	{
		gpD3DDevice->Release();
		gpD3DDevice = NULL;
	}

	if (gpD3D)
	{
		gpD3D->Release();
		gpD3D = NULL;
	}
}