mirror of
https://github.com/Stone-Red-Code/RemSox.git
synced 2026-09-04 00:56:19 +02:00
Add unified input event queue and cursor support for window manager
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
using Cosmos.Kernel.System.Graphics;
|
||||
using Cosmos.Kernel.System.Graphics.Fonts;
|
||||
using Cosmos.Kernel.System.Mouse;
|
||||
|
||||
using RemSox.UI.GUI.UIEelements;
|
||||
using RemSox.Utils;
|
||||
@@ -26,6 +25,8 @@ public sealed class CanvasRenderSource : IRenderSource
|
||||
private static bool isPositionDirty = true;
|
||||
private static Point lastPointerPosition = new(-1, -1);
|
||||
|
||||
private static Point cursorPosition;
|
||||
|
||||
private static readonly Lock renderLock = new();
|
||||
|
||||
public void Render(IEnumerable<RenderCommand> commands)
|
||||
@@ -56,6 +57,11 @@ public sealed class CanvasRenderSource : IRenderSource
|
||||
RemovePrimitives(command.WindowId, command.ElementId);
|
||||
break;
|
||||
|
||||
case RenderCommandType.SetCursor:
|
||||
cursorPosition = command.Position;
|
||||
isPositionDirty = true;
|
||||
break;
|
||||
|
||||
default:
|
||||
if (windowCanvases.ContainsKey(command.WindowId))
|
||||
{
|
||||
@@ -70,7 +76,7 @@ public sealed class CanvasRenderSource : IRenderSource
|
||||
public void Composite()
|
||||
{
|
||||
Canvas screenCanvas = FullScreenCanvas.GetFullScreenCanvas();
|
||||
Point pointerPosition = new(MouseManager.X, MouseManager.Y);
|
||||
Point pointerPosition = cursorPosition;
|
||||
|
||||
lock (renderLock)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user