PDA

View Full Version : Copying surface to backbuffer (DX 9.0)


Neken
04-17-2006, 06:47 PM
I can't seem to copy a surface to backbuffer by any way .. it always return an InvalidCall ...

Here's what i've done :


//640,480
GRAFX->DEVICE()->CreateRenderTarget(m_Width, m_Height, D3DFMT_X8R8G8B8, D3DMULTISAMPLE_NONE, 0, false, &m_Surface, NULL)

LPDIRECT3DSURFACE9 s;
GRAFX->DEVICE()->GetBackBuffer(0, 0, D3DBACKBUFFER_TYPE_MONO, &s);
GRAFX->DEVICE()->UpdateSurface(m_Surface, NULL, s, NULL);

//



It doesn't seem to work with regular surfaces either, nor with GetRenderTargetData ...

Help please !! :(

paulgauthier
04-27-2006, 09:19 AM
Not sure this will help but what works for me is to use:

g_pd3dDevice->CreateOffscreenPlainSurface(Width, Height, D3DFMT_X8R8G8B8, D3DPOOL_SYSTEMMEM, &g_BackgroundSurface, NULL);

Then:

g_pd3dDevice->GetBackBuffer(0, 0, D3DBACKBUFFER_TYPE_MONO, &g_BackBuffer);
g_pd3dDevice->UpdateSurface(g_BackgroundSurface, NULL, g_BackBuffer, NULL);

Paul G.

Neken
05-01-2006, 07:41 AM
what's the difference between a rendertarget surface and an offscreenplainsurface ?