added viewport_info in io::WindowEvent

This commit is contained in:
hyzboy 2025-01-18 20:27:28 +08:00
parent 5aad7d8141
commit 1bcd213b63

View File

@ -1,7 +1,8 @@
#ifndef HGL_IO_WINDOW_EVENT_INCLUDE #ifndef HGL_IO_WINDOW_EVENT_INCLUDE
#define HGL_IO_WINDOW_EVENT_INCLUDE #define HGL_IO_WINDOW_EVENT_INCLUDE
#include<hgl/io/event/InputEvent.h> #include<hgl/io/event/InputEvent.h>
#include<hgl/graph/ViewportInfo.h>
namespace hgl namespace hgl
{ {
namespace io namespace io
@ -31,6 +32,8 @@ namespace hgl
{ {
WindowEventData *wed; WindowEventData *wed;
graph::ViewportInfo viewport_info;
public: public:
WindowEvent():InputEvent(InputEventSource::Window){} WindowEvent():InputEvent(InputEventSource::Window){}
@ -55,7 +58,7 @@ namespace hgl
public: public:
virtual void OnResize(uint,uint){} virtual void OnResize(uint w,uint h){viewport_info.Set(w,h);}
virtual void OnActive(bool){} virtual void OnActive(bool){}
virtual void OnClose (){} virtual void OnClose (){}
};//class WindowEvent:public InputEvent };//class WindowEvent:public InputEvent