mirror of
https://github.com/Stone-Red-Code/RemSox.git
synced 2026-09-04 09:06:23 +02:00
Replace string element render types with RenderCommandType enum, decompose UI elements (Button, CheckBox, chrome) into drawing primitives via ToPrimitives(), emit per-element commands on flush, and move composite into IRenderSource.
This commit is contained in:
@@ -71,7 +71,7 @@ public static class WindowManager
|
||||
wasRightButtonDown = rightButtonDown;
|
||||
wasMiddleButtonDown = middleButtonDown;
|
||||
|
||||
CanvasRenderSource.CompositeAndDisplay(canvas, pointerPosition);
|
||||
renderSource.Composite();
|
||||
|
||||
lastPointerPosition = pointerPosition;
|
||||
}
|
||||
@@ -244,7 +244,7 @@ public static class WindowManager
|
||||
activeInteractWindow = null;
|
||||
}
|
||||
|
||||
renderSource.Render([new RenderCommand { WindowId = window.Id, ElementId = window.Id, ElementType = "WindowClose", Position = window.Position, Properties = new Dictionary<string, object?>() }]);
|
||||
renderSource.Render([new RenderCommand { WindowId = window.Id, ElementId = window.Id, Type = RenderCommandType.DestroyWindow, Position = window.Position }]);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -300,7 +300,7 @@ public static class WindowManager
|
||||
List<RenderCommand> closeCommands = [];
|
||||
foreach (Window window in windowsToClose)
|
||||
{
|
||||
closeCommands.Add(new RenderCommand { WindowId = window.Id, ElementId = window.Id, ElementType = "WindowClose", Position = window.Position, Properties = new Dictionary<string, object?>() });
|
||||
closeCommands.Add(new RenderCommand { WindowId = window.Id, ElementId = window.Id, Type = RenderCommandType.DestroyWindow, Position = window.Position });
|
||||
}
|
||||
renderSource.Render(closeCommands);
|
||||
}
|
||||
@@ -448,5 +448,19 @@ public static class WindowManager
|
||||
source.Render(commands);
|
||||
}
|
||||
}
|
||||
|
||||
public void Composite()
|
||||
{
|
||||
List<IRenderSource> sourcesCopy;
|
||||
lock (sourcesLock)
|
||||
{
|
||||
sourcesCopy = sources.ToList();
|
||||
}
|
||||
|
||||
foreach (IRenderSource source in sourcesCopy)
|
||||
{
|
||||
source.Composite();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user