GetBackBuffer directx 9
hey guys, i''m trying to load a bitmap from a file, i first get the bitmap header info, then create a plain surface, use loadsurfacefromfile to load the image, and then i want to copy this surface to the backbuffer, but when i do i run into problems, the compiler says that the GetBackBuffer routine is undeclared. I have included the following headers & libs:
d3d9.h,d3dx9.h,dxerr9.h, i''m using vc++6 and I have add the libs to the linker path. I can''t figure why its not recognizing the function, what gives???? thanks
/*code snip*/
int cSurface::CopySurfaceToBackBuffer(cDirectX * directX){
HRESULT result;
IDirect3DSurface9* pBackBuffer = NULL;
/*get pointer to back buffer*/
result = GetBackBuffer( <---error 0,0,D3DBACKBUFFER_TYPE_MONO,&pBackBuffer);
if(FAILED(result)) return 0;
/*copy bitmap between surfaces*/
result = directX->g_pd3dDevice->StretchRect(Surface,NULL,pBackBuffer,NULL,D3DTEXF_NONE);
if(FAILED(result)) return 0;
return 1;
}
/*end code snip*/
"Genius is rare because the means of becoming one has not been made commonly available."
Hi!
You should call the function like this:
Hope it helps.
You should call the function like this:
if( SUCCEEDED( m_pd3dDevice->GetBackBuffer( 0, 0, D3DBACKBUFFER_TYPE_MONO, &pBackbuffer) ) ){// Process your code here// Release BackBuffer to prevent from memory leakspBackbuffer->Release();}
Hope it helps.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement