draw-through

it is possible to render with OpenGL/DX by using draw-through.
This commit is contained in:
cnjinhao
2015-01-12 09:39:28 +08:00
parent 7496fea110
commit f67dbdb14b
10 changed files with 101 additions and 10 deletions

View File

@@ -349,6 +349,11 @@ namespace API
return (restrict::window_manager.available(reinterpret_cast<restrict::core_window_t*>(wd)) == false);
}
bool is_window(window wd)
{
return restrict::window_manager.available(reinterpret_cast<restrict::core_window_t*>(wd));
}
void enable_dropfiles(window wd, bool enb)
{
internal_scope_guard lock;
@@ -564,6 +569,27 @@ namespace API
return false;
}
void draw_through(window wd, std::function<void()> draw_fn)
{
auto iwd = reinterpret_cast<restrict::core_window_t*>(wd);
internal_scope_guard lock;
if (!restrict::bedrock.wd_manager.available(iwd))
throw std::invalid_argument("draw_through: invalid window parameter");
if (::nana::category::flags::root != iwd->other.category)
throw std::invalid_argument("draw_through: the window is not a root widget");
iwd->other.attribute.root->draw_through.swap(draw_fn);
}
void map_through_widgets(window wd, native_drawable_type drawable)
{
auto iwd = reinterpret_cast<::nana::detail::basic_window*>(wd);
internal_scope_guard lock;
if (restrict::bedrock.wd_manager.available(iwd) && iwd->is_draw_through() )
restrict::bedrock.map_through_widgets(iwd, drawable);
}
nana::size window_size(window wd)
{
nana::rectangle r;