• ### Announcements

#### Archived

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

# Problem with back surfaces

## Recommended Posts

I seem to be having a small problem with blitting to my back surface. I set a a dual surface so I can have nice joyfully smooth animation. But my problem is that when I blit to the backsurface then call while (FAILED(lpDDSurfacePrimary->Flip(NULL, DDFLIP_WAIT))); it doesn''t show anything, but when I change the blit to blit to the Primary surface it works!, I''m just using a quick memory fill to test this so I dont have any bliting errors and I check to make sure the lpDDBackSurface != NULL. any idea''s at what could be wrong? I''m stuped

##### Share on other sites
Could you post your primary (and back) surface creation code ? I think the problem is here. The back buffer is perhaps not "linked" to the primary surface which therefore cannot flip.

##### Share on other sites
Ok here is the code I''m useing to create the surfaces

  DDSURFACEDESC2 ddSurfaceDesc; //Surface Descriptionmemset(&ddSurfaceDesc,0,sizeof(ddSurfaceDesc)); ddSurfaceDesc.dwSize = sizeof(ddSurfaceDesc); ddSurfaceDesc.dwFlags = DDSD_CAPS | DDSD_BACKBUFFERCOUNT; // we need to let dd know that we want a complex // flippable surface structure, set flags for that ddSurfaceDesc.dwBackBufferCount = 1; ddSurfaceDesc.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE | DDSCAPS_COMPLEX | DDSCAPS_FLIP; // set the backbuffer count to 1, 2 for triple bufferin // create the primary surface if (FAILED(lpMainDD->CreateSurface(&ddSurfaceDesc,&lpDDSurfacePrimary,NULL))) return -1; ddSurfaceDesc.ddsCaps.dwCaps = DDSCAPS_BACKBUFFER; if (FAILED(lpDDSurfacePrimary->GetAttachedSurface(&ddSurfaceDesc.ddsCaps,&lpDDBackSurface))) return -1;

I can''t seem to find the problem, hope you can!

• ## Partner Spotlight

• ### Forum Statistics

• Total Topics
627662
• Total Posts
2978518

• 10
• 10
• 12
• 22
• 13