From be37f10feded3ed626194ed626d62bb23e010de4 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Wed, 16 Mar 2011 13:57:00 -0700 Subject: Add alIsBufferFormatSupportedSOFT --- OpenAL32/Include/alMain.h | 2 ++ OpenAL32/alBuffer.c | 17 +++++++++++++++++ 2 files changed, 19 insertions(+) (limited to 'OpenAL32') diff --git a/OpenAL32/Include/alMain.h b/OpenAL32/Include/alMain.h index f0f45029..cff0a251 100644 --- a/OpenAL32/Include/alMain.h +++ b/OpenAL32/Include/alMain.h @@ -50,6 +50,7 @@ ALC_API void ALC_APIENTRY alcRenderSamples(ALCdevice *device, ALCvoid *buffer, A typedef void (AL_APIENTRY*LPALBUFFERSAMPLESSOFT)(ALuint,ALuint,ALenum,ALsizei,ALenum,ALenum,const ALvoid*); typedef void (AL_APIENTRY*LPALBUFFERSUBSAMPLESSOFT)(ALuint,ALsizei,ALsizei,ALenum,ALenum,const ALvoid*); typedef void (AL_APIENTRY*LPALGETBUFFERSAMPLESSOFT)(ALuint,ALsizei,ALsizei,ALenum,ALenum,ALvoid*); +typedef ALboolean (AL_APIENTRY*LPALISBUFFERFORMATSUPPORTEDSOFT)(ALenum); #ifdef AL_ALEXT_PROTOTYPES AL_API void AL_APIENTRY alBufferSamplesSOFT(ALuint buffer, ALuint samplerate, ALenum internalformat, ALsizei frames, @@ -60,6 +61,7 @@ AL_API void AL_APIENTRY alBufferSubSamplesSOFT(ALuint buffer, AL_API void AL_APIENTRY alGetBufferSamplesSOFT(ALuint buffer, ALsizei offset, ALsizei frames, ALenum channels, ALenum type, ALvoid *data); +AL_API ALboolean AL_APIENTRY alIsBufferFormatSupportedSOFT(ALenum format); #endif #endif diff --git a/OpenAL32/alBuffer.c b/OpenAL32/alBuffer.c index 400db6a8..30402ee1 100644 --- a/OpenAL32/alBuffer.c +++ b/OpenAL32/alBuffer.c @@ -638,6 +638,23 @@ AL_API void AL_APIENTRY alGetBufferSamplesSOFT(ALuint buffer, ProcessContext(Context); } +AL_API ALboolean AL_APIENTRY alIsBufferFormatSupportedSOFT(ALenum format) +{ + enum FmtChannels DstChannels; + enum FmtType DstType; + ALCcontext *Context; + ALboolean ret; + + Context = GetContextSuspended(); + if(!Context) return AL_FALSE; + + ret = DecomposeFormat(format, &DstChannels, &DstType); + + ProcessContext(Context); + + return ret; +} + AL_API void AL_APIENTRY alBufferf(ALuint buffer, ALenum eParam, ALfloat flValue) { -- cgit v1.2.3