mirror of
https://github.com/Ryujinx/Opentk.git
synced 2024-12-25 04:55:29 +00:00
AL.Bool gone
This commit is contained in:
parent
a83044610d
commit
a76d283b70
|
@ -81,15 +81,6 @@ namespace OpenTK.OpenAL
|
|||
/// <summary>An IntPtr.Zero that can be used as Al.Null, for convenience.</summary>
|
||||
public static readonly IntPtr Null = IntPtr.Zero; // do NOT touch.
|
||||
|
||||
/// <summary>OpenAL 8-Bit Boolean char, can either be True or False.</summary>
|
||||
public enum Bool : byte
|
||||
{
|
||||
///<summary>Boolean False.</summary>
|
||||
False = 0,
|
||||
///<summary>Boolean True.</summary>
|
||||
True = 1,
|
||||
}
|
||||
|
||||
#endregion Type Helpers
|
||||
|
||||
#region Renderer State management
|
||||
|
@ -110,7 +101,7 @@ namespace OpenTK.OpenAL
|
|||
/// <param name="capability">The name of a capability to enable.</param>
|
||||
/// <returns>True if enabled, False if disabled.</returns>
|
||||
[DllImport(AL.Lib, EntryPoint = "alIsEnabled", ExactSpelling = true, CallingConvention = AL.Style), SuppressUnmanagedCodeSecurity()]
|
||||
public static extern AL.Bool IsEnabled(Enums.ALCapability capability);
|
||||
public static extern bool IsEnabled(Enums.ALCapability capability);
|
||||
// AL_API ALboolean AL_APIENTRY alIsEnabled( ALenum capability );
|
||||
|
||||
#endregion Renderer State management
|
||||
|
@ -186,11 +177,11 @@ namespace OpenTK.OpenAL
|
|||
|
||||
#region Extension support.
|
||||
|
||||
/// <summary>This function tests if a specific extension is available for the OpenAL driver.</summary>
|
||||
///<summary>This function tests if a specific extension is available for the OpenAL driver.</summary>
|
||||
/// <param name="extname">A null-terminated string describing the desired extension.</param>
|
||||
/// <returns>Returns AL_TRUE if the extension is available, AL_FALSE if the extension is not available.</returns>
|
||||
[DllImport(AL.Lib, EntryPoint = "alIsExtensionPresent", ExactSpelling = true, CallingConvention = AL.Style, CharSet = CharSet.Ansi), SuppressUnmanagedCodeSecurity()]
|
||||
public static extern AL.Bool IsExtensionPresent([In] string extname);
|
||||
public static extern bool IsExtensionPresent([In] string extname);
|
||||
// AL_API ALboolean AL_APIENTRY alIsExtensionPresent( const ALchar* extname );
|
||||
|
||||
/// <summary>This function returns the address of an OpenAL extension function. Handle with care.</summary>
|
||||
|
@ -461,7 +452,7 @@ namespace OpenTK.OpenAL
|
|||
/// <param name="sid">A source name to be tested for validity</param>
|
||||
/// <returns>Success.</returns>
|
||||
[CLSCompliant(false), DllImport(AL.Lib, EntryPoint = "alIsSource", ExactSpelling = true, CallingConvention = AL.Style), SuppressUnmanagedCodeSecurity()]
|
||||
public static extern AL.Bool IsSource(uint sid); // Verify a handle is a valid Source
|
||||
public static extern bool IsSource(uint sid); // Verify a handle is a valid Source
|
||||
// AL_API ALboolean AL_APIENTRY alIsSource( ALuint sid );
|
||||
|
||||
#endregion Create Source objects
|
||||
|
@ -904,7 +895,7 @@ namespace OpenTK.OpenAL
|
|||
/// <param name="bid">A buffer Handle previously allocated with <see cref="Al.GenBuffers"/>.</param>
|
||||
/// <returns>Success.</returns>
|
||||
[CLSCompliant(false), DllImport(AL.Lib, EntryPoint = "alIsBuffer", ExactSpelling = true, CallingConvention = AL.Style), SuppressUnmanagedCodeSecurity()]
|
||||
public static extern AL.Bool IsBuffer(uint bid);
|
||||
public static extern bool IsBuffer(uint bid);
|
||||
// AL_API ALboolean AL_APIENTRY alIsBuffer( ALuint bid );
|
||||
|
||||
/// <summary>This function fills a buffer with audio data. All the pre-defined formats are PCM data, but this function may be used by extensions to load other data types as well.</summary>
|
||||
|
|
|
@ -114,7 +114,7 @@ namespace OpenTK.OpenAL
|
|||
/// <param name="context">A pointer to the new context.</param>
|
||||
/// <returns>Returns True on success, or False on failure.</returns>
|
||||
[DllImport(Alc.Lib, EntryPoint = "alcMakeContextCurrent", ExactSpelling = true, CallingConvention = Alc.Style), SuppressUnmanagedCodeSecurity()]
|
||||
public static extern AL.Bool MakeContextCurrent([In] IntPtr context);
|
||||
public static extern bool MakeContextCurrent([In] IntPtr context);
|
||||
// ALC_API ALCboolean ALC_APIENTRY alcMakeContextCurrent( ALCcontext *context );
|
||||
|
||||
/// <summary>This function tells a context to begin processing. When a context is suspended, changes in OpenAL state will be accepted but will not be processed. alcSuspendContext can be used to suspend a context, and then all the OpenAL state changes can be applied at once, followed by a call to alcProcessContext to apply all the state changes immediately. In some cases, this procedure may be more efficient than application of properties in a non-suspended state. In some implementations, process and suspend calls are each a NOP.</summary>
|
||||
|
@ -163,7 +163,7 @@ namespace OpenTK.OpenAL
|
|||
/// <param name="device">a pointer to an opened device</param>
|
||||
/// <returns>True will be returned on success or False on failure. Closing a device will fail if the device contains any contexts or buffers.</returns>
|
||||
[DllImport(Alc.Lib, EntryPoint = "alcCloseDevice", ExactSpelling = true, CallingConvention = Alc.Style), SuppressUnmanagedCodeSecurity()]
|
||||
public static extern AL.Bool CloseDevice([In] IntPtr device);
|
||||
public static extern bool CloseDevice([In] IntPtr device);
|
||||
// ALC_API ALCboolean ALC_APIENTRY alcCloseDevice( ALCdevice *device );
|
||||
|
||||
#endregion Device Management
|
||||
|
@ -186,7 +186,7 @@ namespace OpenTK.OpenAL
|
|||
/// <param name="extname">a null-terminated string describing the extension.</param>
|
||||
/// <returns>Returns True if the extension is available, False if the extension is not available.</returns>
|
||||
[DllImport(Alc.Lib, EntryPoint = "alcIsExtensionPresent", ExactSpelling = true, CallingConvention = Alc.Style, CharSet = CharSet.Ansi), SuppressUnmanagedCodeSecurity()]
|
||||
public static extern AL.Bool IsExtensionPresent([In] IntPtr device, [In] string extname);
|
||||
public static extern bool IsExtensionPresent([In] IntPtr device, [In] string extname);
|
||||
// ALC_API ALCboolean ALC_APIENTRY alcIsExtensionPresent( ALCdevice *device, const ALCchar *extname );
|
||||
|
||||
/// <summary>This function retrieves the address of a specified context extension function.</summary>
|
||||
|
@ -290,7 +290,7 @@ namespace OpenTK.OpenAL
|
|||
/// <param name="device">a pointer to a capture device.</param>
|
||||
/// <returns>Returns True if the close operation was successful, False on failure.</returns>
|
||||
[DllImport(Alc.Lib, EntryPoint = "alcCaptureCloseDevice", ExactSpelling = true, CallingConvention = Alc.Style), SuppressUnmanagedCodeSecurity()]
|
||||
public static extern AL.Bool CaptureCloseDevice([In] IntPtr device);
|
||||
public static extern bool CaptureCloseDevice([In] IntPtr device);
|
||||
// ALC_API ALCboolean ALC_APIENTRY alcCaptureCloseDevice( ALCdevice *device );
|
||||
|
||||
/// <summary>This function begins a capture operation.</summary>
|
||||
|
|
|
@ -31,12 +31,12 @@ namespace OpenTK.OpenAL
|
|||
/// <param name="argv">Application Main Parameters. Can be IntPtr.Zero.</param>
|
||||
/// <returns>Success.</returns>
|
||||
[DllImport(Alut.Lib, EntryPoint = "alutInit", ExactSpelling = true, CallingConvention = Alut.Style), SuppressUnmanagedCodeSecurity()]
|
||||
public static extern AL.Bool Init([In] IntPtr argcp, [In] IntPtr argv);
|
||||
public static extern bool Init([In] IntPtr argcp, [In] IntPtr argv);
|
||||
// ALUT_API ALboolean ALUT_APIENTRY alutInit (int *argcp, char **argv);
|
||||
|
||||
/// <summary>Parameterless function for convenience. Internally passes IntPtr.Zero as parameters.</summary>
|
||||
/// <returns>Success.</returns>
|
||||
public static AL.Bool Init() // overload for convenience
|
||||
public static bool Init() // overload for convenience
|
||||
{
|
||||
return Init(IntPtr.Zero, IntPtr.Zero);
|
||||
}
|
||||
|
@ -46,12 +46,12 @@ namespace OpenTK.OpenAL
|
|||
/// <param name="argv">Application Main Parameters</param>
|
||||
/// <returns>Success.</returns>
|
||||
[DllImport(Alut.Lib, EntryPoint = "alutInitWithoutContext", ExactSpelling = true, CallingConvention = Alut.Style), SuppressUnmanagedCodeSecurity()]
|
||||
public static extern AL.Bool InitWithoutContext([In] IntPtr argcp, [In] IntPtr argv);
|
||||
public static extern bool InitWithoutContext([In] IntPtr argcp, [In] IntPtr argv);
|
||||
// ALUT_API ALboolean ALUT_APIENTRY alutInitWithoutContext (int *argcp, char **argv);
|
||||
|
||||
/// <summary>Alut.InitWithoutContext initializes the ALUT internals. It does not create any OpenAL context or device, so this has to be done via the usual ALC calls. alutInitWithoutContext examines the commandline arguments passed to it and remove those it recognizes. It is acceptable to pass two NULL pointers in settings where no useful information can be obtained from argc and argv.</summary>
|
||||
/// <returns>Success.</returns>
|
||||
public static AL.Bool InitWithoutContext() // overload for convenience
|
||||
public static bool InitWithoutContext() // overload for convenience
|
||||
{
|
||||
return InitWithoutContext(IntPtr.Zero, IntPtr.Zero);
|
||||
}
|
||||
|
@ -59,7 +59,7 @@ namespace OpenTK.OpenAL
|
|||
/// <summary>When the application has finished playing audio, it should shut down ALUT using Alut.Exit. This closes any OpenAL device/context that ALUT may have created in alutInit (but not any that the application created using ALC). After calling alutExit, you may subsequently call alutInit or alutInitWithoutContext again. Note that under well-behaved operating systems, it should be acceptable to simply exit from your program without bothering to call alutExit, relying on the OS to clean up after you. However, it is dangerous to rely on this behavior if portable operation is expected.</summary>
|
||||
/// <returns>Success.</returns>
|
||||
[DllImport(Alut.Lib, EntryPoint = "alutExit", ExactSpelling = true, CallingConvention = Alut.Style), SuppressUnmanagedCodeSecurity()]
|
||||
public static extern AL.Bool Exit();
|
||||
public static extern bool Exit();
|
||||
// ALUT_API ALboolean ALUT_APIENTRY alutExit (void);
|
||||
|
||||
#endregion Init/Exit
|
||||
|
|
|
@ -14,28 +14,35 @@ namespace OpenTK.OpenAL
|
|||
{
|
||||
public partial class Efx
|
||||
{
|
||||
#region Effect object functions.
|
||||
#region Effect object delegates
|
||||
|
||||
// typedef void (__cdecl *LPALGENEFFECTS)( ALsizei n, ALuint* effects );
|
||||
unsafe private delegate void Delegateal_GenEffects(int n, [Out] uint* effects);
|
||||
[CLSCompliant(false)]
|
||||
unsafe private delegate void Delegate_alGenEffects(int n, [Out] uint* effects);
|
||||
|
||||
// typedef void (__cdecl *LPALDELETEEFFECTS)( ALsizei n, ALuint* effects );
|
||||
[CLSCompliant(false)]
|
||||
unsafe private delegate void Delegate_alDeleteEffects(int n, [In] uint* effects);
|
||||
|
||||
// typedef ALboolean (__cdecl *LPALISEFFECT)( ALuint eid );
|
||||
[CLSCompliant(false)]
|
||||
private delegate bool Delegate_alIsEffect(uint eid);
|
||||
|
||||
// typedef void (__cdecl *LPALEFFECTI)( ALuint eid, ALenum param, ALint value);
|
||||
private delegate void Delegate_alEffecti(uint eid, EfxEffecti param, int value);
|
||||
[CLSCompliant(false)]
|
||||
private delegate void Delegate_alEffecti(uint eid, Enums.EfxEffecti param, int value);
|
||||
|
||||
// typedef void (__cdecl *LPALEFFECTF)( ALuint eid, ALenum param, ALfloat value);
|
||||
private delegate void Delegate_alEffectf(uint eid, EfxEffectf param, float value);
|
||||
[CLSCompliant(false)]
|
||||
private delegate void Delegate_alEffectf(uint eid, Enums.EfxEffectf param, float value);
|
||||
|
||||
// typedef void (__cdecl *LPALGETEFFECTI)( ALuint eid, ALenum pname, ALint* value );
|
||||
unsafe private delegate void Delegate_alGetEffecti(uint eid, EfxEffecti pname, [Out] int* value);
|
||||
[CLSCompliant(false)]
|
||||
unsafe private delegate void Delegate_alGetEffecti(uint eid, Enums.EfxEffecti pname, [Out] int* value);
|
||||
|
||||
// typedef void (__cdecl *LPALGETEFFECTF)( ALuint eid, ALenum pname, ALfloat* value );
|
||||
unsafe private delegate void Delegate_alGetEffectf(uint eid, EfxEffectf pname, [Out]float* value);
|
||||
[CLSCompliant(false)]
|
||||
unsafe private delegate void Delegate_alGetEffectf(uint eid, Enums.EfxEffectf pname, [Out]float* value);
|
||||
|
||||
// Not used:
|
||||
// typedef void (__cdecl *LPALEFFECTIV)( ALuint eid, ALenum param, ALint* values );
|
||||
|
@ -43,30 +50,37 @@ namespace OpenTK.OpenAL
|
|||
// typedef void (__cdecl *LPALGETEFFECTIV)( ALuint eid, ALenum pname, ALint* values );
|
||||
// typedef void (__cdecl *LPALGETEFFECTFV)( ALuint eid, ALenum pname, ALfloat* values );
|
||||
|
||||
#endregion Effect object functions.
|
||||
#endregion Effect object delegates
|
||||
|
||||
#region Filter object functions
|
||||
#region Filter object delegates
|
||||
|
||||
// typedef void (__cdecl *LPALGENFILTERS)( ALsizei n, ALuint* filters );
|
||||
[CLSCompliant(false)]
|
||||
unsafe private delegate void Delegate_alGenFilters(int n, [Out] uint* filters);
|
||||
|
||||
// typedef void (__cdecl *LPALDELETEFILTERS)( ALsizei n, ALuint* filters );
|
||||
[CLSCompliant(false)]
|
||||
unsafe private delegate void Delegate_alDeleteFilters(int n, [In] uint* filters);
|
||||
|
||||
// typedef ALboolean (__cdecl *LPALISFILTER)( ALuint fid );
|
||||
[CLSCompliant(false)]
|
||||
private delegate bool Delegate_alIsFilter(uint fid);
|
||||
|
||||
// typedef void (__cdecl *LPALFILTERI)( ALuint fid, ALenum param, ALint value );
|
||||
private delegate void Delegate_alFilteri(uint fid, EfxFilteri param, int value);
|
||||
[CLSCompliant(false)]
|
||||
private delegate void Delegate_alFilteri(uint fid, Enums.EfxFilteri param, int value);
|
||||
|
||||
// typedef void (__cdecl *LPALFILTERF)( ALuint fid, ALenum param, ALfloat value);
|
||||
private delegate void Delegate_alFilterf(uint fid, EfxFilterf param, float value);
|
||||
[CLSCompliant(false)]
|
||||
private delegate void Delegate_alFilterf(uint fid, Enums.EfxFilterf param, float value);
|
||||
|
||||
// typedef void (__cdecl *LPALGETFILTERI)( ALuint fid, ALenum pname, ALint* value );
|
||||
unsafe private delegate void Delegate_alGetFilteri(uint fid, EfxFilteri pname, [Out] int* value);
|
||||
[CLSCompliant(false)]
|
||||
unsafe private delegate void Delegate_alGetFilteri(uint fid, Enums.EfxFilteri pname, [Out] int* value);
|
||||
|
||||
// typedef void (__cdecl *LPALGETFILTERF)( ALuint fid, ALenum pname, ALfloat* value );
|
||||
unsafe private delegate void Delegate_alGetFilterf(uint fid, EfxFilterf pname, [Out] float* value);
|
||||
[CLSCompliant(false)]
|
||||
unsafe private delegate void Delegate_alGetFilterf(uint fid, Enums.EfxFilterf pname, [Out] float* value);
|
||||
|
||||
// Not used:
|
||||
// typedef void (__cdecl *LPALFILTERIV)( ALuint fid, ALenum param, ALint* values );
|
||||
|
@ -74,30 +88,37 @@ namespace OpenTK.OpenAL
|
|||
// typedef void (__cdecl *LPALGETFILTERIV)( ALuint fid, ALenum pname, ALint* values );
|
||||
// typedef void (__cdecl *LPALGETFILTERFV)( ALuint fid, ALenum pname, ALfloat* values );
|
||||
|
||||
#endregion Filter object functions
|
||||
#endregion Filter object delegates
|
||||
|
||||
#region Auxiliary Slot object functions
|
||||
#region Auxiliary Slot object delegates
|
||||
|
||||
// typedef void (__cdecl *LPALGENAUXILIARYEFFECTSLOTS)( ALsizei n, ALuint* slots );
|
||||
[CLSCompliant(false)]
|
||||
unsafe private delegate void Delegate_alGenAuxiliaryEffectSlots(int n, [Out] uint* slots);
|
||||
|
||||
// typedef void (__cdecl *LPALDELETEAUXILIARYEFFECTSLOTS)( ALsizei n, ALuint* slots );
|
||||
[CLSCompliant(false)]
|
||||
unsafe private delegate void Delegate_alDeleteAuxiliaryEffectSlots(int n, [In] uint* slots);
|
||||
|
||||
// typedef ALboolean (__cdecl *LPALISAUXILIARYEFFECTSLOT)( ALuint slot );
|
||||
[CLSCompliant(false)]
|
||||
private delegate bool Delegate_alIsAuxiliaryEffectSlot(uint slot);
|
||||
|
||||
// typedef void (__cdecl *LPALAUXILIARYEFFECTSLOTI)( ALuint asid, ALenum param, ALint value );
|
||||
private delegate void Delegate_alAuxiliaryEffectSloti(uint asid, EfxAuxiliaryi param, int value);
|
||||
[CLSCompliant(false)]
|
||||
private delegate void Delegate_alAuxiliaryEffectSloti(uint asid, Enums.EfxAuxiliaryi param, int value);
|
||||
|
||||
// typedef void (__cdecl *LPALAUXILIARYEFFECTSLOTF)( ALuint asid, ALenum param, ALfloat value );
|
||||
private delegate void Delegate_alAuxiliaryEffectSlotf(uint asid, EfxAuxiliaryf param, float value);
|
||||
[CLSCompliant(false)]
|
||||
private delegate void Delegate_alAuxiliaryEffectSlotf(uint asid, Enums.EfxAuxiliaryf param, float value);
|
||||
|
||||
// typedef void (__cdecl *LPALGETAUXILIARYEFFECTSLOTI)( ALuint asid, ALenum pname, ALint* value );
|
||||
unsafe private delegate void Delegate_alGetAuxiliaryEffectSloti(uint asid, EfxAuxiliaryi pname, [Out] int* value);
|
||||
[CLSCompliant(false)]
|
||||
unsafe private delegate void Delegate_alGetAuxiliaryEffectSloti(uint asid, Enums.EfxAuxiliaryi pname, [Out] int* value);
|
||||
|
||||
// typedef void (__cdecl *LPALGETAUXILIARYEFFECTSLOTF)( ALuint asid, ALenum pname, ALfloat* value );
|
||||
unsafe private delegate void Delegate_alGetAuxiliaryEffectSlotf(uint asid, EfxAuxiliaryf pname, [Out] float* value);
|
||||
[CLSCompliant(false)]
|
||||
unsafe private delegate void Delegate_alGetAuxiliaryEffectSlotf(uint asid, Enums.EfxAuxiliaryf pname, [Out] float* value);
|
||||
|
||||
// Not used:
|
||||
// typedef void (__cdecl *LPALAUXILIARYEFFECTSLOTIV)( ALuint asid, ALenum param, ALint* values );
|
||||
|
@ -105,6 +126,152 @@ namespace OpenTK.OpenAL
|
|||
// typedef void (__cdecl *LPALGETAUXILIARYEFFECTSLOTIV)( ALuint asid, ALenum pname, ALint* values );
|
||||
// typedef void (__cdecl *LPALGETAUXILIARYEFFECTSLOTFV)( ALuint asid, ALenum pname, ALfloat* values );
|
||||
|
||||
#endregion Auxiliary Slot object functions
|
||||
#endregion Auxiliary Slot object delegates
|
||||
|
||||
#region Effect object functions
|
||||
|
||||
[CLSCompliant(false)]
|
||||
private Delegate_alGenEffects Imported_alGenEffects;
|
||||
[CLSCompliant(false)]
|
||||
private Delegate_alDeleteEffects Imported_alDeleteEffects;
|
||||
[CLSCompliant(false)]
|
||||
private Delegate_alIsEffect Imported_alIsEffect;
|
||||
[CLSCompliant(false)]
|
||||
private Delegate_alEffecti Imported_alEffecti;
|
||||
[CLSCompliant(false)]
|
||||
private Delegate_alEffectf Imported_alEffectf;
|
||||
[CLSCompliant(false)]
|
||||
private Delegate_alGetEffecti Imported_alGetEffecti;
|
||||
[CLSCompliant(false)]
|
||||
private Delegate_alGetEffectf Imported_alGetEffectf;
|
||||
|
||||
#endregion Effect object functions
|
||||
|
||||
#region Filter object functions
|
||||
|
||||
[CLSCompliant(false)]
|
||||
private Delegate_alGenFilters Imported_alGenFilters;
|
||||
[CLSCompliant(false)]
|
||||
private Delegate_alDeleteFilters Imported_alDeleteFilters;
|
||||
[CLSCompliant(false)]
|
||||
private Delegate_alIsFilter Imported_alIsFilter;
|
||||
[CLSCompliant(false)]
|
||||
private Delegate_alFilteri Imported_alFilteri;
|
||||
[CLSCompliant(false)]
|
||||
private Delegate_alFilterf Imported_alFilterf;
|
||||
[CLSCompliant(false)]
|
||||
private Delegate_alGetFilteri Imported_alGetFilteri;
|
||||
[CLSCompliant(false)]
|
||||
private Delegate_alGetFilterf Imported_alGetFilterf;
|
||||
|
||||
#endregion Filter object functions
|
||||
|
||||
#region Auxiliary Effect Slot functions
|
||||
|
||||
[CLSCompliant(false)]
|
||||
private Delegate_alGenAuxiliaryEffectSlots Imported_alGenAuxiliaryEffectSlots;
|
||||
[CLSCompliant(false)]
|
||||
private Delegate_alDeleteAuxiliaryEffectSlots Imported_alDeleteAuxiliaryEffectSlots;
|
||||
[CLSCompliant(false)]
|
||||
private Delegate_alIsAuxiliaryEffectSlot Imported_alIsAuxiliaryEffectSlot;
|
||||
[CLSCompliant(false)]
|
||||
private Delegate_alAuxiliaryEffectSloti Imported_alAuxiliaryEffectSloti;
|
||||
[CLSCompliant(false)]
|
||||
private Delegate_alAuxiliaryEffectSlotf Imported_alAuxiliaryEffectSlotf;
|
||||
[CLSCompliant(false)]
|
||||
private Delegate_alGetAuxiliaryEffectSloti Imported_alGetAuxiliaryEffectSloti;
|
||||
[CLSCompliant(false)]
|
||||
private Delegate_alGetAuxiliaryEffectSlotf Imported_alGetAuxiliaryEffectSlotf;
|
||||
|
||||
#endregion Auxiliary Effect Slot functions
|
||||
|
||||
|
||||
#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; } }
|
||||
|
||||
public Efx()
|
||||
{
|
||||
_valid = false;
|
||||
|
||||
if (Alc.IsExtensionPresent( Alc.GetContextsDevice( Alc.GetCurrentContext()) , "ALC_EXT_EFX") == false)
|
||||
{
|
||||
Console.WriteLine("Extension unknown.");
|
||||
return;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
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_alGetEffecti = (Delegate_alGetEffecti)Marshal.GetDelegateForFunctionPointer(AL.GetProcAddress("alGetEffecti"), typeof(Delegate_alGetEffecti));
|
||||
Imported_alGetEffectf = (Delegate_alGetEffectf)Marshal.GetDelegateForFunctionPointer(AL.GetProcAddress("alGetEffectf"), typeof(Delegate_alGetEffectf));
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Console.WriteLine("Failed to marshal Effect functions. " + e.ToString());
|
||||
return;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
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)
|
||||
{
|
||||
Console.WriteLine("Failed to marshal Filter functions. " + e.ToString());
|
||||
return;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
Imported_alGenFilters = (Delegate_alGenFilters)Marshal.GetDelegateForFunctionPointer(AL.GetProcAddress("alGenFilters"), typeof(Delegate_alGenFilters));
|
||||
Imported_alDeleteFilters = (Delegate_alDeleteFilters)Marshal.GetDelegateForFunctionPointer(AL.GetProcAddress("alFilters"), 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)
|
||||
{
|
||||
Console.WriteLine("Failed to marshal Filter functions. " + e.ToString());
|
||||
return;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
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)
|
||||
{
|
||||
Console.WriteLine("Failed to marshal AuxiliaryEffectSlot functions. " + e.ToString());
|
||||
return;
|
||||
}
|
||||
|
||||
// not early return, everything went fine.
|
||||
_valid = true;
|
||||
}
|
||||
|
||||
#endregion Constructor / Extension Loading
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,10 +9,10 @@
|
|||
|
||||
using System;
|
||||
|
||||
namespace OpenTK.OpenAL
|
||||
namespace OpenTK.OpenAL.Enums
|
||||
|
||||
{
|
||||
public partial class Efx
|
||||
{
|
||||
|
||||
// AL chorus effect parameter ranges and defaults
|
||||
// AL_CHORUS_WAVEFORM_SINUSOID 0
|
||||
// AL_CHORUS_WAVEFORM_TRIANGLE 1
|
||||
|
@ -36,7 +36,7 @@ namespace OpenTK.OpenAL
|
|||
// AL_FREQUENCY_SHIFTER_DIRECTION_UP 1
|
||||
// AL_FREQUENCY_SHIFTER_DIRECTION_OFF 2
|
||||
|
||||
private const string ALC_EXT_EFX_NAME = "ALC_EXT_EFX";
|
||||
|
||||
|
||||
/**
|
||||
* Context definitions to be used with alcCreateContext.
|
||||
|
@ -423,5 +423,5 @@ namespace OpenTK.OpenAL
|
|||
}
|
||||
|
||||
#endregion Filter Object
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -46,6 +46,10 @@ Version History:
|
|||
- Begun working on Efx
|
||||
- X-Ram changed, must be tested properly. verify parameters of GetBufferMode()
|
||||
|
||||
0.7
|
||||
- Efx continued.
|
||||
- removed AL.Bool, replaced with System.Boolean. Seems to work so far.
|
||||
|
||||
Next Version:
|
||||
- EFX Extension
|
||||
- Enums themselves require summaries (do EFX 1st)
|
||||
|
|
|
@ -30,17 +30,17 @@ namespace OpenTK.OpenAL
|
|||
#region X-RAM Function pointer definitions
|
||||
|
||||
[CLSCompliant(false)]
|
||||
public unsafe delegate AL.Bool DelegateSetBufferMode(int n, ref uint buffers, int value);
|
||||
public unsafe delegate bool Delegate_SetBufferMode(int n, ref uint buffers, int value);
|
||||
//typedef ALboolean (__cdecl *EAXSetBufferMode)(ALsizei n, ALuint *buffers, ALint value);
|
||||
|
||||
[CLSCompliant(false)]
|
||||
public delegate int DelegateGetBufferMode(uint buffer, out int value);
|
||||
public delegate int Delegate_GetBufferMode(uint buffer, out int value);
|
||||
//typedef ALenum (__cdecl *EAXGetBufferMode)(ALuint buffer, ALint *value);
|
||||
|
||||
[CLSCompliant(false)]
|
||||
private DelegateSetBufferMode ImportedSetBufferMode;
|
||||
private Delegate_SetBufferMode Imported_SetBufferMode;
|
||||
[CLSCompliant(false)]
|
||||
private DelegateGetBufferMode ImportedGetBufferMode;
|
||||
private Delegate_GetBufferMode Imported_GetBufferMode;
|
||||
|
||||
#endregion X-RAM Function pointer definitions
|
||||
|
||||
|
@ -56,7 +56,7 @@ namespace OpenTK.OpenAL
|
|||
public XRamExtension()
|
||||
{ // Query if Extension supported and retrieve Tokens/Pointers if it is.
|
||||
_valid = false;
|
||||
if (AL.IsExtensionPresent("EAX-RAM") == AL.Bool.False)
|
||||
if (AL.IsExtensionPresent("EAX-RAM") == false)
|
||||
return;
|
||||
|
||||
AL_EAX_RAM_SIZE = AL.GetEnumValue("AL_EAX_RAM_SIZE");
|
||||
|
@ -81,8 +81,8 @@ namespace OpenTK.OpenAL
|
|||
|
||||
try
|
||||
{
|
||||
ImportedGetBufferMode = (DelegateGetBufferMode)Marshal.GetDelegateForFunctionPointer(AL.GetProcAddress("EAXGetBufferMode"), typeof(DelegateGetBufferMode));
|
||||
ImportedSetBufferMode = (DelegateSetBufferMode)Marshal.GetDelegateForFunctionPointer(AL.GetProcAddress("EAXSetBufferMode"), typeof(DelegateSetBufferMode));
|
||||
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)
|
||||
{
|
||||
|
@ -134,13 +134,13 @@ namespace OpenTK.OpenAL
|
|||
switch (mode)
|
||||
{
|
||||
case XRamStorage.Acessible:
|
||||
ImportedSetBufferMode(1, ref buffer, AL_STORAGE_ACCESSIBLE);
|
||||
Imported_SetBufferMode(1, ref buffer, AL_STORAGE_ACCESSIBLE);
|
||||
break;
|
||||
case XRamStorage.Hardware:
|
||||
ImportedSetBufferMode(1, ref buffer, AL_STORAGE_HARDWARE);
|
||||
Imported_SetBufferMode(1, ref buffer, AL_STORAGE_HARDWARE);
|
||||
break;
|
||||
default:
|
||||
ImportedSetBufferMode(1, ref buffer, AL_STORAGE_AUTOMATIC);
|
||||
Imported_SetBufferMode(1, ref buffer, AL_STORAGE_AUTOMATIC);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -149,7 +149,7 @@ namespace OpenTK.OpenAL
|
|||
public XRamStorage GetBufferMode(ref uint buffer)
|
||||
{
|
||||
int t; // this is improper, find sample codes using it and figure out what 2nd param does.
|
||||
return (XRamStorage)ImportedGetBufferMode(buffer, out t);
|
||||
return (XRamStorage)Imported_GetBufferMode(buffer, out t);
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
|
|
Loading…
Reference in a new issue