daily update on 20240610 by nitload youmu
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
using StgSharp.Graphics;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
|
||||
namespace StgSharp.Logic
|
||||
{
|
||||
public abstract partial class ViewModelBase
|
||||
{
|
||||
public void ShowViewPort()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private Blueprint renderLogic;
|
||||
|
||||
public Blueprint RenderLogic
|
||||
{
|
||||
get => renderLogic;
|
||||
set => renderLogic = value;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Init this form and render it on screen, and respond with operation
|
||||
/// </summary>
|
||||
public unsafe void Show()
|
||||
{
|
||||
while(0 == InternalIO.glfwWindowShouldClose(this.context.ViewPortID))
|
||||
{
|
||||
renderLogic.RunRepeatedly(() => ShouldClose);
|
||||
frameTimeProvider.WaitNextSpan();
|
||||
Interlocked.Add(ref _frameCount, 1);
|
||||
}
|
||||
}
|
||||
|
||||
public T BuildNewRenderStream<T>(View arg, (int x, int y, int z) unitCubeSize) where T : RenderStream
|
||||
{
|
||||
if (arg.ContextName == this.Name)
|
||||
{
|
||||
|
||||
}
|
||||
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();
|
||||
ret.timeProvider = this.frameTimeProvider;
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user