DirectDraw Buffered Surface for a Primary Surface Flipping Chain 
Author Message
 DirectDraw Buffered Surface for a Primary Surface Flipping Chain

I am having no luck collating the breadcrumbs in the DX 8.1 SDK
documentation on how to create a flipping surface for the primary surface.

Using the DirectDraw Tutorial 2 as a chassis for the notes in ddraw.doc only
creates an Automation error.

The ddraw.doc note for "Creating Complex Surrfaces and Flipping Chains" is:
__________________________________________________________________
[Visual Basic]
The following example shows how to prepare for creating a primary surface
flipping chain.
Dim ddsd2 As DDSURFACEDESC2

// Tell DirectDraw which members are valid.
ddsd2.lFlags = DDSD_CAPS Or DDSD_BACKBUFFERCOUNT

// Request a primary surface with a single
// back buffer
ddsd2.ddsCaps.lCaps = DDSCAPS_COMPLEX Or DDSCAPS_FLIP Or
DDSCAPS_PRIMARYSURFACE
ddsd2.lBackBufferCount = 1

The previous example constructs a double-buffered flipping environment?a
single call to the DirectDrawSurface7.Flip method exchanges the surface
memory of the primary surface and the back buffer. If you specify 2 for the
value of the lBackBufferCount member of the DDSURFACEDESC2 type, two back
buffers are created, and each call to Flip rotates the surfaces in a
circular pattern, providing a triple-buffered flipping environment. For more
information, see Flipping Surfaces.
___________________________________________________________________

(Finding C comment prefixes in a VB code snippet does suggest that it may
not have been tested.)

Please, can anyone provide clues how to accomplish this elusive goal.

Cheers,
Ian.



Mon, 20 Jun 2005 02:11:52 GMT  
 DirectDraw Buffered Surface for a Primary Surface Flipping Chain
Thanks Patrice,

I captured the error.number and browsed for the meaning. The problem was the
CooperativeLevel was not set to DDSCL_EXCLUSIVE... reason being I have a
Windowed App and am not using full screen... which led me to slowly discover
that Flipping is ONLY used for full screen apps and is not suitable for
Windowed Apps. Flipping does work to a limited degree with Windowed Apps -
limited by the fact that Clipping does not seem to apply to the BackBuffer -
result: flip the buffer and the result is full screen.

The SDK documentation either didn't make this clear, or I had overlooked
it... I'm back to Blt. and not Flip.


Quote:
> And the automation error number is ? Usually this value is enough to find
> out by yourself what goes wrong. My guess would be that
SetCooperativeLevel
> is not called (and in this case the automation error number should be
> DERR_NOCOOPERATIVELEVELSET).

> Patrice



> > I am having no luck collating the breadcrumbs in the DX 8.1 SDK
> > documentation on how to create a flipping surface for the primary
surface.

> > Using the DirectDraw Tutorial 2 as a chassis for the notes in ddraw.doc
> only
> > creates an Automation error.

> > The ddraw.doc note for "Creating Complex Surrfaces and Flipping Chains"
> is:
> > __________________________________________________________________
> > [Visual Basic]
> > The following example shows how to prepare for creating a primary
surface
> > flipping chain.
> > Dim ddsd2 As DDSURFACEDESC2

> > // Tell DirectDraw which members are valid.
> > ddsd2.lFlags = DDSD_CAPS Or DDSD_BACKBUFFERCOUNT

> > // Request a primary surface with a single
> > // back buffer
> > ddsd2.ddsCaps.lCaps = DDSCAPS_COMPLEX Or DDSCAPS_FLIP Or
> > DDSCAPS_PRIMARYSURFACE
> > ddsd2.lBackBufferCount = 1

> > The previous example constructs a double-buffered flipping environment?a
> > single call to the DirectDrawSurface7.Flip method exchanges the surface
> > memory of the primary surface and the back buffer. If you specify 2 for
> the
> > value of the lBackBufferCount member of the DDSURFACEDESC2 type, two
back
> > buffers are created, and each call to Flip rotates the surfaces in a
> > circular pattern, providing a triple-buffered flipping environment. For
> more
> > information, see Flipping Surfaces.
> > ___________________________________________________________________

> > (Finding C comment prefixes in a VB code snippet does suggest that it
may
> > not have been tested.)

> > Please, can anyone provide clues how to accomplish this elusive goal.

> > Cheers,
> > Ian.



Tue, 21 Jun 2005 02:00:55 GMT  
 DirectDraw Buffered Surface for a Primary Surface Flipping Chain
And the automation error number is ? Usually this value is enough to find
out by yourself what goes wrong. My guess would be that SetCooperativeLevel
is not called (and in this case the automation error number should be
DERR_NOCOOPERATIVELEVELSET).

Patrice



Quote:
> I am having no luck collating the breadcrumbs in the DX 8.1 SDK
> documentation on how to create a flipping surface for the primary surface.

> Using the DirectDraw Tutorial 2 as a chassis for the notes in ddraw.doc
only
> creates an Automation error.

> The ddraw.doc note for "Creating Complex Surrfaces and Flipping Chains"
is:
> __________________________________________________________________
> [Visual Basic]
> The following example shows how to prepare for creating a primary surface
> flipping chain.
> Dim ddsd2 As DDSURFACEDESC2

> // Tell DirectDraw which members are valid.
> ddsd2.lFlags = DDSD_CAPS Or DDSD_BACKBUFFERCOUNT

> // Request a primary surface with a single
> // back buffer
> ddsd2.ddsCaps.lCaps = DDSCAPS_COMPLEX Or DDSCAPS_FLIP Or
> DDSCAPS_PRIMARYSURFACE
> ddsd2.lBackBufferCount = 1

> The previous example constructs a double-buffered flipping environment?a
> single call to the DirectDrawSurface7.Flip method exchanges the surface
> memory of the primary surface and the back buffer. If you specify 2 for
the
> value of the lBackBufferCount member of the DDSURFACEDESC2 type, two back
> buffers are created, and each call to Flip rotates the surfaces in a
> circular pattern, providing a triple-buffered flipping environment. For
more
> information, see Flipping Surfaces.
> ___________________________________________________________________

> (Finding C comment prefixes in a VB code snippet does suggest that it may
> not have been tested.)

> Please, can anyone provide clues how to accomplish this elusive goal.

> Cheers,
> Ian.



Tue, 21 Jun 2005 01:28:33 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. copying data from a DirectX8 surface to a DirectX 7 surface

2. writing text to a directdraw surface in vb.net

3. directdraw 7 surface problem

4. Directdraw surface transformation or Special bliting effects

5. DirectDraw problem drawing text on surface

6. dx9 directdraw surface

7. Wide surfaces /DirectDraw/DX7

8. Transparent drawing on DirectDraw surfaces

9. DD7 Double buffering, rotation of picture in surface

10. Surfacing DateTimePicker Events...

11. Drawing Surface/Video Mixing question

12. Hidden Surface Removal

 

 
Powered by phpBB® Forum Software