From 34947d066b994c2ef9121a83497da344982d28e2 Mon Sep 17 00:00:00 2001 From: chai Date: Thu, 17 May 2018 18:04:41 +0800 Subject: v0.1.0 --- src/lua/audio/luaopen_audio.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src/lua/audio/luaopen_audio.cpp') diff --git a/src/lua/audio/luaopen_audio.cpp b/src/lua/audio/luaopen_audio.cpp index 1378f89..4c9b5a7 100644 --- a/src/lua/audio/luaopen_audio.cpp +++ b/src/lua/audio/luaopen_audio.cpp @@ -1,3 +1,5 @@ +#include + #include "libs/luax/luax.h" #include "audio/audio.h" @@ -7,8 +9,12 @@ namespace lua { static int l_init(lua_State* L) { - - return 0; + if (SDL_Init(SDL_INIT_AUDIO) < 0) + { + luax_error(L, "could not init audio"); + luax_pushboolean(L, false); + return 1; + } } static int l_newSound(lua_State* L) @@ -25,7 +31,7 @@ namespace lua int luaopen_audio(lua_State* L) { - + return 1; } } -- cgit v1.1-26-g67d0