lid6j86's picture

OpenAL gen buffers tutorial

I'm following the OpenAL tutorial in the documentation and have already run into a problem. When I get to

AL.GenBuffers(2, out MyBuffers);

It produces an error, saying:

Argument 2:cannot convert from 'out uint[] to 'out int'
The best overloaded method match for 'OpenTK.Audio.OpenAL.AL.GenBuffers(int, out int)' has some invalid arguments


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
the Fiddler's picture

That was a typo in the documentation, fixed now:

int[] MyBuffers = AL.GenBuffers(2);
lid6j86's picture

any reason the way presented won't work? looks like there is an overload that would allow it, am I misinterpreting? (by the way the change worked, thanks)

Also, some other parts of it may be slightly dated as well. The XRam portion doesn't have any overloads that accept only 2 arguments.

the Fiddler's picture

There is no int[] overload, only out int. You can pass out MyBuffers[0] and that will work, but it looks a bit ugly.

The long-term solution would be to autogenerate the OpenAL bindings using the binding generator. That way we'd get a consistent interface (e.g. this issue wouldn't exist in the first place), automatic error detection and other nice things . However, an OpenAL xml registry does not (yet) exist so this is going to take a while.