diff options
author | chai <chaifix@163.com> | 2018-07-28 00:50:12 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2018-07-28 00:50:12 +0800 |
commit | 92dab582ccac31be7fa410e7f4fb3789e88a0629 (patch) | |
tree | 008bbecc76a73aae38d77d1851f4230756356a33 /src/lua/audio/luaopen_audio.cpp | |
parent | b855ebb91ad8d97617ec1aa418b4add84670a07d (diff) |
*update
Diffstat (limited to 'src/lua/audio/luaopen_audio.cpp')
-rw-r--r-- | src/lua/audio/luaopen_audio.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/lua/audio/luaopen_audio.cpp b/src/lua/audio/luaopen_audio.cpp index 992c3ec..73c5bea 100644 --- a/src/lua/audio/luaopen_audio.cpp +++ b/src/lua/audio/luaopen_audio.cpp @@ -1,5 +1,3 @@ -#include <SDL2/SDL.h> - #include "lua/luax.h" #include "libjin/jin.h" @@ -7,14 +5,19 @@ namespace jin { namespace lua { + using namespace jin::audio; + static int l_init(lua_State* L) { - if (SDL_Init(SDL_INIT_AUDIO) < 0) + SDLAudioSetting setting; + if (! SDLAudio::get()->init(&setting)) { luax_error(L, "could not init audio"); luax_pushboolean(L, false); return 1; } + luax_pushboolean(L, true); + return 1; } static int l_newSound(lua_State* L) |