Quote: "I have no clue how to make it where I can use c++ functions with lua is there any help you can give me there?"
So, to bind a DarkGDK function to Lua you need to first make a function to "tell" lua the commands in the function you want to bind. I am going to use "dbSetDisplayMode(iWidth, iHeight, iDepth)". First off make a static int function, and for its parameters put "lua_State *L". In that function you will have to make a variable(s) that contain the data you wish to pass to the DarkGDK function (dbSetDisplayMode in this case) and make them equal to "lua_tonumber(lua_State, parameterNumber)" so for the integer iWidth you would make it equal to "lua_tonumber(L, 1)", L is the luaState and the number 1 is specifing whether it is the first, second, third, ... parameter in "dbSetDisplayMode". Here is the function:
static int lua_func_dgdk_setdisplaymode(lua_State *L)
{
int iWidth = lua_tonumber(L, 1);
int iHeight = lua_tonumber(L, 2);
int iDepth = lua_tonumber(L, 3);
dbSetDisplayMode(iWidth, iHeight, iDepth);
return 0;
}
Then you use a function to actually bind the function to lua, it is "lua_register(lua_State, functionNameInLua, Function);" in this case it would look like:
"lua_register(L, "SetDisplayMode", lua_func_dgdk_setdisplaymode);".
That should make a function, and to use it in a lua script you would type "SetDisplayMode(640, 40, 32)".
I attached a class I made that handles initilization/destruction and handling lua, as well as a couple of functions that have been bound to lua (the class is most useful for using the lua_State member). It also has an "Example.cpp" containing an example of how to use the class and 2 lua files it runs that set the display mode and sync the screen.