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>
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>
EffectType = 0x8001,
}
@ -344,9 +341,6 @@ namespace OpenTK.OpenAL.Enums
///<summary>A list of valid Int32 Filter/GetFilter parameters</summary>
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>
FilterType = 0x8001,
}

View file

@ -1,6 +1,6 @@
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.
"alutLoadMemoryFromFile, alutLoadMemoryFromFileImage, alutLoadMemoryHelloWorld, alutLoadMemoryWaveform"
@ -36,9 +36,11 @@ Alpha v0.95
- commented out debugging Console.WriteLines, replaced errormessages with Trace.Writeline
- 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:
- Identify: AL_FILTER_FIRST_PARAMETER, AL_FILTER_LAST_PARAMETER
AL_EFFECT_FIRST_PARAMETER, AL_EFFECT_LAST_PARAMETER
- replace EaxEfx reverbs with Efx reverbs.
- keep both reverb preset formats, or delete EaxEfxReverb presets?

View file

@ -31,12 +31,12 @@ namespace OpenTK.OpenAL
#region X-RAM Function pointer definitions
[CLSCompliant(false)]
private delegate bool Delegate_SetBufferMode( int n,ref uint buffers,int value );
[CLSCompliant( false )]
private delegate bool Delegate_SetBufferMode( int n, ref uint buffers, int value );
//typedef ALboolean (__cdecl *EAXSetBufferMode)(ALsizei n, ALuint *buffers, ALint value);
[CLSCompliant(false)]
private delegate int Delegate_GetBufferMode( uint buffer,IntPtr value );
[CLSCompliant( false )]
private delegate int Delegate_GetBufferMode( uint buffer, IntPtr value );
//typedef ALenum (__cdecl *EAXGetBufferMode)(ALuint buffer, ALint *value);
//[CLSCompliant(false)]
@ -58,14 +58,14 @@ namespace OpenTK.OpenAL
public XRamExtension( )
{ // Query if Extension supported and retrieve Tokens/Pointers if it is.
_valid = false;
if ( AL.IsExtensionPresent("EAX-RAM") == false )
if ( AL.IsExtensionPresent( "EAX-RAM" ) == false )
return;
AL_EAX_RAM_SIZE = AL.GetEnumValue("AL_EAX_RAM_SIZE");
AL_EAX_RAM_FREE = AL.GetEnumValue("AL_EAX_RAM_FREE");
AL_STORAGE_AUTOMATIC = AL.GetEnumValue("AL_STORAGE_AUTOMATIC");
AL_STORAGE_HARDWARE = AL.GetEnumValue("AL_STORAGE_HARDWARE");
AL_STORAGE_ACCESSIBLE = AL.GetEnumValue("AL_STORAGE_ACCESSIBLE");
AL_EAX_RAM_SIZE = AL.GetEnumValue( "AL_EAX_RAM_SIZE" );
AL_EAX_RAM_FREE = AL.GetEnumValue( "AL_EAX_RAM_FREE" );
AL_STORAGE_AUTOMATIC = AL.GetEnumValue( "AL_STORAGE_AUTOMATIC" );
AL_STORAGE_HARDWARE = AL.GetEnumValue( "AL_STORAGE_HARDWARE" );
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);
@ -75,7 +75,7 @@ namespace OpenTK.OpenAL
AL_STORAGE_HARDWARE == 0 ||
AL_STORAGE_ACCESSIBLE == 0 )
{
Trace.WriteLine("Token values could not be retrieved.");
Trace.WriteLine( "X-Ram: Token values could not be retrieved." );
return;
}
@ -83,11 +83,11 @@ namespace OpenTK.OpenAL
try
{
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_GetBufferMode = (Delegate_GetBufferMode) Marshal.GetDelegateForFunctionPointer( AL.GetProcAddress( "EAXGetBufferMode" ), typeof( Delegate_GetBufferMode ) );
Imported_SetBufferMode = (Delegate_SetBufferMode) Marshal.GetDelegateForFunctionPointer( AL.GetProcAddress( "EAXSetBufferMode" ), typeof( Delegate_SetBufferMode ) );
} 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;
}
@ -101,13 +101,13 @@ namespace OpenTK.OpenAL
/// <summary>Query total amount of X-RAM in bytes.</summary>
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>
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>
@ -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>
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,
/// <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,
}
@ -126,27 +126,27 @@ namespace OpenTK.OpenAL
/// <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>
/// <returns>True if all the Buffers were successfully set to the requested storage mode, False otherwise.</returns>
[CLSCompliant(false)]
public bool SetBufferMode( int n,ref uint buffer,XRamStorage mode )
[CLSCompliant( false )]
public bool SetBufferMode( int n, ref uint buffer, XRamStorage mode )
{
switch ( mode )
{
case XRamStorage.Accessible:
return Imported_SetBufferMode(n,ref buffer,AL_STORAGE_ACCESSIBLE);
return Imported_SetBufferMode( n, ref buffer, AL_STORAGE_ACCESSIBLE );
case XRamStorage.Hardware:
return Imported_SetBufferMode(n,ref buffer,AL_STORAGE_HARDWARE);
return Imported_SetBufferMode( n, ref buffer, AL_STORAGE_HARDWARE );
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>
/// <param name="buffer">The handle of an OpenAL Buffer.</param>
/// <returns>The current Mode of the Buffer.</returns>
[CLSCompliant(false)]
[CLSCompliant( false )]
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 )
return XRamStorage.Accessible;