Jump to content
  • Advertisement
Sign in to follow this  

Could Not Load From BackBuffer using a .bmp file (offscreenPlainSurface)

This topic is 2644 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

Attached is the code I am using to create a Offscreenplainsurface using a bitmap image named as "background.bmp".
I am clearing the screen to the blue screen initially and then obtaining the image from the backbuffer.

After running the program, view filled only with blue color gets rendered and not the bitmap image.
Kindly suggest.

Following is the error that comes up when I enabled debugging using DirectX.

Direct3D9: (ERROR) :Invalid source surface interface specified. StretchRect fails

I could not find any issue with the code. I am simply returning the "surface" reference into the "bkgrd"; which in turn is being used in:


IDirect3DSurface9* getSurfaceFromBitmap()[attachment=5011:DirectX_1.txt]
IDirect3DSurface9* surface=NULL;
HRESULT hResult=pd3dDevice->CreateOffscreenPlainSurface(640,480,D3DFMT_X8R8G8B8,D3DPOOL_DEFAULT,&surface,NULL);
return NULL;

hResult = D3DXLoadSurfaceFromFile(surface,NULL,NULL,"background.bmp",NULL,D3DX_DEFAULT,0,NULL);
return NULL;

return surface;

bkgrd = getSurfaceFromBitmap();

Does resource file has anything to do with this.

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • 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!