some cleanup

This commit is contained in:
Hartmut Seichter 2021-11-27 21:52:54 +01:00
parent b25ab14587
commit 67ae8daef3
10 changed files with 46 additions and 46 deletions

View file

@ -216,12 +216,12 @@ void register_core_function(sol::state& lua,sol::table& ns)
auto image_type = ns.new_usertype<image>("image"
, sol::constructors<image()>()
,"create",&image::create
,"size",sol::readonly_property(&image::size)
,"generate_noise",&image::generate_noise
,"change_count",sol::property(&image::change_count,&image::set_change_count)
);
,sol::call_constructor,sol::constructors<image(),image(const size&,image::pixel_layout pl,const void*)>()
,"create",&image::create
,"size",sol::readonly_property(&image::size)
,"generate_noise",&image::generate_noise
,"change_count",sol::property(&image::change_count,&image::set_change_count)
);
ns.create_named("pixel_layout"
,"rgb8", image::RGB8
@ -239,8 +239,9 @@ void register_core_function(sol::state& lua,sol::table& ns)
,sol::call_constructor,sol::constructors<rectangle(),rectangle(const point_<float>&,const size_<float>&)>()
);
auto mathf_table = ns.create_named("mathf");
mathf_table.set_function("ping_pong",ping_pong<real_t>);
// some math function
ns.create_named("mathf")
.set_function("ping_pong",ping_pong<real_t>);
}

View file

@ -7,7 +7,7 @@ namespace pw {
void register_io_function(sol::state&,sol::table& ns)
{
ns.new_usertype<image_io>("image_io"
,"new", sol::no_constructor
,"new",sol::no_constructor
,"get",&image_io::get
,"read",&image_io::read
,"write",&image_io::write

View file

@ -17,14 +17,14 @@ void register_scene_function(sol::state&,sol::table &ns)
{
ns.new_usertype<scene>("scene",
sol::constructors<scene()>()
sol::call_constructor,sol::constructors<scene()>()
,"count_all_entities",sol::readonly_property(&scene::count_all_enties)
,"count_alive_entities",sol::readonly_property(&scene::count_alive_enties)
);
ns.new_usertype<entity>("entity"
,sol::constructors<entity(),entity(const entity&),entity(scene&)>()
,sol::call_constructor,sol::constructors<entity(),entity(const entity&),entity(scene&)>()
,"add_child",&entity::add_child
,"remove_child",&entity::remove_child
,"child_count",sol::readonly_property(&entity::child_count)

View file

@ -42,7 +42,7 @@ void register_system_function(sol::state&, sol::table &ns)
);
ns.new_usertype<path>("path"
,"new", sol::no_constructor
,"new",sol::no_constructor
,"get",&path::get
,"separator",sol::readonly_property(&path::separator)
,"resource_paths",sol::readonly_property(&path::resource_paths)

View file

@ -16,13 +16,13 @@ namespace pw {
void register_visual_function(sol::state& lua,sol::table &ns)
{
ns.new_usertype<pipeline>("pipeline"
,"create",&pipeline::create
,"draw",&pipeline::draw
);
// ns.new_usertype<pipeline>("pipeline"
// ,"create",&pipeline::create
// ,"draw",&pipeline::draw
// );
ns.new_usertype<shader>("shader"
,sol::constructors<shader()>()
,sol::call_constructor,sol::constructors<shader()>()
,"ready",sol::readonly_property(&shader::ready)
,"use",&shader::use
,"build",&shader::build
@ -54,7 +54,7 @@ void register_visual_function(sol::state& lua,sol::table &ns)
ns.new_usertype<renderer>("renderer"
,sol::constructors<renderer(),renderer(const geometry&)>()
,sol::call_constructor,sol::constructors<renderer(),renderer(const geometry&)>()
,"create",&renderer::create
,"ready",sol::readonly_property(&renderer::ready)
,"release",&renderer::release
@ -62,14 +62,14 @@ void register_visual_function(sol::state& lua,sol::table &ns)
);
ns.new_usertype<framebuffer>("framebuffer"
,sol::constructors<framebuffer()>()
,sol::call_constructor,sol::constructors<framebuffer()>()
,"create",&framebuffer::create
,"bind",&framebuffer::bind
,"unbind",&framebuffer::unbind
,"blit",&framebuffer::blit);
ns.new_usertype<texture>("texture"
,sol::constructors<texture()>()
,sol::call_constructor,sol::constructors<texture()>()
,"create",&texture::create
,"update",&texture::update
,"bind",&texture::bind
@ -78,7 +78,7 @@ void register_visual_function(sol::state& lua,sol::table &ns)
);
ns.new_usertype<context>("context"
,sol::constructors<context()>()
,sol::call_constructor,sol::constructors<context()>()
,"clear",&context::clear
,"set_viewport",&context::set_viewport
,"get_error",&context::get_error