代码精简
This commit is contained in:
parent
333bec0a12
commit
c5b37f9835
@ -1,11 +1,9 @@
|
||||
#ifndef HGL_IO_MOUSE_EVENT_INCLUDE
|
||||
#define HGL_IO_MOUSE_EVENT_INCLUDE
|
||||
#pragma once
|
||||
|
||||
#include<hgl/io/event/InputEvent.h>
|
||||
namespace hgl
|
||||
#include<hgl/math/Vector.h>
|
||||
namespace hgl::io
|
||||
{
|
||||
namespace io
|
||||
{
|
||||
/**
|
||||
* 鼠标按钮枚举
|
||||
*/
|
||||
@ -48,7 +46,7 @@ namespace hgl
|
||||
{
|
||||
MouseEventData *med;
|
||||
|
||||
int x,y;
|
||||
Vector2i position;
|
||||
|
||||
bool pressed_statues[size_t(MouseButton::RANGE_SIZE)];
|
||||
|
||||
@ -57,7 +55,8 @@ namespace hgl
|
||||
MouseEvent():InputEvent(InputEventSource::Mouse)
|
||||
{
|
||||
med=nullptr;
|
||||
x=y=0;
|
||||
position.x=0;
|
||||
position.y=0;;
|
||||
hgl_zero(pressed_statues);
|
||||
}
|
||||
virtual ~MouseEvent()=default;
|
||||
@ -74,7 +73,8 @@ namespace hgl
|
||||
}
|
||||
else
|
||||
{
|
||||
x=med->x;y=med->y;
|
||||
position.x=med->x;
|
||||
position.y=med->y;
|
||||
|
||||
switch(MouseEventID(header.id))
|
||||
{
|
||||
@ -113,9 +113,6 @@ namespace hgl
|
||||
|
||||
public:
|
||||
|
||||
const int GetX()const{return x;}
|
||||
const int GetY()const{return y;}
|
||||
const Vector2i &GetMouseCoord()const{return position;}
|
||||
};//class MouseEvent
|
||||
}//namespace io
|
||||
}//namespace hgl
|
||||
#endif//HGL_IO_MOUSE_EVENT_INCLUDE
|
||||
}//namespace hgl::io
|
||||
|
Loading…
x
Reference in New Issue
Block a user