Jump to content
  • Advertisement

Archived

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

Nullio

Doing a flip (part 2)

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

Ok I think I better explain my problem a little more I set up a primary surface with a back surface useing the code indicated below, I do error checking and everything with the creation of the surfaces go ok. Then to test if this worked I do a memory fill of the back surfaces with the color blue, then when I call while (FAILED(lpDDSurfacePrimary->Flip(NULL, DDFLIP_WAIT))); I see black, the no errors with the flip but it does not display a blue screen, then I do a memory fill to the primary surface (for testing purposes) and it works and I have a nice blue screen. The problem is the back surface must not be getting linked to the primary surface and I don't know why. Surfaces Init code:
  
        memset(&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;
  
If anyone can see what i can not I would be very happy and thank you a million times. Edited by - Nullio on March 18, 2001 5:53:01 PM

Share this post


Link to post
Share on other sites
Advertisement

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