aboutsummaryrefslogtreecommitdiff
path: root/src/lua/audio/luaopen_audio.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/lua/audio/luaopen_audio.cpp')
-rw-r--r--src/lua/audio/luaopen_audio.cpp12
1 files changed, 9 insertions, 3 deletions
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 <SDL2/SDL.h>
+
#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;
}
}