Jump to content
  • Advertisement
Sign in to follow this  

DirectDraw blitting the primary surface

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

Hi im trying to create a function which returns a direct draw surface containing a copy of the primary surface. Heres my code: LPDIRECTDRAWSURFACE screenGrab(){ LPDIRECTDRAWSURFACE returnSurface; if(!(returnSurface = ddcreatesurface(windowwidth,windowheight,DDSCAPS_SYSTEMMEMORY))) {MessageBox(NULL,"Failed to create the dd surface","Error",MB_OK);} RECT rect; rect.top = 0; rect.bottom = windowheight-1; rect.left = 0; rect.right = windowwidth-1; if(FAILED(returnSurface->Blt(&rect, lpddsprimary, &rect, (DDBLT_WAIT | DDBLT_KEYSRC), NULL))) MessageBox(NULL, "Failed to copy the primary surface", "ERRO", MB_OK); return returnSurface; } When i call this function i get the message "failed to copy the primary surface. I also get that error message when i try to copy the secondary surface but it works fine when i try to copy another surface in the system memory. Am i doing something wrong or is it not possible to copy the primary surface? I really dont see why it wouldent be possible. Could it be happening because the primary surface is in the graphics card memory and the new surface is in the system memory?

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!