Specify correct sizes for Alc.GetInteger buffers (needs size in integers, not size in bytes).

This commit is contained in:
the_fiddler 2009-07-17 21:21:52 +00:00
parent cbe3bc6bbb
commit d021884d01

View file

@ -342,11 +342,11 @@ namespace OpenTK.Audio
device_name = Alc.GetString(device_handle, AlcGetString.DeviceSpecifier);
int attribute_count;
Alc.GetInteger(device_handle, AlcGetInteger.AttributesSize, sizeof(int), out attribute_count);
Alc.GetInteger(device_handle, AlcGetInteger.AttributesSize, 1, out attribute_count);
if (attribute_count > 0)
{
int[] device_attributes = new int[attribute_count];
Alc.GetInteger(device_handle, AlcGetInteger.AllAttributes, device_attributes.Length * sizeof(int), out device_attributes[0]);
Alc.GetInteger(device_handle, AlcGetInteger.AllAttributes, device_attributes.Length, device_attributes);
foreach (int attr in device_attributes)
{
switch ((AlcContextAttributes)attr)