Julien Nadeau <ve...@...> writes:

> How are you creating the AG_Pixmap widget? 

I'm assigning an animated SDL Surface to a notebook tap.
This notebook tap is part of one of three appl. windows.

>AG_PixmapFromSurface() will
> only map the surface argument without duplicating it, so the surface
> must remain valid for the lifetime of the widget.

Yes, that's the case ... but when I close the window by a mouse click the
notebook widget will be removed. The crash happens then at rendering time ...
Do we have here a race condition with a worker thread and the rendering action ?

I do also call cyclic AG_PixmapSetSurface() which is using a reference of the
pixel array of the related notbook tap.

Yes, it's a real killer if you close the referenced window :)
But a crash happens also w/o calling AG_PixmapSetSurface().

> AG_PixmapFromSurfaceCopy(), however, will implicitely duplicate the
> surface for you.

It's odd ... but it doesn't work with AG_PixmapFromSurfaceCopy() =:-]

> 
> To be consistent with what most other widgets use for functions accepting
> surface arguments, I should really rename them:
> 
>       AG_PixmapFromSurfaceCopy() -> AG_PixmapFromSurface()
>       AG_PixmapFromSurface() -> AG_PixmapFromSurfaceNODUP()
> 
> but unfortunately I can't do that without breaking compatibility.

The names of the lib calls are somtimes real odd ... e.g.  AG_PixmapSetSurface()
does request a refresh. What about AG_PixmapReqRefresh instead ?

The semantic of the library calls are real week documented. That's a pitty
because that lib is very, very nice!!

Cheers

--Armin
 


_______________________________________________
Agar mailing list
[email protected]
http://libagar.org/lists.html

Reply via email to