daily update on 20231214 by nitload youmu
This commit is contained in:
@@ -10,7 +10,7 @@ namespace StgSharp
|
||||
{
|
||||
internal static void RegistForm(Form form)
|
||||
{
|
||||
TimeLine.allForm.Add(form);
|
||||
|
||||
}
|
||||
|
||||
public static void LoadTimeline()
|
||||
|
||||
@@ -4,7 +4,10 @@
|
||||
public static partial class Operation
|
||||
{
|
||||
//method used for chaging the value of paameters will be listed here
|
||||
internal static void RenderNextFrame()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace StgSharp.Controlling
|
||||
{
|
||||
public static partial class TimeLine
|
||||
internal static partial class TimeLine
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,20 +6,18 @@ using System.Threading;
|
||||
|
||||
namespace StgSharp.Controlling
|
||||
{
|
||||
public static partial class TimeLine
|
||||
internal static partial class TimeLine
|
||||
{
|
||||
internal static LinkedList<Form> allForm;
|
||||
|
||||
private static LinkedList<Form.FrameUpdateTimer> refreshList = new LinkedList<Form.FrameUpdateTimer>();
|
||||
internal static LinkedListNode<Form.FrameUpdateTimer> signalNode;
|
||||
private static LinkedList<Form> allFormList = new LinkedList<Form>();
|
||||
internal static Queue<Form> formList = new Queue<Form>();
|
||||
private static bool renderChainStarted;
|
||||
|
||||
internal static TimelineBlock currentOperation;
|
||||
private static bool isPaused = false;
|
||||
|
||||
static unsafe TimeLine()
|
||||
|
||||
internal static bool RenderStarted
|
||||
{
|
||||
allForm = new LinkedList<Form>();
|
||||
get { return renderChainStarted; }
|
||||
}
|
||||
|
||||
public static TimelineBlock CurrentOperation
|
||||
@@ -35,14 +33,11 @@ namespace StgSharp.Controlling
|
||||
}
|
||||
}
|
||||
|
||||
internal static void UodateAllFrame()
|
||||
{
|
||||
foreach (Form item in allForm)
|
||||
{
|
||||
item.formThread.Start();
|
||||
}
|
||||
}
|
||||
|
||||
internal static void RenderAll()
|
||||
{
|
||||
renderChainStarted = true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -15,14 +15,6 @@ using System.Threading;
|
||||
|
||||
namespace StgSharp.Graphics
|
||||
{
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
internal struct formInfo
|
||||
{
|
||||
public int width;
|
||||
public int height;
|
||||
public Vector4 color;
|
||||
public string name;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
@@ -39,12 +31,15 @@ namespace StgSharp.Graphics
|
||||
internal int width;
|
||||
internal IntPtr windowID;
|
||||
|
||||
private GLonRender glRender;
|
||||
private GLonUpdate glUpdate;
|
||||
protected IglFunc GL;
|
||||
internal FormUpdateBuffer UpdateBuffer;
|
||||
internal FormRenderBuffer RenderBuffer;
|
||||
|
||||
internal FrameUpdateTimer timer = new FrameUpdateTimer();
|
||||
|
||||
private SemaphoreSlim ping = new SemaphoreSlim(1, 1);
|
||||
private SemaphoreSlim pong = new SemaphoreSlim(0, 1);
|
||||
internal readonly SemaphoreSlim ouetrPong = new SemaphoreSlim(0, 1);
|
||||
|
||||
private UpdateWhenRender updateWhenRender;
|
||||
private DynamicMethod updateWhenRenderDM;
|
||||
@@ -83,18 +78,18 @@ namespace StgSharp.Graphics
|
||||
unsafe ~Form()
|
||||
{
|
||||
Marshal.FreeHGlobal((IntPtr)contextID);
|
||||
glRender.api = default;
|
||||
RenderBuffer.GL.api = default;
|
||||
}
|
||||
|
||||
#region form main
|
||||
|
||||
public abstract void Deinit(object[] args, IglFunc GL);
|
||||
public abstract void Deinit(object[] args);
|
||||
|
||||
public abstract void Init(object[] args, IglFunc GL);
|
||||
public abstract void Init(object[] args);
|
||||
|
||||
public abstract void OnRenderFrame(object[] args, IglFunc GL);
|
||||
public abstract void OnRenderFrame(object[] args);
|
||||
|
||||
public abstract void OnUpdateFrame(object[] args, IglFunc GL);
|
||||
public abstract void OnUpdateFrame(object[] args);
|
||||
|
||||
/// <summary>
|
||||
/// Init this form and render it on screen, and respond with operation
|
||||
@@ -103,16 +98,20 @@ namespace StgSharp.Graphics
|
||||
{
|
||||
if (args == null)
|
||||
{
|
||||
args = new object[3] { null, null, null };
|
||||
args = new object[4] { null, null, null, null };
|
||||
}
|
||||
Operation.RegistForm(this);
|
||||
if (!TimeLine.RenderStarted)
|
||||
{
|
||||
TimeLine.RenderAll();
|
||||
}
|
||||
try
|
||||
{
|
||||
Thread updateThread = new Thread(InternalUpdateFrame);
|
||||
Thread renderThread = new Thread(InternalRenderFrame);
|
||||
|
||||
updateThread.Start();
|
||||
renderThread.Start();
|
||||
updateThread.Start(args[1]);
|
||||
renderThread.Start(args[2]);
|
||||
|
||||
updateThread.Join();
|
||||
renderThread.Join();
|
||||
@@ -120,6 +119,8 @@ namespace StgSharp.Graphics
|
||||
ping.Dispose();
|
||||
pong.Dispose();
|
||||
|
||||
InternalDeinit(args[3]);
|
||||
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
@@ -127,7 +128,12 @@ namespace StgSharp.Graphics
|
||||
}
|
||||
}
|
||||
|
||||
internal void InternalInit(object[] args)
|
||||
internal void InternalDeinit(object args)
|
||||
{
|
||||
Deinit((object[])args);
|
||||
}
|
||||
|
||||
internal void InternalInit(object args)
|
||||
{
|
||||
updateWhenRenderDM = new DynamicMethod(
|
||||
name: "updateWhenRender",
|
||||
@@ -137,7 +143,7 @@ namespace StgSharp.Graphics
|
||||
);
|
||||
updateWhenRenderIL = updateWhenRenderDM.GetILGenerator();
|
||||
|
||||
Init((object[])args, this.glRender);
|
||||
Init((object[])args);
|
||||
|
||||
}
|
||||
|
||||
@@ -149,9 +155,9 @@ namespace StgSharp.Graphics
|
||||
ping.Wait();
|
||||
try
|
||||
{
|
||||
OnRenderFrame((object[])args, glRender);
|
||||
timer.GoNextFrame();
|
||||
throw new Exception("Forget to reload GL apis");
|
||||
OnRenderFrame((object[])args);
|
||||
timer.WaitNextFrame();
|
||||
|
||||
pong.Release();
|
||||
}
|
||||
catch (NullReferenceException)
|
||||
@@ -162,7 +168,6 @@ namespace StgSharp.Graphics
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
internal void InternalUpdateFrame(object args)
|
||||
{
|
||||
while (InternalIO.glfw.WindowShouldClose(windowID) != 0)
|
||||
@@ -170,8 +175,8 @@ namespace StgSharp.Graphics
|
||||
pong.Wait();
|
||||
try
|
||||
{
|
||||
OnUpdateFrame((object[])args, glUpdate);
|
||||
timer.GoNextFrame();
|
||||
OnUpdateFrame((object[])args);
|
||||
timer.WaitNextFrame();
|
||||
throw new Exception("Forget to reload GL apis");
|
||||
ping.Release();
|
||||
}
|
||||
@@ -297,12 +302,5 @@ namespace StgSharp.Graphics
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Bind this form to StgSharp platform.
|
||||
/// </summary>
|
||||
protected void BindToPlatform()
|
||||
{
|
||||
TimeLine.allForm.Add(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using StgSharp;
|
||||
using StgSharp.Logic;
|
||||
using System;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Threading;
|
||||
@@ -6,13 +7,63 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace StgSharp.Graphics
|
||||
{
|
||||
public partial class Form
|
||||
{
|
||||
|
||||
private bool isFullyRendered = false;
|
||||
|
||||
internal class FrameUpdateTimer
|
||||
{
|
||||
internal Bool2 alignSign;
|
||||
private float frameLength;
|
||||
private double frameBegin;
|
||||
private bool refreshed;
|
||||
private Counter<uint> tickCounter;
|
||||
|
||||
public double timeAfterFrame
|
||||
{
|
||||
get { return InternalIO.glfw.GetTime() - frameBegin; }
|
||||
}
|
||||
|
||||
public uint totalFrame
|
||||
{
|
||||
get { return tickCounter; }
|
||||
}
|
||||
internal void Refresh()
|
||||
{
|
||||
refreshed = false;
|
||||
}
|
||||
|
||||
internal bool WaitNextFrame()
|
||||
{
|
||||
try
|
||||
{
|
||||
while (refreshed) { }
|
||||
refreshed = true;
|
||||
return true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
InternalIO.InternalWriteLog(ex.Message, LogType.Error);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A timer counting frames after its construction.
|
||||
/// </summary>
|
||||
public class FrameTimer
|
||||
{
|
||||
private Form timeProvider;
|
||||
internal readonly uint bornTick;
|
||||
private Form timeProvider;
|
||||
|
||||
public FrameTimer(Form provaider)
|
||||
{
|
||||
timeProvider = provaider;
|
||||
bornTick = timeProvider.timer.totalFrame;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Frames after this timer created.
|
||||
@@ -22,12 +73,6 @@ namespace StgSharp.Graphics
|
||||
get { return timeProvider.timer.totalFrame - bornTick; }
|
||||
}
|
||||
|
||||
public FrameTimer(Form provaider)
|
||||
{
|
||||
timeProvider = provaider;
|
||||
bornTick = timeProvider.timer.totalFrame;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Convert a <see cref="FrameTimer"/> into uint value.
|
||||
/// this will get total frames since the timer was created.
|
||||
@@ -39,94 +84,4 @@ namespace StgSharp.Graphics
|
||||
return timer.Time;
|
||||
}
|
||||
}
|
||||
|
||||
public partial class Form
|
||||
{
|
||||
|
||||
internal class FrameUpdateTimer
|
||||
{
|
||||
private Counter<uint> tickCounter;
|
||||
private float frameLength;
|
||||
private double frameTime;
|
||||
private bool refreshed;
|
||||
private SemaphoreSlim pong;
|
||||
private bool isOnceFulFrame = false;
|
||||
|
||||
public uint totalFrame
|
||||
{
|
||||
get { return tickCounter; }
|
||||
}
|
||||
|
||||
public double timeAfterFrame
|
||||
{
|
||||
get { return InternalIO.glfw.GetTime() - frameTime; }
|
||||
}
|
||||
|
||||
internal bool IsOnceFullFrame
|
||||
{
|
||||
get { return isOnceFulFrame; }
|
||||
set
|
||||
{
|
||||
if (!isOnceFulFrame)
|
||||
{
|
||||
isOnceFulFrame = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
internal void Init(SemaphoreSlim semaphore)
|
||||
{
|
||||
pong = semaphore;
|
||||
}
|
||||
|
||||
internal void Refresh()
|
||||
{
|
||||
refreshed = false;
|
||||
}
|
||||
|
||||
internal bool GoNextFrame()
|
||||
{
|
||||
try
|
||||
{
|
||||
while (refreshed) { }
|
||||
refreshed = true;
|
||||
return refreshed;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
InternalIO.InternalWriteLog(ex.Message, LogType.Error);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private bool isFullyRendered = false;
|
||||
|
||||
/// <summary>
|
||||
/// Wait until the next frame of a certain <see cref="Form"/> started,
|
||||
/// all GL function after this method will be blocked until the next frame started.
|
||||
/// When a frame refreshed before
|
||||
/// It should be noticed that do not use this method too often to avoid unexpected performance problem
|
||||
/// </summary>
|
||||
/// <param name="form">The <see cref="Form"/> that can provide a frame refresh benchmark</param>
|
||||
/// <param name="action"><see cref="Action"/> to be done and aligned.</param>
|
||||
/// <returns>
|
||||
/// A bool value indicating if the <see cref="Form"/> successfully refresh the frame.
|
||||
/// If the retur value is false, please set a new <see cref="Form"/> as benchmark.
|
||||
/// </returns>
|
||||
protected bool AlignFrame(Form form, Action action)
|
||||
{
|
||||
try
|
||||
{
|
||||
bool isAligned = form.timer.GoNextFrame();
|
||||
action();
|
||||
return isAligned;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StgSharp.Graphics
|
||||
{
|
||||
internal class FormRenderBuffer
|
||||
{
|
||||
internal GLonRender GL;
|
||||
internal InternalFormBuffer data;
|
||||
}
|
||||
|
||||
internal class FormUpdateBuffer
|
||||
{
|
||||
internal GLonUpdate GL;
|
||||
internal InternalFormBuffer data;
|
||||
}
|
||||
|
||||
internal class InternalFormBuffer
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StgSharp.Graphics
|
||||
{
|
||||
internal class FrameBuffer
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -11,7 +11,7 @@ namespace StgSharp.Graphics
|
||||
internal uint[] _bufferID;
|
||||
private IglFunc GL;
|
||||
|
||||
internal VertexArray(int n, IglFunc glFunc)
|
||||
internal VertexArray(int n)
|
||||
{
|
||||
_bufferID = new uint[n];
|
||||
GL = glFunc;
|
||||
|
||||
@@ -18,6 +18,24 @@ namespace StgSharp.Graphics
|
||||
api.ActiveTexture(type);
|
||||
}
|
||||
|
||||
void IglFunc.AfterAlign(Form form, Action action)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
void IglFunc.AlignFrame(Form form)
|
||||
{
|
||||
if (form.timer.alignSign.byte0 > 0)
|
||||
{
|
||||
throw new InvalidOperationException();
|
||||
}
|
||||
form.timer.WaitNextFrame();
|
||||
form.timer.alignSign.byte0++;
|
||||
if (form.timer.)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
void IglFunc.AttachShader(uint program, uint shader)
|
||||
|
||||
@@ -0,0 +1,223 @@
|
||||
using StgSharp.Logic;
|
||||
using StgSharp.Math;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StgSharp.Graphics
|
||||
{
|
||||
internal class GLonTimeout : IglFunc
|
||||
{
|
||||
private static readonly GLonTimeout singleInstance
|
||||
= new GLonTimeout();
|
||||
|
||||
private GLonTimeout() { }
|
||||
|
||||
internal static GLonTimeout Set()
|
||||
{
|
||||
return singleInstance;
|
||||
}
|
||||
|
||||
void IglFunc.ActiveTexture(uint type)
|
||||
{
|
||||
throw new FrameTimeoutException();
|
||||
}
|
||||
|
||||
void IglFunc.AfterAlign(Form form, Action action)
|
||||
{
|
||||
throw new FrameTimeoutException();
|
||||
}
|
||||
|
||||
void IglFunc.AlignFrame(Form form)
|
||||
{
|
||||
throw new FrameTimeoutException();
|
||||
}
|
||||
|
||||
void IglFunc.AttachShader(uint program, uint shader)
|
||||
{
|
||||
throw new FrameTimeoutException();
|
||||
}
|
||||
|
||||
void IglFunc.BindBuffer(BufferType bufferType, uint index)
|
||||
{
|
||||
throw new FrameTimeoutException();
|
||||
}
|
||||
|
||||
void IglFunc.BindTexture(uint type, uint texture)
|
||||
{
|
||||
throw new FrameTimeoutException();
|
||||
}
|
||||
|
||||
void IglFunc.BindVertexArray(uint index)
|
||||
{
|
||||
throw new FrameTimeoutException();
|
||||
}
|
||||
|
||||
void IglFunc.Clear(MaskBufferBit mask)
|
||||
{
|
||||
throw new FrameTimeoutException();
|
||||
}
|
||||
|
||||
void IglFunc.ClearColor(float R, float G, float B, float A)
|
||||
{
|
||||
throw new FrameTimeoutException();
|
||||
}
|
||||
|
||||
void IglFunc.ClearGraphicError()
|
||||
{
|
||||
throw new FrameTimeoutException();
|
||||
}
|
||||
|
||||
uint IglFunc.CompileShader(string shaderCode, ShaderType shaderType)
|
||||
{
|
||||
throw new FrameTimeoutException();
|
||||
}
|
||||
|
||||
uint IglFunc.CreateProgram()
|
||||
{
|
||||
throw new FrameTimeoutException();
|
||||
}
|
||||
|
||||
IntPtr IglFunc.CreateWindowHandle(int width, int height, string tittle, IntPtr monitor, Form share)
|
||||
{
|
||||
throw new FrameTimeoutException();
|
||||
}
|
||||
|
||||
uint IglFunc.CreatGraphicProgram()
|
||||
{
|
||||
throw new FrameTimeoutException();
|
||||
}
|
||||
|
||||
unsafe void IglFunc.DeleteBuffers(int count, uint* ptr)
|
||||
{
|
||||
throw new FrameTimeoutException();
|
||||
}
|
||||
|
||||
unsafe void IglFunc.DeleteVertexArrays(int count, uint* ptr)
|
||||
{
|
||||
throw new FrameTimeoutException();
|
||||
}
|
||||
|
||||
void IglFunc.DrawElements(GepmetryType mode, int count, Type type, IntPtr ptr)
|
||||
{
|
||||
throw new FrameTimeoutException();
|
||||
}
|
||||
|
||||
unsafe void IglFunc.GenBuffers(int count, uint* ptr)
|
||||
{
|
||||
throw new FrameTimeoutException();
|
||||
}
|
||||
|
||||
unsafe void IglFunc.GenTextures(int count, uint* ptr)
|
||||
{
|
||||
throw new FrameTimeoutException();
|
||||
}
|
||||
|
||||
unsafe void IglFunc.GenVertexArrays(int count, uint* ptr)
|
||||
{
|
||||
throw new FrameTimeoutException();
|
||||
}
|
||||
|
||||
void IglFunc.GetGraphicError()
|
||||
{
|
||||
throw new FrameTimeoutException();
|
||||
}
|
||||
|
||||
unsafe int IglFunc.GetUniformLocation(uint program, byte* ptr)
|
||||
{
|
||||
throw new FrameTimeoutException();
|
||||
}
|
||||
|
||||
bool IglFunc.GetWindowShouldClose(Form form)
|
||||
{
|
||||
throw new FrameTimeoutException();
|
||||
}
|
||||
|
||||
void IglFunc.MakeContexCurrent(Form form)
|
||||
{
|
||||
throw new FrameTimeoutException();
|
||||
}
|
||||
|
||||
void IglFunc.SetBufferData<T>(BufferType bufferType, T bufferData, BufferUsage usage)
|
||||
{
|
||||
throw new FrameTimeoutException();
|
||||
}
|
||||
|
||||
void IglFunc.SetBufferData<T>(BufferType bufferType, T[] bufferArray, BufferUsage usage)
|
||||
{
|
||||
throw new FrameTimeoutException();
|
||||
}
|
||||
|
||||
void IglFunc.SetFrameBufferSizeCallback(IntPtr id, FrameBufferSizeHandler handler)
|
||||
{
|
||||
throw new FrameTimeoutException();
|
||||
}
|
||||
|
||||
void IglFunc.SetValue(Uniform<float, float, float, float> uniform, float v0, float v1, float v2, float v3)
|
||||
{
|
||||
throw new FrameTimeoutException();
|
||||
}
|
||||
|
||||
void IglFunc.SetValue(Uniform<float, float, float, float> uniform, Vec4d vec)
|
||||
{
|
||||
throw new FrameTimeoutException();
|
||||
}
|
||||
|
||||
void IglFunc.SetValue(Uniform<float, float, float> uniform, float v0, float v1, float v2)
|
||||
{
|
||||
throw new FrameTimeoutException();
|
||||
}
|
||||
|
||||
void IglFunc.SetValue(Uniform<float, float> uniform, float v0, float v1)
|
||||
{
|
||||
throw new FrameTimeoutException();
|
||||
}
|
||||
|
||||
void IglFunc.SetValue(Uniform<float> uniform, float v0)
|
||||
{
|
||||
throw new FrameTimeoutException();
|
||||
}
|
||||
|
||||
void IglFunc.SetValue(Uniform<int> uniform, int i0)
|
||||
{
|
||||
throw new FrameTimeoutException();
|
||||
}
|
||||
|
||||
void IglFunc.SetValue(Uniform<Vec4d> uniform, Vec4d vec)
|
||||
{
|
||||
throw new FrameTimeoutException();
|
||||
}
|
||||
|
||||
void IglFunc.SetVertexAttribute(uint index, int size, Type t, bool normalized, int stride, int pointer)
|
||||
{
|
||||
throw new FrameTimeoutException();
|
||||
}
|
||||
|
||||
void IglFunc.SwapBuffers(Form form)
|
||||
{
|
||||
throw new FrameTimeoutException();
|
||||
}
|
||||
|
||||
unsafe void IglFunc.TextureImage2d(uint target, int level, uint internalformat, int width, int height, uint format, uint type, void* pixels)
|
||||
{
|
||||
throw new FrameTimeoutException();
|
||||
}
|
||||
|
||||
void IglFunc.TextureParameter(uint target, uint pname, int param)
|
||||
{
|
||||
throw new FrameTimeoutException();
|
||||
}
|
||||
|
||||
void IglFunc.UseProgram(uint program)
|
||||
{
|
||||
throw new FrameTimeoutException();
|
||||
}
|
||||
|
||||
void IglFunc.Viewport(int x, int y, int width, int height)
|
||||
{
|
||||
throw new FrameTimeoutException();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,28 @@ namespace StgSharp.Graphics
|
||||
{
|
||||
public interface IglFunc
|
||||
{
|
||||
/// <summary>
|
||||
/// Align a sets of code to frame update of a <see cref="Form"/>.
|
||||
/// Usually, a call of <see cref="AfterAlign(Form,Action)"/> is required.
|
||||
/// This method is used as sigle thread method. If more than one
|
||||
/// alignment is requested, a <see cref="InvalidOperationException"/> will throw.
|
||||
/// </summary>
|
||||
/// <param name="form">The form used as frame update benchmark.</param>
|
||||
/// <exception cref="InvalidOperationException">More than one alingment attached to one form timer</exception>
|
||||
void AlignFrame(Form form);
|
||||
|
||||
/// <summary>
|
||||
/// Operation after alignment by calling <see cref="AlignFrame(Form)"/>.
|
||||
/// No calling of this method is acceptable, but it will bring the risk
|
||||
/// of that relevant code will not run if it is interrupted by frame overtime.
|
||||
/// Please call this method immediately after calling <see cref="AlignFrame(Form)"/>,
|
||||
/// too early or sonner may cause <see cref="InvalidOperationException"/>.
|
||||
/// </summary>
|
||||
/// <param name="form">The form used as frame update benchmark.</param>
|
||||
/// <param name="action">Operation after frame update alignment.</param>
|
||||
/// <exception cref="InvalidOperationException">The action binded to a wrong alignment.</exception>
|
||||
void AfterAlign(Form form, Action action);
|
||||
|
||||
/// <summary>
|
||||
/// Same function as OpenGL api glActiveTexture
|
||||
/// </summary>
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
using StgSharp.Graphics;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StgSharp.Logic
|
||||
{
|
||||
[System.Serializable]
|
||||
internal class FrameTimeoutException : Exception
|
||||
{
|
||||
internal FrameTimeoutException() { }
|
||||
internal FrameTimeoutException(string message) : base(message) { }
|
||||
internal FrameTimeoutException(Form form) :
|
||||
base($"Form {nameof(form)} cannot accoplish all render work at frame {form.timer.totalFrame}")
|
||||
{ }
|
||||
internal FrameTimeoutException(string message, Exception inner) : base(message, inner) { }
|
||||
protected FrameTimeoutException(
|
||||
System.Runtime.Serialization.SerializationInfo info,
|
||||
System.Runtime.Serialization.StreamingContext context) : base(info, context) { }
|
||||
}
|
||||
}
|
||||
@@ -6,9 +6,8 @@ namespace StgSharp
|
||||
{
|
||||
internal readonly T _value;
|
||||
|
||||
[AllowNull]
|
||||
|
||||
internal LinkedListNode<T> _previous;
|
||||
[AllowNull]
|
||||
internal LinkedListNode<T> _next;
|
||||
internal LinkedList<T> list;
|
||||
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StgSharp.Logic
|
||||
{
|
||||
/// <summary>
|
||||
/// A pair of <see cref="bool"/> value
|
||||
/// </summary>
|
||||
[StructLayout(LayoutKind.Explicit, Size = 2)]
|
||||
public struct Bool2
|
||||
{
|
||||
/// <summary>
|
||||
/// A <see cref="ushort"/> value.
|
||||
/// The lower byte is <see cref="bool0"/>,
|
||||
/// and higher byte is <see cref="bool1"/>.
|
||||
/// </summary>
|
||||
[FieldOffset(0)] public ushort Value;
|
||||
|
||||
/// <summary>
|
||||
/// The first <see cref="bool"/> value.
|
||||
/// </summary>
|
||||
[FieldOffset(0)] public bool bool0;
|
||||
|
||||
[FieldOffset(0)] public byte byte0;
|
||||
|
||||
/// <summary>
|
||||
/// The second <see cref="bool"/> value.
|
||||
/// </summary>
|
||||
[FieldOffset(1)] public bool bool1;
|
||||
|
||||
[FieldOffset(1)] public bool byte1;
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,7 @@ using System.Text;
|
||||
|
||||
namespace StgSharp.Controlling
|
||||
{
|
||||
public static unsafe partial class TimeLine
|
||||
internal static unsafe partial class TimeLine
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,81 +1,79 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netstandard2.1</TargetFramework>
|
||||
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
|
||||
<LangVersion>preview</LangVersion>
|
||||
<ProduceReferenceAssembly>True</ProduceReferenceAssembly>
|
||||
<GenerateDocumentationFile>True</GenerateDocumentationFile>
|
||||
<Platforms>AnyCPU;x64</Platforms>
|
||||
<GeneratePackageOnBuild>False</GeneratePackageOnBuild>
|
||||
<PackageRequireLicenseAcceptance>True</PackageRequireLicenseAcceptance>
|
||||
<PackageLicenseExpression> MIT</PackageLicenseExpression>
|
||||
<EnableNETAnalyzers>True</EnableNETAnalyzers>
|
||||
<AnalysisLevel>preview-all</AnalysisLevel>
|
||||
<OutputType>Library</OutputType>
|
||||
<Nullable>enable</Nullable>
|
||||
<Configurations>Debug;Release;NoOps;RealDebug</Configurations>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netstandard2.1</TargetFramework>
|
||||
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
|
||||
<LangVersion>preview</LangVersion>
|
||||
<ProduceReferenceAssembly>True</ProduceReferenceAssembly>
|
||||
<GenerateDocumentationFile>True</GenerateDocumentationFile>
|
||||
<Platforms>AnyCPU;x64</Platforms>
|
||||
<GeneratePackageOnBuild>False</GeneratePackageOnBuild>
|
||||
<PackageRequireLicenseAcceptance>True</PackageRequireLicenseAcceptance>
|
||||
<PackageLicenseExpression> MIT</PackageLicenseExpression>
|
||||
<EnableNETAnalyzers>True</EnableNETAnalyzers>
|
||||
<AnalysisLevel>preview-all</AnalysisLevel>
|
||||
<OutputType>Library</OutputType>
|
||||
<Nullable>enable</Nullable>
|
||||
<Configurations>Debug;Release;NoOps;RealDebug</Configurations>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Optimize>True</Optimize>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Optimize>True</Optimize>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='RealDebug|x64'">
|
||||
<Optimize>True</Optimize>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='RealDebug|x64'">
|
||||
<Optimize>True</Optimize>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Optimize>True</Optimize>
|
||||
<DebugType>embedded</DebugType>
|
||||
<NoWarn>1701;1702;0649;1591;0169</NoWarn>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Optimize>True</Optimize>
|
||||
<DebugType>embedded</DebugType>
|
||||
<NoWarn>1701;1702;0649;1591;0169</NoWarn>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='RealDebug|x64'">
|
||||
<Optimize>True</Optimize>
|
||||
<DebugType>embedded</DebugType>
|
||||
<NoWarn>1701;1702;0649;1591;0169</NoWarn>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='RealDebug|x64'">
|
||||
<Optimize>True</Optimize>
|
||||
<DebugType>embedded</DebugType>
|
||||
<NoWarn>1701;1702;0649;1591;0169</NoWarn>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||
<DebugType>embedded</DebugType>
|
||||
<Optimize>True</Optimize>
|
||||
<NoWarn>1701;1702;0649;1591;0169</NoWarn>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||
<DebugType>embedded</DebugType>
|
||||
<Optimize>True</Optimize>
|
||||
<NoWarn>1701;1702;0649;1591;0169</NoWarn>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='RealDebug|AnyCPU'">
|
||||
<DebugType>embedded</DebugType>
|
||||
<Optimize>True</Optimize>
|
||||
<NoWarn>1701;1702;0649;1591;0169</NoWarn>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='RealDebug|AnyCPU'">
|
||||
<DebugType>embedded</DebugType>
|
||||
<Optimize>True</Optimize>
|
||||
<NoWarn>1701;1702;0649;1591;0169</NoWarn>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
|
||||
<DebugType>none</DebugType>
|
||||
<NoWarn>1701;1702;0649;1591;0169</NoWarn>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
|
||||
<DebugType>none</DebugType>
|
||||
<NoWarn>1701;1702;0649;1591;0169</NoWarn>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<DebugType>none</DebugType>
|
||||
<NoWarn>1701;1702;0649;1591;0169</NoWarn>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<DebugType>none</DebugType>
|
||||
<NoWarn>1701;1702;0649;1591;0169</NoWarn>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition=" '$(OS)' == 'Windows_NT' ">
|
||||
<DefineConstants>_WINDOWS</DefineConstants>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.Bcl.HashCode" Version="1.1.1" />
|
||||
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Update="..\StgSharpGraphic">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
|
||||
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
|
||||
|
||||
</Target>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.Bcl.HashCode" Version="1.1.1" />
|
||||
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Update="..\StgSharpGraphic">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
|
||||
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
|
||||
|
||||
</Target>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -14,7 +14,7 @@ using System.Reflection;
|
||||
[assembly: System.Reflection.AssemblyCompanyAttribute("StgSharp")]
|
||||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
||||
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+f97fb137bab6d3951628058d311cdd6563088253")]
|
||||
[assembly: System.Reflection.AssemblyProductAttribute("StgSharp")]
|
||||
[assembly: System.Reflection.AssemblyTitleAttribute("StgSharp")]
|
||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
||||
|
||||
@@ -1 +1 @@
|
||||
c037a45127bb9a5e3e153dd0686c8ec78e62d669
|
||||
04dfcfa786a1963af50078b294ac03205243553745bcaa6e3699fa1e9b6c1b95
|
||||
|
||||
+10
@@ -1,3 +1,13 @@
|
||||
is_global = true
|
||||
build_property.TargetFramework = netstandard2.0
|
||||
build_property.TargetPlatformMinVersion = 7.0
|
||||
build_property.UsingMicrosoftNETSdkWeb =
|
||||
build_property.ProjectTypeGuids =
|
||||
build_property.InvariantGlobalization =
|
||||
build_property.PlatformNeutralAssembly =
|
||||
build_property.EnforceExtendedAnalyzerRules =
|
||||
build_property._SupportedPlatformList = Linux,macOS,Windows
|
||||
build_property.RootNamespace = StgSharp
|
||||
build_property.ProjectDir = D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgSharp\
|
||||
build_property.EnableComHosting =
|
||||
build_property.EnableGeneratedComInterfaceComImportInterop =
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -1 +1 @@
|
||||
e0508ef3df2648b89976ea207d573cd7d001b127
|
||||
8dddfab4563f7975c58d9882befd136094f47cb89b21d9aa34fabd362789c3a2
|
||||
|
||||
@@ -12,3 +12,4 @@ D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgSharp
|
||||
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgSharp\obj\x64\Debug\netstandard2.0\StgSharp.xml
|
||||
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgSharp\obj\x64\Debug\netstandard2.0\StgSharp.pdb
|
||||
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgSharp\obj\x64\Debug\netstandard2.0\ref\StgSharp.dll
|
||||
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgSharp\obj\x64\Debug\netstandard2.0\StgSharp.sourcelink.json
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
{"documents":{"D:\\NitloadIndustry\\研究项目\\1-Flagship\\TH2020\\ProjectFile\\*":"https://raw.githubusercontent.com/Nitload-NSI/CCD_Github/f97fb137bab6d3951628058d311cdd6563088253/*"}}
|
||||
@@ -14,7 +14,7 @@ using System.Reflection;
|
||||
[assembly: System.Reflection.AssemblyCompanyAttribute("StgSharp")]
|
||||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
||||
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+ab85c1a9fe556e53e39ce33690efdd1b4ad28484")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")]
|
||||
[assembly: System.Reflection.AssemblyProductAttribute("StgSharp")]
|
||||
[assembly: System.Reflection.AssemblyTitleAttribute("StgSharp")]
|
||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
||||
|
||||
@@ -1 +1 @@
|
||||
b38880cab427ff4384d0fea3dec02c59d1d5ebab3deb9283cedea7e2be0c13d3
|
||||
e8b19b35bca753348ef94df4faf984102d2e81946d465d23132400b7d6c8fb6d
|
||||
|
||||
@@ -1 +1 @@
|
||||
04fd394b76052c1382ce478d9e85878535f06255ce0da04c1bfa05a5caccc08c
|
||||
dd6796f149809295555f79b84f32a9815cb39557dd7a5256658cce0f77660c44
|
||||
|
||||
@@ -1 +1 @@
|
||||
{"documents":{"D:\\NitloadIndustry\\研究项目\\1-Flagship\\TH2020\\ProjectFile\\*":"https://raw.githubusercontent.com/Nitload-NSI/CCD_Github/ab85c1a9fe556e53e39ce33690efdd1b4ad28484/*"}}
|
||||
{"documents":{"D:\\NitloadIndustry\\研究项目\\1-Flagship\\TH2020\\ProjectFile\\*":"https://raw.githubusercontent.com/Nitload-NSI/CCD_Github/f97fb137bab6d3951628058d311cdd6563088253/*"}}
|
||||
Reference in New Issue
Block a user