代码精简

This commit is contained in:
hyzboy 2025-06-11 01:03:53 +08:00
parent 333bec0a12
commit c5b37f9835

View File

@ -1,10 +1,8 @@
#ifndef HGL_IO_MOUSE_EVENT_INCLUDE
#define HGL_IO_MOUSE_EVENT_INCLUDE
#pragma once
#include<hgl/io/event/InputEvent.h>
namespace hgl
{
namespace io
#include<hgl/math/Vector.h>
namespace hgl::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