Re: [AD] [WIN] page flipping again and again

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


> EnumSurfacesCallback looks fine for me, back is written on
> first call, trip on second, unless the prim is passed to it?

Not for me...

HRESULT WINAPI EnumSurfacesCallback (LPDIRECTDRAWSURFACE lpDDSurface,
 LPDDSURFACEDESC lpDDSurfaceDesc,LPVOID lpContext)
{
   if (backbuffersurf == NULL)
      backbuffersurf = lpDDSurface;

   if (tripbuffersurf == NULL)
      tripbuffersurf = lpDDSurface;

   return DDENUMRET_OK;
}

Before enumeration: backbuffersur = NULL, triplebuffersurf = NULL
First call to EnumSurfacesCallback with lpDDSurface = pointer to the DirectX
back buffer surface: *both* backbuffersurf and tripbuffersurf are assigned
with the pointer !!
Second call to EnumSurfacesCallback with lpDDSurface = pointer to the
DirectX triple buffer surface: nothing happens, the surface is lost.
The code should be:

HRESULT WINAPI EnumSurfacesCallback (LPDIRECTDRAWSURFACE lpDDSurface,
 LPDDSURFACEDESC lpDDSurfaceDesc,LPVOID lpContext)
{
   if (backbuffersurf == NULL)
      backbuffersurf = lpDDSurface;
  else if (tripbuffersurf == NULL)
      tripbuffersurf = lpDDSurface;

   return DDENUMRET_OK;
}

> > Related question: did you intentionally disable the FLIP_NOVSYNC
> capability
> > in the new code ?
>
>  Yes, this should surely be default behaviour for pageflip and
triplebuffer?

I wasn't sure of that because, on my ATI card, enabling the capability ends
up with a huge performance boost and no flicker. But the message by Javier
Gonzalez you've just replied to shows the flicker is back for Voodoo 3
cards.
George, could you definitely remove the patch at SourceForge ?

--
Eric Botcazou (ebotcazou@xxxxxxxxxx)
Web Site: http://www.multimania.com/ebotcazou



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