Jump to content


Copying surface to backbuffer (DX 9.0)


2 replies to this topic

#1 Neken

    New Member

  • Members
  • Pip
  • 7 posts

Posted 18 April 2006 - 01:47 AM

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 !! :(

#2 paulgauthier

    New Member

  • Members
  • Pip
  • 1 posts

Posted 27 April 2006 - 04:19 PM

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.

#3 Neken

    New Member

  • Members
  • Pip
  • 7 posts

Posted 01 May 2006 - 02:41 PM

what's the difference between a rendertarget surface and an offscreenplainsurface ?





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users