draw-through
it is possible to render with OpenGL/DX by using draw-through.
This commit is contained in:
@@ -292,6 +292,13 @@ namespace nana
|
||||
return false;
|
||||
}
|
||||
|
||||
bool basic_window::is_draw_through() const
|
||||
{
|
||||
if (::nana::category::flags::root == this->other.category)
|
||||
return static_cast<bool>(other.attribute.root->draw_through);
|
||||
return false;
|
||||
}
|
||||
|
||||
void basic_window::_m_init_pos_and_size(basic_window* parent, const rectangle& r)
|
||||
{
|
||||
pos_owner = pos_root = r;
|
||||
|
||||
@@ -1265,6 +1265,15 @@ namespace detail
|
||||
brock.event_move(msgwnd, (int)(short) LOWORD(lParam), (int)(short) HIWORD(lParam));
|
||||
break;
|
||||
case WM_PAINT:
|
||||
if (msgwnd->is_draw_through())
|
||||
{
|
||||
msgwnd->other.attribute.root->draw_through();
|
||||
|
||||
::PAINTSTRUCT ps;
|
||||
::BeginPaint(root_window, &ps);
|
||||
::EndPaint(root_window, &ps);
|
||||
}
|
||||
else
|
||||
{
|
||||
::PAINTSTRUCT ps;
|
||||
::HDC dc = ::BeginPaint(root_window, &ps);
|
||||
@@ -1581,6 +1590,26 @@ namespace detail
|
||||
return impl_->estore;
|
||||
}
|
||||
|
||||
void bedrock::map_through_widgets(core_window_t* wd, native_drawable_type drawable)
|
||||
{
|
||||
#if defined(NANA_WINDOWS)
|
||||
auto graph_context = reinterpret_cast<HDC>(wd->root_graph->handle()->context);
|
||||
|
||||
for (auto child : wd->children)
|
||||
{
|
||||
if (!child->visible) continue;
|
||||
|
||||
if (::nana::category::flags::widget == child->other.category)
|
||||
{
|
||||
::BitBlt(reinterpret_cast<HDC>(drawable), child->pos_root.x, child->pos_root.y, static_cast<int>(child->dimension.width), static_cast<int>(child->dimension.height),
|
||||
graph_context, child->pos_root.x, child->pos_root.y, SRCCOPY);
|
||||
}
|
||||
else if (::nana::category::flags::lite_widget == child->other.category)
|
||||
map_through_widgets(child, drawable);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
bool bedrock::emit(event_code evt_code, core_window_t* wd, const arg_mouse& arg, bool ask_update, thread_context* thrd)
|
||||
{
|
||||
if (evt_code != arg.evt_code)
|
||||
|
||||
@@ -674,7 +674,7 @@ namespace detail
|
||||
{
|
||||
//Thread-Safe Required!
|
||||
std::lock_guard<decltype(mutex_)> lock(mutex_);
|
||||
if (impl_->wd_register.available(wd))
|
||||
if (impl_->wd_register.available(wd) && !wd->is_draw_through())
|
||||
{
|
||||
//Copy the root buffer that wd specified into DeviceContext
|
||||
#if defined(NANA_LINUX)
|
||||
@@ -738,7 +738,7 @@ namespace detail
|
||||
if (false == impl_->wd_register.available(wd))
|
||||
return false;
|
||||
|
||||
if(wd->visible)
|
||||
if(wd->visible && (!wd->is_draw_through()))
|
||||
{
|
||||
if (wd->visible_parents())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user