daily update on 20240528 by nitload youmu
This commit is contained in:
@@ -41,7 +41,7 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace StgSharp.Graphics
|
||||
{
|
||||
public abstract partial class Form
|
||||
public abstract partial class ViewModel
|
||||
{
|
||||
private Blueprint renderLogic;
|
||||
|
||||
@@ -64,6 +64,40 @@ namespace StgSharp.Graphics
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public T BuildMainRenderStream<T>((int x, int y, int z) unitCubeSize) where T : RenderStream
|
||||
{
|
||||
RenderStreamConstructArgs args = new RenderStreamConstructArgs();
|
||||
args.UnitCubeSize = unitCubeSize;
|
||||
args.Name = this.name;
|
||||
args.Height = this.Height;
|
||||
args.Width = this.Width;
|
||||
T? ret = Activator.CreateInstance(typeof(T), args) as T;
|
||||
if (ret == null)
|
||||
{
|
||||
throw new InvalidOperationException("Failed in building a new RenderStream when calling AsMainStreamOf");
|
||||
}
|
||||
ret!.InternalInit();
|
||||
this.WindowID = ret.CanvasHandle;
|
||||
ret.timeProvider = this.frameTimeProvider;
|
||||
return ret;
|
||||
}
|
||||
|
||||
public T BuildNewRenderStream<T>(RenderStreamConstructArgs arg, (int x, int y, int z) unitCubeSize) where T : RenderStream
|
||||
{
|
||||
T? ret = Activator.CreateInstance(typeof(T), arg) as T;
|
||||
if (ret == null)
|
||||
{
|
||||
throw new InvalidOperationException("Failed in building a new RenderStream when calling AsMainStreamOf");
|
||||
}
|
||||
ret!.InternalInit();
|
||||
this.WindowID = ret.CanvasHandle;
|
||||
ret.timeProvider = this.frameTimeProvider;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
private void GatherSingleFrameAsyncThread(MethodInfo[] methods)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user