Opentk/Source/OpenTK/Audio/OpenAL/AL/Efx.cs

1370 lines
65 KiB
C#
Raw Normal View History

2008-01-16 18:43:52 +00:00
#region --- OpenTK.OpenAL License ---
/* EfxFunctions.cs
* C headers: \OpenAL 1.1 SDK\include\ "efx.h", "efx-creative.h", "Efx-Util.h"
* Spec: Effects Extension Guide.pdf (bundled with OpenAL SDK)
* Copyright (c) 2008 Christoph Brandtner and Stefanos Apostolopoulos
* See license.txt for license details
* http://www.OpenTK.net */
#endregion
using System;
2008-01-25 22:14:16 +00:00
using System.Diagnostics;
2008-01-16 18:43:52 +00:00
using System.Runtime.InteropServices;
using OpenTK.Math;
namespace OpenTK.Audio
2008-01-16 18:43:52 +00:00
{
2008-01-25 22:14:16 +00:00
public partial class EfxExtension
2008-01-16 18:43:52 +00:00
{
2008-01-25 22:14:16 +00:00
#region Helpers
#region BindEffect
/// <summary>(Helper) Selects the Effect type used by this Effect handle.</summary>
/// <param name="eid">Effect id returned from a successful call to GenEffects.</param>
/// <param name="type">Effect type.</param>
[CLSCompliant(false)]
2008-04-06 14:49:03 +00:00
public void BindEffect(uint eid, EfxEffectType type)
2008-01-25 22:14:16 +00:00
{
2008-04-06 14:49:03 +00:00
Imported_alEffecti(eid, EfxEffecti.EffectType, (int)type);
2008-01-25 22:14:16 +00:00
}
/// <summary>(Helper) Selects the Effect type used by this Effect handle.</summary>
/// <param name="eid">Effect id returned from a successful call to GenEffects.</param>
/// <param name="type">Effect type.</param>
2008-04-06 14:49:03 +00:00
[CLSCompliant(true)]
public void BindEffect(int eid, EfxEffectType type)
{
2008-04-06 14:49:03 +00:00
Imported_alEffecti((uint)eid, EfxEffecti.EffectType, (int)type);
}
2008-01-25 22:14:16 +00:00
#endregion BindEffect
#region BindFilterToSource
/// <summary>(Helper) reroutes the output of a Source through a Filter.</summary>
/// <param name="source">A valid Source handle.</param>
/// <param name="filter">A valid Filter handle.</param>
2008-04-06 14:49:03 +00:00
[CLSCompliant(false)]
public void BindFilterToSource(uint source, uint filter)
2008-01-25 22:14:16 +00:00
{
2008-04-06 14:49:03 +00:00
AL.Source(source, ALSourcei.EfxDirectFilter, (int)filter);
2008-01-25 22:14:16 +00:00
}
/// <summary>(Helper) reroutes the output of a Source through a Filter.</summary>
/// <param name="source">A valid Source handle.</param>
/// <param name="filter">A valid Filter handle.</param>
2008-04-06 14:49:03 +00:00
[CLSCompliant(true)]
public void BindFilterToSource(int source, int filter)
{
2008-04-06 14:49:03 +00:00
AL.Source((uint)source, ALSourcei.EfxDirectFilter, (int)filter);
}
2008-01-25 22:14:16 +00:00
#endregion BindFilterToSource
#region BindEffectToAuxiliarySlot
/// <summary>(Helper) Attaches an Effect to an Auxiliary Effect Slot.</summary>
/// <param name="auxiliaryeffectslot">The slot handle to attach the Effect to.</param>
/// <param name="effect">The Effect handle that is being attached.</param>
2008-04-06 14:49:03 +00:00
[CLSCompliant(false)]
public void BindEffectToAuxiliarySlot(uint auxiliaryeffectslot, uint effect)
2008-01-25 22:14:16 +00:00
{
2008-04-06 14:49:03 +00:00
AuxiliaryEffectSlot(auxiliaryeffectslot, EfxAuxiliaryi.EffectslotEffect, (int)effect);
2008-01-25 22:14:16 +00:00
}
/// <summary>(Helper) Attaches an Effect to an Auxiliary Effect Slot.</summary>
/// <param name="auxiliaryeffectslot">The slot handle to attach the Effect to.</param>
/// <param name="effect">The Effect handle that is being attached.</param>
2008-04-06 14:49:03 +00:00
[CLSCompliant(true)]
public void BindEffectToAuxiliarySlot(int auxiliaryeffectslot, int effect)
{
2008-04-06 14:49:03 +00:00
AuxiliaryEffectSlot((uint)auxiliaryeffectslot, EfxAuxiliaryi.EffectslotEffect, (int)effect);
}
2008-01-25 22:14:16 +00:00
#endregion BindEffectToAuxiliarySlot
#region BindSourceToAuxiliarySlot
/// <summary>(Helper) Reroutes a Source's output into an Auxiliary Effect Slot.</summary>
/// <param name="source">The Source handle who's output is forwarded.</param>
/// <param name="slot">The Auxiliary Effect Slot handle that receives input from the Source.</param>
/// <param name="slotnumber">Every Source has only a limited number of slots it can feed buffer to. The number must stay below AlcContextAttributes.EfxMaxAuxiliarySends</param>
2008-01-25 22:14:16 +00:00
/// <param name="filter">Filter handle to be attached between Source ouput and Auxiliary Slot input. Use 0 or EfxFilterType.FilterNull for no filter. </param>
2008-04-06 14:49:03 +00:00
[CLSCompliant(false)]
public void BindSourceToAuxiliarySlot(uint source, uint slot, int slotnumber, uint filter)
2008-01-25 22:14:16 +00:00
{
2008-04-06 14:49:03 +00:00
AL.Source(source, ALSource3i.EfxAuxiliarySendFilter, (int)slot, (int)slotnumber, (int)filter);
}
/// <summary>(Helper) Reroutes a Source's output into an Auxiliary Effect Slot.</summary>
/// <param name="source">The Source handle who's output is forwarded.</param>
/// <param name="slot">The Auxiliary Effect Slot handle that receives input from the Source.</param>
/// <param name="slotnumber">Every Source has only a limited number of slots it can feed buffer to. The number must stay below AlcContextAttributes.EfxMaxAuxiliarySends</param>
/// <param name="filter">Filter handle to be attached between Source ouput and Auxiliary Slot input. Use 0 or EfxFilterType.FilterNull for no filter. </param>
2008-04-06 14:49:03 +00:00
[CLSCompliant(true)]
public void BindSourceToAuxiliarySlot(int source, int slot, int slotnumber, int filter)
{
2008-04-06 14:49:03 +00:00
AL.Source((uint)source, ALSource3i.EfxAuxiliarySendFilter, (int)slot, (int)slotnumber, (int)filter);
2008-01-25 22:14:16 +00:00
}
#endregion BindSourceToAuxiliarySlot
#endregion Helpers
#region Effect Object
#region alGenEffects
2008-01-16 18:43:52 +00:00
//[CLSCompliant(false)]
2008-04-06 14:49:03 +00:00
unsafe private delegate void Delegate_alGenEffects(int n, [Out] uint* effects);
2008-01-25 22:14:16 +00:00
// typedef void (__cdecl *LPALGENEFFECTS)( ALsizei n, ALuint* effects );
//[CLSCompliant(false)]
private Delegate_alGenEffects Imported_alGenEffects;
2008-01-25 22:14:16 +00:00
/// <summary>The GenEffects function is used to create one or more Effect objects. An Effect object stores an effect type and a set of parameter values to control that Effect. In order to use an Effect it must be attached to an Auxiliary Effect Slot object</summary>
/// <remarks>After creation an Effect has no type (EfxEffectType.Null), so before it can be used to store a set of parameters, the application must specify what type of effect should be stored in the object, using Effect() with EfxEffecti.</remarks>
2008-01-18 17:24:39 +00:00
/// <param name="n">Number of Effects to be created.</param>
/// <param name="effects">Pointer addressing sufficient memory to store n Effect object identifiers.</param>
2008-04-06 14:49:03 +00:00
[CLSCompliant(false)]
public void GenEffects(int n, out uint effects)
{
unsafe
{
2008-04-06 14:49:03 +00:00
fixed (uint* ptr = &effects)
{
2008-04-06 14:49:03 +00:00
Imported_alGenEffects(n, ptr);
2008-01-18 17:24:39 +00:00
effects = *ptr;
}
}
}
/// <summary>The GenEffects function is used to create one or more Effect objects. An Effect object stores an effect type and a set of parameter values to control that Effect. In order to use an Effect it must be attached to an Auxiliary Effect Slot object</summary>
/// <remarks>After creation an Effect has no type (EfxEffectType.Null), so before it can be used to store a set of parameters, the application must specify what type of effect should be stored in the object, using Effect() with EfxEffecti.</remarks>
/// <param name="n">Number of Effects to be created.</param>
/// <param name="effects">Pointer addressing sufficient memory to store n Effect object identifiers.</param>
2008-04-06 14:49:03 +00:00
[CLSCompliant(true)]
public void GenEffects(int n, out int[] effects)
{
uint[] temp = new uint[n];
2008-04-06 14:49:03 +00:00
GenEffects(n, out temp[0]);
effects = new int[n];
2008-04-06 14:49:03 +00:00
for (int i = 0; i < n; i++)
{
2008-04-06 14:49:03 +00:00
effects[i] = (int)temp[i];
}
}
/// <summary>The GenEffects function is used to create one or more Effect objects. An Effect object stores an effect type and a set of parameter values to control that Effect. In order to use an Effect it must be attached to an Auxiliary Effect Slot object</summary>
/// <remarks>After creation an Effect has no type (EfxEffectType.Null), so before it can be used to store a set of parameters, the application must specify what type of effect should be stored in the object, using Effect() with EfxEffecti.</remarks>
/// <param name="effects">Pointer addressing sufficient memory to store n Effect object identifiers.</param>
2008-04-06 14:49:03 +00:00
[CLSCompliant(true)]
public void GenEffects(int[] effects)
{
uint[] temp = new uint[effects.Length];
2008-04-06 14:49:03 +00:00
GenEffects(temp.Length, out temp[0]);
for (int i = 0; i < temp.Length; i++)
{
2008-04-06 14:49:03 +00:00
effects[i] = (int)temp[i];
}
}
/// <summary>The GenEffects function is used to create one or more Effect objects. An Effect object stores an effect type and a set of parameter values to control that Effect. In order to use an Effect it must be attached to an Auxiliary Effect Slot object</summary>
/// <remarks>After creation an Effect has no type (EfxEffectType.Null), so before it can be used to store a set of parameters, the application must specify what type of effect should be stored in the object, using Effect() with EfxEffecti.</remarks>
/// <param name="n">Number of Effects to be created.</param>
/// <returns>Pointer addressing sufficient memory to store n Effect object identifiers.</returns>
2008-04-06 14:49:03 +00:00
[CLSCompliant(true)]
public int[] GenEffects(int n)
{
uint[] temp = new uint[n];
2008-04-06 14:49:03 +00:00
GenEffects(temp.Length, out temp[0]);
int[] effects = new int[n];
2008-04-06 14:49:03 +00:00
for (int i = 0; i < temp.Length; i++)
{
2008-04-06 14:49:03 +00:00
effects[i] = (int)temp[i];
}
return effects;
}
/// <summary>This function generates only one Effect.</summary>
2008-01-18 17:24:39 +00:00
/// <param name="effect">Storage UInt32 for the new effect name/handle.</param>
2008-04-06 14:49:03 +00:00
[CLSCompliant(false)]
public void GenEffects(out uint effect)
{
unsafe
{
2008-04-06 14:49:03 +00:00
fixed (uint* ptr = &effect)
{
2008-04-06 14:49:03 +00:00
Imported_alGenEffects(1, ptr);
}
}
}
/// <summary>This function generates only one Effect.</summary>
/// <param name="effect">Storage UInt32 for the new effect name/handle.</param>
2008-04-06 14:49:03 +00:00
[CLSCompliant(true)]
public void GenEffects(out int effect)
{
uint temp;
2008-04-06 14:49:03 +00:00
GenEffects(out temp);
effect = (int)temp;
}
/// <summary>This function generates only one Effect.</summary>
/// <returns>Storage UInt32 for the new effect name/handle.</returns>
2008-04-06 14:49:03 +00:00
[CLSCompliant(true)]
public int GenEffects()
{
uint temp;
2008-04-06 14:49:03 +00:00
GenEffects(out temp);
return (int)temp;
}
#endregion alGenEffects
#region alDeleteEffects
2008-01-16 18:43:52 +00:00
//[CLSCompliant(false)]
2008-04-06 14:49:03 +00:00
unsafe private delegate void Delegate_alDeleteEffects(int n, [In] uint* effects);
2008-01-25 22:14:16 +00:00
// typedef void (__cdecl *LPALDELETEEFFECTS)( ALsizei n, ALuint* effects );
//[CLSCompliant(false)]
private Delegate_alDeleteEffects Imported_alDeleteEffects;
2008-01-25 22:14:16 +00:00
/// <summary>The DeleteEffects function is used to delete and free resources for Effect objects previously created with GenEffects.</summary>
2008-01-18 17:24:39 +00:00
/// <param name="n">Number of Effects to be deleted.</param>
/// <param name="effects">Pointer to n Effect object identifiers.</param>
2008-04-06 14:49:03 +00:00
[CLSCompliant(false)]
public void DeleteEffects(int n, ref uint[] effects)
{
unsafe
{
2008-04-06 14:49:03 +00:00
fixed (uint* ptr = effects)
{
2008-04-06 14:49:03 +00:00
Imported_alDeleteEffects(n, ptr);
}
}
}
/// <summary>The DeleteEffects function is used to delete and free resources for Effect objects previously created with GenEffects.</summary>
/// <param name="n">Number of Effects to be deleted.</param>
/// <param name="effects">Pointer to n Effect object identifiers.</param>
2008-04-06 14:49:03 +00:00
[CLSCompliant(true)]
public void DeleteEffects(int n, ref int[] effects)
{
uint[] temp = new uint[n];
2008-04-06 14:49:03 +00:00
for (int i = 0; i < n; i++)
{
2008-04-06 14:49:03 +00:00
temp[i] = (uint)effects[i];
}
2008-04-06 14:49:03 +00:00
DeleteEffects(n, ref temp);
}
/// <summary>The DeleteEffects function is used to delete and free resources for Effect objects previously created with GenEffects.</summary>
/// <param name="effects">Pointer to n Effect object identifiers.</param>
2008-04-06 14:49:03 +00:00
[CLSCompliant(true)]
public void DeleteEffects(int[] effects)
{
uint[] temp = new uint[effects.Length];
2008-04-06 14:49:03 +00:00
for (int i = 0; i < temp.Length; i++)
{
2008-04-06 14:49:03 +00:00
temp[i] = (uint)effects[i];
}
2008-04-06 14:49:03 +00:00
DeleteEffects(temp.Length, ref temp);
}
/// <summary>This function deletes one Effect only.</summary>
2008-01-18 17:24:39 +00:00
/// <param name="effect">Pointer to an effect name/handle identifying the Effect Object to be deleted.</param>
2008-04-06 14:49:03 +00:00
[CLSCompliant(false)]
public void DeleteEffects(ref uint effect)
{
unsafe
{
2008-04-06 14:49:03 +00:00
fixed (uint* ptr = &effect)
{
2008-04-06 14:49:03 +00:00
Imported_alDeleteEffects(1, ptr);
}
}
}
/// <summary>This function deletes one Effect only.</summary>
/// <param name="effect">Pointer to an effect name/handle identifying the Effect Object to be deleted.</param>
2008-04-06 14:49:03 +00:00
[CLSCompliant(true)]
public void DeleteEffects(ref int effect)
{
2008-04-06 14:49:03 +00:00
uint temp = (uint)effect;
DeleteEffects(ref temp);
}
/// <summary>This function deletes one Effect only.</summary>
/// <param name="effect">Pointer to an effect name/handle identifying the Effect Object to be deleted.</param>
2008-04-06 14:49:03 +00:00
[CLSCompliant(true)]
public void DeleteEffects(int effect)
{
2008-04-06 14:49:03 +00:00
uint temp = (uint)effect;
DeleteEffects(ref temp);
}
#endregion alDeleteEffects
#region alIsEffect
2008-01-16 18:43:52 +00:00
//[CLSCompliant(false)]
2008-04-06 14:49:03 +00:00
private delegate bool Delegate_alIsEffect(uint eid);
2008-01-25 22:14:16 +00:00
// typedef ALboolean (__cdecl *LPALISEFFECT)( ALuint eid );
//[CLSCompliant(false)]
2008-01-18 17:24:39 +00:00
private Delegate_alIsEffect Imported_alIsEffect;
2008-01-25 22:14:16 +00:00
/// <summary>The IsEffect function is used to determine if an object identifier is a valid Effect object.</summary>
2008-01-18 17:24:39 +00:00
/// <param name="eid">Effect identifier to validate.</param>
/// <returns>True if the identifier is a valid Effect, False otherwise.</returns>
2008-04-06 14:49:03 +00:00
[CLSCompliant(false)]
public bool IsEffect(uint eid)
2008-01-18 17:24:39 +00:00
{
2008-04-06 14:49:03 +00:00
return Imported_alIsEffect(eid);
2008-01-18 17:24:39 +00:00
}
/// <summary>The IsEffect function is used to determine if an object identifier is a valid Effect object.</summary>
/// <param name="eid">Effect identifier to validate.</param>
/// <returns>True if the identifier is a valid Effect, False otherwise.</returns>
2008-04-06 14:49:03 +00:00
[CLSCompliant(true)]
public bool IsEffect(int eid)
{
2008-04-06 14:49:03 +00:00
return Imported_alIsEffect((uint)eid);
}
#endregion alIsEffect
#region alEffecti
2008-01-16 18:43:52 +00:00
//[CLSCompliant(false)]
2008-04-06 14:49:03 +00:00
private delegate void Delegate_alEffecti(uint eid, EfxEffecti param, int value);
2008-01-25 22:14:16 +00:00
// typedef void (__cdecl *LPALEFFECTI)( ALuint eid, ALenum param, ALint value);
//[CLSCompliant(false)]
2008-01-18 17:24:39 +00:00
private Delegate_alEffecti Imported_alEffecti;
2008-01-18 17:24:39 +00:00
/// <summary>This function is used to set integer properties on Effect objects.</summary>
/// <param name="eid">Effect object identifier.</param>
/// <param name="param">Effect property to set.</param>
/// <param name="value">Integer value.</param>
[CLSCompliant(false)]
2008-04-06 14:49:03 +00:00
public void Effect(uint eid, EfxEffecti param, int value)
2008-01-18 17:24:39 +00:00
{
2008-04-06 14:49:03 +00:00
Imported_alEffecti(eid, param, value);
2008-01-18 17:24:39 +00:00
}
/// <summary>This function is used to set integer properties on Effect objects.</summary>
/// <param name="eid">Effect object identifier.</param>
/// <param name="param">Effect property to set.</param>
/// <param name="value">Integer value.</param>
2008-04-06 14:49:03 +00:00
[CLSCompliant(true)]
public void Effect(int eid, EfxEffecti param, int value)
{
2008-04-06 14:49:03 +00:00
Imported_alEffecti((uint)eid, param, value);
}
#endregion alEffecti
#region alEffectf
2008-01-17 17:05:19 +00:00
//[CLSCompliant(false)]
2008-04-06 14:49:03 +00:00
private delegate void Delegate_alEffectf(uint eid, EfxEffectf param, float value);
2008-01-25 22:14:16 +00:00
// typedef void (__cdecl *LPALEFFECTF)( ALuint eid, ALenum param, ALfloat value);
2008-01-18 17:24:39 +00:00
//[CLSCompliant(false)]
2008-01-18 17:24:39 +00:00
private Delegate_alEffectf Imported_alEffectf;
2008-01-18 17:24:39 +00:00
/// <summary>This function is used to set floating point properties on Effect objects.</summary>
/// <param name="eid">Effect object identifier.</param>
/// <param name="param">Effect property to set.</param>
/// <param name="value">Floating point value.</param>
[CLSCompliant(false)]
2008-04-06 14:49:03 +00:00
public void Effect(uint eid, EfxEffectf param, float value)
2008-01-18 17:24:39 +00:00
{
2008-04-06 14:49:03 +00:00
Imported_alEffectf(eid, param, value);
2008-01-18 17:24:39 +00:00
}
/// <summary>This function is used to set floating point properties on Effect objects.</summary>
/// <param name="eid">Effect object identifier.</param>
/// <param name="param">Effect property to set.</param>
/// <param name="value">Floating point value.</param>
2008-04-06 14:49:03 +00:00
[CLSCompliant(true)]
public void Effect(int eid, EfxEffectf param, float value)
{
2008-04-06 14:49:03 +00:00
Imported_alEffectf((uint)eid, param, value);
}
#endregion alEffectf
#region alEffectfv
//[CLSCompliant(false)]
2008-04-06 14:49:03 +00:00
unsafe private delegate void Delegate_alEffectfv(uint eid, EfxEffect3f param, [In] float* values);
2008-01-25 22:14:16 +00:00
// typedef void (__cdecl *LPALEFFECTFV)( ALuint eid, ALenum param, ALfloat* values );
//[CLSCompliant(false)]
private Delegate_alEffectfv Imported_alEffectfv;
/// <summary>This function is used to set 3 floating point properties on Effect objects.</summary>
/// <param name="eid">Effect object identifier.</param>
/// <param name="param">Effect property to set.</param>
/// <param name="values">Pointer to Math.Vector3.</param>
[CLSCompliant(false)]
2008-04-06 14:49:03 +00:00
public void Effect(uint eid, EfxEffect3f param, ref Vector3 values)
{
unsafe
{
2008-04-06 14:49:03 +00:00
fixed (float* ptr = &values.X)
{
2008-04-06 14:49:03 +00:00
Imported_alEffectfv(eid, param, ptr);
}
}
}
/// <summary>This function is used to set 3 floating point properties on Effect objects.</summary>
/// <param name="eid">Effect object identifier.</param>
/// <param name="param">Effect property to set.</param>
/// <param name="values">Pointer to Math.Vector3.</param>
2008-04-06 14:49:03 +00:00
[CLSCompliant(true)]
public void Effect(int eid, EfxEffect3f param, ref Vector3 values)
{
2008-04-06 14:49:03 +00:00
Effect((uint)eid, param, ref values);
}
#endregion alEffectfv
#region alGetEffecti
2008-01-16 18:43:52 +00:00
//[CLSCompliant(false)]
2008-04-06 14:49:03 +00:00
unsafe private delegate void Delegate_alGetEffecti(uint eid, EfxEffecti pname, [Out] int* value);
2008-01-25 22:14:16 +00:00
// typedef void (__cdecl *LPALGETEFFECTI)( ALuint eid, ALenum pname, ALint* value );
//[CLSCompliant(false)]
private Delegate_alGetEffecti Imported_alGetEffecti;
2008-01-18 17:24:39 +00:00
/// <summary>This function is used to retrieve integer properties from Effect objects.</summary>
/// <param name="eid">Effect object identifier.</param>
/// <param name="pname">Effect property to retrieve.</param>
/// <param name="value">Address where integer value will be stored.</param>
[CLSCompliant(false)]
2008-04-06 14:49:03 +00:00
public void GetEffect(uint eid, EfxEffecti pname, out int value)
{
unsafe
{
2008-04-06 14:49:03 +00:00
fixed (int* ptr = &value)
{
2008-04-06 14:49:03 +00:00
Imported_alGetEffecti(eid, pname, ptr);
}
}
}
/// <summary>This function is used to retrieve integer properties from Effect objects.</summary>
/// <param name="eid">Effect object identifier.</param>
/// <param name="pname">Effect property to retrieve.</param>
/// <param name="value">Address where integer value will be stored.</param>
2008-04-06 14:49:03 +00:00
[CLSCompliant(true)]
public void GetEffect(int eid, EfxEffecti pname, out int value)
{
2008-04-06 14:49:03 +00:00
GetEffect((uint)eid, pname, out value);
}
#endregion alGetEffecti
#region alGetEffectf
2008-01-17 17:05:19 +00:00
//[CLSCompliant(false)]
2008-04-06 14:49:03 +00:00
unsafe private delegate void Delegate_alGetEffectf(uint eid, EfxEffectf pname, [Out]float* value);
2008-01-25 22:14:16 +00:00
// typedef void (__cdecl *LPALGETEFFECTF)( ALuint eid, ALenum pname, ALfloat* value );
//[CLSCompliant(false)]
private Delegate_alGetEffectf Imported_alGetEffectf;
2008-01-18 17:24:39 +00:00
/// <summary>This function is used to retrieve floating point properties from Effect objects.</summary>
/// <param name="eid">Effect object identifier.</param>
/// <param name="pname">Effect property to retrieve.</param>
/// <param name="value">Address where floating point value will be stored.</param>
[CLSCompliant(false)]
2008-04-06 14:49:03 +00:00
public void GetEffect(uint eid, EfxEffectf pname, out float value)
{
unsafe
{
2008-04-06 14:49:03 +00:00
fixed (float* ptr = &value)
{
2008-04-06 14:49:03 +00:00
Imported_alGetEffectf(eid, pname, ptr);
}
}
}
/// <summary>This function is used to retrieve floating point properties from Effect objects.</summary>
/// <param name="eid">Effect object identifier.</param>
/// <param name="pname">Effect property to retrieve.</param>
/// <param name="value">Address where floating point value will be stored.</param>
2008-04-06 14:49:03 +00:00
[CLSCompliant(true)]
public void GetEffect(int eid, EfxEffectf pname, out float value)
{
2008-04-06 14:49:03 +00:00
GetEffect((uint)eid, pname, out value);
}
#endregion alGetEffectf
2008-01-17 17:05:19 +00:00
#region alGetEffectfv
2008-01-25 22:14:16 +00:00
//[CLSCompliant(false)]
2008-04-06 14:49:03 +00:00
unsafe private delegate void Delegate_alGetEffectfv(uint eid, EfxEffect3f param, [Out] float* values);
// typedef void (__cdecl *LPALGETEFFECTFV)( ALuint eid, ALenum pname, ALfloat* values );
//[CLSCompliant(false)]
private Delegate_alGetEffectfv Imported_alGetEffectfv;
/// <summary>This function is used to retrieve 3 floating point properties from Effect objects.</summary>
/// <param name="eid">Effect object identifier.</param>
/// <param name="pname">Effect property to retrieve.</param>
/// <param name="value">A Math.Vector3 to hold the values.</param>
[CLSCompliant(false)]
2008-04-06 14:49:03 +00:00
public void GetEffect(uint eid, EfxEffect3f param, out Vector3 values)
{
unsafe
{
2008-04-06 14:49:03 +00:00
fixed (float* ptr = &values.X)
{
2008-04-06 14:49:03 +00:00
Imported_alGetEffectfv(eid, param, ptr);
values.X = ptr[0];
values.Y = ptr[1];
values.Z = ptr[2];
}
}
}
/// <summary>This function is used to retrieve 3 floating point properties from Effect objects.</summary>
/// <param name="eid">Effect object identifier.</param>
/// <param name="pname">Effect property to retrieve.</param>
/// <param name="value">A Math.Vector3 to hold the values.</param>
2008-04-06 14:49:03 +00:00
[CLSCompliant(true)]
public void GetEffect(int eid, EfxEffect3f param, out Vector3 values)
{
2008-04-06 14:49:03 +00:00
GetEffect((uint)eid, param, out values);
}
#endregion alGetEffectfv
2008-01-17 19:02:37 +00:00
// Not used:
// typedef void (__cdecl *LPALEFFECTIV)( ALuint eid, ALenum param, ALint* values );
// typedef void (__cdecl *LPALGETEFFECTIV)( ALuint eid, ALenum pname, ALint* values );
2008-01-16 18:43:52 +00:00
#endregion Effect Object
#region Filter Object
2008-01-16 18:43:52 +00:00
2008-01-18 15:50:58 +00:00
#region alGenFilters
2008-01-17 17:05:19 +00:00
//[CLSCompliant(false)]
2008-04-06 14:49:03 +00:00
unsafe private delegate void Delegate_alGenFilters(int n, [Out] uint* filters);
2008-01-25 22:14:16 +00:00
// typedef void (__cdecl *LPALGENFILTERS)( ALsizei n, ALuint* filters );
2008-01-16 18:43:52 +00:00
//[CLSCompliant(false)]
2008-01-18 15:50:58 +00:00
private Delegate_alGenFilters Imported_alGenFilters;
2008-01-25 22:14:16 +00:00
/// <summary>The GenFilters function is used to create one or more Filter objects. A Filter object stores a filter type and a set of parameter values to control that Filter. Filter objects can be attached to Sources as Direct Filters or Auxiliary Send Filters.</summary>
/// <remarks>After creation a Filter has no type (EfxFilterType.Null), so before it can be used to store a set of parameters, the application must specify what type of filter should be stored in the object, using Filter() with EfxFilteri.</remarks>
2008-01-18 17:24:39 +00:00
/// <param name="n">Number of Filters to be created.</param>
/// <param name="filters">Pointer addressing sufficient memory to store n Filter object identifiers.</param>
2008-04-06 14:49:03 +00:00
[CLSCompliant(false)]
public void GenFilters(int n, out uint filters)
2008-01-18 15:50:58 +00:00
{
unsafe
{
2008-04-06 14:49:03 +00:00
fixed (uint* ptr = &filters)
2008-01-18 15:50:58 +00:00
{
2008-04-06 14:49:03 +00:00
Imported_alGenFilters(n, ptr);
2008-01-18 15:50:58 +00:00
filters = *ptr;
}
}
}
/// <summary>The GenFilters function is used to create one or more Filter objects. A Filter object stores a filter type and a set of parameter values to control that Filter. Filter objects can be attached to Sources as Direct Filters or Auxiliary Send Filters.</summary>
/// <remarks>After creation a Filter has no type (EfxFilterType.Null), so before it can be used to store a set of parameters, the application must specify what type of filter should be stored in the object, using Filter() with EfxFilteri.</remarks>
/// <param name="n">Number of Filters to be created.</param>
/// <param name="filters">Pointer addressing sufficient memory to store n Filter object identifiers.</param>
2008-04-06 14:49:03 +00:00
[CLSCompliant(true)]
public void GenFilters(int n, out int[] filters)
{
uint[] temp = new uint[n];
2008-04-06 14:49:03 +00:00
GenFilters(n, out temp[0]);
filters = new int[n];
2008-04-06 14:49:03 +00:00
for (int i = 0; i < n; i++)
{
2008-04-06 14:49:03 +00:00
filters[i] = (int)temp[i];
}
}
/// <summary>The GenFilters function is used to create one or more Filter objects. A Filter object stores a filter type and a set of parameter values to control that Filter. Filter objects can be attached to Sources as Direct Filters or Auxiliary Send Filters.</summary>
/// <remarks>After creation a Filter has no type (EfxFilterType.Null), so before it can be used to store a set of parameters, the application must specify what type of filter should be stored in the object, using Filter() with EfxFilteri.</remarks>
/// <param name="filters">Pointer addressing sufficient memory to store n Filter object identifiers.</param>
2008-04-06 14:49:03 +00:00
[CLSCompliant(true)]
public void GenFilters(int[] filters)
{
uint[] temp = new uint[filters.Length];
2008-04-06 14:49:03 +00:00
GenFilters(temp.Length, out temp[0]);
for (int i = 0; i < temp.Length; i++)
{
2008-04-06 14:49:03 +00:00
filters[i] = (int)temp[i];
}
}
/// <summary>The GenFilters function is used to create one or more Filter objects. A Filter object stores a filter type and a set of parameter values to control that Filter. Filter objects can be attached to Sources as Direct Filters or Auxiliary Send Filters.</summary>
/// <remarks>After creation a Filter has no type (EfxFilterType.Null), so before it can be used to store a set of parameters, the application must specify what type of filter should be stored in the object, using Filter() with EfxFilteri.</remarks>
/// <param name="n">Number of Filters to be created.</param>
/// <returns>Pointer addressing sufficient memory to store n Filter object identifiers.</returns>
2008-04-06 14:49:03 +00:00
[CLSCompliant(true)]
public int[] GenFilters(int n)
{
uint[] temp = new uint[n];
2008-04-06 14:49:03 +00:00
GenFilters(temp.Length, out temp[0]);
int[] filters = new int[n];
2008-04-06 14:49:03 +00:00
for (int i = 0; i < temp.Length; i++)
{
2008-04-06 14:49:03 +00:00
filters[i] = (int)temp[i];
}
return filters;
}
2008-01-18 15:50:58 +00:00
/// <summary>This function generates only one Filter.</summary>
2008-01-18 17:24:39 +00:00
/// <param name="filter">Storage UInt32 for the new filter name/handle.</param>
2008-04-06 14:49:03 +00:00
[CLSCompliant(false)]
public void GenFilters(out uint filter)
2008-01-18 15:50:58 +00:00
{
unsafe
{
2008-04-06 14:49:03 +00:00
fixed (uint* ptr = &filter)
2008-01-18 15:50:58 +00:00
{
2008-04-06 14:49:03 +00:00
Imported_alGenFilters(1, ptr);
2008-01-18 15:50:58 +00:00
}
}
}
/// <summary>This function generates only one Filter.</summary>
/// <param name="filter">Storage UInt32 for the new filter name/handle.</param>
2008-04-06 14:49:03 +00:00
[CLSCompliant(true)]
public void GenFilters(out int filter)
{
uint temp;
2008-04-06 14:49:03 +00:00
GenFilters(out temp);
filter = (int)temp;
}
/// <summary>This function generates only one Filter.</summary>
/// <returns>Storage UInt32 for the new filter name/handle.</returns>
2008-04-06 14:49:03 +00:00
[CLSCompliant(true)]
public int GenFilters()
{
uint temp;
2008-04-06 14:49:03 +00:00
GenFilters(out temp);
return (int)temp;
}
2008-01-18 15:50:58 +00:00
#endregion alGenFilters
#region alDeleteFilters
//[CLSCompliant(false)]
2008-04-06 14:49:03 +00:00
unsafe private delegate void Delegate_alDeleteFilters(int n, [In] uint* filters);
2008-01-25 22:14:16 +00:00
// typedef void (__cdecl *LPALDELETEFILTERS)( ALsizei n, ALuint* filters );
2008-01-16 18:43:52 +00:00
//[CLSCompliant(false)]
2008-01-18 15:50:58 +00:00
private Delegate_alDeleteFilters Imported_alDeleteFilters;
2008-01-25 22:14:16 +00:00
/// <summary>The DeleteFilters function is used to delete and free resources for Filter objects previously created with GenFilters.</summary>
2008-01-18 17:24:39 +00:00
/// <param name="n">Number of Filters to be deleted.</param>
/// <param name="filters">Pointer to n Filter object identifiers.</param>
2008-04-06 14:49:03 +00:00
[CLSCompliant(false)]
public void DeleteFilters(int n, ref uint[] filters)
2008-01-18 15:50:58 +00:00
{
unsafe
{
2008-04-06 14:49:03 +00:00
fixed (uint* ptr = filters)
2008-01-18 15:50:58 +00:00
{
2008-04-06 14:49:03 +00:00
Imported_alDeleteFilters(n, ptr);
2008-01-18 15:50:58 +00:00
}
}
}
/// <summary>The DeleteFilters function is used to delete and free resources for Filter objects previously created with GenFilters.</summary>
/// <param name="n">Number of Filters to be deleted.</param>
/// <param name="filters">Pointer to n Filter object identifiers.</param>
2008-04-06 14:49:03 +00:00
[CLSCompliant(true)]
public void DeleteFilters(int n, ref int[] filters)
{
uint[] temp = new uint[n];
2008-04-06 14:49:03 +00:00
for (int i = 0; i < n; i++)
{
2008-04-06 14:49:03 +00:00
temp[i] = (uint)filters[i];
}
2008-04-06 14:49:03 +00:00
DeleteFilters(n, ref temp);
}
/// <summary>The DeleteFilters function is used to delete and free resources for Filter objects previously created with GenFilters.</summary>
/// <param name="filters">Pointer to n Filter object identifiers.</param>
2008-04-06 14:49:03 +00:00
[CLSCompliant(true)]
public void DeleteFilters(int[] filters)
{
uint[] temp = new uint[filters.Length];
2008-04-06 14:49:03 +00:00
for (int i = 0; i < temp.Length; i++)
{
2008-04-06 14:49:03 +00:00
temp[i] = (uint)filters[i];
}
2008-04-06 14:49:03 +00:00
DeleteFilters(temp.Length, ref temp);
}
2008-01-18 15:50:58 +00:00
/// <summary>This function deletes one Filter only.</summary>
2008-01-18 17:24:39 +00:00
/// <param name="filter">Pointer to an filter name/handle identifying the Filter Object to be deleted.</param>
2008-04-06 14:49:03 +00:00
[CLSCompliant(false)]
public void DeleteFilters(ref uint filter)
2008-01-18 15:50:58 +00:00
{
unsafe
{
2008-04-06 14:49:03 +00:00
fixed (uint* ptr = &filter)
2008-01-18 15:50:58 +00:00
{
2008-04-06 14:49:03 +00:00
Imported_alDeleteFilters(1, ptr);
2008-01-18 15:50:58 +00:00
}
}
}
/// <summary>This function deletes one Filter only.</summary>
/// <param name="filter">Pointer to an filter name/handle identifying the Filter Object to be deleted.</param>
2008-04-06 14:49:03 +00:00
[CLSCompliant(true)]
public void DeleteFilters(ref int filter)
{
2008-04-06 14:49:03 +00:00
uint temp = (uint)filter;
DeleteFilters(ref temp);
}
/// <summary>This function deletes one Filter only.</summary>
/// <param name="filter">Pointer to an filter name/handle identifying the Filter Object to be deleted.</param>
2008-04-06 14:49:03 +00:00
[CLSCompliant(true)]
public void DeleteFilters(int filter)
{
2008-04-06 14:49:03 +00:00
uint temp = (uint)filter;
DeleteFilters(ref temp);
}
2008-01-18 15:50:58 +00:00
#endregion alDeleteFilters
#region alIsFilter
//[CLSCompliant(false)]
2008-04-06 14:49:03 +00:00
private delegate bool Delegate_alIsFilter(uint fid);
2008-01-25 22:14:16 +00:00
// typedef ALboolean (__cdecl *LPALISFILTER)( ALuint fid );
2008-01-16 18:43:52 +00:00
//[CLSCompliant(false)]
2008-01-18 17:24:39 +00:00
private Delegate_alIsFilter Imported_alIsFilter;
2008-01-25 22:14:16 +00:00
/// <summary>The IsFilter function is used to determine if an object identifier is a valid Filter object.</summary>
2008-01-18 17:24:39 +00:00
/// <param name="fid">Effect identifier to validate.</param>
/// <returns>True if the identifier is a valid Filter, False otherwise.</returns>
2008-04-06 14:49:03 +00:00
[CLSCompliant(false)]
public bool IsFilter(uint fid)
2008-01-18 17:24:39 +00:00
{
2008-04-06 14:49:03 +00:00
return Imported_alIsFilter(fid);
2008-01-18 17:24:39 +00:00
}
2008-01-18 15:50:58 +00:00
/// <summary>The IsFilter function is used to determine if an object identifier is a valid Filter object.</summary>
/// <param name="fid">Effect identifier to validate.</param>
/// <returns>True if the identifier is a valid Filter, False otherwise.</returns>
2008-04-06 14:49:03 +00:00
[CLSCompliant(true)]
public bool IsFilter(int fid)
{
2008-04-06 14:49:03 +00:00
return Imported_alIsFilter((uint)fid);
}
2008-01-18 15:50:58 +00:00
#endregion alIsFilter
#region alFilteri
//[CLSCompliant(false)]
2008-04-06 14:49:03 +00:00
private delegate void Delegate_alFilteri(uint fid, EfxFilteri param, int value);
2008-01-25 22:14:16 +00:00
// typedef void (__cdecl *LPALFILTERI)( ALuint fid, ALenum param, ALint value );
2008-01-18 17:24:39 +00:00
//[CLSCompliant(false)]
2008-01-18 17:24:39 +00:00
private Delegate_alFilteri Imported_alFilteri;
2008-01-16 18:43:52 +00:00
2008-01-18 17:24:39 +00:00
/// <summary>This function is used to set integer properties on Filter objects.</summary>
/// <param name="fid">Filter object identifier.</param>
/// <param name="param">Effect property to set.</param>
/// <param name="value">Integer value.</param>
[CLSCompliant(false)]
2008-04-06 14:49:03 +00:00
public void Filter(uint fid, EfxFilteri param, int value)
2008-01-18 17:24:39 +00:00
{
2008-04-06 14:49:03 +00:00
Imported_alFilteri(fid, param, value);
2008-01-18 17:24:39 +00:00
}
2008-01-18 15:50:58 +00:00
/// <summary>This function is used to set integer properties on Filter objects.</summary>
/// <param name="fid">Filter object identifier.</param>
/// <param name="param">Effect property to set.</param>
/// <param name="value">Integer value.</param>
2008-04-06 14:49:03 +00:00
[CLSCompliant(true)]
public void Filter(int fid, EfxFilteri param, int value)
{
2008-04-06 14:49:03 +00:00
Imported_alFilteri((uint)fid, param, value);
}
2008-01-25 22:14:16 +00:00
#endregion alFilteri
2008-01-18 15:50:58 +00:00
#region alFilterf
//[CLSCompliant(false)]
2008-04-06 14:49:03 +00:00
private delegate void Delegate_alFilterf(uint fid, EfxFilterf param, float value);
2008-01-25 22:14:16 +00:00
// typedef void (__cdecl *LPALFILTERF)( ALuint fid, ALenum param, ALfloat value);
2008-01-16 18:43:52 +00:00
//[CLSCompliant(false)]
2008-01-18 17:24:39 +00:00
private Delegate_alFilterf Imported_alFilterf;
/// <summary>This function is used to set floating point properties on Filter objects.</summary>
/// <param name="fid">Filter object identifier.</param>
/// <param name="param">Effect property to set.</param>
/// <param name="value">Floating point value.</param>
[CLSCompliant(false)]
2008-04-06 14:49:03 +00:00
public void Filter(uint fid, EfxFilterf param, float value)
2008-01-18 17:24:39 +00:00
{
2008-04-06 14:49:03 +00:00
Imported_alFilterf(fid, param, value);
2008-01-18 17:24:39 +00:00
}
2008-01-18 15:50:58 +00:00
/// <summary>This function is used to set floating point properties on Filter objects.</summary>
/// <param name="fid">Filter object identifier.</param>
/// <param name="param">Effect property to set.</param>
/// <param name="value">Floating point value.</param>
2008-04-06 14:49:03 +00:00
[CLSCompliant(true)]
public void Filter(int fid, EfxFilterf param, float value)
{
2008-04-06 14:49:03 +00:00
Imported_alFilterf((uint)fid, param, value);
}
2008-01-18 15:50:58 +00:00
#endregion alFilterf
#region alGetFilteri
//[CLSCompliant(false)]
2008-04-06 14:49:03 +00:00
unsafe private delegate void Delegate_alGetFilteri(uint fid, EfxFilteri pname, [Out] int* value);
2008-01-25 22:14:16 +00:00
// typedef void (__cdecl *LPALGETFILTERI)( ALuint fid, ALenum pname, ALint* value );
2008-01-16 18:43:52 +00:00
//[CLSCompliant(false)]
2008-01-18 15:50:58 +00:00
private Delegate_alGetFilteri Imported_alGetFilteri;
2008-01-18 17:24:39 +00:00
/// <summary>This function is used to retrieve integer properties from Filter objects.</summary>
/// <param name="fid">Filter object identifier.</param>
/// <param name="pname">Effect property to retrieve.</param>
/// <param name="value">Address where integer value will be stored.</param>
[CLSCompliant(false)]
2008-04-06 14:49:03 +00:00
public void GetFilter(uint fid, EfxFilteri pname, out int value)
2008-01-18 15:50:58 +00:00
{
unsafe
{
2008-04-06 14:49:03 +00:00
fixed (int* ptr = &value)
2008-01-18 15:50:58 +00:00
{
2008-04-06 14:49:03 +00:00
Imported_alGetFilteri(fid, pname, ptr);
2008-01-18 15:50:58 +00:00
}
}
}
/// <summary>This function is used to retrieve integer properties from Filter objects.</summary>
/// <param name="fid">Filter object identifier.</param>
/// <param name="pname">Effect property to retrieve.</param>
/// <param name="value">Address where integer value will be stored.</param>
2008-04-06 14:49:03 +00:00
[CLSCompliant(true)]
public void GetFilter(int fid, EfxFilteri pname, out int value)
{
2008-04-06 14:49:03 +00:00
GetFilter((uint)fid, pname, out value);
}
2008-01-18 15:50:58 +00:00
#endregion alGetFilteri
#region alGetFilterf
//[CLSCompliant(false)]
2008-04-06 14:49:03 +00:00
unsafe private delegate void Delegate_alGetFilterf(uint fid, EfxFilterf pname, [Out] float* value);
2008-01-25 22:14:16 +00:00
// typedef void (__cdecl *LPALGETFILTERF)( ALuint fid, ALenum pname, ALfloat* value );
2008-01-16 18:43:52 +00:00
//[CLSCompliant(false)]
2008-01-18 15:50:58 +00:00
private Delegate_alGetFilterf Imported_alGetFilterf;
2008-01-18 17:24:39 +00:00
/// <summary>This function is used to retrieve floating point properties from Filter objects.</summary>
/// <param name="fid">Filter object identifier.</param>
/// <param name="pname">Effect property to retrieve.</param>
/// <param name="value">Address where floating point value will be stored.</param>
[CLSCompliant(false)]
2008-04-06 14:49:03 +00:00
public void GetFilter(uint fid, EfxFilterf pname, out float value)
2008-01-18 15:50:58 +00:00
{
unsafe
{
2008-04-06 14:49:03 +00:00
fixed (float* ptr = &value)
2008-01-18 15:50:58 +00:00
{
2008-04-06 14:49:03 +00:00
Imported_alGetFilterf(fid, pname, ptr);
2008-01-18 15:50:58 +00:00
}
}
}
/// <summary>This function is used to retrieve floating point properties from Filter objects.</summary>
/// <param name="fid">Filter object identifier.</param>
/// <param name="pname">Effect property to retrieve.</param>
/// <param name="value">Address where floating point value will be stored.</param>
2008-04-06 14:49:03 +00:00
[CLSCompliant(true)]
public void GetFilter(int fid, EfxFilterf pname, out float value)
{
2008-04-06 14:49:03 +00:00
GetFilter((uint)fid, pname, out value);
}
2008-01-18 15:50:58 +00:00
#endregion alGetFilterf
2008-01-17 19:02:37 +00:00
// Not used:
// typedef void (__cdecl *LPALFILTERIV)( ALuint fid, ALenum param, ALint* values );
// typedef void (__cdecl *LPALFILTERFV)( ALuint fid, ALenum param, ALfloat* values );
// typedef void (__cdecl *LPALGETFILTERIV)( ALuint fid, ALenum pname, ALint* values );
// typedef void (__cdecl *LPALGETFILTERFV)( ALuint fid, ALenum pname, ALfloat* values );
2008-01-16 18:43:52 +00:00
2008-01-18 15:50:58 +00:00
#endregion Filter Object
#region Auxiliary Effect Slot Object
2008-01-16 23:57:54 +00:00
2008-01-18 15:50:58 +00:00
#region alGenAuxiliaryEffectSlots
//[CLSCompliant(false)]
2008-04-06 14:49:03 +00:00
unsafe private delegate void Delegate_alGenAuxiliaryEffectSlots(int n, [Out] uint* slots);
2008-01-25 22:14:16 +00:00
// typedef void (__cdecl *LPALGENAUXILIARYEFFECTSLOTS)( ALsizei n, ALuint* slots );
2008-01-18 15:50:58 +00:00
//[CLSCompliant(false)]
2008-01-18 15:50:58 +00:00
private Delegate_alGenAuxiliaryEffectSlots Imported_alGenAuxiliaryEffectSlots;
2008-01-25 22:14:16 +00:00
/// <summary>The GenAuxiliaryEffectSlots function is used to create one or more Auxiliary Effect Slots. The number of slots that can be created will be dependant upon the Open AL device used.</summary>
2008-01-18 17:24:39 +00:00
/// <remarks>An application should check the OpenAL error state after making this call to determine if the Effect Slot was successfully created. If the function call fails then none of the requested Effect Slots are created. A good strategy for creating any OpenAL object is to use a for-loop and generate one object each loop iteration and then check for an error condition. If an error is set then the loop can be broken and the application can determine if sufficient resources are available.</remarks>
/// <param name="n">Number of Auxiliary Effect Slots to be created.</param>
/// <param name="slots">Pointer addressing sufficient memory to store n Effect Slot object identifiers.</param>
2008-04-06 14:49:03 +00:00
[CLSCompliant(false)]
public void GenAuxiliaryEffectSlots(int n, out uint slots)
2008-01-18 15:50:58 +00:00
{
unsafe
{
2008-04-06 14:49:03 +00:00
fixed (uint* ptr = &slots)
2008-01-18 15:50:58 +00:00
{
2008-04-06 14:49:03 +00:00
Imported_alGenAuxiliaryEffectSlots(n, ptr);
2008-01-18 15:50:58 +00:00
slots = *ptr;
}
}
}
/// <summary>The GenAuxiliaryEffectSlots function is used to create one or more Auxiliary Effect Slots. The number of slots that can be created will be dependant upon the Open AL device used.</summary>
/// <remarks>An application should check the OpenAL error state after making this call to determine if the Effect Slot was successfully created. If the function call fails then none of the requested Effect Slots are created. A good strategy for creating any OpenAL object is to use a for-loop and generate one object each loop iteration and then check for an error condition. If an error is set then the loop can be broken and the application can determine if sufficient resources are available.</remarks>
/// <param name="n">Number of Auxiliary Effect Slots to be created.</param>
/// <param name="slots">Pointer addressing sufficient memory to store n Effect Slot object identifiers.</param>
2008-04-06 14:49:03 +00:00
[CLSCompliant(true)]
public void GenAuxiliaryEffectSlots(int n, out int[] slots)
{
uint[] temp = new uint[n];
2008-04-06 14:49:03 +00:00
GenAuxiliaryEffectSlots(n, out temp[0]);
slots = new int[n];
2008-04-06 14:49:03 +00:00
for (int i = 0; i < n; i++)
{
2008-04-06 14:49:03 +00:00
slots[i] = (int)temp[i];
}
}
/// <summary>The GenAuxiliaryEffectSlots function is used to create one or more Auxiliary Effect Slots. The number of slots that can be created will be dependant upon the Open AL device used.</summary>
/// <remarks>An application should check the OpenAL error state after making this call to determine if the Effect Slot was successfully created. If the function call fails then none of the requested Effect Slots are created. A good strategy for creating any OpenAL object is to use a for-loop and generate one object each loop iteration and then check for an error condition. If an error is set then the loop can be broken and the application can determine if sufficient resources are available.</remarks>
/// <param name="slots">Pointer addressing sufficient memory to store n Effect Slot object identifiers.</param>
2008-04-06 14:49:03 +00:00
[CLSCompliant(true)]
public void GenAuxiliaryEffectSlots(int[] slots)
{
uint[] temp = new uint[slots.Length];
2008-04-06 14:49:03 +00:00
GenAuxiliaryEffectSlots(temp.Length, out temp[0]);
for (int i = 0; i < temp.Length; i++)
{
2008-04-06 14:49:03 +00:00
slots[i] = (int)temp[i];
}
}
/// <summary>The GenAuxiliaryEffectSlots function is used to create one or more Auxiliary Effect Slots. The number of slots that can be created will be dependant upon the Open AL device used.</summary>
/// <remarks>An application should check the OpenAL error state after making this call to determine if the Effect Slot was successfully created. If the function call fails then none of the requested Effect Slots are created. A good strategy for creating any OpenAL object is to use a for-loop and generate one object each loop iteration and then check for an error condition. If an error is set then the loop can be broken and the application can determine if sufficient resources are available.</remarks>
/// <param name="n">Number of Auxiliary Effect Slots to be created.</param>
/// <returns>Pointer addressing sufficient memory to store n Effect Slot object identifiers.</returns>
2008-04-06 14:49:03 +00:00
[CLSCompliant(true)]
public int[] GenAuxiliaryEffectSlots(int n)
{
uint[] temp = new uint[n];
2008-04-06 14:49:03 +00:00
GenAuxiliaryEffectSlots(temp.Length, out temp[0]);
int[] slots = new int[n];
2008-04-06 14:49:03 +00:00
for (int i = 0; i < temp.Length; i++)
{
2008-04-06 14:49:03 +00:00
slots[i] = (int)temp[i];
}
return slots;
}
2008-01-18 15:50:58 +00:00
/// <summary>This function generates only one Auxiliary Effect Slot.</summary>
2008-01-18 17:24:39 +00:00
/// <param name="slot">Storage UInt32 for the new auxiliary effect slot name/handle.</param>
2008-04-06 14:49:03 +00:00
[CLSCompliant(false)]
public void GenAuxiliaryEffectSlots(out uint slot)
2008-01-18 15:50:58 +00:00
{
unsafe
{
2008-04-06 14:49:03 +00:00
fixed (uint* ptr = &slot)
2008-01-18 15:50:58 +00:00
{
2008-04-06 14:49:03 +00:00
Imported_alGenAuxiliaryEffectSlots(1, ptr);
2008-01-18 15:50:58 +00:00
}
}
}
/// <summary>This function generates only one Auxiliary Effect Slot.</summary>
/// <param name="slot">Storage UInt32 for the new auxiliary effect slot name/handle.</param>
2008-04-06 14:49:03 +00:00
[CLSCompliant(true)]
public void GenAuxiliaryEffectSlots(out int slot)
{
uint temp;
2008-04-06 14:49:03 +00:00
GenAuxiliaryEffectSlots(out temp);
slot = (int)temp;
}
/// <summary>This function generates only one Auxiliary Effect Slot.</summary>
/// <returns>Storage UInt32 for the new auxiliary effect slot name/handle.</returns>
2008-04-06 14:49:03 +00:00
[CLSCompliant(true)]
public int GenAuxiliaryEffectSlots()
{
uint temp;
2008-04-06 14:49:03 +00:00
GenAuxiliaryEffectSlots(out temp);
return (int)temp;
}
2008-01-18 15:50:58 +00:00
#endregion alGenAuxiliaryEffectSlots
2008-01-18 15:50:58 +00:00
#region alDeleteAuxiliaryEffectSlots
2008-04-06 14:49:03 +00:00
unsafe private delegate void Delegate_alDeleteAuxiliaryEffectSlots(int n, [In] uint* slots);
2008-01-25 22:14:16 +00:00
// typedef void (__cdecl *LPALDELETEAUXILIARYEFFECTSLOTS)( ALsizei n, ALuint* slots );
2008-01-18 15:50:58 +00:00
private Delegate_alDeleteAuxiliaryEffectSlots Imported_alDeleteAuxiliaryEffectSlots;
2008-01-16 18:43:52 +00:00
2008-01-25 22:14:16 +00:00
/// <summary>The DeleteAuxiliaryEffectSlots function is used to delete and free resources for Auxiliary Effect Slots previously created with GenAuxiliaryEffectSlots.</summary>
2008-01-18 17:24:39 +00:00
/// <param name="n">Number of Auxiliary Effect Slots to be deleted.</param>
/// <param name="slots">Pointer to n Effect Slot object identifiers.</param>
2008-04-06 14:49:03 +00:00
[CLSCompliant(false)]
public void DeleteAuxiliaryEffectSlots(int n, ref uint slots)
2008-01-18 15:50:58 +00:00
{
unsafe
2008-01-18 15:50:58 +00:00
{
fixed (uint* ptr = &slots)
2008-01-18 15:50:58 +00:00
{
2008-04-06 14:49:03 +00:00
Imported_alDeleteAuxiliaryEffectSlots(n, ptr);
2008-01-18 15:50:58 +00:00
}
}
}
2008-01-16 18:43:52 +00:00
/// <summary>The DeleteAuxiliaryEffectSlots function is used to delete and free resources for Auxiliary Effect Slots previously created with GenAuxiliaryEffectSlots.</summary>
/// <param name="n">Number of Auxiliary Effect Slots to be deleted.</param>
/// <param name="slots">Pointer to n Effect Slot object identifiers.</param>
public void DeleteAuxiliaryEffectSlots(int n, ref int slots)
{
unsafe
{
fixed (int* ptr = &slots)
{
Imported_alDeleteAuxiliaryEffectSlots(n, (uint*)ptr);
}
}
}
/// <summary>The DeleteAuxiliaryEffectSlots function is used to delete and free resources for Auxiliary Effect Slots previously created with GenAuxiliaryEffectSlots.</summary>
/// <param name="n">Number of Auxiliary Effect Slots to be deleted.</param>
/// <param name="slots">Pointer to n Effect Slot object identifiers.</param>
2008-04-06 14:49:03 +00:00
public void DeleteAuxiliaryEffectSlots(int[] slots)
{
if (slots == null) throw new ArgumentNullException("slots");
DeleteAuxiliaryEffectSlots(slots.Length, ref slots[0]);
}
2008-01-18 15:50:58 +00:00
/// <summary>This function deletes one AuxiliaryEffectSlot only.</summary>
2008-01-18 17:24:39 +00:00
/// <param name="slot">Pointer to an auxiliary effect slot name/handle identifying the Auxiliary Effect Slot Object to be deleted.</param>
2008-04-06 14:49:03 +00:00
[CLSCompliant(false)]
public void DeleteAuxiliaryEffectSlots(uint[] slots)
2008-01-18 15:50:58 +00:00
{
if (slots == null) throw new ArgumentNullException("slots");
DeleteAuxiliaryEffectSlots(slots.Length, ref slots[0]);
2008-01-18 15:50:58 +00:00
}
/// <summary>This function deletes one AuxiliaryEffectSlot only.</summary>
/// <param name="slot">Pointer to an auxiliary effect slot name/handle identifying the Auxiliary Effect Slot Object to be deleted.</param>
public void DeleteAuxiliaryEffectSlots(int slot)
{
DeleteAuxiliaryEffectSlots(1, ref slot);
}
/// <summary>This function deletes one AuxiliaryEffectSlot only.</summary>
/// <param name="slot">Pointer to an auxiliary effect slot name/handle identifying the Auxiliary Effect Slot Object to be deleted.</param>
[CLSCompliant(false)]
public void DeleteAuxiliaryEffectSlots(uint slot)
{
DeleteAuxiliaryEffectSlots(1, ref slot);
}
2008-01-18 15:50:58 +00:00
#endregion alDeleteAuxiliaryEffectSlots
#region alIsAuxiliaryEffectSlot
2008-01-16 18:43:52 +00:00
//[CLSCompliant(false)]
2008-04-06 14:49:03 +00:00
private delegate bool Delegate_alIsAuxiliaryEffectSlot(uint slot);
2008-01-25 22:14:16 +00:00
// typedef ALboolean (__cdecl *LPALISAUXILIARYEFFECTSLOT)( ALuint slot );
2008-01-18 17:24:39 +00:00
//[CLSCompliant(false)]
2008-01-18 17:24:39 +00:00
private Delegate_alIsAuxiliaryEffectSlot Imported_alIsAuxiliaryEffectSlot;
2008-01-16 18:43:52 +00:00
2008-01-25 22:14:16 +00:00
/// <summary>The IsAuxiliaryEffectSlot function is used to determine if an object identifier is a valid Auxiliary Effect Slot object.</summary>
2008-01-18 17:24:39 +00:00
/// <param name="slot">Effect Slot object identifier to validate.</param>
/// <returns>True if the identifier is a valid Auxiliary Effect Slot, False otherwise.</returns>
2008-04-06 14:49:03 +00:00
[CLSCompliant(false)]
public bool IsAuxiliaryEffectSlot(uint slot)
2008-01-18 17:24:39 +00:00
{
2008-04-06 14:49:03 +00:00
return Imported_alIsAuxiliaryEffectSlot(slot);
2008-01-18 17:24:39 +00:00
}
2008-01-18 15:50:58 +00:00
/// <summary>The IsAuxiliaryEffectSlot function is used to determine if an object identifier is a valid Auxiliary Effect Slot object.</summary>
/// <param name="slot">Effect Slot object identifier to validate.</param>
/// <returns>True if the identifier is a valid Auxiliary Effect Slot, False otherwise.</returns>
2008-04-06 14:49:03 +00:00
[CLSCompliant(true)]
public bool IsAuxiliaryEffectSlot(int slot)
{
2008-04-06 14:49:03 +00:00
return Imported_alIsAuxiliaryEffectSlot((uint)slot);
}
2008-01-18 15:50:58 +00:00
#endregion alIsAuxiliaryEffectSlot
#region alAuxiliaryEffectSloti
//[CLSCompliant(false)]
2008-04-06 14:49:03 +00:00
private delegate void Delegate_alAuxiliaryEffectSloti(uint asid, EfxAuxiliaryi param, int value);
2008-01-25 22:14:16 +00:00
// typedef void (__cdecl *LPALAUXILIARYEFFECTSLOTI)( ALuint asid, ALenum param, ALint value );
2008-01-18 17:24:39 +00:00
//[CLSCompliant(false)]
2008-01-18 17:24:39 +00:00
private Delegate_alAuxiliaryEffectSloti Imported_alAuxiliaryEffectSloti;
2008-01-16 18:43:52 +00:00
2008-01-18 17:24:39 +00:00
/// <summary>This function is used to set integer properties on Auxiliary Effect Slot objects.</summary>
/// <param name="asid">Auxiliary Effect Slot object identifier.</param>
/// <param name="param">Auxiliary Effect Slot property to set.</param>
/// <param name="value">Integer value.</param>
[CLSCompliant(false)]
2008-04-06 14:49:03 +00:00
public void AuxiliaryEffectSlot(uint asid, EfxAuxiliaryi param, int value)
2008-01-18 17:24:39 +00:00
{
2008-04-06 14:49:03 +00:00
Imported_alAuxiliaryEffectSloti(asid, param, value);
2008-01-18 17:24:39 +00:00
}
2008-01-18 15:50:58 +00:00
/// <summary>This function is used to set integer properties on Auxiliary Effect Slot objects.</summary>
/// <param name="asid">Auxiliary Effect Slot object identifier.</param>
/// <param name="param">Auxiliary Effect Slot property to set.</param>
/// <param name="value">Integer value.</param>
2008-04-06 14:49:03 +00:00
[CLSCompliant(true)]
public void AuxiliaryEffectSlot(int asid, EfxAuxiliaryi param, int value)
{
2008-04-06 14:49:03 +00:00
Imported_alAuxiliaryEffectSloti((uint)asid, param, value);
}
2008-01-18 15:50:58 +00:00
#endregion alAuxiliaryEffectSloti
#region alAuxiliaryEffectSlotf
//[CLSCompliant(false)]
2008-04-06 14:49:03 +00:00
private delegate void Delegate_alAuxiliaryEffectSlotf(uint asid, EfxAuxiliaryf param, float value);
2008-01-25 22:14:16 +00:00
// typedef void (__cdecl *LPALAUXILIARYEFFECTSLOTF)( ALuint asid, ALenum param, ALfloat value );
2008-01-16 18:43:52 +00:00
//[CLSCompliant(false)]
2008-01-18 17:24:39 +00:00
private Delegate_alAuxiliaryEffectSlotf Imported_alAuxiliaryEffectSlotf;
/// <summary>This function is used to set floating point properties on Auxiliary Effect Slot objects.</summary>
/// <param name="asid">Auxiliary Effect Slot object identifier.</param>
/// <param name="param">Auxiliary Effect Slot property to set.</param>
/// <param name="value">Floating point value.</param>
[CLSCompliant(false)]
2008-04-06 14:49:03 +00:00
public void AuxiliaryEffectSlot(uint asid, EfxAuxiliaryf param, float value)
2008-01-18 17:24:39 +00:00
{
2008-04-06 14:49:03 +00:00
Imported_alAuxiliaryEffectSlotf(asid, param, value);
2008-01-18 17:24:39 +00:00
}
2008-01-18 15:50:58 +00:00
/// <summary>This function is used to set floating point properties on Auxiliary Effect Slot objects.</summary>
/// <param name="asid">Auxiliary Effect Slot object identifier.</param>
/// <param name="param">Auxiliary Effect Slot property to set.</param>
/// <param name="value">Floating point value.</param>
2008-04-06 14:49:03 +00:00
[CLSCompliant(true)]
public void AuxiliaryEffectSlot(int asid, EfxAuxiliaryf param, float value)
{
2008-04-06 14:49:03 +00:00
Imported_alAuxiliaryEffectSlotf((uint)asid, param, value);
}
2008-01-18 15:50:58 +00:00
#endregion alAuxiliaryEffectSlotf
#region alGetAuxiliaryEffectSloti
//[CLSCompliant(false)]
2008-04-06 14:49:03 +00:00
unsafe private delegate void Delegate_alGetAuxiliaryEffectSloti(uint asid, EfxAuxiliaryi pname, [Out] int* value);
2008-01-25 22:14:16 +00:00
// typedef void (__cdecl *LPALGETAUXILIARYEFFECTSLOTI)( ALuint asid, ALenum pname, ALint* value );
2008-01-16 18:43:52 +00:00
//[CLSCompliant(false)]
2008-01-18 15:50:58 +00:00
private Delegate_alGetAuxiliaryEffectSloti Imported_alGetAuxiliaryEffectSloti;
2008-01-18 17:24:39 +00:00
/// <summary>This function is used to retrieve integer properties on Auxiliary Effect Slot objects.</summary>
/// <param name="asid">Auxiliary Effect Slot object identifier.</param>
/// <param name="pname">Auxiliary Effect Slot property to retrieve.</param>
/// <param name="value">Address where integer value will be stored.</param>
[CLSCompliant(false)]
2008-04-06 14:49:03 +00:00
public void GetAuxiliaryEffectSlot(uint asid, EfxAuxiliaryi pname, out int value)
2008-01-18 15:50:58 +00:00
{
unsafe
{
2008-04-06 14:49:03 +00:00
fixed (int* ptr = &value)
2008-01-18 15:50:58 +00:00
{
2008-04-06 14:49:03 +00:00
Imported_alGetAuxiliaryEffectSloti(asid, pname, ptr);
2008-01-18 15:50:58 +00:00
}
}
}
/// <summary>This function is used to retrieve integer properties on Auxiliary Effect Slot objects.</summary>
/// <param name="asid">Auxiliary Effect Slot object identifier.</param>
/// <param name="pname">Auxiliary Effect Slot property to retrieve.</param>
/// <param name="value">Address where integer value will be stored.</param>
2008-04-06 14:49:03 +00:00
[CLSCompliant(true)]
public void GetAuxiliaryEffectSlot(int asid, EfxAuxiliaryi pname, out int value)
{
2008-04-06 14:49:03 +00:00
GetAuxiliaryEffectSlot((uint)asid, pname, out value);
}
2008-01-18 15:50:58 +00:00
#endregion alGetAuxiliaryEffectSloti
#region alGetAuxiliaryEffectSlotf
//[CLSCompliant(false)]
2008-04-06 14:49:03 +00:00
unsafe private delegate void Delegate_alGetAuxiliaryEffectSlotf(uint asid, EfxAuxiliaryf pname, [Out] float* value);
2008-01-25 22:14:16 +00:00
// typedef void (__cdecl *LPALGETAUXILIARYEFFECTSLOTF)( ALuint asid, ALenum pname, ALfloat* value );
2008-01-17 19:02:37 +00:00
//[CLSCompliant(false)]
2008-01-18 15:50:58 +00:00
private Delegate_alGetAuxiliaryEffectSlotf Imported_alGetAuxiliaryEffectSlotf;
2008-01-18 17:24:39 +00:00
/// <summary>This function is used to retrieve floating properties on Auxiliary Effect Slot objects.</summary>
/// <param name="asid">Auxiliary Effect Slot object identifier.</param>
/// <param name="pname">Auxiliary Effect Slot property to retrieve.</param>
/// <param name="value">Address where floating point value will be stored.</param>
[CLSCompliant(false)]
2008-04-06 14:49:03 +00:00
public void GetAuxiliaryEffectSlot(uint asid, EfxAuxiliaryf pname, out float value)
2008-01-18 15:50:58 +00:00
{
unsafe
{
2008-04-06 14:49:03 +00:00
fixed (float* ptr = &value)
2008-01-18 15:50:58 +00:00
{
2008-04-06 14:49:03 +00:00
Imported_alGetAuxiliaryEffectSlotf(asid, pname, ptr);
2008-01-18 15:50:58 +00:00
}
}
}
/// <summary>This function is used to retrieve floating properties on Auxiliary Effect Slot objects.</summary>
/// <param name="asid">Auxiliary Effect Slot object identifier.</param>
/// <param name="pname">Auxiliary Effect Slot property to retrieve.</param>
/// <param name="value">Address where floating point value will be stored.</param>
2008-04-06 14:49:03 +00:00
[CLSCompliant(true)]
public void GetAuxiliaryEffectSlot(int asid, EfxAuxiliaryf pname, out float value)
{
2008-04-06 14:49:03 +00:00
GetAuxiliaryEffectSlot((uint)asid, pname, out value);
}
2008-01-18 15:50:58 +00:00
#endregion alGetAuxiliaryEffectSlotf
2008-01-17 19:02:37 +00:00
// Not used:
// typedef void (__cdecl *LPALAUXILIARYEFFECTSLOTIV)( ALuint asid, ALenum param, ALint* values );
// typedef void (__cdecl *LPALAUXILIARYEFFECTSLOTFV)( ALuint asid, ALenum param, ALfloat* values );
// typedef void (__cdecl *LPALGETAUXILIARYEFFECTSLOTIV)( ALuint asid, ALenum pname, ALint* values );
2008-01-16 18:43:52 +00:00
// typedef void (__cdecl *LPALGETAUXILIARYEFFECTSLOTFV)( ALuint asid, ALenum pname, ALfloat* values );
2008-01-17 19:02:37 +00:00
2008-01-18 15:50:58 +00:00
#endregion Auxiliary Effect Slot Object
2008-01-17 20:55:56 +00:00
#region Constructor / Extension Loading
private bool _valid;
/// <summary>Returns True if the EFX Extension has been found and could be initialized.</summary>
public bool IsInitialized
{
get
{
return _valid;
}
}
2008-01-17 20:55:56 +00:00
2008-04-06 14:49:03 +00:00
public EfxExtension()
2008-01-17 20:55:56 +00:00
{
_valid = false;
2008-04-06 14:49:03 +00:00
if (Alc.IsExtensionPresent(Alc.GetContextsDevice(Alc.GetCurrentContext()), "ALC_EXT_EFX") == false)
2008-01-17 20:55:56 +00:00
{
2008-04-06 14:49:03 +00:00
Trace.WriteLine("Efx Extension ALC_EXT_EFX is unknown to the Device.");
2008-01-17 20:55:56 +00:00
return;
}
2008-01-25 22:14:16 +00:00
// Console.WriteLine("ALC_EXT_EFX found. Efx can be used.");
2008-01-17 20:55:56 +00:00
try
{
2008-04-06 14:49:03 +00:00
Imported_alGenEffects = (Delegate_alGenEffects)Marshal.GetDelegateForFunctionPointer(AL.GetProcAddress("alGenEffects"), typeof(Delegate_alGenEffects));
Imported_alDeleteEffects = (Delegate_alDeleteEffects)Marshal.GetDelegateForFunctionPointer(AL.GetProcAddress("alDeleteEffects"), typeof(Delegate_alDeleteEffects));
Imported_alIsEffect = (Delegate_alIsEffect)Marshal.GetDelegateForFunctionPointer(AL.GetProcAddress("alIsEffect"), typeof(Delegate_alIsEffect));
Imported_alEffecti = (Delegate_alEffecti)Marshal.GetDelegateForFunctionPointer(AL.GetProcAddress("alEffecti"), typeof(Delegate_alEffecti));
Imported_alEffectf = (Delegate_alEffectf)Marshal.GetDelegateForFunctionPointer(AL.GetProcAddress("alEffectf"), typeof(Delegate_alEffectf));
Imported_alEffectfv = (Delegate_alEffectfv)Marshal.GetDelegateForFunctionPointer(AL.GetProcAddress("alEffectfv"), typeof(Delegate_alEffectfv));
Imported_alGetEffecti = (Delegate_alGetEffecti)Marshal.GetDelegateForFunctionPointer(AL.GetProcAddress("alGetEffecti"), typeof(Delegate_alGetEffecti));
Imported_alGetEffectf = (Delegate_alGetEffectf)Marshal.GetDelegateForFunctionPointer(AL.GetProcAddress("alGetEffectf"), typeof(Delegate_alGetEffectf));
Imported_alGetEffectfv = (Delegate_alGetEffectfv)Marshal.GetDelegateForFunctionPointer(AL.GetProcAddress("alGetEffectfv"), typeof(Delegate_alGetEffectfv));
}
catch (Exception e)
2008-01-17 20:55:56 +00:00
{
2008-04-06 14:49:03 +00:00
Trace.WriteLine("Failed to marshal Effect functions. " + e.ToString());
2008-01-17 20:55:56 +00:00
return;
}
2008-01-25 22:14:16 +00:00
// Console.WriteLine("Effect functions appear to be ok.");
2008-01-17 20:55:56 +00:00
try
{
2008-04-06 14:49:03 +00:00
Imported_alGenFilters = (Delegate_alGenFilters)Marshal.GetDelegateForFunctionPointer(AL.GetProcAddress("alGenFilters"), typeof(Delegate_alGenFilters));
Imported_alDeleteFilters = (Delegate_alDeleteFilters)Marshal.GetDelegateForFunctionPointer(AL.GetProcAddress("alDeleteFilters"), typeof(Delegate_alDeleteFilters));
Imported_alIsFilter = (Delegate_alIsFilter)Marshal.GetDelegateForFunctionPointer(AL.GetProcAddress("alIsFilter"), typeof(Delegate_alIsFilter));
Imported_alFilteri = (Delegate_alFilteri)Marshal.GetDelegateForFunctionPointer(AL.GetProcAddress("alFilteri"), typeof(Delegate_alFilteri));
Imported_alFilterf = (Delegate_alFilterf)Marshal.GetDelegateForFunctionPointer(AL.GetProcAddress("alFilterf"), typeof(Delegate_alFilterf));
Imported_alGetFilteri = (Delegate_alGetFilteri)Marshal.GetDelegateForFunctionPointer(AL.GetProcAddress("alGetFilteri"), typeof(Delegate_alGetFilteri));
Imported_alGetFilterf = (Delegate_alGetFilterf)Marshal.GetDelegateForFunctionPointer(AL.GetProcAddress("alGetFilterf"), typeof(Delegate_alGetFilterf));
}
catch (Exception e)
2008-01-17 20:55:56 +00:00
{
2008-04-06 14:49:03 +00:00
Trace.WriteLine("Failed to marshal Filter functions. " + e.ToString());
2008-01-17 20:55:56 +00:00
return;
}
2008-01-25 22:14:16 +00:00
// Console.WriteLine("Filter functions appear to be ok.");
2008-01-17 20:55:56 +00:00
try
{
2008-04-06 14:49:03 +00:00
Imported_alGenAuxiliaryEffectSlots = (Delegate_alGenAuxiliaryEffectSlots)Marshal.GetDelegateForFunctionPointer(AL.GetProcAddress("alGenAuxiliaryEffectSlots"), typeof(Delegate_alGenAuxiliaryEffectSlots));
Imported_alDeleteAuxiliaryEffectSlots = (Delegate_alDeleteAuxiliaryEffectSlots)Marshal.GetDelegateForFunctionPointer(AL.GetProcAddress("alDeleteAuxiliaryEffectSlots"), typeof(Delegate_alDeleteAuxiliaryEffectSlots));
Imported_alIsAuxiliaryEffectSlot = (Delegate_alIsAuxiliaryEffectSlot)Marshal.GetDelegateForFunctionPointer(AL.GetProcAddress("alIsAuxiliaryEffectSlot"), typeof(Delegate_alIsAuxiliaryEffectSlot));
Imported_alAuxiliaryEffectSloti = (Delegate_alAuxiliaryEffectSloti)Marshal.GetDelegateForFunctionPointer(AL.GetProcAddress("alAuxiliaryEffectSloti"), typeof(Delegate_alAuxiliaryEffectSloti));
Imported_alAuxiliaryEffectSlotf = (Delegate_alAuxiliaryEffectSlotf)Marshal.GetDelegateForFunctionPointer(AL.GetProcAddress("alAuxiliaryEffectSlotf"), typeof(Delegate_alAuxiliaryEffectSlotf));
Imported_alGetAuxiliaryEffectSloti = (Delegate_alGetAuxiliaryEffectSloti)Marshal.GetDelegateForFunctionPointer(AL.GetProcAddress("alGetAuxiliaryEffectSloti"), typeof(Delegate_alGetAuxiliaryEffectSloti));
Imported_alGetAuxiliaryEffectSlotf = (Delegate_alGetAuxiliaryEffectSlotf)Marshal.GetDelegateForFunctionPointer(AL.GetProcAddress("alGetAuxiliaryEffectSlotf"), typeof(Delegate_alGetAuxiliaryEffectSlotf));
}
catch (Exception e)
2008-01-17 20:55:56 +00:00
{
2008-04-06 14:49:03 +00:00
Trace.WriteLine("Failed to marshal AuxiliaryEffectSlot functions. " + e.ToString());
2008-01-17 20:55:56 +00:00
return;
}
2008-01-25 22:14:16 +00:00
// Console.WriteLine("Auxiliary Effect Slot functions appear to be ok.");
2008-01-17 20:55:56 +00:00
2008-01-18 17:33:07 +00:00
// didn't return so far, everything went fine.
2008-01-17 20:55:56 +00:00
_valid = true;
}
#endregion Constructor / Extension Loading
2008-01-16 18:43:52 +00:00
}
2008-01-16 18:43:52 +00:00
}