Re: GLU.Tessellator crashes

Jules Bean <[email protected]>
Newsgroups gmane.comp.lang.haskell.hopengl
Message-ID <[email protected]>
Balazs Komuves wrote:
> I found the cause of the crashes. A patch which should solve the problem
> (but changes the API, see below) is attached.

[snip]

> ...but the GLU implementation sets some of those pointers to 0:

How stupid! Good catch.

> Since the vertex annotations are of arbitrary type, there is no default
> value we could supply when GLU gives us zero pointers; thus I changed
> the type WeightedProperties to
> 
>     data WeightedProperties v =
>       WeightedProperties
>         (GLclampf, v)                   
>         (GLclampf, v)                   
>         (Maybe (GLclampf, v))
>         (Maybe (GLclampf, v))
> 
> 
> Maybe some other solution, like WeightedProperties2 ... | 
> WeightedProperties4 ...
> would be better...

Maybe just [(GLclampf, v)] ? The docs could note that the list will in 
practice probably be of length 2 or 4, but most of the situations I can 
imagine you would treat it more uniformly as a list anyway.

Jules
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.