75 lines
1.9 KiB
C
Raw Normal View History

2019-08-23 10:54:57 +08:00
#ifndef HGL_GRAPH_WINDOW_INCLUDE
#define HGL_GRAPH_WINDOW_INCLUDE
2020-09-03 15:57:08 +08:00
#include<hgl/type/String.h>
2022-01-24 18:57:10 +08:00
#include<hgl/io/event/WindowEvent.h>
2019-08-23 10:54:57 +08:00
namespace hgl
{
2025-03-06 01:21:31 +08:00
class Window:public io::WindowEvent
2019-08-23 10:54:57 +08:00
{
protected:
uint width,height;
bool full_screen;
OSString win_name;
bool active;
bool is_close;
bool is_min;
protected:
2025-03-06 01:21:31 +08:00
/**
* <br>
* Windows平台WindowProc函数传递过来的
* io::WindowEvent的对象指针<br>
* Event是要放在外面的
*/
2022-01-24 18:57:10 +08:00
io::InputEvent input_event;
2019-08-23 10:54:57 +08:00
2022-01-24 18:57:10 +08:00
void OnResize(uint,uint) override;
void OnActive(bool) override;
void OnClose () override;
2019-08-23 10:54:57 +08:00
2022-01-24 18:57:10 +08:00
virtual bool MessageProc()=0;
virtual bool WaitMessage()=0;
2019-08-23 10:54:57 +08:00
public:
2022-01-24 18:57:10 +08:00
const uint GetWidth()const{return width;}
const uint GetHeight()const{return height;}
2019-08-23 10:54:57 +08:00
public:
2022-01-24 18:57:10 +08:00
Window(const OSString &);
2019-08-23 10:54:57 +08:00
virtual ~Window()=default;
virtual bool Create(uint,uint)=0;
virtual bool Create(uint,uint,uint)=0;
virtual void Close()=0;
bool IsMin()const{return is_min;}
bool IsClose()const{return is_close;}
bool IsVisible()const{return (!is_close)&&width&&height;}
virtual void SetCaption(const OSString &)=0;
virtual void Show()=0;
virtual void Hide()=0;
virtual void ToMinWindow()=0;
virtual void ToMaxWindow()=0;
virtual void SetSystemCursor(bool){}
2025-06-10 01:32:43 +08:00
virtual bool Update() override;
2019-08-23 10:54:57 +08:00
};//class Window
Window *CreateRenderWindow(const OSString &win_name);
void InitNativeWindowSystem();
}//namespace hgl
#endif//HGL_GRAPH_WINDOW_INCLUDE