minor corrections.

This commit is contained in:
chrisbrandtner 2008-01-28 15:05:39 +00:00
parent fef3329a54
commit 3b61ea541c
3 changed files with 30 additions and 34 deletions

View file

@ -220,9 +220,6 @@ namespace OpenTK.OpenAL.Enums
///<summary>When this flag is set, the high-frequency decay time automatically stays below a limit value that's derived from the setting of the property AirAbsorptionGainHF. Unit: (0) False, (1) True Range [False, True] Default: True</summary> ///<summary>When this flag is set, the high-frequency decay time automatically stays below a limit value that's derived from the setting of the property AirAbsorptionGainHF. Unit: (0) False, (1) True Range [False, True] Default: True</summary>
EaxReverbDecayHFLimit = 0x0017, EaxReverbDecayHFLimit = 0x0017,
AL_EFFECT_FIRST_PARAMETER = 0x0000,// deprecated?
AL_EFFECT_LAST_PARAMETER = 0x8000, // deprecated?
/// <summary>Used with the enum EfxEffectType as it's parameter.</summary> /// <summary>Used with the enum EfxEffectType as it's parameter.</summary>
EffectType = 0x8001, EffectType = 0x8001,
} }
@ -344,9 +341,6 @@ namespace OpenTK.OpenAL.Enums
///<summary>A list of valid Int32 Filter/GetFilter parameters</summary> ///<summary>A list of valid Int32 Filter/GetFilter parameters</summary>
public enum EfxFilteri : int public enum EfxFilteri : int
{ {
AL_FILTER_FIRST_PARAMETER = 0x0000, // deprecated?
AL_FILTER_LAST_PARAMETER = 0x8000, // deprecated?
/// <summary>Used with the enum EfxFilterType as Parameter to select a filter logic.</summary> /// <summary>Used with the enum EfxFilterType as Parameter to select a filter logic.</summary>
FilterType = 0x8001, FilterType = 0x8001,
} }

View file

@ -1,6 +1,6 @@
Version History: Version History:
Alpha v0.1 - 0.8 Alpha v0.1 - 0.9
- Alut: The following functions are not bound/imported. Issue of undoing C malloc to prevent memory leaks. - Alut: The following functions are not bound/imported. Issue of undoing C malloc to prevent memory leaks.
"alutLoadMemoryFromFile, alutLoadMemoryFromFileImage, alutLoadMemoryHelloWorld, alutLoadMemoryWaveform" "alutLoadMemoryFromFile, alutLoadMemoryFromFileImage, alutLoadMemoryHelloWorld, alutLoadMemoryWaveform"
@ -36,9 +36,11 @@ Alpha v0.95
- commented out debugging Console.WriteLines, replaced errormessages with Trace.Writeline - commented out debugging Console.WriteLines, replaced errormessages with Trace.Writeline
- Added description for most enums. - Added description for most enums.
Alpha v0.96
- Removed: AL_FILTER_FIRST_PARAMETER, AL_FILTER_LAST_PARAMETER, AL_EFFECT_FIRST_PARAMETER, AL_EFFECT_LAST_PARAMETER
they were merely used to reserve the range 0x0000 - 0x8000 for future filters/effects.
- some spelling errors corrected
Todo for beta: Todo for beta:
- Identify: AL_FILTER_FIRST_PARAMETER, AL_FILTER_LAST_PARAMETER
AL_EFFECT_FIRST_PARAMETER, AL_EFFECT_LAST_PARAMETER
- replace EaxEfx reverbs with Efx reverbs. - replace EaxEfx reverbs with Efx reverbs.
- keep both reverb preset formats, or delete EaxEfxReverb presets? - keep both reverb preset formats, or delete EaxEfxReverb presets?

View file

