Files
stgsharp/源代码/StgSharp/Logic/ViewModel/ViewManage.cs
T

33 lines
911 B
C#

using StgSharp.Graphics;
using StgSharp.Graphics.GL;
using System;
using System.Collections.Generic;
using System.Text;
namespace StgSharp.Logic
{
public partial class ViewModelBase
{
private List<View> allView;
public View BuildNewView(
ViewPortDesigner designer, (int x, int y, int z) unitCubeSize
)
{
View ret = new View(this.viewPortDisplay, designer,unitCubeSize);
allView.Add(ret);
return ret;
}
public T BuildRenderStream<T>(View view) where T : RenderStream
{
T ret = Activator.CreateInstance(typeof(T), view.Port, view.UnitCubeSize) as T ??
throw new InvalidOperationException("Cannot build new render stream.");
ret.timeProvider = this.frameTimeProvider;
ret.InternalInit();
return ret;
}
}
}