refactoring and cleaning while searching for a problem in the demo code

This commit is contained in:
Hartmut Seichter 2021-01-09 21:40:23 +01:00
parent 3471196830
commit 52c077af6c
7 changed files with 47 additions and 22 deletions

View file

@ -1,8 +1,6 @@
#include "pw/io/image_io.hpp"
#include "runtime_lua.hpp"
namespace pw {

View file

@ -3,8 +3,11 @@
#include "pw/visual/pipeline.hpp"
#include "pw/visual/shader.hpp"
#include "pw/visual/framebuffer.hpp"
#include "pw/visual/texture.hpp"
#include "pw/core/size.hpp"
#include "runtime_lua.hpp"
namespace pw {
@ -17,8 +20,6 @@ void register_visual_function(sol::state&,sol::table &ns)
,"draw",&pipeline::draw
);
ns.new_usertype<shader>("shader"
,sol::constructors<shader()>()
,"ready",sol::readonly_property(&shader::ready)
@ -59,6 +60,12 @@ void register_visual_function(sol::state&,sol::table &ns)
,"bind",&framebuffer::bind
,"unbind",&framebuffer::unbind
,"blit",&framebuffer::blit);
ns.new_usertype<texture>("texture"
,sol::constructors<texture(),texture(texture::image_ref,texture::data_layout)>()
,"image",sol::property(&texture::set_image,&texture::image)
,"type",sol::property(&texture::set_type,&texture::type)
);
}
PW_REGISTER_LUA(visual)