daily update on 20240613 by nitload youmu[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[C[4
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user