diff options
author | Chris Xiong <chirs241097@gmail.com> | 2015-08-15 11:31:21 +0800 |
---|---|---|
committer | Chris Xiong <chirs241097@gmail.com> | 2015-08-15 11:31:21 +0800 |
commit | bfe4f5ac512493bd9a359a06875288fbfaea6ff8 (patch) | |
tree | f3792da663b88b0db48376bf493d9dbe1ceba248 /smelt/sdl/sfx_sdl.cpp | |
parent | 65408f92d1728d06094cb81eac3c81e1dae34a65 (diff) | |
download | bullet-lab-remix-bfe4f5ac512493bd9a359a06875288fbfaea6ff8.tar.xz |
Bump SMELT to apilevel 2, adding several functions.
Diffstat (limited to 'smelt/sdl/sfx_sdl.cpp')
-rw-r--r-- | smelt/sdl/sfx_sdl.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/smelt/sdl/sfx_sdl.cpp b/smelt/sdl/sfx_sdl.cpp index afc8f68..10a207c 100644 --- a/smelt/sdl/sfx_sdl.cpp +++ b/smelt/sdl/sfx_sdl.cpp @@ -2,7 +2,6 @@ /* * Simple MultimEdia LiTerator(SMELT) * by Chris Xiong 2015 - * api level 1 * GFX implementation based on OpenAL * * WARNING: This library is in development and interfaces would be very @@ -90,6 +89,14 @@ DWORD SMELT_IMPL::smSFXGetLengthd(SMSFX fx) } return -1; } +void SMELT_IMPL::smSFXSetLoopPoint(SMSFX fx,DWORD l,DWORD r) +{ + if(pOpenALDevice) + { + ALint pt[2];pt[0]=l;pt[1]=r; + alBufferiv((ALuint)fx,AL_LOOP_POINTS_SOFT,pt); + } +} void SMELT_IMPL::smSFXFree(SMSFX fx) { if(pOpenALDevice) @@ -299,6 +306,9 @@ bool SMELT_IMPL::initOAL() smLog("%s:"SLINE": AL_VENDOR: %s\n",SFX_SDL_SRCFN,(char*)alGetString(AL_VENDOR)); smLog("%s:"SLINE": AL_RENDERER: %s\n",SFX_SDL_SRCFN,(char*)alGetString(AL_RENDERER)); smLog("%s:"SLINE": AL_VERSION: %s\n",SFX_SDL_SRCFN,(char*)alGetString(AL_VERSION)); + const char* ext=(const char*)alGetString(AL_EXTENSIONS); + lpp=strstr(ext,"AL_SOFT_loop_points")!=NULL; + if(!lpp)smLog("%s:"SLINE": Warning: loop points not supported. Please recompile with OpenAL Soft.\n",SFX_SDL_SRCFN); pOpenALDevice=(void*)dev; return true; } |