daily update on 20240828 by nitload youmu, autotexture added
This commit is contained in:
@@ -47,6 +47,7 @@ namespace StgSharp.MVVM.ViewModel
|
||||
|
||||
public unsafe struct DataBindingEntry
|
||||
{
|
||||
|
||||
private IntPtr getterPtr, setterPtr;
|
||||
|
||||
public DataBindingEntry(
|
||||
|
||||
@@ -63,24 +63,11 @@ namespace StgSharp.MVVM.ViewModel
|
||||
}
|
||||
}
|
||||
|
||||
private void ShowFrameOnce()
|
||||
{
|
||||
viewPortDisplay.FlushSize();
|
||||
if (_nextView != _currentView)
|
||||
{
|
||||
Interlocked.Exchange(ref _currentView, _nextView);
|
||||
}
|
||||
CurrentView.Use();
|
||||
RenderStream.PollEvents();
|
||||
frameTimeProvider.WaitNextSpan();
|
||||
Interlocked.Add(ref _frameCount, 1);
|
||||
}
|
||||
|
||||
protected void UseViewInNextFrame(string name)
|
||||
{
|
||||
if (!allView.TryGetValue(name, out ViewBase v))
|
||||
{
|
||||
throw new KeyNotFoundException($"{($"Cannot find View named {name} ")}{($"in current View Model of {GetType().FullName}")}");
|
||||
throw new KeyNotFoundException($"{$"Cannot find View named {name} "}{$"in current View Model of {GetType().FullName}"}");
|
||||
}
|
||||
CurrentView = v;
|
||||
}
|
||||
@@ -94,5 +81,18 @@ namespace StgSharp.MVVM.ViewModel
|
||||
}
|
||||
}
|
||||
|
||||
private void ShowFrameOnce()
|
||||
{
|
||||
viewPortDisplay.FlushSize();
|
||||
if (_nextView != _currentView)
|
||||
{
|
||||
Interlocked.Exchange(ref _currentView, _nextView);
|
||||
}
|
||||
CurrentView.Use();
|
||||
RenderStream.PollEvents();
|
||||
frameTimeProvider.WaitNextSpan();
|
||||
Interlocked.Add(ref _frameCount, 1);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,6 +41,7 @@ namespace StgSharp.MVVM.ViewModel
|
||||
{
|
||||
public partial class ViewModelBase
|
||||
{
|
||||
|
||||
private Dictionary<string, ViewBase> allView;
|
||||
|
||||
public T CreateAndBindView<T>(string name, (int x, int y, int z) unitCubeSize)
|
||||
@@ -48,7 +49,7 @@ namespace StgSharp.MVVM.ViewModel
|
||||
{
|
||||
T ret = new T();
|
||||
ret.SelfName = name;
|
||||
ret.InternalInitialize(name,unitCubeSize,this);
|
||||
ret.InternalInitialize(name, unitCubeSize, this);
|
||||
allView.Add(name, ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -34,6 +34,7 @@ using StgSharp.Graphics.OpenGL;
|
||||
using StgSharp.Math;
|
||||
using StgSharp.MVVM.View;
|
||||
using StgSharp.MVVM.ViewModel;
|
||||
using StgSharp.Timing;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -116,7 +117,7 @@ namespace StgSharp.MVVM.ViewModel
|
||||
=>
|
||||
{
|
||||
InternalIO.glfwMakeContextCurrent(viewPortDisplay.ViewPortID);
|
||||
GlFunction.CurrentGL.Viewport(0, 0, width, height);
|
||||
OpenGLFunction.CurrentGL.Viewport(0, 0, width, height);
|
||||
PrivateShow();
|
||||
};
|
||||
viewPortDisplay.FramePostionCallback = (handle, xpos, ypos)
|
||||
@@ -147,7 +148,7 @@ namespace StgSharp.MVVM.ViewModel
|
||||
=>
|
||||
{
|
||||
InternalIO.glfwMakeContextCurrent(viewPortDisplay.ViewPortID);
|
||||
GlFunction.CurrentGL.Viewport(0, 0, width, height);
|
||||
OpenGLFunction.CurrentGL.Viewport(0, 0, width, height);
|
||||
PrivateShow();
|
||||
};
|
||||
viewPortDisplay.FramePostionCallback = (handle, xpos, ypos)
|
||||
|
||||
Reference in New Issue
Block a user