Fixed spacing.

Normalized [Gen|Delete][Buffers|Sources] overload parameters. Added singular versions (1 parameter to generate/delete only).
This commit is contained in:
the_fiddler 2008-04-04 21:33:08 +00:00
parent 4b45494433
commit 01106c7a0e

View file

@ -448,80 +448,62 @@ namespace OpenTK.Audio
#region DeleteSources()
[CLSCompliant( false ), DllImport( AL.Lib, EntryPoint = "alDeleteSources", ExactSpelling = true, CallingConvention = AL.Style ), SuppressUnmanagedCodeSecurity( )]
/// <summary>This function deletes one or more sources.</summary>
/// <param name="n">The number of sources to be deleted.</param>
/// <param name="sources">Pointer to an array of source names identifying the sources to be deleted.</param>
[CLSCompliant(false)]
[DllImport(AL.Lib, EntryPoint = "alDeleteSources", ExactSpelling = true, CallingConvention = AL.Style), SuppressUnmanagedCodeSecurity()]
unsafe public static extern void DeleteSources(int n, [In] uint* sources); // Delete Source objects
// AL_API void AL_APIENTRY alDeleteSources( ALsizei n, const ALuint* Sources );
/// <summary>This function deletes one or more sources.</summary>
/// <param name="n">The number of sources to be deleted.</param>
/// <param name="sources">Pointer to an array of source names identifying the sources to be deleted.</param>
/// <param name="sources">Reference to a single source, or an array of source names identifying the sources to be deleted.</param>
[CLSCompliant(false)]
public static void DeleteSources( int n, ref uint[] sources )
{
unsafe
{
fixed ( uint* ptr = sources )
{
DeleteSources( n, (uint*) ptr );
}
}
}
[DllImport(AL.Lib, EntryPoint = "alDeleteSources", ExactSpelling = true, CallingConvention = AL.Style), SuppressUnmanagedCodeSecurity()]
public static extern void DeleteSources(int n, ref uint sources);
/// <summary>This function deletes one or more sources.</summary>
/// <param name="n">The number of sources to be deleted.</param>
/// <param name="sources">Pointer to an array of source names identifying the sources to be deleted.</param>
/// <param name="sources">Reference to a single source, or an array of source names identifying the sources to be deleted.</param>
[CLSCompliant(true)]
public static void DeleteSources( int n, ref int[] sources )
[DllImport(AL.Lib, EntryPoint = "alDeleteSources", ExactSpelling = true, CallingConvention = AL.Style), SuppressUnmanagedCodeSecurity()]
public static extern void DeleteSources(int n, ref int sources);
/// <summary>This function deletes one or more sources.</summary>
/// <param name="sources">An array of source names identifying the sources to be deleted.</param>
[CLSCompliant(false)]
public static void DeleteSources(uint[] sources)
{
uint[] temp = new uint[n];
for ( int i = 0 ; i < n ; i++ )
{
temp[i] = (uint) sources[i];
}
DeleteSources( n, ref temp );
if (sources == null) throw new ArgumentNullException();
if (sources.Length == 0) throw new ArgumentOutOfRangeException();
DeleteBuffers(sources.Length, ref sources[0]);
}
/// <summary>This function deletes one or more sources.</summary>
/// <param name="sources">Pointer to an array of source names identifying the sources to be deleted.</param>
/// <param name="sources">An array of source names identifying the sources to be deleted.</param>
[CLSCompliant(true)]
public static void DeleteSources(int[] sources)
{
uint[] temp = new uint[sources.Length];
for ( int i = 0 ; i < temp.Length ; i++ )
{
temp[i] = (uint) sources[i];
}
DeleteSources( temp.Length, ref temp );
if (sources == null) throw new ArgumentNullException();
if (sources.Length == 0) throw new ArgumentOutOfRangeException();
DeleteBuffers(sources.Length, ref sources[0]);
}
/// <summary>This function deletes one source only.</summary>
/// <param name="source">Pointer to a source name identifying the source to be deleted.</param>
[CLSCompliant(false)]
public static void DeleteSources( ref uint source )
public static void DeleteSource(uint source)
{
uint[] temp = new uint[1];
temp[0] = source;
DeleteSources( 1, ref temp );
DeleteSources(1, ref source);
}
/// <summary>This function deletes one source only.</summary>
/// <param name="source">Pointer to a source name identifying the source to be deleted.</param>
[CLSCompliant(true)]
public static void DeleteSources( ref int source )
public static void DeleteSource(int source)
{
uint[] temp = new uint[1];
temp[0] = (uint) source;
DeleteSources( 1, ref temp );
}
/// <summary>This function deletes one source only.</summary>
/// <param name="source">Pointer to a source name identifying the source to be deleted.</param>
[CLSCompliant( true )]
public static void DeleteSources( int source )
{
uint[] temp = new uint[1];
temp[0] = (uint) source;
DeleteSources( 1, ref temp );
DeleteSources(1, ref source);
}
#endregion DeleteSources()
@ -1339,7 +1321,8 @@ namespace OpenTK.Audio
/// <summary>This function deletes one or more buffers, freeing the resources used by the buffer. Buffers which are attached to a source can not be deleted. See AL.Source (ALSourcei) and AL.SourceUnqueueBuffers for information on how to detach a buffer from a source.</summary>
/// <param name="n">The number of buffers to be deleted.</param>
/// <param name="buffers">Pointer to an array of buffer names identifying the buffers to be deleted.</param>
[CLSCompliant( false ), DllImport( AL.Lib, EntryPoint = "alDeleteBuffers", ExactSpelling = true, CallingConvention = AL.Style ), SuppressUnmanagedCodeSecurity( )]
[CLSCompliant(false)]
[DllImport(AL.Lib, EntryPoint = "alDeleteBuffers", ExactSpelling = true, CallingConvention = AL.Style), SuppressUnmanagedCodeSecurity()]
unsafe public static extern void DeleteBuffers(int n, [In] uint* buffers);
// AL_API void AL_APIENTRY alDeleteBuffers( ALsizei n, const ALuint* Buffers );
@ -1347,29 +1330,24 @@ namespace OpenTK.Audio
/// <param name="n">The number of buffers to be deleted.</param>
/// <param name="buffers">Pointer to an array of buffer names identifying the buffers to be deleted.</param>
[CLSCompliant(false)]
public static void DeleteBuffers( int n, ref uint[] buffers )
{
unsafe
{
fixed ( uint* ptr = buffers )
{
DeleteBuffers( n, (uint*) ptr );
}
}
}
[DllImport(AL.Lib, EntryPoint = "alDeleteBuffers", ExactSpelling = true, CallingConvention = AL.Style), SuppressUnmanagedCodeSecurity()]
public static extern void DeleteBuffers(int n, [In] ref uint buffers);
/// <summary>This function deletes one or more buffers, freeing the resources used by the buffer. Buffers which are attached to a source can not be deleted. See AL.Source (ALSourcei) and AL.SourceUnqueueBuffers for information on how to detach a buffer from a source.</summary>
/// <param name="n">The number of buffers to be deleted.</param>
/// <param name="buffers">Pointer to an array of buffer names identifying the buffers to be deleted.</param>
[CLSCompliant(true)]
public static void DeleteBuffers( int n, ref int[] buffers )
[DllImport(AL.Lib, EntryPoint = "alDeleteBuffers", ExactSpelling = true, CallingConvention = AL.Style), SuppressUnmanagedCodeSecurity()]
public static extern void DeleteBuffers(int n, [In] ref int buffers);
/// <summary>This function deletes one buffer only, freeing the resources used by the buffer. Buffers which are attached to a source can not be deleted. See AL.Source (ALSourcei) and AL.SourceUnqueueBuffers for information on how to detach a buffer from a source.</summary>
/// <param name="buffer">Pointer to a buffer name identifying the buffer to be deleted.</param>
[CLSCompliant(false)]
public static void DeleteBuffers(uint[] buffers)
{
uint[] temp = new uint[n];
for ( int i = 0 ; i < n ; i++ )
{
temp[i] = (uint) buffers[i];
}
DeleteBuffers( n, ref temp );
if (buffers == null) throw new ArgumentNullException();
if (buffers.Length == 0) throw new ArgumentOutOfRangeException();
DeleteBuffers(buffers.Length, ref buffers[0]);
}
/// <summary>This function deletes one or more buffers, freeing the resources used by the buffer. Buffers which are attached to a source can not be deleted. See AL.Source (ALSourcei) and AL.SourceUnqueueBuffers for information on how to detach a buffer from a source.</summary>
@ -1378,44 +1356,25 @@ namespace OpenTK.Audio
[CLSCompliant(true)]
public static void DeleteBuffers(int[] buffers)
{
uint[] temp = new uint[buffers.Length];
for ( int i = 0 ; i < temp.Length ; i++ )
{
temp[i] = (uint) buffers[i];
}
DeleteBuffers( temp.Length, ref temp );
if (buffers == null) throw new ArgumentNullException();
if (buffers.Length == 0) throw new ArgumentOutOfRangeException();
DeleteBuffers(buffers.Length, ref buffers[0]);
}
/// <summary>This function deletes one buffer only, freeing the resources used by the buffer. Buffers which are attached to a source can not be deleted. See AL.Source (ALSourcei) and AL.SourceUnqueueBuffers for information on how to detach a buffer from a source.</summary>
/// <param name="buffer">Pointer to a buffer name identifying the buffer to be deleted.</param>
[CLSCompliant(false)]
public static void DeleteBuffers( ref uint buffer )
public static void DeleteBuffer(uint buffer)
{
unsafe
{
fixed ( uint* ptr = &buffer )
{
DeleteBuffers( 1, (uint*) ptr );
}
}
DeleteBuffers(1, ref buffer);
}
/// <summary>This function deletes one buffer only, freeing the resources used by the buffer. Buffers which are attached to a source can not be deleted. See AL.Source (ALSourcei) and AL.SourceUnqueueBuffers for information on how to detach a buffer from a source.</summary>
/// <param name="buffer">Pointer to a buffer name identifying the buffer to be deleted.</param>
[CLSCompliant(true)]
public static void DeleteBuffers( ref int buffer )
public static void DeleteBuffer(int buffer)
{
uint temp = (uint) buffer;
DeleteBuffers( ref temp );
}
/// <summary>This function deletes one buffer only, freeing the resources used by the buffer. Buffers which are attached to a source can not be deleted. See AL.Source (ALSourcei) and AL.SourceUnqueueBuffers for information on how to detach a buffer from a source.</summary>
/// <param name="buffer">Pointer to a buffer name identifying the buffer to be deleted.</param>
[CLSCompliant( true )]
public static void DeleteBuffers( int buffer )
{
uint temp = (uint) buffer;
DeleteBuffers( ref temp );
DeleteBuffers(1, ref buffer);
}
#endregion DeleteBuffers
@ -1611,5 +1570,4 @@ namespace OpenTK.Audio
#endregion Global Parameters
}
}