draw-through
it is possible to render with OpenGL/DX by using draw-through.
This commit is contained in:
@@ -25,6 +25,7 @@ namespace nana
|
||||
struct native_window_handle_impl{};
|
||||
struct window_handle_impl{};
|
||||
struct event_handle_impl{};
|
||||
struct native_drawable_impl{};
|
||||
}
|
||||
|
||||
enum class checkstate
|
||||
@@ -66,6 +67,7 @@ namespace nana
|
||||
using native_window_type = detail::native_window_handle_impl*;
|
||||
using window = detail::window_handle_impl*; ///< \see [What is window class ](https://sourceforge.net/p/nanapro/discussion/general/thread/bd0fabfb/)
|
||||
using event_handle = detail::event_handle_impl*;
|
||||
using native_drawable_type = detail::native_drawable_impl*;
|
||||
|
||||
|
||||
struct keyboard
|
||||
|
||||
@@ -74,7 +74,7 @@ namespace detail
|
||||
struct basic_window
|
||||
: public events_holder
|
||||
{
|
||||
typedef std::vector<basic_window*> container;
|
||||
using container = std::vector<basic_window*>;
|
||||
|
||||
struct root_context
|
||||
{
|
||||
@@ -119,6 +119,8 @@ namespace detail
|
||||
bool is_ancestor_of(const basic_window* wd) const;
|
||||
bool visible_parents() const;
|
||||
bool belong_to_lazy() const;
|
||||
|
||||
bool is_draw_through() const; ///< Determines whether it is a draw-through window.
|
||||
public:
|
||||
//Override event_holder
|
||||
bool set_events(const std::shared_ptr<general_events>&) override;
|
||||
@@ -206,6 +208,8 @@ namespace detail
|
||||
#endif
|
||||
cursor state_cursor{nana::cursor::arrow};
|
||||
basic_window* state_cursor_window{ nullptr };
|
||||
|
||||
std::function<void()> draw_through; ///< A draw through renderer for root widgets.
|
||||
};
|
||||
|
||||
const category::flags category;
|
||||
|
||||
@@ -67,6 +67,7 @@ namespace detail
|
||||
bool whether_keyboard_shortkey() const;
|
||||
|
||||
element_store& get_element_store() const;
|
||||
void map_through_widgets(core_window_t*, native_drawable_type);
|
||||
public:
|
||||
void event_expose(core_window_t *, bool exposed);
|
||||
void event_move(core_window_t*, int x, int y);
|
||||
|
||||
@@ -115,7 +115,8 @@ namespace API
|
||||
|
||||
void window_icon_default(const paint::image&);
|
||||
void window_icon(window, const paint::image&);
|
||||
bool empty_window(window); ///< Determines whether a window is existing.
|
||||
bool empty_window(window); ///< Determines whether a window is existing.
|
||||
bool is_window(window); ///< Determines whether a window is existing, equal to !empty_window.
|
||||
void enable_dropfiles(window, bool);
|
||||
|
||||
/// \brief Retrieves the native window of a Nana.GUI window.
|
||||
@@ -176,6 +177,9 @@ namespace API
|
||||
void bring_top(window, bool activated);
|
||||
bool set_window_z_order(window wd, window wd_after, z_order_action action_if_no_wd_after);
|
||||
|
||||
void draw_through(window, std::function<void()>);
|
||||
void map_through_widgets(window, native_drawable_type);
|
||||
|
||||
nana::size window_size(window);
|
||||
void window_size(window, const size&);
|
||||
bool window_rectangle(window, rectangle&);
|
||||
|
||||
@@ -401,6 +401,16 @@ namespace nana
|
||||
{
|
||||
return *scheme_;
|
||||
}
|
||||
|
||||
void draw_through(std::function<void()> draw_fn)
|
||||
{
|
||||
API::draw_through(handle(), draw_fn);
|
||||
}
|
||||
|
||||
void map_through_widgets(native_drawable_type drawable)
|
||||
{
|
||||
API::map_through_widgets(handle(), drawable);
|
||||
}
|
||||
protected:
|
||||
DrawerTrigger& get_drawer_trigger()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user