daily update on 20240613 by nitload youmu[4

This commit is contained in:
Nitload
2024-06-14 05:30:19 +08:00
parent be6c2e6b92
commit 7fb220c523
50 changed files with 991 additions and 700 deletions
+15 -44
View File
@@ -49,22 +49,15 @@ namespace StgSharp.Graphics
public unsafe partial class View
{
private (int w, int h) sizeCache;
private (int x, int y, int z) unitCubeSize;
private ViewPort context;
private ViewPortDesigner design;
public ViewPort Port
{
get => context;
}
public View(ViewPort vp, ViewPortDesigner design)
{
context = vp;
sizeCache = (0, 0);
unitCubeSize = (1, 1, 1);
localLogic = new Logic.Blueprint();
this.design = design;
@@ -74,30 +67,27 @@ namespace StgSharp.Graphics
public View(ViewPort vp, ViewPortDesigner design, (int, int, int) cubeSize)
{
context = vp;
sizeCache = (0, 0);
unitCubeSize = cubeSize;
localLogic = new Logic.Blueprint();
}
public (int x, int y, int z) UnitCubeSize
{
get => unitCubeSize;
}
public bool Activated { get; internal set; }
public int Height
{
get
{
if (context.Height != sizeCache.h)
{
sizeCache.h = context.Height;
InternalIO.glfwSetWindowSize(ViewHandle, context.Height, context.Width);
}
return sizeCache.h;
}
internal set
{
sizeCache.h = value;
context.Height = value;
InternalIO.glfwSetWindowSize(ViewHandle, context.Height, context.Width);
}
get => context.Height;
internal set { context.Height = value; }
}
public int Width
{
get => context.Width;
internal set { context.Width = value; }
}
public IntPtr Monitor => context.Monitor;
@@ -108,28 +98,9 @@ namespace StgSharp.Graphics
public string SelfName { get; set; }
public (int x, int y, int z) UnitCubeSize
public ViewPort Port
{
get => unitCubeSize;
}
public int Width
{
get
{
if (context.Width != sizeCache.w)
{
sizeCache.w = context.Width;
InternalIO.glfwSetWindowSize(ViewHandle, context.Height, context.Width);
}
return sizeCache.h;
}
internal set
{
sizeCache.w = value;
context.Width = value;
InternalIO.glfwSetWindowSize(ViewHandle, context.Height, context.Width);
}
get => context;
}
}