not dealing with SOL2 problem now

This commit is contained in:
Hartmut Seichter 2019-01-16 11:13:44 +01:00
parent 46eff44297
commit e8be36243d
2 changed files with 17 additions and 2 deletions

View file

@ -53,8 +53,7 @@ add_library (lualib STATIC
${libsrc}
)
target_compile_definitions(lualib PRIVATE LUA_USE_POSIX)
if(UNIX)
target_link_libraries( lualib m )

View file

@ -11,6 +11,7 @@
namespace pw {
#if defined(__clang)
struct window_lua : public window {
// overridable function
sol::function lua_update;
@ -23,10 +24,13 @@ struct window_lua : public window {
_on_update = [this](window&){this->lua_update();};
}
};
#endif
void script_system::load(sol::table &ns)
{
#if defined(__clang)
ns.new_usertype<window_lua>("window",
sol::constructors<window_lua(sol::this_state)>(),
"on_update",&window_lua::lua_update,
@ -36,6 +40,18 @@ void script_system::load(sol::table &ns)
"position",sol::property(&window::position,&window::set_position),
"fullscreen",sol::property(&window::fullscreen,&window::set_fullscreen)
);
#else
ns.new_usertype<window>("window",
"update",&window::update,
"title",sol::writeonly_property(&window::set_title),
"size",sol::property(&window::size,&window::set_size),
"position",sol::property(&window::position,&window::set_position),
"fullscreen",sol::property(&window::fullscreen,&window::set_fullscreen)
);
#endif
ns.new_usertype<input>("input",
"new", sol::no_constructor,