LUA, C++ and SDL ?
So, I''m writing a game in C++, using LUA as a scripting language for the actual game and keeping the deeper engine stuff hard-coded. The problem steps in, when I want to use SDL and LUA (for example in-game keyboard events controlling).
There is libluaSDL (or something like that), but it seems to be used only, when running lua scripts under the script-parser program
''lua'', not under my own C++ program. (Do you still get, what I''m meaning, huh?).
So do I have to write millions of glue functions for SDL stuff (in other words, make my own library for using SDL&LUA under C++) or is there already a library for this?
Shit, I can write really as undenstandable text as my code is.
Kekkonen, Kekkonen, Kekkonen.
The library you mention will work just fine with embedded lua scripts. Check out this, and this for how to use it.
How appropriate. You fight like a cow.
How appropriate. You fight like a cow.
Well, I can't find a way to use loadmodule with Lua 5.0 and Linux. There is a patch for 5.0-beta in the bottom of the page, but it seems to be unworkable for me.
EDIT: Oh yeah, and Luacheia seems not to have any c/c++ libraries.
Am I retard or what?
[edited by - Temuz on October 19, 2003 4:59:25 PM]
EDIT: Oh yeah, and Luacheia seems not to have any c/c++ libraries.
Am I retard or what?
[edited by - Temuz on October 19, 2003 4:59:25 PM]
Kekkonen, Kekkonen, Kekkonen.
You don''t need a patch. It''s built into 5.0.
LuaCheia is a standalone distribution of Lua; it isn''t really intended for embedding.
How appropriate. You fight like a cow.
LuaCheia is a standalone distribution of Lua; it isn''t really intended for embedding.
How appropriate. You fight like a cow.
October 26, 2003 07:35 AM
quote: Original post by Anonymous Poster
Whaa?
I mean, there''s loadlib() but no loadmodule() (or I can''t find a way to use it), and if I use loadlib() I still can''t use the SDL functions (the script parser doesn''t recognize ''em).
October 26, 2003 01:52 PM
Well, this is how I now do the init
loadlib("./libluaSDL.so", "SDL_Init"(SDL_INIT_VIDEO)
It seems to work. But how do I access the other functions? The same way? (BLAH?)
Oh fuck, it''s good to be an intelligent coder.
loadlib("./libluaSDL.so", "SDL_Init"(SDL_INIT_VIDEO)
It seems to work. But how do I access the other functions? The same way? (BLAH?)
Oh fuck, it''s good to be an intelligent coder.
October 31, 2003 09:59 AM
Please, I can''t get this to work...
Using
loadlib ("./libluaSDL.so", "tolua_SDL_open" ()
gives a message
"attempt to index a function value"
And I think that is the only function I can init the library with.
Using
loadlib ("./libluaSDL.so", "tolua_SDL_open" ()
gives a message
"attempt to index a function value"
And I think that is the only function I can init the library with.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement