diff --git a/inc/hgl/platform/Window.h b/inc/hgl/platform/Window.h index 310d60a..96ce62d 100644 --- a/inc/hgl/platform/Window.h +++ b/inc/hgl/platform/Window.h @@ -6,7 +6,7 @@ namespace hgl { - class Window:io::WindowEvent + class Window:public io::WindowEvent { protected: @@ -21,8 +21,13 @@ namespace hgl protected: + /** + * 外部输入事件
+ * 比如Windows平台,是由WindowProc函数传递过来的。 + * 本事件传递器会呼叫io::WindowEvent的对象指针,在本类中指向的是自己。
+ * 注:仅当前类会如此设计,本身此Event是要放在外面的,不该在此级别。 + */ io::InputEvent input_event; - io::InputEvent sub_input_event; void OnResize(uint,uint) override; void OnActive(bool) override; @@ -41,9 +46,6 @@ namespace hgl Window(const OSString &); virtual ~Window()=default; - bool Join(InputEvent *ie){return sub_input_event.Join(ie);} - bool Unjoin(InputEvent *ie){return sub_input_event.Unjoin(ie);} - virtual bool Create(uint,uint)=0; virtual bool Create(uint,uint,uint)=0; virtual void Close()=0; diff --git a/src/Window.cpp b/src/Window.cpp index fe31c77..9fc5bdc 100644 --- a/src/Window.cpp +++ b/src/Window.cpp @@ -12,7 +12,6 @@ namespace hgl is_min=false; input_event.Join(this); - input_event.Join(&sub_input_event); } void Window::OnResize(uint w,uint h)