@ -31,12 +31,12 @@ namespace OpenTK.OpenAL
#region X-RAM Function pointer definitions #region X-RAM Function pointer definitions
[CLSCompliant(false)] [CLSCompliant( false )]
private delegate bool Delegate_SetBufferMode( int n,ref uint buffers,int value ); private delegate bool Delegate_SetBufferMode( int n, ref uint buffers, int value );
//typedef ALboolean (__cdecl *EAXSetBufferMode)(ALsizei n, ALuint *buffers, ALint value); //typedef ALboolean (__cdecl *EAXSetBufferMode)(ALsizei n, ALuint *buffers, ALint value);
[CLSCompliant(false)] [CLSCompliant( false )]
private delegate int Delegate_GetBufferMode( uint buffer,IntPtr value ); private delegate int Delegate_GetBufferMode( uint buffer, IntPtr value );
//typedef ALenum (__cdecl *EAXGetBufferMode)(ALuint buffer, ALint *value); //typedef ALenum (__cdecl *EAXGetBufferMode)(ALuint buffer, ALint *value);
//[CLSCompliant(false)] //[CLSCompliant(false)]
@ -58,14 +58,14 @@ namespace OpenTK.OpenAL
public XRamExtension( ) public XRamExtension( )
{ // Query if Extension supported and retrieve Tokens/Pointers if it is. { // Query if Extension supported and retrieve Tokens/Pointers if it is.
_valid = false; _valid = false;
if ( AL.IsExtensionPresent("EAX-RAM") == false ) if ( AL.IsExtensionPresent( "EAX-RAM" ) == false )
return; return;
AL_EAX_RAM_SIZE = AL.GetEnumValue("AL_EAX_RAM_SIZE"); AL_EAX_RAM_SIZE = AL.GetEnumValue( "AL_EAX_RAM_SIZE" );
AL_EAX_RAM_FREE = AL.GetEnumValue("AL_EAX_RAM_FREE"); AL_EAX_RAM_FREE = AL.GetEnumValue( "AL_EAX_RAM_FREE" );
AL_STORAGE_AUTOMATIC = AL.GetEnumValue("AL_STORAGE_AUTOMATIC"); AL_STORAGE_AUTOMATIC = AL.GetEnumValue( "AL_STORAGE_AUTOMATIC" );
AL_STORAGE_HARDWARE = AL.GetEnumValue("AL_STORAGE_HARDWARE"); AL_STORAGE_HARDWARE = AL.GetEnumValue( "AL_STORAGE_HARDWARE" );
AL_STORAGE_ACCESSIBLE = AL.GetEnumValue("AL_STORAGE_ACCESSIBLE"); AL_STORAGE_ACCESSIBLE = AL.GetEnumValue( "AL_STORAGE_ACCESSIBLE" );
// Console.WriteLine("RamSize: {0} RamFree: {1} StorageAuto: {2} StorageHW: {3} StorageAccess: {4}",AL_EAX_RAM_SIZE,AL_EAX_RAM_FREE,AL_STORAGE_AUTOMATIC,AL_STORAGE_HARDWARE,AL_STORAGE_ACCESSIBLE); // Console.WriteLine("RamSize: {0} RamFree: {1} StorageAuto: {2} StorageHW: {3} StorageAccess: {4}",AL_EAX_RAM_SIZE,AL_EAX_RAM_FREE,AL_STORAGE_AUTOMATIC,AL_STORAGE_HARDWARE,AL_STORAGE_ACCESSIBLE);
@ -75,7 +75,7 @@ namespace OpenTK.OpenAL
AL_STORAGE_HARDWARE == 0 || AL_STORAGE_HARDWARE == 0 ||
AL_STORAGE_ACCESSIBLE == 0 ) AL_STORAGE_ACCESSIBLE == 0 )
{ {
Trace.WriteLine("Token values could not be retrieved."); Trace.WriteLine( "X-Ram: Token values could not be retrieved." );
return; return;
} }
@ -83,11 +83,11 @@ namespace OpenTK.OpenAL
try try
{ {
Imported_GetBufferMode = (Delegate_GetBufferMode) Marshal.GetDelegateForFunctionPointer(AL.GetProcAddress("EAXGetBufferMode"),typeof(Delegate_GetBufferMode)); Imported_GetBufferMode = (Delegate_GetBufferMode) Marshal.GetDelegateForFunctionPointer( AL.GetProcAddress( "EAXGetBufferMode" ), typeof( Delegate_GetBufferMode ) );
Imported_SetBufferMode = (Delegate_SetBufferMode) Marshal.GetDelegateForFunctionPointer(AL.GetProcAddress("EAXSetBufferMode"),typeof(Delegate_SetBufferMode)); Imported_SetBufferMode = (Delegate_SetBufferMode) Marshal.GetDelegateForFunctionPointer( AL.GetProcAddress( "EAXSetBufferMode" ), typeof( Delegate_SetBufferMode ) );
} catch ( Exception e ) } catch ( Exception e )
{ {
Trace.WriteLine("Attempt to marshal function pointers with AL.GetProcAddress failed. " + e.ToString( )); Trace.WriteLine( "X-Ram: Attempt to marshal function pointers with AL.GetProcAddress failed. " + e.ToString( ) );
return; return;
} }
@ -101,13 +101,13 @@ namespace OpenTK.OpenAL
/// <summary>Query total amount of X-RAM in bytes.</summary> /// <summary>Query total amount of X-RAM in bytes.</summary>
public int GetRamSize( ) public int GetRamSize( )
{ {
return AL.Get((Enums.ALGetInteger) AL_EAX_RAM_SIZE); return AL.Get( (Enums.ALGetInteger) AL_EAX_RAM_SIZE );
} }
/// <summary>Query free X-RAM available in bytes.</summary> /// <summary>Query free X-RAM available in bytes.</summary>
public int GetRamFree( ) public int GetRamFree( )
{ {
return AL.Get((Enums.ALGetInteger) AL_EAX_RAM_FREE); return AL.Get( (Enums.ALGetInteger) AL_EAX_RAM_FREE );
} }
/// <summary>This enum is used to abstract the need of using AL.GetEnumValue() with the Extension. The values do NOT correspond to AL_STORAGE_* tokens!</summary> /// <summary>This enum is used to abstract the need of using AL.GetEnumValue() with the Extension. The values do NOT correspond to AL_STORAGE_* tokens!</summary>
@ -115,9 +115,9 @@ namespace OpenTK.OpenAL
{ {
/// <summary>Put an Open AL Buffer into X-RAM if memory is available, otherwise use host RAM. This is the default mode.</summary> /// <summary>Put an Open AL Buffer into X-RAM if memory is available, otherwise use host RAM. This is the default mode.</summary>
Automatic = 0, Automatic = 0,
/// <summary>Force an Open AL Buffer into X-RAM (good for non-streaming buffers)</summary> /// <summary>Force an Open AL Buffer into X-RAM, good for non-streaming buffers.</summary>
Hardware = 1, Hardware = 1,
/// <summary>Force an Open AL Buffer into 'accessible' (currently host) RAM (good for streaming buffers)</summary> /// <summary>Force an Open AL Buffer into 'accessible' (currently host) RAM, good for streaming buffers.</summary>
Accessible = 2, Accessible = 2,
} }
@ -126,27 +126,27 @@ namespace OpenTK.OpenAL
/// <param name="buffer">An array of OpenAL Buffer handles.</param> /// <param name="buffer">An array of OpenAL Buffer handles.</param>
/// <param name="mode">The storage mode that should be used for all the given buffers. Should be the value of one of the following enum names: XRamStorage.Automatic, XRamStorage.Hardware, XRamStorage.Accessible</param> /// <param name="mode">The storage mode that should be used for all the given buffers. Should be the value of one of the following enum names: XRamStorage.Automatic, XRamStorage.Hardware, XRamStorage.Accessible</param>
/// <returns>True if all the Buffers were successfully set to the requested storage mode, False otherwise.</returns> /// <returns>True if all the Buffers were successfully set to the requested storage mode, False otherwise.</returns>
[CLSCompliant(false)] [CLSCompliant( false )]
public bool SetBufferMode( int n,ref uint buffer,XRamStorage mode ) public bool SetBufferMode( int n, ref uint buffer, XRamStorage mode )
{ {
switch ( mode ) switch ( mode )
{ {
case XRamStorage.Accessible: case XRamStorage.Accessible:
return Imported_SetBufferMode(n,ref buffer,AL_STORAGE_ACCESSIBLE); return Imported_SetBufferMode( n, ref buffer, AL_STORAGE_ACCESSIBLE );
case XRamStorage.Hardware: case XRamStorage.Hardware:
return Imported_SetBufferMode(n,ref buffer,AL_STORAGE_HARDWARE); return Imported_SetBufferMode( n, ref buffer, AL_STORAGE_HARDWARE );
default: default:
return Imported_SetBufferMode(n,ref buffer,AL_STORAGE_AUTOMATIC); return Imported_SetBufferMode( n, ref buffer, AL_STORAGE_AUTOMATIC );
} }
} }
/// <summary>This function is used to retrieve the storage Mode of a single OpenAL Buffer.</summary> /// <summary>This function is used to retrieve the storage Mode of a single OpenAL Buffer.</summary>
/// <param name="buffer">The handle of an OpenAL Buffer.</param> /// <param name="buffer">The handle of an OpenAL Buffer.</param>
/// <returns>The current Mode of the Buffer.</returns> /// <returns>The current Mode of the Buffer.</returns>
[CLSCompliant(false)] [CLSCompliant( false )]
public XRamStorage GetBufferMode( ref uint buffer ) public XRamStorage GetBufferMode( ref uint buffer )
{ {
int tempresult= Imported_GetBufferMode(buffer,IntPtr.Zero); // IntPtr.Zero due to the parameter being unused/reserved atm int tempresult = Imported_GetBufferMode( buffer, IntPtr.Zero ); // IntPtr.Zero due to the parameter being unused/reserved atm
if ( tempresult == AL_STORAGE_ACCESSIBLE ) if ( tempresult == AL_STORAGE_ACCESSIBLE )
return XRamStorage.Accessible; return XRamStorage.Accessible;