예제 #1
0
HRESULT HookIDirect3DDevice9::ColorFill(LPVOID _this,
										IDirect3DSurface9* pSurface,
										CONST RECT* pRect,
										D3DCOLOR color)
{
	LOG_API();
	return pD3Dev->ColorFill(pSurface, pRect, color);
}
예제 #2
0
	virtual void clear()
	{
		if ( retry_count && !restore_objects() ) return;

		lptex->GetLevelDesc(0, &d3dsd);
		lptex->GetSurfaceLevel(0, &lpsurface);

		if ( lpsurface )
		{
			lpdev->ColorFill( lpsurface, NULL, D3DCOLOR_XRGB(0x00, 0x00, 0x00) );
			lpsurface->Release();
			lpsurface = 0;
		}

		for ( unsigned i = 0; i < 3; i++ )
		{
			lpdev->Clear( 0, 0, D3DCLEAR_TARGET, D3DCOLOR_XRGB(0x00, 0x00, 0x00), 1.0f, 0 );
			lpdev->Present( 0, 0, 0, 0 );
		}
	}
예제 #3
0
INT CrenderTarget::CreateRenderSurface()
{
	HRESULT hr=-1;

	DWORD				dMip = 1;
	LPDIRECT3DSURFACE9	pSfC = NULL;
	LPDIRECT3DSURFACE9	pSfD = NULL;
	D3DSURFACE_DESC		dscC;
	D3DSURFACE_DESC		dscD;

	D3DCAPS9			m_Caps;

	m_pDev->GetRenderTarget(0,&pSfC);
	m_pDev->GetDepthStencilSurface(&pSfD);

    pSfC->GetDesc(&dscC);
	pSfD->GetDesc(&dscD);

	m_pDev->GetDeviceCaps(&m_Caps);

	pSfC->Release();
	pSfD->Release();

	if(m_iW<0)
		m_iW = dscC.Width;
	
	if(m_iH<0)
		m_iH = dscC.Height;


	m_dC = dscC.Format;
	m_dD = dscD.Format;

	if(LCX_TARGET_HDR16 == m_nType)
		m_dC = D3DFMT_A16B16G16R16F;

	if(LCX_TARGET_HDR32 == m_nType)
		m_dC = D3DFMT_A32B32G32R32F;


	
	hr = D3DXCreateRenderToSurface(m_pDev
							, m_iW
							, m_iH
							, (D3DFORMAT)m_dC
							, TRUE
							, (D3DFORMAT)m_dD
							, &m_pRts);

	if(FAILED(hr))
		return -1;

	hr = D3DXCreateTexture(m_pDev
							, m_iW
							, m_iH
							, dMip
							, D3DUSAGE_RENDERTARGET
							, (D3DFORMAT)m_dC
							, D3DPOOL_DEFAULT
							, &m_pTxP);

	if(FAILED(hr))
        return -1;

	hr = m_pTxP->GetSurfaceLevel(0, &m_pSfc);

	if(FAILED(hr))
		return -1;

	// Clear 0x0
	m_pDev->ColorFill(m_pSfc, NULL, 0x0);
	

	return hr;
}