DOUBLE BUFFER C++/WIN32?

1. Which class can represent a (fast) double buffer?

2. How do I draw to it?

3. How do I draw it to the screen?



Any help will be appreciated. Thanks.


Comments

  • how do you draw to the screen?



    assuming that...

    LPDIRECTDRAWSURFACE4 lpddsprimary = NULL;



    you flip it like this:



    lpddsprimary->Flip(NULL, DDFLIP_WAIT);



    how do you draw to the 2x buffer? depends on what you wanna draw. lines? pixels? bitmaps?



    just e-mail me: [email protected]













    : 1. Which class can represent a (fast) double buffer?

    : 2. How do I draw to it?

    : 3. How do I draw it to the screen?

    :

    : Any help will be appreciated. Thanks.

    :






  • : how do you draw to the screen?
    :
    : assuming that...
    : LPDIRECTDRAWSURFACE4 lpddsprimary = NULL;
    :
    : you flip it like this:
    :
    : lpddsprimary->Flip(NULL, DDFLIP_WAIT);
    :
    : how do you draw to the 2x buffer? depends on what you wanna draw. lines? pixels? bitmaps?
    :
    : just e-mail me: [email protected]
    :
    :
    :
    :
    :
    :
    : : 1. Which class can represent a (fast) double buffer?
    : : 2. How do I draw to it?
    : : 3. How do I draw it to the screen?
    : :
    : : Any help will be appreciated. Thanks.
    : :
    There is more stuff you have to do to initiate the direct draw primary buffer. First off you also need to create a secondary buffer:
    LPDIRECTDRAWSURFACE4 lpddsprimary=NULL;
    LPDIRECTDRAWSURFACE4 lpddssecond=NULL;

    ZeroMemory(&ddsd,sizeof(ddsd));
    ddsd.dwSize = sizeof( ddsd );
    ddsd.dwBackBufferCount = 1;//tells how many back buffers there //are
    ddsd.dwFlags = DDSD_CAPS | DDSD_BACKBUFFERCOUNT;
    ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE | DDSCAPS_FLIP | DDSCAPS_COMPLEX;
    lpDD->CreateSurface( &ddsd, &lpDDSPrimary, NULL );
    //back buffer
    ddscaps.dwCaps=DDSCAPS_BACKBUFFER;
    lpddsprimary->GetAttachedSurface(&ddscaps,&lpddssecond);

    any questions please post your question

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion