Jump to content
  • Advertisement


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


DDraw backbuffer problem

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

I''m using DX5 for a platform scroller targeted at lower end machines. To gain some videomem, I decided to fall back to double buffering (it was using triple buffers at 640x480x16). But when I set backbuffers to 1 the screen gets messed up, resulting in some sort of delayed, interlaced display. I can''t figure out why this is happening while my setup code is quite plain and standard (it''s on my laptop so I can''t post it right now). Maybe one of you has experienced this as well and has a solution or other thoughts. Thanks in advance.

Share this post

Link to post
Share on other sites
Do the DDraw SDK samples that perform flipping have this same problem on your machine?

Share this post

Link to post
Share on other sites
Dunno about the samples, I don''t have any SDK installed as I use the header files that came with VC. Could this be a problem? Didn''t have any problems with it so far.
(I have the DX5 docs though, which leads me to thinking it has something to do with DDFLIP_WAIT / DDERR_WASSTILLDRAWING).
Well I''m going to do some more investigation, might be back soon

Tnx so far.

Share this post

Link to post
Share on other sites
I might be able to help if you can post some code.

Also, you can error Check like this:

Instead of:


//it''s not workin'', Pa!!!
return 0; //or whatever

Share this post

Link to post
Share on other sites
Ok, here's how I create the flipping chain (should be familiar):

memset( &ddsd, 0, sizeof(ddsd) );
ddsd.dwSize = sizeof( ddsd );
ddsd.dwBackBufferCount = 1;

//Create Primary Surface

ddrval = lpDD->CreateSurface( &ddsd, &lpDDSPrimary_, NULL );
if( ddrval != DD_OK )
return DXError( DXERR_INIT, "Create primary surface");
lpDDSPrimary_->QueryInterface( IID_IDirectDrawSurface3, (void**)&lpDDSPrimary );

DDSCAPS ddscaps;
ZeroMemory( &ddscaps, sizeof( ddscaps ) );
ddscaps.dwCaps = DDSCAPS_BACKBUFFER;
ddrval = lpDDSPrimary->GetAttachedSurface( &ddscaps, &lpDDSBack );
if( ddrval != DD_OK )
return DXError( DXERR_INIT, "GetAttachedSurface");

Note: with dwBackbuffer to 2, it runs flawlessly.
(edit: sorry, source tag screws up identation)

[edited by - Prototype on November 22, 2002 2:17:57 PM]

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!