Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


GetBackBuffer directx 9

This topic is 5554 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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."

Share this post

Link to post
Share on other sites

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 leaks


Hope it helps.

Share this post

Link to post
Share on other sites
thanks, I don''t know why i didn''t try that, funny thing is the book I''m going over "Direct 3D programming QuickStart" shows it as an independant function. hmmmm.

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!