Re: [AD] [WIN] page flipping code summary

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


> You too, this is my patch, fixes EnumSurfaces and an extra check in the
> flip, Eric, does this need applying, or have you already done this, has it
> been tested on Voodoo3?

I've already posted a similar patch at SourceForge but it hasn't been
applied yet.
And yes, the current CVS code has successfully been tested on a Voodoo 3
card.

About your patch:
+   if (lpDDSurface == primbuffersurf) return DDENUMRET_OK;
Not useful: primbuffersurf is never enumerated.
Ok for the end of EnumSurfacesCallback().

+   if (invisible == primbuffersurf ||
+      invisible == backbuffersurf || invisible == tripbuffersurf) {
+         if (tripbuffersurf != NULL)
+  hr = IDirectDrawSurface_Flip(primbuffersurf, invisible, 0);
I think the first case (invisible == primbuffersurf) can be removed since
nothing then happens.
And I think we should keep the (backbuffersurf != NULL) test for the sake of
robustness.

-         if (FAILED(hr))
+         if (FAILED(hr) || tripbuffersurf == NULL)
             IDirectDrawSurface_Flip(primbuffersurf, invisible,
DDFLIP_WAIT);
I don't understand your handling of tripbuffersurf. In most cases, both
backbuffersurf and tripbuffersurf will be allocated when creating the
primary surface; afterwards, it's up to the programmer to properly code
either page flipping or triple buffering:
- for page flipping, the Allegro API function show_video_bitmap()
explicitely requests the system to wait for the flipping completeness, so
DDFLIP_WAIT must be set.
- for triple buffering, request_video_bitmap() doesn't request the system to
wait so DDFLIP_WAIT must not be set.

Eric.









Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/