传递MouseCoord到WorkObject

This commit is contained in:
2025-06-11 01:05:24 +08:00
parent 73027ffd9a
commit 3057fc7b6f
3 changed files with 26 additions and 7 deletions

View File

@@ -7,6 +7,7 @@
#include<hgl/graph/module/GraphModuleManager.h>
#include<hgl/graph/RenderList.h>
#include<hgl/graph/CameraControl.h>
#include<hgl/io/event/MouseEvent.h>
VK_NAMESPACE_BEGIN
@@ -62,7 +63,7 @@ protected: //RenderContext,未来合并成一个RenderContext结构
protected: //InputEvent
ObjectList<io::InputEvent> input_event;
io::MouseEvent *mouse_event=nullptr;
public:
@@ -92,6 +93,17 @@ public:
CameraControl * GetDefaultCameraControl (){return default_camera_control;}
Renderer * GetDefaultRenderer (){return default_renderer;}
public:
bool GetMouseCoord(Vector2i *mc)const
{
if(!mouse_event||!mc)
return(false);
*mc=mouse_event->GetMouseCoord();
return(true);
}
public:
RenderFramework(const OSString &);