[Haskell-cafe] Is OpenAL unqueueBuffers implemented correctly?

alex at tapdancinggoats.com alex at tapdancinggoats.com
Tue Dec 25 05:03:51 CET 2012


Hi, there's no maintainer listed for the OpenAL package, so I'm posting 
here in hopes of finding the right person.

The unqueueBuffers function in Sound.OpenAL.AL.Source has the type

    Source -> [Buffer] -> IO ()

but I think the type should be

    Source -> Int -> IO [Buffer]

This wraps the function alSourceUnqueueBuffers which uses the array of 
buffers as an output argument. With the current implementation, it's 
impossible to get the list of buffers that were unqueued. This 
implementation works the way I expect:

    unqueueBuffers :: AL.Source -> Int -> IO [AL.Buffer]
    unqueueBuffers source nbuffers =
        allocaArray nbuffers $ \ptr -> do 
          alSourceUnqueueBuffers source (fromIntegral nbuffers) ptr
          peekArray nbuffers ptr

I just started using OpenAL, so I might be misunderstanding how this is 
supposed to work.

Thanks,
Alex Midgley
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20121224/9c28071a/attachment.htm>


More information about the Haskell-Cafe mailing list