ULRE/src/Platform/Window.cpp

33 lines
564 B
C++
Raw Normal View History

2019-05-01 16:21:25 +08:00
#include<hgl/platform/Window.h>
namespace hgl
{
void Window::OnKeyDown(KeyboardButton kb)
{
if(key_push[kb])
OnKeyPress(kb);
else
{
OnKeyDown(kb);
key_push[kb]=true;
}
}
void Window::OnKeyUp(KeyboardButton kb)
{
OnKeyUp(kb);
key_push[kb]=false;
}
bool Window::Update()
{
while(MessageProc())
{
}
if(!active||width==0||height==0)
this->WaitMessage();
return(!is_close);
}
2019-05-01 16:21:25 +08:00
}//namespace hgl