daily update on 20240320 by nitload youmu

This commit is contained in:
YoumuLiu
2024-03-21 02:01:17 +08:00
parent 0c50c6282e
commit 9a10ec201c
91 changed files with 1150 additions and 1815 deletions
@@ -39,6 +39,7 @@ namespace StgSharp
{
public static unsafe partial class StgSharp
{
private static bool _inited;
/// <summary>
/// Init an instance of OpenGL program,
@@ -78,6 +78,18 @@ namespace StgSharp
private static bool vsyncActivated;
internal static GraphicAPI API = default;
public static void Init()
{
mainTimeProvider = new StgSharpTime();
MainTimeProvider.StartProvidingTime();
InternalIO.glfwInit();
}
public static void Terminate()
{
MainTimeProvider.Terminate();
}
public static void Mark(bool needConsole)
{
markCount++;
+19 -6
View File
@@ -42,8 +42,11 @@ namespace StgSharp
public partial class StgSharp
{
internal static StgSharpTime mainTimeProvider;
internal static StgSharpTime MainTimeProvider=>mainTimeProvider;
}
public sealed class StgSharpTime : TimeSourceProviderBase
@@ -58,8 +61,7 @@ namespace StgSharp
{
}
public static StgSharpTime OnlyInstance
=> StgSharp.mainTimeProvider;
public static StgSharpTime OnlyInstance => StgSharp.MainTimeProvider;
public override sealed void StartProvidingTime()
{
@@ -90,10 +92,6 @@ namespace StgSharp
timeProvideThread.Start();
}
[MethodImpl(MethodImplOptions.NoOptimization)]
public static void TimerActivate(int maxFrameUpdateSensitiveTimeProviderCount)
{
}
protected override sealed void AddSubscriberUnsynced(TimeSpanProvider subscriber)
{
@@ -115,6 +113,11 @@ namespace StgSharp
while (mainProvider.IsRunning)
{
totalMS = mainProvider.ElapsedTicks / (internalFrequncy / (1000L * 1000L));
if (subscriberList.Count==0)
{
continue;
}
CheckSubscriberSemaphore.Wait();
foreach (TimeSpanProvider subscriber in subscriberList)
{
if (subscriber.CheckTime(totalMS))
@@ -122,6 +125,16 @@ namespace StgSharp
};
}
CheckSubscriberSemaphore.Release();
}
int a = 0;
}
public void Terminate()
{
lock (mainProvider)
{
mainProvider.Stop();
}
}
@@ -59,22 +59,22 @@ namespace StgSharp.Geometries
return new Plain(this.center, this.beginPoint, this.endPoint);
}
public virtual vec3d MovBegin(uint tick)
public virtual vec3d MovBegin(int tick)
{
return movBeginOperation.Invoke(tick);
}
public virtual vec3d MoveCenter(uint tick)
public virtual vec3d MoveCenter(int tick)
{
return movCenterOperation.Invoke(tick);
}
public virtual vec3d MovEnd(uint tick)
public virtual vec3d MovEnd(int tick)
{
return movEndOperation.Invoke(tick);
}
internal override void UpdateCoordinate(uint tick)
internal override void UpdateCoordinate(int tick)
{
tick = time;
center.Position = this.coordinate.origin + MoveCenter(tick);
@@ -60,23 +60,23 @@ namespace StgSharp.Geometries
return new Plain(center, pointOnCircle, pointOnPlain);
}
public virtual vec3d MoveCenter(uint tick)
public virtual vec3d MoveCenter(int tick)
{
return movCenterOperation.Invoke(tick);
}
public virtual vec3d UpdatePlain(uint tick)
public virtual vec3d UpdatePlain(int tick)
{
return movEndOperation.Invoke(tick);
}
public virtual vec3d UpdateRadius(uint tick)
public virtual vec3d UpdateRadius(int tick)
{
return movBeginOperation.Invoke(tick);
}
internal override void UpdateCoordinate(uint tick)
internal override void UpdateCoordinate(int tick)
{
tick = time;
center.Position = this.coordinate.origin + MoveCenter(tick);
@@ -37,12 +37,12 @@ namespace StgSharp.Geometries
/// </summary>
/// <param name="tick">The game tick represent time passed by</param>
/// <returns>A 3d vector representing movement</returns>
public delegate vec3d GetLocationHandler(uint tick);
public delegate vec3d GetLocationHandler(int tick);
public static unsafe class GeometryOperation
{
public static vec3d DefualtMotion(uint tick)
public static vec3d DefualtMotion(int tick)
{
return default(vec3d);
}
@@ -77,7 +77,7 @@ namespace StgSharp.Geometries
/// loading an <see cref="GetLocationHandler"/> with same function.
/// </summary>
/// <param name="tick">Time passed since current line was created.</param>
public virtual vec3d MoveBeginPoint(uint tick)
public virtual vec3d MoveBeginPoint(int tick)
{
return movBegin.Invoke(time);
}
@@ -89,12 +89,12 @@ namespace StgSharp.Geometries
/// </summary>
/// <param name="tick">Time passed since current line was created.</param>
/// <returns></returns>
public virtual vec3d MoveEndPoint(uint tick)
public virtual vec3d MoveEndPoint(int tick)
{
return movEnd.Invoke(time);
}
internal override void UpdateCoordinate(uint tick)
internal override void UpdateCoordinate(int tick)
{
beginPoint.Position = coordinate.origin + MoveBeginPoint(time);
endPoint.Position = coordinate.origin + MoveEndPoint(time);
@@ -66,7 +66,7 @@ namespace StgSharp.Geometries
public GetLocationHandler MovVertex01Operation => moveVertex0Operation;
public GetLocationHandler MovVertex02Operation => moveVertex1Operation;
public virtual vec3d MovCenter(uint tick)
public virtual vec3d MovCenter(int tick)
{
return movCenterOperation.Invoke(tick);
}
@@ -77,7 +77,7 @@ namespace StgSharp.Geometries
/// <param name="tick">Current time tick</param>
/// <returns></returns>
/// <exception cref="UnusedVertexException">Geometry overdefined</exception>
public override sealed vec3d MoveVertex2(uint tick)
public override sealed vec3d MoveVertex2(int tick)
{
throw new UnusedVertexException();
}
@@ -88,12 +88,12 @@ namespace StgSharp.Geometries
/// <param name="tick">Current time tick</param>
/// <returns></returns>
/// <exception cref="UnusedVertexException">Geometry overdefined</exception>
public override sealed vec3d MoveVertex3(uint tick)
public override sealed vec3d MoveVertex3(int tick)
{
throw new UnusedVertexException();
}
internal override sealed void UpdateCoordinate(uint tick)
internal override sealed void UpdateCoordinate(int tick)
{
}
@@ -51,7 +51,7 @@ namespace StgSharp.Geometries
/// <summary>
/// Tick time this geometry eas crested
/// </summary>
public uint BornTime => time;
public int BornTime => time;
public PartialPlainCoordinate ReferenceCoordinate => this.coordinate;
@@ -70,7 +70,7 @@ namespace StgSharp.Geometries
public abstract Plain GetPlain();
internal abstract void UpdateCoordinate(uint tick);
internal abstract void UpdateCoordinate(int tick);
//public abstract Rectangle GetRenderFrame();
}
@@ -151,29 +151,29 @@ namespace StgSharp.Geometries
vertexMat.mat.colum2);
}
public virtual vec3d MoveVertex0(uint tick)
public virtual vec3d MoveVertex0(int tick)
{
return moveVertex0Operation(tick);
}
public virtual vec3d MoveVertex1(uint tick)
public virtual vec3d MoveVertex1(int tick)
{
return moveVertex1Operation(tick);
}
public virtual vec3d MoveVertex2(uint tick)
public virtual vec3d MoveVertex2(int tick)
{
return moveVertex2Operation(tick);
}
public virtual vec3d MoveVertex3(uint tick)
public virtual vec3d MoveVertex3(int tick)
{
return moveVertex3Operation(tick);
}
internal override void UpdateCoordinate(uint tick)
internal override void UpdateCoordinate(int tick)
{
}
@@ -124,35 +124,35 @@ namespace StgSharp.Geometries
return new Plain(Vertex0, Vertex1, Vertex2);
}
public virtual vec3d movVertex01(uint tick)
public virtual vec3d movVertex01(int tick)
{
return movP01Operation.Invoke(time);
}
public virtual vec3d movVertex02(uint tick)
public virtual vec3d movVertex02(int tick)
{
return movP02Operation.Invoke(time);
}
public virtual vec3d movVertex03(uint tick)
public virtual vec3d movVertex03(int tick)
{
return movP03Operation.Invoke(time);
}
public virtual vec3d movVertex04(uint tick)
public virtual vec3d movVertex04(int tick)
{
return movP04Operation.Invoke(time);
}
public virtual vec3d movVertex05(uint tick)
public virtual vec3d movVertex05(int tick)
{
return movP05Operation.Invoke(time);
}
internal override void UpdateCoordinate(uint tick)
internal override void UpdateCoordinate(int tick)
{
uint nowTick = tick - BornTime;
int nowTick = tick - BornTime;
vertexMat.vec0 = (coordinate.origin + movVertex01(nowTick)).vec;
vertexMat.vec1 = (coordinate.origin + movVertex02(nowTick)).vec;
vertexMat.vec2 = (coordinate.origin + movVertex03(nowTick)).vec;
@@ -111,39 +111,39 @@ namespace StgSharp.Geometries
return new Plain(Vertex0, Vertex1, Vertex2);
}
public virtual vec3d movVertex0(uint tick)
public virtual vec3d movVertex0(int tick)
{
return movVertex0Operation.Invoke(time);
}
public virtual vec3d movVertex1(uint tick)
public virtual vec3d movVertex1(int tick)
{
return movVertex1Operation.Invoke(time);
}
public virtual vec3d movVertex2(uint tick)
public virtual vec3d movVertex2(int tick)
{
return movVertex2Operation.Invoke(time);
}
public virtual vec3d movVertex3(uint tick)
public virtual vec3d movVertex3(int tick)
{
return movVertex3Operation.Invoke(time);
}
public virtual vec3d movVertex4(uint tick)
public virtual vec3d movVertex4(int tick)
{
return movVertex4Operation.Invoke(time);
}
public virtual vec3d movVertex5(uint tick)
public virtual vec3d movVertex5(int tick)
{
return movVertex5Operation.Invoke(time);
}
internal override void UpdateCoordinate(uint tick)
internal override void UpdateCoordinate(int tick)
{
uint nowTick = tick - BornTime;
int nowTick = tick - BornTime;
Vector4 origin = coordinate.origin.vec;
vertexMat.vec0 = origin + movVertex0(nowTick).vec;
vertexMat.vec1 = origin + movVertex1(nowTick).vec;
@@ -53,7 +53,7 @@ namespace StgSharp.Geometries
{
}
public override sealed vec3d MoveVertex1(uint tick)
public override sealed vec3d MoveVertex1(int tick)
{
return default;
}
@@ -98,22 +98,22 @@ namespace StgSharp.Geometries
return new Plain(this.vertexMat.mat.colum0, this.vertexMat.mat.colum1, this.vertexMat.mat.colum2);
}
public virtual vec3d MovVertex01(uint tick)
public virtual vec3d MovVertex01(int tick)
{
return movVertex01Opearion.Invoke(tick);
}
public virtual vec3d MovVertex02(uint tick)
public virtual vec3d MovVertex02(int tick)
{
return movVertex02Opearion.Invoke(tick);
}
public virtual vec3d MovVertex03(uint tick)
public virtual vec3d MovVertex03(int tick)
{
return movVertex03Opearion.Invoke(tick);
}
internal override sealed void UpdateCoordinate(uint tick)
internal override sealed void UpdateCoordinate(int tick)
{
tick = time;
vertexMat.mat.colum0 = coordinate.origin.vec + MovVertex01(time).vec;
+56 -47
View File
@@ -58,22 +58,22 @@ namespace StgSharp.Graphics
internal int width;
private GLFWwindow* windowID;
internal TimeSpanProvider frameTimeProvider;
#endregion metadata
#region glapicount
private int missingAPIcount = 0;
private int problemAPIcount = 0;
#endregion glapicount
#region form main
#region form time
private short fpsCount;
internal TimeSpanProvider frameTimeProvider;
internal TimeSpanProvider fpsCountProvider = new TimeSpanProvider(1.0, TimeSpanProvider.DefaultProvider);
#endregion
#region form thread setting
private bool isSingleThread = true;
private List<FrameAsyncTask> frameAsyncTaskList = new List<FrameAsyncTask>();
#endregion form thread setting
protected Form()
{
}
@@ -129,8 +129,6 @@ namespace StgSharp.Graphics
public unsafe IntPtr WindowID => (IntPtr)windowID;
internal unsafe GLFWwindow* id => windowID;
protected FrameBufferSizeHandler FrameBufferSizeCallback
{
set
@@ -140,8 +138,26 @@ namespace StgSharp.Graphics
}
}
internal unsafe GLFWwindow* id => windowID;
internal bool IsSingleThread => isSingleThread;
public abstract void Deinit(params object[] args);
/// <summary>
/// Necessary operation to init this form.
/// </summary>
/// <param name="args"></param>
public abstract void Init(params object[] args);
/// <summary>
/// Behaviour of current form when in a frame cycle.
/// </summary>
/// <param name="args"></param>
public abstract void Main();
/// <summary>
/// Init an OpenGl context if current form has not been binded to any context. and set the context binded to
/// current form as current OpenGL context.
@@ -179,7 +195,12 @@ namespace StgSharp.Graphics
gl = new GLonRender(contextID);
}
InternalIO.glfwMakeContextCurrent(windowID);
gl.SwitchContext();
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public unsafe void PollEvents()
{
InternalIO.glfwPollEvents();
}
/// <summary>
@@ -250,33 +271,12 @@ namespace StgSharp.Graphics
public void SetSizeLimit(int minWidth, int minHeight, int maxWidth, int maxHeight)
{ InternalIO.glfwSetWindowSizeLimits(this.windowID, minWidth, minHeight, maxWidth, maxHeight); }
unsafe ~Form() { Marshal.FreeHGlobal(graphicContextID); }
public abstract void Deinit(params object[] args);
/// <summary>
/// Necessary operation to init this form.
/// </summary>
/// <param name="args"></param>
public abstract void Init(params object[] args);
/// <summary>
/// Behaviour of current form when in a render cycle. When this form
/// </summary>
/// <param name="args"></param>
public abstract void Main(params object[] args);
public unsafe void PollEvents()
{
InternalIO.glfwPollEvents();
}
#region form main
/// <summary>
/// Init this form and render it on screen, and respond with operation
/// </summary>
public unsafe void Show(params object[] args)
public unsafe void Show()
{
if (gl == null)
{
@@ -284,40 +284,46 @@ namespace StgSharp.Graphics
}
else
{
frameTimeProvider = new TimeSpanProvider(1 / 60.0, TimeSpanProvider.DefaultProvider);
if (isSingleThread)
{
while (!ShouldClose)
{
Main(args);
Main();
SwapBuffers();
PollEvents();
frameTimeProvider.WaitNextSpan();
}
}
else
{
GLonUpdate update = new GLonUpdate((GLcontext*)graphicContextID);
FrameAsyncTask renderTask = new FrameAsyncTask(update);
FrameAsyncTask updateTask = new FrameAsyncTask(update);
FrameAsyncTask updateTask = new AsyncUpdateDataTask(this);
FrameAsyncTask renderTask = new AsyncRenderFrameTask(this);
frameAsyncTaskList.Add(renderTask);
frameAsyncTaskList.Add(updateTask);
gl = update;
update.ActivatedOperationBuffer = updateTask.opBuffer;
SemaphoreSlim frameBeginSemaphore = FrameAsyncTask.CombineAsync(renderTask, updateTask);
SemaphoreSlim renderCompleteSemaphor = renderTask.StartAsync();
SemaphoreSlim updateCompleteSemaphor = updateTask.StartAsync();
while (!ShouldClose)
{
renderTask.StartAsync();
updateTask.StartAsync();
FrameAsyncTask.CombineAsync(renderTask, updateTask);
frameBeginSemaphore.Release(2);
renderCompleteSemaphor.Wait();
updateCompleteSemaphor.Wait();
SwapBuffers();
PollEvents();
FrameAsyncTask.ExchangeBuffer(updateTask, renderTask);
update.ActivatedOperationBuffer = updateTask.opBuffer;
frameTimeProvider.WaitNextSpan();
}
//TODO 对逻辑线程和渲染线程进行同步,两种gl模式包需要改名字
}
}
}
internal static unsafe void InternalSwapBuffers(FrameOperationBuffer operationBuffer, GLcontext* context)
{
IntPtr window = default;
operationBuffer.TryDequeue(out window);
InternalIO.glfwSwapBuffers((GLFWwindow*)window);
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
internal void InternalDeinit(params object[] args) { Deinit(args); }
@@ -373,8 +379,11 @@ namespace StgSharp.Graphics
throw new ArgumentException("Amount of threads should be bigger than 0");
}
}
#endregion form main
unsafe ~Form() { Marshal.FreeHGlobal(graphicContextID); }
#endregion form main
}
}
+90 -19
View File
@@ -32,6 +32,7 @@ using StgSharp.Math;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
@@ -47,6 +48,12 @@ namespace StgSharp.Graphics
private ConcurrentQueue<IntPtr> _funcQueue;
private readonly unsafe GLcontext* currentContext;
public unsafe FrameOperationBuffer(IglFunc gl)
{
currentContext = gl.Context;
_funcQueue = new ConcurrentQueue<IntPtr>();
}
public unsafe bool CallNext()
{
if (_funcQueue.TryDequeue(out _func))
@@ -481,22 +488,60 @@ namespace StgSharp.Graphics
#endregion gl param queue
}
//TODO 任务组绑定机制有问题,现在一次只能绑定两个
//TODO 目前还不能加载任何任务
//TODO 任务的启动逻辑需要重构
internal class FrameAsyncTask
public class FrameAsyncTask
{
private SemaphoreSlim _refrshSemaphore;
private SemaphoreSlim _frameCompleteSemaphore;
private Task _task;
private FrameOperationBuffer opBuffer = new FrameOperationBuffer();
protected SemaphoreSlim _frameCompleteSemaphore = new SemaphoreSlim(0, 1);
protected SemaphoreSlim _refreshSemaphore;
private Task _task;
protected Action _taskTODO;
protected Func<bool> _terminateSignature;
internal FrameOperationBuffer opBuffer;
internal FrameAsyncTask(GLonUpdate gl)
public Action TaskTODO
{
get => _taskTODO;
set => _taskTODO = value;
}
internal FrameAsyncTask(Action action, IglFunc gl)
{
_taskTODO = action;
opBuffer = new FrameOperationBuffer(gl);
}
public static SemaphoreSlim CombineAsync(params FrameAsyncTask[] taskList)
{
if (taskList.Length == 0)
{
return null;
}
SemaphoreSlim refresh = new SemaphoreSlim(taskList.Length);
foreach (FrameAsyncTask item in taskList)
{
item._refreshSemaphore = refresh;
}
return refresh;
}
public static SemaphoreSlim CombineAsync(List<FrameAsyncTask> taskList)
{
if (taskList.Count == 0)
{
return null;
}
SemaphoreSlim refresh = new SemaphoreSlim(taskList.Count);
foreach (FrameAsyncTask item in taskList)
{
item._refreshSemaphore = refresh;
}
return refresh;
}
public static void ExchangeBuffer(FrameAsyncTask task0, FrameAsyncTask task1)
@@ -506,25 +551,51 @@ namespace StgSharp.Graphics
task1.opBuffer = cache;
}
public async Task StartAsync()
public virtual SemaphoreSlim StartAsync()
{
_task = new Task(
() =>
{
while (true)
{
_refreshSemaphore.Wait();
_taskTODO();
_frameCompleteSemaphore.Release();
}
});
_task.Start();
await _task;
return _frameCompleteSemaphore;
}
public static SemaphoreSlim CombineAsync(FrameAsyncTask task0, FrameAsyncTask task1)
}
internal sealed class AsyncUpdateDataTask : FrameAsyncTask
{
public AsyncUpdateDataTask(Form f) : base(f.Main, f.GL)
{
SemaphoreSlim refresh = new SemaphoreSlim(2);
task0._refrshSemaphore = refresh;
task1._refrshSemaphore = refresh;
return refresh;
}
public static SemaphoreSlim AsyncWait(FrameAsyncTask task0, FrameAsyncTask task1)
}
internal sealed class AsyncRenderFrameTask : FrameAsyncTask
{
public AsyncRenderFrameTask(Form f) : base(null, f.gl)
{
SemaphoreSlim refresh = new SemaphoreSlim(2);
task0._refrshSemaphore = refresh;
task1._refrshSemaphore = refresh;
return refresh;
TaskTODO = new (
() =>
{
while (true)
{
FrameOperation();
}
});
}
private void FrameOperation()
{
while (opBuffer.CallNext()){}
}
}
@@ -128,6 +128,7 @@ namespace StgSharp.Graphics
#endregion texture setting
}
public enum Filter
@@ -149,7 +149,6 @@ namespace StgSharp.Graphics
}
//TODO 发现一个大问题,paramQueue大多数时候取出的是数组,不是数组句柄,也就是说其内存将被长期固定且不能回收,这是内存泄漏
public unsafe class glArrayHandle
{
+1 -4
View File
@@ -223,7 +223,7 @@ namespace StgSharp.Graphics
default:
InternalIO.InternalWriteLog(
$"{($"Parameter error in parameter {nameof(type)} method DrawElements. ")}{($"Only {typeof(uint).Name},{typeof(ushort).Name},{typeof(byte).Name} types are suporrted.")}",
$"{$"Parameter error in parameter {nameof(type)} method DrawElements. "}{$"Only {typeof(uint).Name},{typeof(ushort).Name},{typeof(byte).Name} types are suporrted."}",
LogType.Error);
return;
}
@@ -333,9 +333,6 @@ namespace StgSharp.Graphics
api->glEnableVertexAttribArray(index);
}
void IglFunc.SwitchContext()
{
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
void IglFunc.TextureImage2d<T>(int target, int level, uint internalformat, uint width, uint height, uint format, uint type, glHandle pixels)
+2 -11
View File
@@ -48,14 +48,9 @@ namespace StgSharp.Graphics
private GLcontext* api;
private FrameOperationBuffer frameOpBuffer;
private glSHandle unupdatedFrame = glSHandle.Alloc(0);
internal GLonUpdate(GLcontext* context)
{
if (frameOpBuffer == null)
{
frameOpBuffer = new FrameOperationBuffer();
}
api = context;
}
@@ -263,7 +258,7 @@ namespace StgSharp.Graphics
default:
InternalIO.InternalWriteLog(
$"{($"Parameter error in parameter {type} method DrawElements. ")}{($"Only {TypeCode.Byte}, {TypeCode.UInt16}, {TypeCode.UInt32} types are suporrted.")}",
$"{$"Parameter error in parameter {type} method DrawElements. "}{$"Only {TypeCode.Byte}, {TypeCode.UInt16}, {TypeCode.UInt32} types are suporrted."}",
LogType.Error);
return;
}
@@ -369,9 +364,6 @@ namespace StgSharp.Graphics
frameOpBuffer.MethodEnqueue(SetVertexArrayPtr);
}
void IglFunc.SwitchContext()
{
}
unsafe void IglFunc.TextureImage2d<T>(int target, int level, uint internalformat, uint width, uint height, uint format, uint type, glHandle pixels)
{
@@ -404,8 +396,7 @@ namespace StgSharp.Graphics
frameOpBuffer.MethodEnqueue(ViewPortPtr);
}
GLcontext* IglFunc.Context
=> api;
GLcontext* IglFunc.Context => api;
}
}
@@ -997,7 +997,7 @@ namespace StgSharp.Graphics
catch (Exception ex)
{
InternalIO.InternalWriteLog(
$"{($"Failed to convert the api {typeof(T).Name}.\n")}{ex.Message}", LogType.Warning);
$"{$"Failed to convert the api {typeof(T).Name}.\n"}{ex.Message}", LogType.Warning);
return default;
}
}
-1
View File
@@ -331,7 +331,6 @@ namespace StgSharp.Graphics
internal void frameworkHandleEnqueue(IntPtr handle, params M128[] param);
internal void SwitchContext();
}
}
@@ -79,6 +79,10 @@ namespace StgSharpDebug.Logic
public abstract void StartProvidingTime();
protected SemaphoreSlim CheckSubscriberSemaphore
{
get => _addSubscriberSemaphore;
}
protected abstract void AddSubscriberUnsynced(TimeSpanProvider subscriber);
protected abstract void RemoveSubscriberUnsynced(TimeSpanProvider subscriber);
+52 -9
View File
@@ -32,6 +32,7 @@ using StgSharpDebug.Logic;
using System;
using System.Linq;
using System.Threading;
namespace StgSharp
{
@@ -48,7 +49,8 @@ namespace StgSharp
private long _spanBegin;
private readonly long _spanLength;
private bool _subscribed;
private Counter<uint> timeSpanCount = new Counter<uint>(0, 1, 1);
private Counter<int> timeSpanCount = new Counter<int>(-1, 1, 1);
private SemaphoreSlim _refreshSemaphore = new SemaphoreSlim(0,1);
/// <summary>
/// Create a new <see cref="TimeSpanProvider"/> and define the length of time span. Length of a single time span is defined in microseconds.
@@ -61,19 +63,36 @@ namespace StgSharp
provider.AddSubscriber(this);
_subscribed = true;
}
/// <summary>
/// Create a new <see cref="TimeSpanProvider"/> and define the length of time span.
/// Length of a single time span is defined in seconds.
/// </summary>
/// <param name="spanLength"></param>
/// <parma name="provider"></parma>
public TimeSpanProvider(double spanLength, TimeSourceProviderBase provider)
{
_spanLength = ((int)spanLength) * 1000L * 1000L; _spanBegin = -_spanLength;
provider.AddSubscriber(this);
_subscribed = true;
}
/// <summary>
/// Create a new <see cref="TimeSpanProvider"/> and define the length of time span. Length of a single time span is defined in microseconds.
/// </summary>
/// <param name="spanLength"></param>
/// <parma name="provider"></parma>
public TimeSpanProvider(long spanLength, uint maxSpan, TimeSourceProviderBase provider)
public TimeSpanProvider(long spanLength, int maxSpan, TimeSourceProviderBase provider)
{
_spanLength = spanLength;
if (maxSpan <= 0)
{
maxSpan = int.MaxValue;
}
_spanLength = spanLength; _spanBegin = -_spanLength;
provider.AddSubscriber(this);
_subscribed = true;
}
/// <summary>
/// Time source provider provided in <see cref="StgSharp"/> internal framework.
/// </summary>
@@ -105,15 +124,39 @@ namespace StgSharp
{
_spanBegin = microseconds;
timeSpanCount++;
}
if (timeSpanCount > _maxSpanCount)
{
return false;
try
{
_refreshSemaphore.Release();
}
catch(SemaphoreFullException ex)
{
if (_frameUpdateMissCallback != null)
{
_frameUpdateMissCallback(ex);
}
}
if (timeSpanCount > _maxSpanCount)
{
return false;
}
}
return true;
}
public static implicit operator uint(TimeSpanProvider provider)
private Action<SemaphoreFullException> _frameUpdateMissCallback = null;
public Action<SemaphoreFullException> FrameUpdateMissCallback
{
get { return _frameUpdateMissCallback; }
set { _frameUpdateMissCallback = value;}
}
public void WaitNextSpan()
{
_refreshSemaphore.Wait();
}
public static implicit operator int(TimeSpanProvider provider)
{
return provider.timeSpanCount.Value;
}
+1 -1
View File
@@ -119,7 +119,7 @@ namespace StgSharp.Math
public override string ToString()
{
InternalTranspose();
return $"{($"[{mat.m00},{mat.m01},{mat.m02},{mat.m03}],")}{($"[{mat.m10},{mat.m11},{mat.m12},{mat.m13}]")}";
return $"{$"[{mat.m00},{mat.m01},{mat.m02},{mat.m03}],"}{$"[{mat.m10},{mat.m11},{mat.m12},{mat.m13}]"}";
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -50,6 +50,18 @@
Width of this form, represent in <see cref="T:System.Int32"/>
</summary>
</member>
<member name="M:StgSharp.Graphics.Form.Init(System.Object[])">
<summary>
Necessary operation to init this form.
</summary>
<param name="args"></param>
</member>
<member name="M:StgSharp.Graphics.Form.Main">
<summary>
Behaviour of current form when in a frame cycle.
</summary>
<param name="args"></param>
</member>
<member name="M:StgSharp.Graphics.Form.MakeAsCurrentContext">
<summary>
Init an OpenGl context if current form has not been binded to any context. and set the context binded to
@@ -99,19 +111,7 @@
<param name="maxWidth">Maximum width of curent form</param>
<param name="maxHeight">Maximum height of current form</param>
</member>
<member name="M:StgSharp.Graphics.Form.Init(System.Object[])">
<summary>
Necessary operation to init this form.
</summary>
<param name="args"></param>
</member>
<member name="M:StgSharp.Graphics.Form.Main(System.Object[])">
<summary>
Behaviour of current form when in a render cycle. When this form
</summary>
<param name="args"></param>
</member>
<member name="M:StgSharp.Graphics.Form.Show(System.Object[])">
<member name="M:StgSharp.Graphics.Form.Show">
<summary>
Init this form and render it on screen, and respond with operation
</summary>
@@ -137,13 +137,6 @@
<param name="count">Amount of EBO to be created.</param>
<returns></returns>
</member>
<member name="M:StgSharp.Graphics.Form.CreateVertexArray(System.Int32)">
<summary>
Create a set of <see cref="T:StgSharp.Graphics.VertexArray"/>.
</summary>
<param name="count">Amount of VAO to be crated.</param>
<returns></returns>
</member>
<member name="M:StgSharp.Graphics.Form.CreateTexture(System.Int32)">
<summary>
Create a sets of <see cref="T:StgSharp.Graphics.Texture"/>
@@ -151,6 +144,13 @@
<param name="count">Amount of textures to be crated.</param>
<returns></returns>
</member>
<member name="M:StgSharp.Graphics.Form.CreateVertexArray(System.Int32)">
<summary>
Create a set of <see cref="T:StgSharp.Graphics.VertexArray"/>.
</summary>
<param name="count">Amount of VAO to be crated.</param>
<returns></returns>
</member>
<member name="M:StgSharp.Graphics.Form.CreateVertexBuffer(System.Int32)">
<summary>
Create aset of <see cref="T:StgSharp.Graphics.VertexBuffer"/>.
@@ -273,11 +273,6 @@
Inti a shader with no program attached.
</summary>
</member>
<member name="M:StgSharp.Graphics.ShaderProgram.Link">
<summary>
Link the shader to current context.
</summary>
</member>
<member name="M:StgSharp.Graphics.ShaderProgram.GetUniform``1(System.String)">
<summary>
Get a uniform form current shader,
@@ -302,6 +297,11 @@
<param name="name">Name of the Uniform in shader code</param>
<returns></returns>
</member>
<member name="M:StgSharp.Graphics.ShaderProgram.Link">
<summary>
Link the shader to current context.
</summary>
</member>
<member name="M:StgSharp.Graphics.ShaderProgram.Use">
<summary>
Let the current context use this shader.
@@ -466,17 +466,6 @@
</summary>
<param name="form"></param>
</member>
<member name="M:StgSharp.Graphics.IglFunc.SetValue(StgSharp.Graphics.Uniform{System.Single,System.Single,System.Single,System.Single},System.Single,System.Single,System.Single,System.Single)">
<summary>
Set data value to a float <see cref="T:StgSharp.Graphics.Uniform`4"/>,
all types of parameters are float.
</summary>
<param name="uniform">The <see cref="T:StgSharp.Graphics.Uniform`4"/> target</param>
<param name="v0">The first value to be set</param>
<param name="v1">The second value to be set</param>
<param name="v2">The third value to be set</param>
<param name="v3">The forth value to be set</param>
</member>
<member name="M:StgSharp.Graphics.IglFunc.SetValue(StgSharp.Graphics.Uniform{System.Single,System.Single,System.Single,System.Single},StgSharp.Math.Vec4d)">
<summary>
Set data value to a float <see cref="T:StgSharp.Graphics.Uniform`4"/>,
@@ -485,25 +474,6 @@
<param name="uniform">The <see cref="T:StgSharp.Graphics.Uniform`4"/> target</param>
<param name="vec">A <see cref="T:StgSharp.Math.Vec4d"/> packing four parameters of the uniform </param>
</member>
<member name="M:StgSharp.Graphics.IglFunc.SetValue(StgSharp.Graphics.Uniform{System.Single,System.Single,System.Single},System.Single,System.Single,System.Single)">
<summary>
Set data value to a float <see cref="T:StgSharp.Graphics.Uniform`3"/>,
all types of parameters are float.
</summary>
<param name="uniform">The <see cref="T:StgSharp.Graphics.Uniform`3"/> target</param>
<param name="v0">The first value to be set</param>
<param name="v1">The second value to be set</param>
<param name="v2">The third value to be set</param>
</member>
<member name="M:StgSharp.Graphics.IglFunc.SetValue(StgSharp.Graphics.Uniform{System.Single,System.Single},System.Single,System.Single)">
<summary>
Set data value to a float <see cref="T:StgSharp.Graphics.Uniform`2"/>,
all types of parameters are float.
</summary>
<param name="uniform">The <see cref="T:StgSharp.Graphics.Uniform`2"/> target</param>
<param name="v0">The first value to be set</param>
<param name="v1">The second value to be set</param>
</member>
<member name="M:StgSharp.Graphics.IglFunc.SetValue(StgSharp.Graphics.Uniform{System.Single},System.Single)">
<summary>
Set data value to a float <see cref="T:StgSharp.Graphics.Uniform`1"/>,
@@ -528,6 +498,36 @@
<param name="uniform">The <see cref="T:StgSharp.Graphics.Uniform`1"/> target</param>
<param name="vec">A <see cref="T:StgSharp.Math.Vec4d"/> value of the uniform </param>
</member>
<member name="M:StgSharp.Graphics.IglFunc.SetValue(StgSharp.Graphics.Uniform{System.Single,System.Single},System.Single,System.Single)">
<summary>
Set data value to a float <see cref="T:StgSharp.Graphics.Uniform`2"/>,
all types of parameters are float.
</summary>
<param name="uniform">The <see cref="T:StgSharp.Graphics.Uniform`2"/> target</param>
<param name="v0">The first value to be set</param>
<param name="v1">The second value to be set</param>
</member>
<member name="M:StgSharp.Graphics.IglFunc.SetValue(StgSharp.Graphics.Uniform{System.Single,System.Single,System.Single},System.Single,System.Single,System.Single)">
<summary>
Set data value to a float <see cref="T:StgSharp.Graphics.Uniform`3"/>,
all types of parameters are float.
</summary>
<param name="uniform">The <see cref="T:StgSharp.Graphics.Uniform`3"/> target</param>
<param name="v0">The first value to be set</param>
<param name="v1">The second value to be set</param>
<param name="v2">The third value to be set</param>
</member>
<member name="M:StgSharp.Graphics.IglFunc.SetValue(StgSharp.Graphics.Uniform{System.Single,System.Single,System.Single,System.Single},System.Single,System.Single,System.Single,System.Single)">
<summary>
Set data value to a float <see cref="T:StgSharp.Graphics.Uniform`4"/>,
all types of parameters are float.
</summary>
<param name="uniform">The <see cref="T:StgSharp.Graphics.Uniform`4"/> target</param>
<param name="v0">The first value to be set</param>
<param name="v1">The second value to be set</param>
<param name="v2">The third value to be set</param>
<param name="v3">The forth value to be set</param>
</member>
<member name="M:StgSharp.Graphics.IglFunc.SetVertexAttribute(System.UInt32,System.Int32,System.TypeCode,System.Boolean,System.UInt32,System.Int32)">
<summary>
Set how a shader parameter read data from a VBO.
@@ -654,7 +654,7 @@
<param name="tick">The game tick represent time passed by</param>
<returns>A 3d vector representing movement</returns>
</member>
<member name="M:StgSharp.Geometries.Line.MoveBeginPoint(System.UInt32)">
<member name="M:StgSharp.Geometries.Line.MoveBeginPoint(System.Int32)">
<summary>
Move begin side of a line.
It is recommended to override this function rather than
@@ -662,7 +662,7 @@
</summary>
<param name="tick">Time passed since current line was created.</param>
</member>
<member name="M:StgSharp.Geometries.Line.MoveEndPoint(System.UInt32)">
<member name="M:StgSharp.Geometries.Line.MoveEndPoint(System.Int32)">
<summary>
Move end side of a line.
It is recommended to override this function rather than
@@ -671,7 +671,7 @@
<param name="tick">Time passed since current line was created.</param>
<returns></returns>
</member>
<member name="M:StgSharp.Geometries.Parallelogram.MoveVertex2(System.UInt32)">
<member name="M:StgSharp.Geometries.Parallelogram.MoveVertex2(System.Int32)">
<summary>
Move the third vertix. this is a useless method for Parallelograms.
</summary>
@@ -679,7 +679,7 @@
<returns></returns>
<exception cref="T:StgSharp.Geometries.UnusedVertexException">Geometry overdefined</exception>
</member>
<member name="M:StgSharp.Geometries.Parallelogram.MoveVertex3(System.UInt32)">
<member name="M:StgSharp.Geometries.Parallelogram.MoveVertex3(System.Int32)">
<summary>
Move the third vertix. This method is useless for Parallelograms.
</summary>
@@ -692,6 +692,11 @@
平面几何体。包含三角形,对称四边形,自由多边形等。最多可由16个点参数定义。
</summary>
</member>
<member name="P:StgSharp.Geometries.PlainGeometry.BornTime">
<summary>
Tick time this geometry eas crested
</summary>
</member>
<member name="M:StgSharp.Geometries.PlainGeometry.GetAllSides">
<summary>
Get all sides of this <see cref="T:StgSharp.Geometries.PlainGeometry"/>.
@@ -704,11 +709,6 @@
</summary>
<returns></returns>
</member>
<member name="P:StgSharp.Geometries.PlainGeometry.BornTime">
<summary>
Tick time this geometry eas crested
</summary>
</member>
<member name="M:StgSharp.Geometries.Point.Update(System.UInt32)">
<summary>
Update the coordinate of the point. If this is a moving point,
@@ -778,25 +778,41 @@
The second <see cref="T:System.Boolean"/> value.
</summary>
</member>
<member name="T:StgSharp.TimeProvider">
<member name="T:StgSharp.TimeSpanProvider">
<summary>
A microsecond-accuracy timer. It will refresh every a certain time span.
</summary>
</member>
<member name="M:StgSharp.TimeProvider.#ctor(System.Int64,StgSharp.TimeSourceProvider)">
<member name="M:StgSharp.TimeSpanProvider.#ctor(System.Int64,StgSharpDebug.Logic.TimeSourceProviderBase)">
<summary>
Create a new <see cref="T:StgSharp.TimeProvider"/> and define the length of time span. Length of a single time span is defined in microseconds.
Create a new <see cref="T:StgSharp.TimeSpanProvider"/> and define the length of time span. Length of a single time span is defined in microseconds.
</summary>
<param name="spanLength"></param>
<parma name="provider"></parma>
</member>
<member name="P:StgSharp.TimeProvider.DefaultProvider">
<member name="M:StgSharp.TimeSpanProvider.#ctor(System.Double,StgSharpDebug.Logic.TimeSourceProviderBase)">
<summary>
Create a new <see cref="T:StgSharp.TimeSpanProvider"/> and define the length of time span.
Length of a single time span is defined in seconds.
</summary>
<param name="spanLength"></param>
<parma name="provider"></parma>
</member>
<member name="M:StgSharp.TimeSpanProvider.#ctor(System.Int64,System.Int32,StgSharpDebug.Logic.TimeSourceProviderBase)">
<summary>
Create a new <see cref="T:StgSharp.TimeSpanProvider"/> and define the length of time span. Length of a single time span is defined in microseconds.
</summary>
<param name="spanLength"></param>
<parma name="provider"></parma>
</member>
<member name="P:StgSharp.TimeSpanProvider.DefaultProvider">
<summary>
Time source provider provided in <see cref="T:StgSharp.StgSharp"/> internal framework.
</summary>
</member>
<member name="P:StgSharp.TimeProvider.SpanRefreshCallback">
<member name="P:StgSharp.TimeSpanProvider.SpanRefreshCallback">
<summary>
The method this <see cref="T:StgSharp.TimeProvider"/> will call every time a new time span started.
The method this <see cref="T:StgSharp.TimeSpanProvider"/> will call every time a new time span started.
</summary>
</member>
<member name="T:StgSharp.Math.GLclampf">
@@ -849,18 +865,18 @@
<param name="y"></param>
<returns>Returns the value of x^y</returns>
</member>
<member name="M:StgSharp.Math.Scaler.Random">
<summary>
</summary>
<returns></returns>
</member>
<member name="M:StgSharp.Math.Scaler.LowProceisionRandom">
<summary>
returns a random float number between 0 and 1.
</summary>
<returns></returns>
</member>
<member name="M:StgSharp.Math.Scaler.Random">
<summary>
</summary>
<returns></returns>
</member>
<member name="M:StgSharp.Math.Scaler.RandomSeed">
<summary>
Generates a random seed in int value.
@@ -44,7 +44,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+15bf989285b01c5617b5f5612667e0da6a2b1781")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+0c50c6282e58714d20a68c1b2346c6dcec49af41")]
[assembly: System.Reflection.AssemblyProductAttribute("StgSharp")]
[assembly: System.Reflection.AssemblyTitleAttribute("StgSharp")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
@@ -1 +1 @@
a5fb7efba2f765dd708647c8b1db6590919a361aa8faa70d0f2be4d86bb8ef88
2d5ea9ef2f157207bf6ee00ab84f624a9e25fd320dfc78958779a7efb72477d0
@@ -1 +1 @@
{"documents":{"D:\\NitloadIndustry\\研究项目\\1-Flagship\\TH2020\\ProjectFile\\*":"https://raw.githubusercontent.com/Nitload-NSI/CCD_Github/15bf989285b01c5617b5f5612667e0da6a2b1781/*"}}
{"documents":{"D:\\NitloadIndustry\\研究项目\\1-Flagship\\TH2020\\ProjectFile\\*":"https://raw.githubusercontent.com/Nitload-NSI/CCD_Github/0c50c6282e58714d20a68c1b2346c6dcec49af41/*"}}
@@ -50,6 +50,18 @@
Width of this form, represent in <see cref="T:System.Int32"/>
</summary>
</member>
<member name="M:StgSharp.Graphics.Form.Init(System.Object[])">
<summary>
Necessary operation to init this form.
</summary>
<param name="args"></param>
</member>
<member name="M:StgSharp.Graphics.Form.Main">
<summary>
Behaviour of current form when in a frame cycle.
</summary>
<param name="args"></param>
</member>
<member name="M:StgSharp.Graphics.Form.MakeAsCurrentContext">
<summary>
Init an OpenGl context if current form has not been binded to any context. and set the context binded to
@@ -99,19 +111,7 @@
<param name="maxWidth">Maximum width of curent form</param>
<param name="maxHeight">Maximum height of current form</param>
</member>
<member name="M:StgSharp.Graphics.Form.Init(System.Object[])">
<summary>
Necessary operation to init this form.
</summary>
<param name="args"></param>
</member>
<member name="M:StgSharp.Graphics.Form.Main(System.Object[])">
<summary>
Behaviour of current form when in a render cycle. When this form
</summary>
<param name="args"></param>
</member>
<member name="M:StgSharp.Graphics.Form.Show(System.Object[])">
<member name="M:StgSharp.Graphics.Form.Show">
<summary>
Init this form and render it on screen, and respond with operation
</summary>
@@ -137,13 +137,6 @@
<param name="count">Amount of EBO to be created.</param>
<returns></returns>
</member>
<member name="M:StgSharp.Graphics.Form.CreateVertexArray(System.Int32)">
<summary>
Create a set of <see cref="T:StgSharp.Graphics.VertexArray"/>.
</summary>
<param name="count">Amount of VAO to be crated.</param>
<returns></returns>
</member>
<member name="M:StgSharp.Graphics.Form.CreateTexture(System.Int32)">
<summary>
Create a sets of <see cref="T:StgSharp.Graphics.Texture"/>
@@ -151,6 +144,13 @@
<param name="count">Amount of textures to be crated.</param>
<returns></returns>
</member>
<member name="M:StgSharp.Graphics.Form.CreateVertexArray(System.Int32)">
<summary>
Create a set of <see cref="T:StgSharp.Graphics.VertexArray"/>.
</summary>
<param name="count">Amount of VAO to be crated.</param>
<returns></returns>
</member>
<member name="M:StgSharp.Graphics.Form.CreateVertexBuffer(System.Int32)">
<summary>
Create aset of <see cref="T:StgSharp.Graphics.VertexBuffer"/>.
@@ -273,11 +273,6 @@
Inti a shader with no program attached.
</summary>
</member>
<member name="M:StgSharp.Graphics.ShaderProgram.Link">
<summary>
Link the shader to current context.
</summary>
</member>
<member name="M:StgSharp.Graphics.ShaderProgram.GetUniform``1(System.String)">
<summary>
Get a uniform form current shader,
@@ -302,6 +297,11 @@
<param name="name">Name of the Uniform in shader code</param>
<returns></returns>
</member>
<member name="M:StgSharp.Graphics.ShaderProgram.Link">
<summary>
Link the shader to current context.
</summary>
</member>
<member name="M:StgSharp.Graphics.ShaderProgram.Use">
<summary>
Let the current context use this shader.
@@ -466,17 +466,6 @@
</summary>
<param name="form"></param>
</member>
<member name="M:StgSharp.Graphics.IglFunc.SetValue(StgSharp.Graphics.Uniform{System.Single,System.Single,System.Single,System.Single},System.Single,System.Single,System.Single,System.Single)">
<summary>
Set data value to a float <see cref="T:StgSharp.Graphics.Uniform`4"/>,
all types of parameters are float.
</summary>
<param name="uniform">The <see cref="T:StgSharp.Graphics.Uniform`4"/> target</param>
<param name="v0">The first value to be set</param>
<param name="v1">The second value to be set</param>
<param name="v2">The third value to be set</param>
<param name="v3">The forth value to be set</param>
</member>
<member name="M:StgSharp.Graphics.IglFunc.SetValue(StgSharp.Graphics.Uniform{System.Single,System.Single,System.Single,System.Single},StgSharp.Math.Vec4d)">
<summary>
Set data value to a float <see cref="T:StgSharp.Graphics.Uniform`4"/>,
@@ -485,25 +474,6 @@
<param name="uniform">The <see cref="T:StgSharp.Graphics.Uniform`4"/> target</param>
<param name="vec">A <see cref="T:StgSharp.Math.Vec4d"/> packing four parameters of the uniform </param>
</member>
<member name="M:StgSharp.Graphics.IglFunc.SetValue(StgSharp.Graphics.Uniform{System.Single,System.Single,System.Single},System.Single,System.Single,System.Single)">
<summary>
Set data value to a float <see cref="T:StgSharp.Graphics.Uniform`3"/>,
all types of parameters are float.
</summary>
<param name="uniform">The <see cref="T:StgSharp.Graphics.Uniform`3"/> target</param>
<param name="v0">The first value to be set</param>
<param name="v1">The second value to be set</param>
<param name="v2">The third value to be set</param>
</member>
<member name="M:StgSharp.Graphics.IglFunc.SetValue(StgSharp.Graphics.Uniform{System.Single,System.Single},System.Single,System.Single)">
<summary>
Set data value to a float <see cref="T:StgSharp.Graphics.Uniform`2"/>,
all types of parameters are float.
</summary>
<param name="uniform">The <see cref="T:StgSharp.Graphics.Uniform`2"/> target</param>
<param name="v0">The first value to be set</param>
<param name="v1">The second value to be set</param>
</member>
<member name="M:StgSharp.Graphics.IglFunc.SetValue(StgSharp.Graphics.Uniform{System.Single},System.Single)">
<summary>
Set data value to a float <see cref="T:StgSharp.Graphics.Uniform`1"/>,
@@ -528,6 +498,36 @@
<param name="uniform">The <see cref="T:StgSharp.Graphics.Uniform`1"/> target</param>
<param name="vec">A <see cref="T:StgSharp.Math.Vec4d"/> value of the uniform </param>
</member>
<member name="M:StgSharp.Graphics.IglFunc.SetValue(StgSharp.Graphics.Uniform{System.Single,System.Single},System.Single,System.Single)">
<summary>
Set data value to a float <see cref="T:StgSharp.Graphics.Uniform`2"/>,
all types of parameters are float.
</summary>
<param name="uniform">The <see cref="T:StgSharp.Graphics.Uniform`2"/> target</param>
<param name="v0">The first value to be set</param>
<param name="v1">The second value to be set</param>
</member>
<member name="M:StgSharp.Graphics.IglFunc.SetValue(StgSharp.Graphics.Uniform{System.Single,System.Single,System.Single},System.Single,System.Single,System.Single)">
<summary>
Set data value to a float <see cref="T:StgSharp.Graphics.Uniform`3"/>,
all types of parameters are float.
</summary>
<param name="uniform">The <see cref="T:StgSharp.Graphics.Uniform`3"/> target</param>
<param name="v0">The first value to be set</param>
<param name="v1">The second value to be set</param>
<param name="v2">The third value to be set</param>
</member>
<member name="M:StgSharp.Graphics.IglFunc.SetValue(StgSharp.Graphics.Uniform{System.Single,System.Single,System.Single,System.Single},System.Single,System.Single,System.Single,System.Single)">
<summary>
Set data value to a float <see cref="T:StgSharp.Graphics.Uniform`4"/>,
all types of parameters are float.
</summary>
<param name="uniform">The <see cref="T:StgSharp.Graphics.Uniform`4"/> target</param>
<param name="v0">The first value to be set</param>
<param name="v1">The second value to be set</param>
<param name="v2">The third value to be set</param>
<param name="v3">The forth value to be set</param>
</member>
<member name="M:StgSharp.Graphics.IglFunc.SetVertexAttribute(System.UInt32,System.Int32,System.TypeCode,System.Boolean,System.UInt32,System.Int32)">
<summary>
Set how a shader parameter read data from a VBO.
@@ -654,7 +654,7 @@
<param name="tick">The game tick represent time passed by</param>
<returns>A 3d vector representing movement</returns>
</member>
<member name="M:StgSharp.Geometries.Line.MoveBeginPoint(System.UInt32)">
<member name="M:StgSharp.Geometries.Line.MoveBeginPoint(System.Int32)">
<summary>
Move begin side of a line.
It is recommended to override this function rather than
@@ -662,7 +662,7 @@
</summary>
<param name="tick">Time passed since current line was created.</param>
</member>
<member name="M:StgSharp.Geometries.Line.MoveEndPoint(System.UInt32)">
<member name="M:StgSharp.Geometries.Line.MoveEndPoint(System.Int32)">
<summary>
Move end side of a line.
It is recommended to override this function rather than
@@ -671,7 +671,7 @@
<param name="tick">Time passed since current line was created.</param>
<returns></returns>
</member>
<member name="M:StgSharp.Geometries.Parallelogram.MoveVertex2(System.UInt32)">
<member name="M:StgSharp.Geometries.Parallelogram.MoveVertex2(System.Int32)">
<summary>
Move the third vertix. this is a useless method for Parallelograms.
</summary>
@@ -679,7 +679,7 @@
<returns></returns>
<exception cref="T:StgSharp.Geometries.UnusedVertexException">Geometry overdefined</exception>
</member>
<member name="M:StgSharp.Geometries.Parallelogram.MoveVertex3(System.UInt32)">
<member name="M:StgSharp.Geometries.Parallelogram.MoveVertex3(System.Int32)">
<summary>
Move the third vertix. This method is useless for Parallelograms.
</summary>
@@ -692,6 +692,11 @@
平面几何体。包含三角形,对称四边形,自由多边形等。最多可由16个点参数定义。
</summary>
</member>
<member name="P:StgSharp.Geometries.PlainGeometry.BornTime">
<summary>
Tick time this geometry eas crested
</summary>
</member>
<member name="M:StgSharp.Geometries.PlainGeometry.GetAllSides">
<summary>
Get all sides of this <see cref="T:StgSharp.Geometries.PlainGeometry"/>.
@@ -704,11 +709,6 @@
</summary>
<returns></returns>
</member>
<member name="P:StgSharp.Geometries.PlainGeometry.BornTime">
<summary>
Tick time this geometry eas crested
</summary>
</member>
<member name="M:StgSharp.Geometries.Point.Update(System.UInt32)">
<summary>
Update the coordinate of the point. If this is a moving point,
@@ -778,25 +778,41 @@
The second <see cref="T:System.Boolean"/> value.
</summary>
</member>
<member name="T:StgSharp.TimeProvider">
<member name="T:StgSharp.TimeSpanProvider">
<summary>
A microsecond-accuracy timer. It will refresh every a certain time span.
</summary>
</member>
<member name="M:StgSharp.TimeProvider.#ctor(System.Int64,StgSharp.TimeSourceProvider)">
<member name="M:StgSharp.TimeSpanProvider.#ctor(System.Int64,StgSharpDebug.Logic.TimeSourceProviderBase)">
<summary>
Create a new <see cref="T:StgSharp.TimeProvider"/> and define the length of time span. Length of a single time span is defined in microseconds.
Create a new <see cref="T:StgSharp.TimeSpanProvider"/> and define the length of time span. Length of a single time span is defined in microseconds.
</summary>
<param name="spanLength"></param>
<parma name="provider"></parma>
</member>
<member name="P:StgSharp.TimeProvider.DefaultProvider">
<member name="M:StgSharp.TimeSpanProvider.#ctor(System.Double,StgSharpDebug.Logic.TimeSourceProviderBase)">
<summary>
Create a new <see cref="T:StgSharp.TimeSpanProvider"/> and define the length of time span.
Length of a single time span is defined in seconds.
</summary>
<param name="spanLength"></param>
<parma name="provider"></parma>
</member>
<member name="M:StgSharp.TimeSpanProvider.#ctor(System.Int64,System.Int32,StgSharpDebug.Logic.TimeSourceProviderBase)">
<summary>
Create a new <see cref="T:StgSharp.TimeSpanProvider"/> and define the length of time span. Length of a single time span is defined in microseconds.
</summary>
<param name="spanLength"></param>
<parma name="provider"></parma>
</member>
<member name="P:StgSharp.TimeSpanProvider.DefaultProvider">
<summary>
Time source provider provided in <see cref="T:StgSharp.StgSharp"/> internal framework.
</summary>
</member>
<member name="P:StgSharp.TimeProvider.SpanRefreshCallback">
<member name="P:StgSharp.TimeSpanProvider.SpanRefreshCallback">
<summary>
The method this <see cref="T:StgSharp.TimeProvider"/> will call every time a new time span started.
The method this <see cref="T:StgSharp.TimeSpanProvider"/> will call every time a new time span started.
</summary>
</member>
<member name="T:StgSharp.Math.GLclampf">
@@ -849,18 +865,18 @@
<param name="y"></param>
<returns>Returns the value of x^y</returns>
</member>
<member name="M:StgSharp.Math.Scaler.Random">
<summary>
</summary>
<returns></returns>
</member>
<member name="M:StgSharp.Math.Scaler.LowProceisionRandom">
<summary>
returns a random float number between 0 and 1.
</summary>
<returns></returns>
</member>
<member name="M:StgSharp.Math.Scaler.Random">
<summary>
</summary>
<returns></returns>
</member>
<member name="M:StgSharp.Math.Scaler.RandomSeed">
<summary>
Generates a random seed in int value.