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
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large Load Diff
Binary file not shown.
File diff suppressed because it is too large Load Diff
@@ -11,7 +11,7 @@ uniform vec3 color;
void main() void main()
{ {
gl_Position = vec4(aPos.xyz,1.0); gl_Position = vec4(aPos.xyz,1.0) + vec4(color.xy-vec2(0.5,0.5),0.0,0.0);
TexColor = color; TexColor = color;
TexCoord = aTextCoord; TexCoord = aTextCoord;
} }
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -50,6 +50,18 @@
Width of this form, represent in <see cref="T:System.Int32"/> Width of this form, represent in <see cref="T:System.Int32"/>
</summary> </summary>
</member> </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"> <member name="M:StgSharp.Graphics.Form.MakeAsCurrentContext">
<summary> <summary>
Init an OpenGl context if current form has not been binded to any context. and set the context binded to 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="maxWidth">Maximum width of curent form</param>
<param name="maxHeight">Maximum height of current form</param> <param name="maxHeight">Maximum height of current form</param>
</member> </member>
<member name="M:StgSharp.Graphics.Form.Init(System.Object[])"> <member name="M:StgSharp.Graphics.Form.Show">
<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[])">
<summary> <summary>
Init this form and render it on screen, and respond with operation Init this form and render it on screen, and respond with operation
</summary> </summary>
@@ -137,13 +137,6 @@
<param name="count">Amount of EBO to be created.</param> <param name="count">Amount of EBO to be created.</param>
<returns></returns> <returns></returns>
</member> </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)"> <member name="M:StgSharp.Graphics.Form.CreateTexture(System.Int32)">
<summary> <summary>
Create a sets of <see cref="T:StgSharp.Graphics.Texture"/> Create a sets of <see cref="T:StgSharp.Graphics.Texture"/>
@@ -151,6 +144,13 @@
<param name="count">Amount of textures to be crated.</param> <param name="count">Amount of textures to be crated.</param>
<returns></returns> <returns></returns>
</member> </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)"> <member name="M:StgSharp.Graphics.Form.CreateVertexBuffer(System.Int32)">
<summary> <summary>
Create aset of <see cref="T:StgSharp.Graphics.VertexBuffer"/>. Create aset of <see cref="T:StgSharp.Graphics.VertexBuffer"/>.
@@ -273,11 +273,6 @@
Inti a shader with no program attached. Inti a shader with no program attached.
</summary> </summary>
</member> </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)"> <member name="M:StgSharp.Graphics.ShaderProgram.GetUniform``1(System.String)">
<summary> <summary>
Get a uniform form current shader, Get a uniform form current shader,
@@ -302,6 +297,11 @@
<param name="name">Name of the Uniform in shader code</param> <param name="name">Name of the Uniform in shader code</param>
<returns></returns> <returns></returns>
</member> </member>
<member name="M:StgSharp.Graphics.ShaderProgram.Link">
<summary>
Link the shader to current context.
</summary>
</member>
<member name="M:StgSharp.Graphics.ShaderProgram.Use"> <member name="M:StgSharp.Graphics.ShaderProgram.Use">
<summary> <summary>
Let the current context use this shader. Let the current context use this shader.
@@ -466,17 +466,6 @@
</summary> </summary>
<param name="form"></param> <param name="form"></param>
</member> </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)"> <member name="M:StgSharp.Graphics.IglFunc.SetValue(StgSharp.Graphics.Uniform{System.Single,System.Single,System.Single,System.Single},StgSharp.Math.Vec4d)">
<summary> <summary>
Set data value to a float <see cref="T:StgSharp.Graphics.Uniform`4"/>, 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="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> <param name="vec">A <see cref="T:StgSharp.Math.Vec4d"/> packing four parameters of the uniform </param>
</member> </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)"> <member name="M:StgSharp.Graphics.IglFunc.SetValue(StgSharp.Graphics.Uniform{System.Single},System.Single)">
<summary> <summary>
Set data value to a float <see cref="T:StgSharp.Graphics.Uniform`1"/>, 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="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> <param name="vec">A <see cref="T:StgSharp.Math.Vec4d"/> value of the uniform </param>
</member> </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)"> <member name="M:StgSharp.Graphics.IglFunc.SetVertexAttribute(System.UInt32,System.Int32,System.TypeCode,System.Boolean,System.UInt32,System.Int32)">
<summary> <summary>
Set how a shader parameter read data from a VBO. 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> <param name="tick">The game tick represent time passed by</param>
<returns>A 3d vector representing movement</returns> <returns>A 3d vector representing movement</returns>
</member> </member>
<member name="M:StgSharp.Geometries.Line.MoveBeginPoint(System.UInt32)"> <member name="M:StgSharp.Geometries.Line.MoveBeginPoint(System.Int32)">
<summary> <summary>
Move begin side of a line. Move begin side of a line.
It is recommended to override this function rather than It is recommended to override this function rather than
@@ -662,7 +662,7 @@
</summary> </summary>
<param name="tick">Time passed since current line was created.</param> <param name="tick">Time passed since current line was created.</param>
</member> </member>
<member name="M:StgSharp.Geometries.Line.MoveEndPoint(System.UInt32)"> <member name="M:StgSharp.Geometries.Line.MoveEndPoint(System.Int32)">
<summary> <summary>
Move end side of a line. Move end side of a line.
It is recommended to override this function rather than It is recommended to override this function rather than
@@ -671,7 +671,7 @@
<param name="tick">Time passed since current line was created.</param> <param name="tick">Time passed since current line was created.</param>
<returns></returns> <returns></returns>
</member> </member>
<member name="M:StgSharp.Geometries.Parallelogram.MoveVertex2(System.UInt32)"> <member name="M:StgSharp.Geometries.Parallelogram.MoveVertex2(System.Int32)">
<summary> <summary>
Move the third vertix. this is a useless method for Parallelograms. Move the third vertix. this is a useless method for Parallelograms.
</summary> </summary>
@@ -679,7 +679,7 @@
<returns></returns> <returns></returns>
<exception cref="T:StgSharp.Geometries.UnusedVertexException">Geometry overdefined</exception> <exception cref="T:StgSharp.Geometries.UnusedVertexException">Geometry overdefined</exception>
</member> </member>
<member name="M:StgSharp.Geometries.Parallelogram.MoveVertex3(System.UInt32)"> <member name="M:StgSharp.Geometries.Parallelogram.MoveVertex3(System.Int32)">
<summary> <summary>
Move the third vertix. This method is useless for Parallelograms. Move the third vertix. This method is useless for Parallelograms.
</summary> </summary>
@@ -692,6 +692,11 @@
平面几何体。包含三角形,对称四边形,自由多边形等。最多可由16个点参数定义。 平面几何体。包含三角形,对称四边形,自由多边形等。最多可由16个点参数定义。
</summary> </summary>
</member> </member>
<member name="P:StgSharp.Geometries.PlainGeometry.BornTime">
<summary>
Tick time this geometry eas crested
</summary>
</member>
<member name="M:StgSharp.Geometries.PlainGeometry.GetAllSides"> <member name="M:StgSharp.Geometries.PlainGeometry.GetAllSides">
<summary> <summary>
Get all sides of this <see cref="T:StgSharp.Geometries.PlainGeometry"/>. Get all sides of this <see cref="T:StgSharp.Geometries.PlainGeometry"/>.
@@ -704,11 +709,6 @@
</summary> </summary>
<returns></returns> <returns></returns>
</member> </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)"> <member name="M:StgSharp.Geometries.Point.Update(System.UInt32)">
<summary> <summary>
Update the coordinate of the point. If this is a moving point, Update the coordinate of the point. If this is a moving point,
@@ -778,25 +778,41 @@
The second <see cref="T:System.Boolean"/> value. The second <see cref="T:System.Boolean"/> value.
</summary> </summary>
</member> </member>
<member name="T:StgSharp.TimeProvider"> <member name="T:StgSharp.TimeSpanProvider">
<summary> <summary>
A microsecond-accuracy timer. It will refresh every a certain time span. A microsecond-accuracy timer. It will refresh every a certain time span.
</summary> </summary>
</member> </member>
<member name="M:StgSharp.TimeProvider.#ctor(System.Int64,StgSharp.TimeSourceProvider)"> <member name="M:StgSharp.TimeSpanProvider.#ctor(System.Int64,StgSharpDebug.Logic.TimeSourceProviderBase)">
<summary> <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> </summary>
<param name="spanLength"></param> <param name="spanLength"></param>
<parma name="provider"></parma>
</member> </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> <summary>
Time source provider provided in <see cref="T:StgSharp.StgSharp"/> internal framework. Time source provider provided in <see cref="T:StgSharp.StgSharp"/> internal framework.
</summary> </summary>
</member> </member>
<member name="P:StgSharp.TimeProvider.SpanRefreshCallback"> <member name="P:StgSharp.TimeSpanProvider.SpanRefreshCallback">
<summary> <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> </summary>
</member> </member>
<member name="T:StgSharp.Math.GLclampf"> <member name="T:StgSharp.Math.GLclampf">
@@ -849,18 +865,18 @@
<param name="y"></param> <param name="y"></param>
<returns>Returns the value of x^y</returns> <returns>Returns the value of x^y</returns>
</member> </member>
<member name="M:StgSharp.Math.Scaler.Random">
<summary>
</summary>
<returns></returns>
</member>
<member name="M:StgSharp.Math.Scaler.LowProceisionRandom"> <member name="M:StgSharp.Math.Scaler.LowProceisionRandom">
<summary> <summary>
returns a random float number between 0 and 1. returns a random float number between 0 and 1.
</summary> </summary>
<returns></returns> <returns></returns>
</member> </member>
<member name="M:StgSharp.Math.Scaler.Random">
<summary>
</summary>
<returns></returns>
</member>
<member name="M:StgSharp.Math.Scaler.RandomSeed"> <member name="M:StgSharp.Math.Scaler.RandomSeed">
<summary> <summary>
Generates a random seed in int value. Generates a random seed in int value.
@@ -39,6 +39,7 @@ namespace StgSharp
{ {
public static unsafe partial class StgSharp public static unsafe partial class StgSharp
{ {
private static bool _inited;
/// <summary> /// <summary>
/// Init an instance of OpenGL program, /// Init an instance of OpenGL program,
@@ -78,6 +78,18 @@ namespace StgSharp
private static bool vsyncActivated; private static bool vsyncActivated;
internal static GraphicAPI API = default; 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) public static void Mark(bool needConsole)
{ {
markCount++; markCount++;
+19 -6
View File
@@ -42,8 +42,11 @@ namespace StgSharp
public partial class StgSharp public partial class StgSharp
{ {
internal static StgSharpTime mainTimeProvider; internal static StgSharpTime mainTimeProvider;
internal static StgSharpTime MainTimeProvider=>mainTimeProvider;
} }
public sealed class StgSharpTime : TimeSourceProviderBase public sealed class StgSharpTime : TimeSourceProviderBase
@@ -58,8 +61,7 @@ namespace StgSharp
{ {
} }
public static StgSharpTime OnlyInstance public static StgSharpTime OnlyInstance => StgSharp.MainTimeProvider;
=> StgSharp.mainTimeProvider;
public override sealed void StartProvidingTime() public override sealed void StartProvidingTime()
{ {
@@ -90,10 +92,6 @@ namespace StgSharp
timeProvideThread.Start(); timeProvideThread.Start();
} }
[MethodImpl(MethodImplOptions.NoOptimization)]
public static void TimerActivate(int maxFrameUpdateSensitiveTimeProviderCount)
{
}
protected override sealed void AddSubscriberUnsynced(TimeSpanProvider subscriber) protected override sealed void AddSubscriberUnsynced(TimeSpanProvider subscriber)
{ {
@@ -115,6 +113,11 @@ namespace StgSharp
while (mainProvider.IsRunning) while (mainProvider.IsRunning)
{ {
totalMS = mainProvider.ElapsedTicks / (internalFrequncy / (1000L * 1000L)); totalMS = mainProvider.ElapsedTicks / (internalFrequncy / (1000L * 1000L));
if (subscriberList.Count==0)
{
continue;
}
CheckSubscriberSemaphore.Wait();
foreach (TimeSpanProvider subscriber in subscriberList) foreach (TimeSpanProvider subscriber in subscriberList)
{ {
if (subscriber.CheckTime(totalMS)) 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); 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); return movBeginOperation.Invoke(tick);
} }
public virtual vec3d MoveCenter(uint tick) public virtual vec3d MoveCenter(int tick)
{ {
return movCenterOperation.Invoke(tick); return movCenterOperation.Invoke(tick);
} }
public virtual vec3d MovEnd(uint tick) public virtual vec3d MovEnd(int tick)
{ {
return movEndOperation.Invoke(tick); return movEndOperation.Invoke(tick);
} }
internal override void UpdateCoordinate(uint tick) internal override void UpdateCoordinate(int tick)
{ {
tick = time; tick = time;
center.Position = this.coordinate.origin + MoveCenter(tick); center.Position = this.coordinate.origin + MoveCenter(tick);
@@ -60,23 +60,23 @@ namespace StgSharp.Geometries
return new Plain(center, pointOnCircle, pointOnPlain); return new Plain(center, pointOnCircle, pointOnPlain);
} }
public virtual vec3d MoveCenter(uint tick) public virtual vec3d MoveCenter(int tick)
{ {
return movCenterOperation.Invoke(tick); return movCenterOperation.Invoke(tick);
} }
public virtual vec3d UpdatePlain(uint tick) public virtual vec3d UpdatePlain(int tick)
{ {
return movEndOperation.Invoke(tick); return movEndOperation.Invoke(tick);
} }
public virtual vec3d UpdateRadius(uint tick) public virtual vec3d UpdateRadius(int tick)
{ {
return movBeginOperation.Invoke(tick); return movBeginOperation.Invoke(tick);
} }
internal override void UpdateCoordinate(uint tick) internal override void UpdateCoordinate(int tick)
{ {
tick = time; tick = time;
center.Position = this.coordinate.origin + MoveCenter(tick); center.Position = this.coordinate.origin + MoveCenter(tick);
@@ -37,12 +37,12 @@ namespace StgSharp.Geometries
/// </summary> /// </summary>
/// <param name="tick">The game tick represent time passed by</param> /// <param name="tick">The game tick represent time passed by</param>
/// <returns>A 3d vector representing movement</returns> /// <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 unsafe class GeometryOperation
{ {
public static vec3d DefualtMotion(uint tick) public static vec3d DefualtMotion(int tick)
{ {
return default(vec3d); return default(vec3d);
} }
@@ -77,7 +77,7 @@ namespace StgSharp.Geometries
/// loading an <see cref="GetLocationHandler"/> with same function. /// loading an <see cref="GetLocationHandler"/> with same function.
/// </summary> /// </summary>
/// <param name="tick">Time passed since current line was created.</param> /// <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); return movBegin.Invoke(time);
} }
@@ -89,12 +89,12 @@ namespace StgSharp.Geometries
/// </summary> /// </summary>
/// <param name="tick">Time passed since current line was created.</param> /// <param name="tick">Time passed since current line was created.</param>
/// <returns></returns> /// <returns></returns>
public virtual vec3d MoveEndPoint(uint tick) public virtual vec3d MoveEndPoint(int tick)
{ {
return movEnd.Invoke(time); return movEnd.Invoke(time);
} }
internal override void UpdateCoordinate(uint tick) internal override void UpdateCoordinate(int tick)
{ {
beginPoint.Position = coordinate.origin + MoveBeginPoint(time); beginPoint.Position = coordinate.origin + MoveBeginPoint(time);
endPoint.Position = coordinate.origin + MoveEndPoint(time); endPoint.Position = coordinate.origin + MoveEndPoint(time);
@@ -66,7 +66,7 @@ namespace StgSharp.Geometries
public GetLocationHandler MovVertex01Operation => moveVertex0Operation; public GetLocationHandler MovVertex01Operation => moveVertex0Operation;
public GetLocationHandler MovVertex02Operation => moveVertex1Operation; public GetLocationHandler MovVertex02Operation => moveVertex1Operation;
public virtual vec3d MovCenter(uint tick) public virtual vec3d MovCenter(int tick)
{ {
return movCenterOperation.Invoke(tick); return movCenterOperation.Invoke(tick);
} }
@@ -77,7 +77,7 @@ namespace StgSharp.Geometries
/// <param name="tick">Current time tick</param> /// <param name="tick">Current time tick</param>
/// <returns></returns> /// <returns></returns>
/// <exception cref="UnusedVertexException">Geometry overdefined</exception> /// <exception cref="UnusedVertexException">Geometry overdefined</exception>
public override sealed vec3d MoveVertex2(uint tick) public override sealed vec3d MoveVertex2(int tick)
{ {
throw new UnusedVertexException(); throw new UnusedVertexException();
} }
@@ -88,12 +88,12 @@ namespace StgSharp.Geometries
/// <param name="tick">Current time tick</param> /// <param name="tick">Current time tick</param>
/// <returns></returns> /// <returns></returns>
/// <exception cref="UnusedVertexException">Geometry overdefined</exception> /// <exception cref="UnusedVertexException">Geometry overdefined</exception>
public override sealed vec3d MoveVertex3(uint tick) public override sealed vec3d MoveVertex3(int tick)
{ {
throw new UnusedVertexException(); 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> /// <summary>
/// Tick time this geometry eas crested /// Tick time this geometry eas crested
/// </summary> /// </summary>
public uint BornTime => time; public int BornTime => time;
public PartialPlainCoordinate ReferenceCoordinate => this.coordinate; public PartialPlainCoordinate ReferenceCoordinate => this.coordinate;
@@ -70,7 +70,7 @@ namespace StgSharp.Geometries
public abstract Plain GetPlain(); public abstract Plain GetPlain();
internal abstract void UpdateCoordinate(uint tick); internal abstract void UpdateCoordinate(int tick);
//public abstract Rectangle GetRenderFrame(); //public abstract Rectangle GetRenderFrame();
} }
@@ -151,29 +151,29 @@ namespace StgSharp.Geometries
vertexMat.mat.colum2); vertexMat.mat.colum2);
} }
public virtual vec3d MoveVertex0(uint tick) public virtual vec3d MoveVertex0(int tick)
{ {
return moveVertex0Operation(tick); return moveVertex0Operation(tick);
} }
public virtual vec3d MoveVertex1(uint tick) public virtual vec3d MoveVertex1(int tick)
{ {
return moveVertex1Operation(tick); return moveVertex1Operation(tick);
} }
public virtual vec3d MoveVertex2(uint tick) public virtual vec3d MoveVertex2(int tick)
{ {
return moveVertex2Operation(tick); return moveVertex2Operation(tick);
} }
public virtual vec3d MoveVertex3(uint tick) public virtual vec3d MoveVertex3(int tick)
{ {
return moveVertex3Operation(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); return new Plain(Vertex0, Vertex1, Vertex2);
} }
public virtual vec3d movVertex01(uint tick) public virtual vec3d movVertex01(int tick)
{ {
return movP01Operation.Invoke(time); return movP01Operation.Invoke(time);
} }
public virtual vec3d movVertex02(uint tick) public virtual vec3d movVertex02(int tick)
{ {
return movP02Operation.Invoke(time); return movP02Operation.Invoke(time);
} }
public virtual vec3d movVertex03(uint tick) public virtual vec3d movVertex03(int tick)
{ {
return movP03Operation.Invoke(time); return movP03Operation.Invoke(time);
} }
public virtual vec3d movVertex04(uint tick) public virtual vec3d movVertex04(int tick)
{ {
return movP04Operation.Invoke(time); return movP04Operation.Invoke(time);
} }
public virtual vec3d movVertex05(uint tick) public virtual vec3d movVertex05(int tick)
{ {
return movP05Operation.Invoke(time); 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.vec0 = (coordinate.origin + movVertex01(nowTick)).vec;
vertexMat.vec1 = (coordinate.origin + movVertex02(nowTick)).vec; vertexMat.vec1 = (coordinate.origin + movVertex02(nowTick)).vec;
vertexMat.vec2 = (coordinate.origin + movVertex03(nowTick)).vec; vertexMat.vec2 = (coordinate.origin + movVertex03(nowTick)).vec;
@@ -111,39 +111,39 @@ namespace StgSharp.Geometries
return new Plain(Vertex0, Vertex1, Vertex2); return new Plain(Vertex0, Vertex1, Vertex2);
} }
public virtual vec3d movVertex0(uint tick) public virtual vec3d movVertex0(int tick)
{ {
return movVertex0Operation.Invoke(time); return movVertex0Operation.Invoke(time);
} }
public virtual vec3d movVertex1(uint tick) public virtual vec3d movVertex1(int tick)
{ {
return movVertex1Operation.Invoke(time); return movVertex1Operation.Invoke(time);
} }
public virtual vec3d movVertex2(uint tick) public virtual vec3d movVertex2(int tick)
{ {
return movVertex2Operation.Invoke(time); return movVertex2Operation.Invoke(time);
} }
public virtual vec3d movVertex3(uint tick) public virtual vec3d movVertex3(int tick)
{ {
return movVertex3Operation.Invoke(time); return movVertex3Operation.Invoke(time);
} }
public virtual vec3d movVertex4(uint tick) public virtual vec3d movVertex4(int tick)
{ {
return movVertex4Operation.Invoke(time); return movVertex4Operation.Invoke(time);
} }
public virtual vec3d movVertex5(uint tick) public virtual vec3d movVertex5(int tick)
{ {
return movVertex5Operation.Invoke(time); 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; Vector4 origin = coordinate.origin.vec;
vertexMat.vec0 = origin + movVertex0(nowTick).vec; vertexMat.vec0 = origin + movVertex0(nowTick).vec;
vertexMat.vec1 = origin + movVertex1(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; return default;
} }
@@ -98,22 +98,22 @@ namespace StgSharp.Geometries
return new Plain(this.vertexMat.mat.colum0, this.vertexMat.mat.colum1, this.vertexMat.mat.colum2); 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); return movVertex01Opearion.Invoke(tick);
} }
public virtual vec3d MovVertex02(uint tick) public virtual vec3d MovVertex02(int tick)
{ {
return movVertex02Opearion.Invoke(tick); return movVertex02Opearion.Invoke(tick);
} }
public virtual vec3d MovVertex03(uint tick) public virtual vec3d MovVertex03(int tick)
{ {
return movVertex03Opearion.Invoke(tick); return movVertex03Opearion.Invoke(tick);
} }
internal override sealed void UpdateCoordinate(uint tick) internal override sealed void UpdateCoordinate(int tick)
{ {
tick = time; tick = time;
vertexMat.mat.colum0 = coordinate.origin.vec + MovVertex01(time).vec; vertexMat.mat.colum0 = coordinate.origin.vec + MovVertex01(time).vec;
+56 -47
View File
@@ -58,22 +58,22 @@ namespace StgSharp.Graphics
internal int width; internal int width;
private GLFWwindow* windowID; private GLFWwindow* windowID;
internal TimeSpanProvider frameTimeProvider;
#endregion metadata #endregion metadata
#region glapicount #region form time
private int missingAPIcount = 0;
private int problemAPIcount = 0; private short fpsCount;
#endregion glapicount internal TimeSpanProvider frameTimeProvider;
#region form main internal TimeSpanProvider fpsCountProvider = new TimeSpanProvider(1.0, TimeSpanProvider.DefaultProvider);
#endregion
#region form thread setting #region form thread setting
private bool isSingleThread = true; private bool isSingleThread = true;
private List<FrameAsyncTask> frameAsyncTaskList = new List<FrameAsyncTask>();
#endregion form thread setting #endregion form thread setting
protected Form() protected Form()
{ {
} }
@@ -129,8 +129,6 @@ namespace StgSharp.Graphics
public unsafe IntPtr WindowID => (IntPtr)windowID; public unsafe IntPtr WindowID => (IntPtr)windowID;
internal unsafe GLFWwindow* id => windowID;
protected FrameBufferSizeHandler FrameBufferSizeCallback protected FrameBufferSizeHandler FrameBufferSizeCallback
{ {
set set
@@ -140,8 +138,26 @@ namespace StgSharp.Graphics
} }
} }
internal unsafe GLFWwindow* id => windowID;
internal bool IsSingleThread => isSingleThread; 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> /// <summary>
/// Init an OpenGl context if current form has not been binded to any context. and set the context binded to /// 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. /// current form as current OpenGL context.
@@ -179,7 +195,12 @@ namespace StgSharp.Graphics
gl = new GLonRender(contextID); gl = new GLonRender(contextID);
} }
InternalIO.glfwMakeContextCurrent(windowID); InternalIO.glfwMakeContextCurrent(windowID);
gl.SwitchContext(); }
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public unsafe void PollEvents()
{
InternalIO.glfwPollEvents();
} }
/// <summary> /// <summary>
@@ -250,33 +271,12 @@ namespace StgSharp.Graphics
public void SetSizeLimit(int minWidth, int minHeight, int maxWidth, int maxHeight) public void SetSizeLimit(int minWidth, int minHeight, int maxWidth, int maxHeight)
{ InternalIO.glfwSetWindowSizeLimits(this.windowID, minWidth, minHeight, maxWidth, maxHeight); } { InternalIO.glfwSetWindowSizeLimits(this.windowID, minWidth, minHeight, maxWidth, maxHeight); }
unsafe ~Form() { Marshal.FreeHGlobal(graphicContextID); } #region form main
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();
}
/// <summary> /// <summary>
/// Init this form and render it on screen, and respond with operation /// Init this form and render it on screen, and respond with operation
/// </summary> /// </summary>
public unsafe void Show(params object[] args) public unsafe void Show()
{ {
if (gl == null) if (gl == null)
{ {
@@ -284,40 +284,46 @@ namespace StgSharp.Graphics
} }
else else
{ {
frameTimeProvider = new TimeSpanProvider(1 / 60.0, TimeSpanProvider.DefaultProvider);
if (isSingleThread) if (isSingleThread)
{ {
while (!ShouldClose) while (!ShouldClose)
{ {
Main(args); Main();
SwapBuffers(); SwapBuffers();
PollEvents(); PollEvents();
frameTimeProvider.WaitNextSpan();
} }
} }
else else
{ {
GLonUpdate update = new GLonUpdate((GLcontext*)graphicContextID); GLonUpdate update = new GLonUpdate((GLcontext*)graphicContextID);
FrameAsyncTask renderTask = new FrameAsyncTask(update); FrameAsyncTask updateTask = new AsyncUpdateDataTask(this);
FrameAsyncTask updateTask = new FrameAsyncTask(update); FrameAsyncTask renderTask = new AsyncRenderFrameTask(this);
frameAsyncTaskList.Add(renderTask);
frameAsyncTaskList.Add(updateTask);
gl = update; gl = update;
update.ActivatedOperationBuffer = updateTask.opBuffer;
SemaphoreSlim frameBeginSemaphore = FrameAsyncTask.CombineAsync(renderTask, updateTask);
SemaphoreSlim renderCompleteSemaphor = renderTask.StartAsync();
SemaphoreSlim updateCompleteSemaphor = updateTask.StartAsync();
while (!ShouldClose) while (!ShouldClose)
{ {
renderTask.StartAsync(); frameBeginSemaphore.Release(2);
updateTask.StartAsync(); renderCompleteSemaphor.Wait();
FrameAsyncTask.CombineAsync(renderTask, updateTask); updateCompleteSemaphor.Wait();
SwapBuffers(); SwapBuffers();
PollEvents(); PollEvents();
FrameAsyncTask.ExchangeBuffer(updateTask, renderTask);
update.ActivatedOperationBuffer = updateTask.opBuffer;
frameTimeProvider.WaitNextSpan();
} }
//TODO 对逻辑线程和渲染线程进行同步,两种gl模式包需要改名字 //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)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
internal void InternalDeinit(params object[] args) { Deinit(args); } 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"); 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;
using System.Collections.Concurrent; using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using System.Text; using System.Text;
@@ -47,6 +48,12 @@ namespace StgSharp.Graphics
private ConcurrentQueue<IntPtr> _funcQueue; private ConcurrentQueue<IntPtr> _funcQueue;
private readonly unsafe GLcontext* currentContext; private readonly unsafe GLcontext* currentContext;
public unsafe FrameOperationBuffer(IglFunc gl)
{
currentContext = gl.Context;
_funcQueue = new ConcurrentQueue<IntPtr>();
}
public unsafe bool CallNext() public unsafe bool CallNext()
{ {
if (_funcQueue.TryDequeue(out _func)) if (_funcQueue.TryDequeue(out _func))
@@ -481,22 +488,60 @@ namespace StgSharp.Graphics
#endregion gl param queue #endregion gl param queue
} }
//TODO 任务组绑定机制有问题,现在一次只能绑定两个
//TODO 目前还不能加载任何任务 //TODO 目前还不能加载任何任务
//TODO 任务的启动逻辑需要重构 //TODO 任务的启动逻辑需要重构
internal class FrameAsyncTask public class FrameAsyncTask
{ {
private SemaphoreSlim _refrshSemaphore; protected SemaphoreSlim _frameCompleteSemaphore = new SemaphoreSlim(0, 1);
private SemaphoreSlim _frameCompleteSemaphore; protected SemaphoreSlim _refreshSemaphore;
private Task _task; private Task _task;
private FrameOperationBuffer opBuffer = new FrameOperationBuffer(); 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) public static void ExchangeBuffer(FrameAsyncTask task0, FrameAsyncTask task1)
@@ -506,25 +551,51 @@ namespace StgSharp.Graphics
task1.opBuffer = cache; task1.opBuffer = cache;
} }
public async Task StartAsync() public virtual SemaphoreSlim StartAsync()
{ {
_task = new Task(
() =>
{
while (true)
{
_refreshSemaphore.Wait();
_taskTODO();
_frameCompleteSemaphore.Release();
}
});
_task.Start(); _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); TaskTODO = new (
task0._refrshSemaphore = refresh; () =>
task1._refrshSemaphore = refresh; {
return refresh; while (true)
{
FrameOperation();
}
});
}
private void FrameOperation()
{
while (opBuffer.CallNext()){}
} }
} }
@@ -128,6 +128,7 @@ namespace StgSharp.Graphics
#endregion texture setting #endregion texture setting
} }
public enum Filter public enum Filter
@@ -149,7 +149,6 @@ namespace StgSharp.Graphics
} }
//TODO 发现一个大问题,paramQueue大多数时候取出的是数组,不是数组句柄,也就是说其内存将被长期固定且不能回收,这是内存泄漏
public unsafe class glArrayHandle public unsafe class glArrayHandle
{ {
+1 -4
View File
@@ -223,7 +223,7 @@ namespace StgSharp.Graphics
default: default:
InternalIO.InternalWriteLog( 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); LogType.Error);
return; return;
} }
@@ -333,9 +333,6 @@ namespace StgSharp.Graphics
api->glEnableVertexAttribArray(index); api->glEnableVertexAttribArray(index);
} }
void IglFunc.SwitchContext()
{
}
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
void IglFunc.TextureImage2d<T>(int target, int level, uint internalformat, uint width, uint height, uint format, uint type, glHandle pixels) 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 GLcontext* api;
private FrameOperationBuffer frameOpBuffer; private FrameOperationBuffer frameOpBuffer;
private glSHandle unupdatedFrame = glSHandle.Alloc(0);
internal GLonUpdate(GLcontext* context) internal GLonUpdate(GLcontext* context)
{ {
if (frameOpBuffer == null)
{
frameOpBuffer = new FrameOperationBuffer();
}
api = context; api = context;
} }
@@ -263,7 +258,7 @@ namespace StgSharp.Graphics
default: default:
InternalIO.InternalWriteLog( 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); LogType.Error);
return; return;
} }
@@ -369,9 +364,6 @@ namespace StgSharp.Graphics
frameOpBuffer.MethodEnqueue(SetVertexArrayPtr); 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) 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); frameOpBuffer.MethodEnqueue(ViewPortPtr);
} }
GLcontext* IglFunc.Context GLcontext* IglFunc.Context => api;
=> api;
} }
} }
@@ -997,7 +997,7 @@ namespace StgSharp.Graphics
catch (Exception ex) catch (Exception ex)
{ {
InternalIO.InternalWriteLog( 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; return default;
} }
} }
-1
View File
@@ -331,7 +331,6 @@ namespace StgSharp.Graphics
internal void frameworkHandleEnqueue(IntPtr handle, params M128[] param); internal void frameworkHandleEnqueue(IntPtr handle, params M128[] param);
internal void SwitchContext();
} }
} }
@@ -79,6 +79,10 @@ namespace StgSharpDebug.Logic
public abstract void StartProvidingTime(); public abstract void StartProvidingTime();
protected SemaphoreSlim CheckSubscriberSemaphore
{
get => _addSubscriberSemaphore;
}
protected abstract void AddSubscriberUnsynced(TimeSpanProvider subscriber); protected abstract void AddSubscriberUnsynced(TimeSpanProvider subscriber);
protected abstract void RemoveSubscriberUnsynced(TimeSpanProvider subscriber); protected abstract void RemoveSubscriberUnsynced(TimeSpanProvider subscriber);
+52 -9
View File
@@ -32,6 +32,7 @@ using StgSharpDebug.Logic;
using System; using System;
using System.Linq; using System.Linq;
using System.Threading;
namespace StgSharp namespace StgSharp
{ {
@@ -48,7 +49,8 @@ namespace StgSharp
private long _spanBegin; private long _spanBegin;
private readonly long _spanLength; private readonly long _spanLength;
private bool _subscribed; 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> /// <summary>
/// Create a new <see cref="TimeSpanProvider"/> and define the length of time span. Length of a single time span is defined in microseconds. /// 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); provider.AddSubscriber(this);
_subscribed = true; _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> /// <summary>
/// Create a new <see cref="TimeSpanProvider"/> and define the length of time span. Length of a single time span is defined in microseconds. /// Create a new <see cref="TimeSpanProvider"/> and define the length of time span. Length of a single time span is defined in microseconds.
/// </summary> /// </summary>
/// <param name="spanLength"></param> /// <param name="spanLength"></param>
/// <parma name="provider"></parma> /// <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); provider.AddSubscriber(this);
_subscribed = true; _subscribed = true;
} }
/// <summary> /// <summary>
/// Time source provider provided in <see cref="StgSharp"/> internal framework. /// Time source provider provided in <see cref="StgSharp"/> internal framework.
/// </summary> /// </summary>
@@ -105,15 +124,39 @@ namespace StgSharp
{ {
_spanBegin = microseconds; _spanBegin = microseconds;
timeSpanCount++; timeSpanCount++;
} try
if (timeSpanCount > _maxSpanCount) {
{ _refreshSemaphore.Release();
return false; }
catch(SemaphoreFullException ex)
{
if (_frameUpdateMissCallback != null)
{
_frameUpdateMissCallback(ex);
}
}
if (timeSpanCount > _maxSpanCount)
{
return false;
}
} }
return true; 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; return provider.timeSpanCount.Value;
} }
+1 -1
View File
@@ -119,7 +119,7 @@ namespace StgSharp.Math
public override string ToString() public override string ToString()
{ {
InternalTranspose(); 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)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -50,6 +50,18 @@
Width of this form, represent in <see cref="T:System.Int32"/> Width of this form, represent in <see cref="T:System.Int32"/>
</summary> </summary>
</member> </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"> <member name="M:StgSharp.Graphics.Form.MakeAsCurrentContext">
<summary> <summary>
Init an OpenGl context if current form has not been binded to any context. and set the context binded to 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="maxWidth">Maximum width of curent form</param>
<param name="maxHeight">Maximum height of current form</param> <param name="maxHeight">Maximum height of current form</param>
</member> </member>
<member name="M:StgSharp.Graphics.Form.Init(System.Object[])"> <member name="M:StgSharp.Graphics.Form.Show">
<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[])">
<summary> <summary>
Init this form and render it on screen, and respond with operation Init this form and render it on screen, and respond with operation
</summary> </summary>
@@ -137,13 +137,6 @@
<param name="count">Amount of EBO to be created.</param> <param name="count">Amount of EBO to be created.</param>
<returns></returns> <returns></returns>
</member> </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)"> <member name="M:StgSharp.Graphics.Form.CreateTexture(System.Int32)">
<summary> <summary>
Create a sets of <see cref="T:StgSharp.Graphics.Texture"/> Create a sets of <see cref="T:StgSharp.Graphics.Texture"/>
@@ -151,6 +144,13 @@
<param name="count">Amount of textures to be crated.</param> <param name="count">Amount of textures to be crated.</param>
<returns></returns> <returns></returns>
</member> </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)"> <member name="M:StgSharp.Graphics.Form.CreateVertexBuffer(System.Int32)">
<summary> <summary>
Create aset of <see cref="T:StgSharp.Graphics.VertexBuffer"/>. Create aset of <see cref="T:StgSharp.Graphics.VertexBuffer"/>.
@@ -273,11 +273,6 @@
Inti a shader with no program attached. Inti a shader with no program attached.
</summary> </summary>
</member> </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)"> <member name="M:StgSharp.Graphics.ShaderProgram.GetUniform``1(System.String)">
<summary> <summary>
Get a uniform form current shader, Get a uniform form current shader,
@@ -302,6 +297,11 @@
<param name="name">Name of the Uniform in shader code</param> <param name="name">Name of the Uniform in shader code</param>
<returns></returns> <returns></returns>
</member> </member>
<member name="M:StgSharp.Graphics.ShaderProgram.Link">
<summary>
Link the shader to current context.
</summary>
</member>
<member name="M:StgSharp.Graphics.ShaderProgram.Use"> <member name="M:StgSharp.Graphics.ShaderProgram.Use">
<summary> <summary>
Let the current context use this shader. Let the current context use this shader.
@@ -466,17 +466,6 @@
</summary> </summary>
<param name="form"></param> <param name="form"></param>
</member> </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)"> <member name="M:StgSharp.Graphics.IglFunc.SetValue(StgSharp.Graphics.Uniform{System.Single,System.Single,System.Single,System.Single},StgSharp.Math.Vec4d)">
<summary> <summary>
Set data value to a float <see cref="T:StgSharp.Graphics.Uniform`4"/>, 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="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> <param name="vec">A <see cref="T:StgSharp.Math.Vec4d"/> packing four parameters of the uniform </param>
</member> </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)"> <member name="M:StgSharp.Graphics.IglFunc.SetValue(StgSharp.Graphics.Uniform{System.Single},System.Single)">
<summary> <summary>
Set data value to a float <see cref="T:StgSharp.Graphics.Uniform`1"/>, 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="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> <param name="vec">A <see cref="T:StgSharp.Math.Vec4d"/> value of the uniform </param>
</member> </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)"> <member name="M:StgSharp.Graphics.IglFunc.SetVertexAttribute(System.UInt32,System.Int32,System.TypeCode,System.Boolean,System.UInt32,System.Int32)">
<summary> <summary>
Set how a shader parameter read data from a VBO. 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> <param name="tick">The game tick represent time passed by</param>
<returns>A 3d vector representing movement</returns> <returns>A 3d vector representing movement</returns>
</member> </member>
<member name="M:StgSharp.Geometries.Line.MoveBeginPoint(System.UInt32)"> <member name="M:StgSharp.Geometries.Line.MoveBeginPoint(System.Int32)">
<summary> <summary>
Move begin side of a line. Move begin side of a line.
It is recommended to override this function rather than It is recommended to override this function rather than
@@ -662,7 +662,7 @@
</summary> </summary>
<param name="tick">Time passed since current line was created.</param> <param name="tick">Time passed since current line was created.</param>
</member> </member>
<member name="M:StgSharp.Geometries.Line.MoveEndPoint(System.UInt32)"> <member name="M:StgSharp.Geometries.Line.MoveEndPoint(System.Int32)">
<summary> <summary>
Move end side of a line. Move end side of a line.
It is recommended to override this function rather than It is recommended to override this function rather than
@@ -671,7 +671,7 @@
<param name="tick">Time passed since current line was created.</param> <param name="tick">Time passed since current line was created.</param>
<returns></returns> <returns></returns>
</member> </member>
<member name="M:StgSharp.Geometries.Parallelogram.MoveVertex2(System.UInt32)"> <member name="M:StgSharp.Geometries.Parallelogram.MoveVertex2(System.Int32)">
<summary> <summary>
Move the third vertix. this is a useless method for Parallelograms. Move the third vertix. this is a useless method for Parallelograms.
</summary> </summary>
@@ -679,7 +679,7 @@
<returns></returns> <returns></returns>
<exception cref="T:StgSharp.Geometries.UnusedVertexException">Geometry overdefined</exception> <exception cref="T:StgSharp.Geometries.UnusedVertexException">Geometry overdefined</exception>
</member> </member>
<member name="M:StgSharp.Geometries.Parallelogram.MoveVertex3(System.UInt32)"> <member name="M:StgSharp.Geometries.Parallelogram.MoveVertex3(System.Int32)">
<summary> <summary>
Move the third vertix. This method is useless for Parallelograms. Move the third vertix. This method is useless for Parallelograms.
</summary> </summary>
@@ -692,6 +692,11 @@
平面几何体。包含三角形,对称四边形,自由多边形等。最多可由16个点参数定义。 平面几何体。包含三角形,对称四边形,自由多边形等。最多可由16个点参数定义。
</summary> </summary>
</member> </member>
<member name="P:StgSharp.Geometries.PlainGeometry.BornTime">
<summary>
Tick time this geometry eas crested
</summary>
</member>
<member name="M:StgSharp.Geometries.PlainGeometry.GetAllSides"> <member name="M:StgSharp.Geometries.PlainGeometry.GetAllSides">
<summary> <summary>
Get all sides of this <see cref="T:StgSharp.Geometries.PlainGeometry"/>. Get all sides of this <see cref="T:StgSharp.Geometries.PlainGeometry"/>.
@@ -704,11 +709,6 @@
</summary> </summary>
<returns></returns> <returns></returns>
</member> </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)"> <member name="M:StgSharp.Geometries.Point.Update(System.UInt32)">
<summary> <summary>
Update the coordinate of the point. If this is a moving point, Update the coordinate of the point. If this is a moving point,
@@ -778,25 +778,41 @@
The second <see cref="T:System.Boolean"/> value. The second <see cref="T:System.Boolean"/> value.
</summary> </summary>
</member> </member>
<member name="T:StgSharp.TimeProvider"> <member name="T:StgSharp.TimeSpanProvider">
<summary> <summary>
A microsecond-accuracy timer. It will refresh every a certain time span. A microsecond-accuracy timer. It will refresh every a certain time span.
</summary> </summary>
</member> </member>
<member name="M:StgSharp.TimeProvider.#ctor(System.Int64,StgSharp.TimeSourceProvider)"> <member name="M:StgSharp.TimeSpanProvider.#ctor(System.Int64,StgSharpDebug.Logic.TimeSourceProviderBase)">
<summary> <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> </summary>
<param name="spanLength"></param> <param name="spanLength"></param>
<parma name="provider"></parma>
</member> </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> <summary>
Time source provider provided in <see cref="T:StgSharp.StgSharp"/> internal framework. Time source provider provided in <see cref="T:StgSharp.StgSharp"/> internal framework.
</summary> </summary>
</member> </member>
<member name="P:StgSharp.TimeProvider.SpanRefreshCallback"> <member name="P:StgSharp.TimeSpanProvider.SpanRefreshCallback">
<summary> <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> </summary>
</member> </member>
<member name="T:StgSharp.Math.GLclampf"> <member name="T:StgSharp.Math.GLclampf">
@@ -849,18 +865,18 @@
<param name="y"></param> <param name="y"></param>
<returns>Returns the value of x^y</returns> <returns>Returns the value of x^y</returns>
</member> </member>
<member name="M:StgSharp.Math.Scaler.Random">
<summary>
</summary>
<returns></returns>
</member>
<member name="M:StgSharp.Math.Scaler.LowProceisionRandom"> <member name="M:StgSharp.Math.Scaler.LowProceisionRandom">
<summary> <summary>
returns a random float number between 0 and 1. returns a random float number between 0 and 1.
</summary> </summary>
<returns></returns> <returns></returns>
</member> </member>
<member name="M:StgSharp.Math.Scaler.Random">
<summary>
</summary>
<returns></returns>
</member>
<member name="M:StgSharp.Math.Scaler.RandomSeed"> <member name="M:StgSharp.Math.Scaler.RandomSeed">
<summary> <summary>
Generates a random seed in int value. Generates a random seed in int value.
@@ -44,7 +44,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("StgSharp")] [assembly: System.Reflection.AssemblyCompanyAttribute("StgSharp")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] [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.AssemblyProductAttribute("StgSharp")]
[assembly: System.Reflection.AssemblyTitleAttribute("StgSharp")] [assembly: System.Reflection.AssemblyTitleAttribute("StgSharp")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] [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"/> Width of this form, represent in <see cref="T:System.Int32"/>
</summary> </summary>
</member> </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"> <member name="M:StgSharp.Graphics.Form.MakeAsCurrentContext">
<summary> <summary>
Init an OpenGl context if current form has not been binded to any context. and set the context binded to 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="maxWidth">Maximum width of curent form</param>
<param name="maxHeight">Maximum height of current form</param> <param name="maxHeight">Maximum height of current form</param>
</member> </member>
<member name="M:StgSharp.Graphics.Form.Init(System.Object[])"> <member name="M:StgSharp.Graphics.Form.Show">
<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[])">
<summary> <summary>
Init this form and render it on screen, and respond with operation Init this form and render it on screen, and respond with operation
</summary> </summary>
@@ -137,13 +137,6 @@
<param name="count">Amount of EBO to be created.</param> <param name="count">Amount of EBO to be created.</param>
<returns></returns> <returns></returns>
</member> </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)"> <member name="M:StgSharp.Graphics.Form.CreateTexture(System.Int32)">
<summary> <summary>
Create a sets of <see cref="T:StgSharp.Graphics.Texture"/> Create a sets of <see cref="T:StgSharp.Graphics.Texture"/>
@@ -151,6 +144,13 @@
<param name="count">Amount of textures to be crated.</param> <param name="count">Amount of textures to be crated.</param>
<returns></returns> <returns></returns>
</member> </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)"> <member name="M:StgSharp.Graphics.Form.CreateVertexBuffer(System.Int32)">
<summary> <summary>
Create aset of <see cref="T:StgSharp.Graphics.VertexBuffer"/>. Create aset of <see cref="T:StgSharp.Graphics.VertexBuffer"/>.
@@ -273,11 +273,6 @@
Inti a shader with no program attached. Inti a shader with no program attached.
</summary> </summary>
</member> </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)"> <member name="M:StgSharp.Graphics.ShaderProgram.GetUniform``1(System.String)">
<summary> <summary>
Get a uniform form current shader, Get a uniform form current shader,
@@ -302,6 +297,11 @@
<param name="name">Name of the Uniform in shader code</param> <param name="name">Name of the Uniform in shader code</param>
<returns></returns> <returns></returns>
</member> </member>
<member name="M:StgSharp.Graphics.ShaderProgram.Link">
<summary>
Link the shader to current context.
</summary>
</member>
<member name="M:StgSharp.Graphics.ShaderProgram.Use"> <member name="M:StgSharp.Graphics.ShaderProgram.Use">
<summary> <summary>
Let the current context use this shader. Let the current context use this shader.
@@ -466,17 +466,6 @@
</summary> </summary>
<param name="form"></param> <param name="form"></param>
</member> </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)"> <member name="M:StgSharp.Graphics.IglFunc.SetValue(StgSharp.Graphics.Uniform{System.Single,System.Single,System.Single,System.Single},StgSharp.Math.Vec4d)">
<summary> <summary>
Set data value to a float <see cref="T:StgSharp.Graphics.Uniform`4"/>, 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="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> <param name="vec">A <see cref="T:StgSharp.Math.Vec4d"/> packing four parameters of the uniform </param>
</member> </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)"> <member name="M:StgSharp.Graphics.IglFunc.SetValue(StgSharp.Graphics.Uniform{System.Single},System.Single)">
<summary> <summary>
Set data value to a float <see cref="T:StgSharp.Graphics.Uniform`1"/>, 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="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> <param name="vec">A <see cref="T:StgSharp.Math.Vec4d"/> value of the uniform </param>
</member> </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)"> <member name="M:StgSharp.Graphics.IglFunc.SetVertexAttribute(System.UInt32,System.Int32,System.TypeCode,System.Boolean,System.UInt32,System.Int32)">
<summary> <summary>
Set how a shader parameter read data from a VBO. 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> <param name="tick">The game tick represent time passed by</param>
<returns>A 3d vector representing movement</returns> <returns>A 3d vector representing movement</returns>
</member> </member>
<member name="M:StgSharp.Geometries.Line.MoveBeginPoint(System.UInt32)"> <member name="M:StgSharp.Geometries.Line.MoveBeginPoint(System.Int32)">
<summary> <summary>
Move begin side of a line. Move begin side of a line.
It is recommended to override this function rather than It is recommended to override this function rather than
@@ -662,7 +662,7 @@
</summary> </summary>
<param name="tick">Time passed since current line was created.</param> <param name="tick">Time passed since current line was created.</param>
</member> </member>
<member name="M:StgSharp.Geometries.Line.MoveEndPoint(System.UInt32)"> <member name="M:StgSharp.Geometries.Line.MoveEndPoint(System.Int32)">
<summary> <summary>
Move end side of a line. Move end side of a line.
It is recommended to override this function rather than It is recommended to override this function rather than
@@ -671,7 +671,7 @@
<param name="tick">Time passed since current line was created.</param> <param name="tick">Time passed since current line was created.</param>
<returns></returns> <returns></returns>
</member> </member>
<member name="M:StgSharp.Geometries.Parallelogram.MoveVertex2(System.UInt32)"> <member name="M:StgSharp.Geometries.Parallelogram.MoveVertex2(System.Int32)">
<summary> <summary>
Move the third vertix. this is a useless method for Parallelograms. Move the third vertix. this is a useless method for Parallelograms.
</summary> </summary>
@@ -679,7 +679,7 @@
<returns></returns> <returns></returns>
<exception cref="T:StgSharp.Geometries.UnusedVertexException">Geometry overdefined</exception> <exception cref="T:StgSharp.Geometries.UnusedVertexException">Geometry overdefined</exception>
</member> </member>
<member name="M:StgSharp.Geometries.Parallelogram.MoveVertex3(System.UInt32)"> <member name="M:StgSharp.Geometries.Parallelogram.MoveVertex3(System.Int32)">
<summary> <summary>
Move the third vertix. This method is useless for Parallelograms. Move the third vertix. This method is useless for Parallelograms.
</summary> </summary>
@@ -692,6 +692,11 @@
平面几何体。包含三角形,对称四边形,自由多边形等。最多可由16个点参数定义。 平面几何体。包含三角形,对称四边形,自由多边形等。最多可由16个点参数定义。
</summary> </summary>
</member> </member>
<member name="P:StgSharp.Geometries.PlainGeometry.BornTime">
<summary>
Tick time this geometry eas crested
</summary>
</member>
<member name="M:StgSharp.Geometries.PlainGeometry.GetAllSides"> <member name="M:StgSharp.Geometries.PlainGeometry.GetAllSides">
<summary> <summary>
Get all sides of this <see cref="T:StgSharp.Geometries.PlainGeometry"/>. Get all sides of this <see cref="T:StgSharp.Geometries.PlainGeometry"/>.
@@ -704,11 +709,6 @@
</summary> </summary>
<returns></returns> <returns></returns>
</member> </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)"> <member name="M:StgSharp.Geometries.Point.Update(System.UInt32)">
<summary> <summary>
Update the coordinate of the point. If this is a moving point, Update the coordinate of the point. If this is a moving point,
@@ -778,25 +778,41 @@
The second <see cref="T:System.Boolean"/> value. The second <see cref="T:System.Boolean"/> value.
</summary> </summary>
</member> </member>
<member name="T:StgSharp.TimeProvider"> <member name="T:StgSharp.TimeSpanProvider">
<summary> <summary>
A microsecond-accuracy timer. It will refresh every a certain time span. A microsecond-accuracy timer. It will refresh every a certain time span.
</summary> </summary>
</member> </member>
<member name="M:StgSharp.TimeProvider.#ctor(System.Int64,StgSharp.TimeSourceProvider)"> <member name="M:StgSharp.TimeSpanProvider.#ctor(System.Int64,StgSharpDebug.Logic.TimeSourceProviderBase)">
<summary> <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> </summary>
<param name="spanLength"></param> <param name="spanLength"></param>
<parma name="provider"></parma>
</member> </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> <summary>
Time source provider provided in <see cref="T:StgSharp.StgSharp"/> internal framework. Time source provider provided in <see cref="T:StgSharp.StgSharp"/> internal framework.
</summary> </summary>
</member> </member>
<member name="P:StgSharp.TimeProvider.SpanRefreshCallback"> <member name="P:StgSharp.TimeSpanProvider.SpanRefreshCallback">
<summary> <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> </summary>
</member> </member>
<member name="T:StgSharp.Math.GLclampf"> <member name="T:StgSharp.Math.GLclampf">
@@ -849,18 +865,18 @@
<param name="y"></param> <param name="y"></param>
<returns>Returns the value of x^y</returns> <returns>Returns the value of x^y</returns>
</member> </member>
<member name="M:StgSharp.Math.Scaler.Random">
<summary>
</summary>
<returns></returns>
</member>
<member name="M:StgSharp.Math.Scaler.LowProceisionRandom"> <member name="M:StgSharp.Math.Scaler.LowProceisionRandom">
<summary> <summary>
returns a random float number between 0 and 1. returns a random float number between 0 and 1.
</summary> </summary>
<returns></returns> <returns></returns>
</member> </member>
<member name="M:StgSharp.Math.Scaler.Random">
<summary>
</summary>
<returns></returns>
</member>
<member name="M:StgSharp.Math.Scaler.RandomSeed"> <member name="M:StgSharp.Math.Scaler.RandomSeed">
<summary> <summary>
Generates a random seed in int value. Generates a random seed in int value.
Binary file not shown.
Binary file not shown.
Binary file not shown.
-1
View File
@@ -9,7 +9,6 @@ extern char infolog[512] = { 0 };
SSCAPI void SSCDECL initGL(int majorVersion, int minorVersion) SSCAPI void SSCDECL initGL(int majorVersion, int minorVersion)
{ {
glfwInit();
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, majorVersion); glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, majorVersion);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, minorVersion); glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, minorVersion);
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
+61 -66
View File
@@ -154,7 +154,6 @@ PUBLIC ??_C@_0BL@MOJGOJJP@Failed?5to?5load?5OpenGL?5api?3@ ; `string'
PUBLIC ??_C@_03OFAPEBGM@?$CFs?6@ ; `string' PUBLIC ??_C@_03OFAPEBGM@?$CFs?6@ ; `string'
EXTRN __report_rangecheckfailure:PROC EXTRN __report_rangecheckfailure:PROC
EXTRN __imp_free:PROC EXTRN __imp_free:PROC
EXTRN glfwInit:PROC
EXTRN glfwWindowHint:PROC EXTRN glfwWindowHint:PROC
EXTRN glfwGetProcAddress:PROC EXTRN glfwGetProcAddress:PROC
EXTRN __imp___acrt_iob_func:PROC EXTRN __imp___acrt_iob_func:PROC
@@ -191,7 +190,7 @@ pdata ENDS
; COMDAT pdata ; COMDAT pdata
pdata SEGMENT pdata SEGMENT
$pdata$initGL DD imagerel $LN3 $pdata$initGL DD imagerel $LN3
DD imagerel $LN3+96 DD imagerel $LN3+91
DD imagerel $unwind$initGL DD imagerel $unwind$initGL
pdata ENDS pdata ENDS
; COMDAT pdata ; COMDAT pdata
@@ -375,7 +374,7 @@ _TEXT SEGMENT
$T1 = 200 $T1 = 200
readLog PROC ; COMDAT readLog PROC ; COMDAT
; 66 : { ; 65 : {
$LN5: $LN5:
00000 40 55 push rbp 00000 40 55 push rbp
@@ -387,7 +386,7 @@ $LN5:
00 00 lea rcx, OFFSET FLAT:__59F96598_StgSharpC@c 00 00 lea rcx, OFFSET FLAT:__59F96598_StgSharpC@c
00016 e8 00 00 00 00 call __CheckForDebuggerJustMyCode 00016 e8 00 00 00 00 call __CheckForDebuggerJustMyCode
; 67 : infolog[511] = '\0'; ; 66 : infolog[511] = '\0';
0001b b8 01 00 00 00 mov eax, 1 0001b b8 01 00 00 00 mov eax, 1
00020 48 69 c0 ff 01 00020 48 69 c0 ff 01
@@ -408,13 +407,13 @@ $LN4@readLog:
00 00 mov rcx, QWORD PTR $T1[rbp] 00 00 mov rcx, QWORD PTR $T1[rbp]
00050 c6 04 08 00 mov BYTE PTR [rax+rcx], 0 00050 c6 04 08 00 mov BYTE PTR [rax+rcx], 0
; 68 : return &infolog; ; 67 : return &infolog;
00054 48 8d 05 00 00 00054 48 8d 05 00 00
00 00 lea rax, OFFSET FLAT:infolog 00 00 lea rax, OFFSET FLAT:infolog
$LN2@readLog: $LN2@readLog:
; 69 : } ; 68 : }
0005b 48 8d a5 e8 00 0005b 48 8d a5 e8 00
00 00 lea rsp, QWORD PTR [rbp+232] 00 00 lea rsp, QWORD PTR [rbp+232]
@@ -430,7 +429,7 @@ _TEXT SEGMENT
out$ = 224 out$ = 224
unloadImageData PROC ; COMDAT unloadImageData PROC ; COMDAT
; 61 : { ; 60 : {
$LN3: $LN3:
00000 48 89 4c 24 08 mov QWORD PTR [rsp+8], rcx 00000 48 89 4c 24 08 mov QWORD PTR [rsp+8], rcx
@@ -443,7 +442,7 @@ $LN3:
00 00 lea rcx, OFFSET FLAT:__59F96598_StgSharpC@c 00 00 lea rcx, OFFSET FLAT:__59F96598_StgSharpC@c
0001a e8 00 00 00 00 call __CheckForDebuggerJustMyCode 0001a e8 00 00 00 00 call __CheckForDebuggerJustMyCode
; 62 : free(out->pixelPtr); ; 61 : free(out->pixelPtr);
0001f 48 8b 85 e0 00 0001f 48 8b 85 e0 00
00 00 mov rax, QWORD PTR out$[rbp] 00 00 mov rax, QWORD PTR out$[rbp]
@@ -451,7 +450,7 @@ $LN3:
0002a ff 15 00 00 00 0002a ff 15 00 00 00
00 call QWORD PTR __imp_free 00 call QWORD PTR __imp_free
; 63 : } ; 62 : }
00030 48 8d a5 c8 00 00030 48 8d a5 c8 00
00 00 lea rsp, QWORD PTR [rbp+200] 00 00 lea rsp, QWORD PTR [rbp+200]
@@ -469,7 +468,7 @@ i$1 = 40
procName$ = 288 procName$ = 288
loadGlfuncDefault PROC ; COMDAT loadGlfuncDefault PROC ; COMDAT
; 19 : { ; 18 : {
$LN7: $LN7:
00000 48 89 4c 24 08 mov QWORD PTR [rsp+8], rcx 00000 48 89 4c 24 08 mov QWORD PTR [rsp+8], rcx
@@ -482,29 +481,29 @@ $LN7:
00 00 lea rcx, OFFSET FLAT:__59F96598_StgSharpC@c 00 00 lea rcx, OFFSET FLAT:__59F96598_StgSharpC@c
0001a e8 00 00 00 00 call __CheckForDebuggerJustMyCode 0001a e8 00 00 00 00 call __CheckForDebuggerJustMyCode
; 20 : void* ret = glfwGetProcAddress(procName); ; 19 : void* ret = glfwGetProcAddress(procName);
0001f 48 8b 8d 20 01 0001f 48 8b 8d 20 01
00 00 mov rcx, QWORD PTR procName$[rbp] 00 00 mov rcx, QWORD PTR procName$[rbp]
00026 e8 00 00 00 00 call glfwGetProcAddress 00026 e8 00 00 00 00 call glfwGetProcAddress
0002b 48 89 45 08 mov QWORD PTR ret$[rbp], rax 0002b 48 89 45 08 mov QWORD PTR ret$[rbp], rax
; 21 : printf("%llu\n", (uint64_t)ret); ; 20 : printf("%llu\n", (uint64_t)ret);
0002f 48 8b 55 08 mov rdx, QWORD PTR ret$[rbp] 0002f 48 8b 55 08 mov rdx, QWORD PTR ret$[rbp]
00033 48 8d 0d 00 00 00033 48 8d 0d 00 00
00 00 lea rcx, OFFSET FLAT:??_C@_05JMLLFKBP@?$CFllu?6@ 00 00 lea rcx, OFFSET FLAT:??_C@_05JMLLFKBP@?$CFllu?6@
0003a e8 00 00 00 00 call printf 0003a e8 00 00 00 00 call printf
; 22 : if (ret = NULL) ; 21 : if (ret = NULL)
0003f 48 c7 45 08 00 0003f 48 c7 45 08 00
00 00 00 mov QWORD PTR ret$[rbp], 0 00 00 00 mov QWORD PTR ret$[rbp], 0
00047 48 83 7d 08 00 cmp QWORD PTR ret$[rbp], 0 00047 48 83 7d 08 00 cmp QWORD PTR ret$[rbp], 0
0004c 74 6e je SHORT $LN5@loadGlfunc 0004c 74 6e je SHORT $LN5@loadGlfunc
; 23 : { ; 22 : {
; 24 : *infolog = "Failed to load OpenGL api:"; ; 23 : *infolog = "Failed to load OpenGL api:";
0004e b8 01 00 00 00 mov eax, 1 0004e b8 01 00 00 00 mov eax, 1
00053 48 6b c0 00 imul rax, rax, 0 00053 48 6b c0 00 imul rax, rax, 0
@@ -514,7 +513,7 @@ $LN7:
00 00 lea rdx, OFFSET FLAT:??_C@_0BL@MOJGOJJP@Failed?5to?5load?5OpenGL?5api?3@ 00 00 lea rdx, OFFSET FLAT:??_C@_0BL@MOJGOJJP@Failed?5to?5load?5OpenGL?5api?3@
00065 88 14 01 mov BYTE PTR [rcx+rax], dl 00065 88 14 01 mov BYTE PTR [rcx+rax], dl
; 25 : for (size_t i = 0; i < sizeof(procName); i++) ; 24 : for (size_t i = 0; i < sizeof(procName); i++)
00068 48 c7 45 28 00 00068 48 c7 45 28 00
00 00 00 mov QWORD PTR i$1[rbp], 0 00 00 00 mov QWORD PTR i$1[rbp], 0
@@ -527,8 +526,8 @@ $LN4@loadGlfunc:
0007d 48 83 7d 28 08 cmp QWORD PTR i$1[rbp], 8 0007d 48 83 7d 28 08 cmp QWORD PTR i$1[rbp], 8
00082 73 25 jae SHORT $LN3@loadGlfunc 00082 73 25 jae SHORT $LN3@loadGlfunc
; 26 : { ; 25 : {
; 27 : infolog[30 + i] = procName[i]; ; 26 : infolog[30 + i] = procName[i];
00084 48 8d 05 00 00 00084 48 8d 05 00 00
00 00 lea rax, OFFSET FLAT:infolog 00 00 lea rax, OFFSET FLAT:infolog
@@ -541,12 +540,12 @@ $LN4@loadGlfunc:
000a0 0f b6 09 movzx ecx, BYTE PTR [rcx] 000a0 0f b6 09 movzx ecx, BYTE PTR [rcx]
000a3 88 4c 10 1e mov BYTE PTR [rax+rdx+30], cl 000a3 88 4c 10 1e mov BYTE PTR [rax+rdx+30], cl
; 28 : } ; 27 : }
000a7 eb c9 jmp SHORT $LN2@loadGlfunc 000a7 eb c9 jmp SHORT $LN2@loadGlfunc
$LN3@loadGlfunc: $LN3@loadGlfunc:
; 29 : printf("%s\n", infolog); ; 28 : printf("%s\n", infolog);
000a9 48 8d 15 00 00 000a9 48 8d 15 00 00
00 00 lea rdx, OFFSET FLAT:infolog 00 00 lea rdx, OFFSET FLAT:infolog
@@ -555,12 +554,12 @@ $LN3@loadGlfunc:
000b7 e8 00 00 00 00 call printf 000b7 e8 00 00 00 00 call printf
$LN5@loadGlfunc: $LN5@loadGlfunc:
; 30 : } ; 29 : }
; 31 : return (GLFWglproc)ret; ; 30 : return (GLFWglproc)ret;
000bc 48 8b 45 08 mov rax, QWORD PTR ret$[rbp] 000bc 48 8b 45 08 mov rax, QWORD PTR ret$[rbp]
; 32 : } ; 31 : }
000c0 48 8d a5 08 01 000c0 48 8d a5 08 01
00 00 lea rsp, QWORD PTR [rbp+264] 00 00 lea rsp, QWORD PTR [rbp+264]
@@ -578,7 +577,7 @@ out$ = 232
loader$ = 240 loader$ = 240
loadImageData PROC ; COMDAT loadImageData PROC ; COMDAT
; 52 : { ; 51 : {
$LN4: $LN4:
00000 4c 89 44 24 18 mov QWORD PTR [rsp+24], r8 00000 4c 89 44 24 18 mov QWORD PTR [rsp+24], r8
@@ -593,14 +592,14 @@ $LN4:
00 00 lea rcx, OFFSET FLAT:__59F96598_StgSharpC@c 00 00 lea rcx, OFFSET FLAT:__59F96598_StgSharpC@c
00024 e8 00 00 00 00 call __CheckForDebuggerJustMyCode 00024 e8 00 00 00 00 call __CheckForDebuggerJustMyCode
; 53 : if (loader == NULL) ; 52 : if (loader == NULL)
00029 48 83 bd f0 00 00029 48 83 bd f0 00
00 00 00 cmp QWORD PTR loader$[rbp], 0 00 00 00 cmp QWORD PTR loader$[rbp], 0
00031 75 0e jne SHORT $LN2@loadImageD 00031 75 0e jne SHORT $LN2@loadImageD
; 54 : { ; 53 : {
; 55 : loader = stbi_load; ; 54 : loader = stbi_load;
00033 48 8d 05 00 00 00033 48 8d 05 00 00
00 00 lea rax, OFFSET FLAT:stbi_load 00 00 lea rax, OFFSET FLAT:stbi_load
@@ -608,8 +607,8 @@ $LN4:
00 00 mov QWORD PTR loader$[rbp], rax 00 00 mov QWORD PTR loader$[rbp], rax
$LN2@loadImageD: $LN2@loadImageD:
; 56 : } ; 55 : }
; 57 : out->pixelPtr = loader(location, &(out->width), &(out->height), &(out->channel), 0); ; 56 : out->pixelPtr = loader(location, &(out->width), &(out->height), &(out->channel), 0);
00041 48 8b 85 e8 00 00041 48 8b 85 e8 00
00 00 mov rax, QWORD PTR out$[rbp] 00 00 mov rax, QWORD PTR out$[rbp]
@@ -631,7 +630,7 @@ $LN2@loadImageD:
00 00 mov rcx, QWORD PTR out$[rbp] 00 00 mov rcx, QWORD PTR out$[rbp]
00080 48 89 41 10 mov QWORD PTR [rcx+16], rax 00080 48 89 41 10 mov QWORD PTR [rcx+16], rax
; 58 : } ; 57 : }
00084 48 8d a5 c8 00 00084 48 8d a5 c8 00
00 00 lea rsp, QWORD PTR [rbp+200] 00 00 lea rsp, QWORD PTR [rbp+200]
@@ -650,7 +649,7 @@ context$ = 256
shaderProgram$ = 264 shaderProgram$ = 264
linkShaderProgram PROC ; COMDAT linkShaderProgram PROC ; COMDAT
; 35 : { ; 34 : {
$LN5: $LN5:
00000 89 54 24 10 mov DWORD PTR [rsp+16], edx 00000 89 54 24 10 mov DWORD PTR [rsp+16], edx
@@ -675,7 +674,7 @@ $LN5:
00 00 lea rcx, OFFSET FLAT:__59F96598_StgSharpC@c 00 00 lea rcx, OFFSET FLAT:__59F96598_StgSharpC@c
00048 e8 00 00 00 00 call __CheckForDebuggerJustMyCode 00048 e8 00 00 00 00 call __CheckForDebuggerJustMyCode
; 36 : context->LinkProgram(shaderProgram); ; 35 : context->LinkProgram(shaderProgram);
0004d 8b 8d 08 01 00 0004d 8b 8d 08 01 00
00 mov ecx, DWORD PTR shaderProgram$[rbp] 00 mov ecx, DWORD PTR shaderProgram$[rbp]
@@ -684,9 +683,9 @@ $LN5:
0005a ff 90 80 22 00 0005a ff 90 80 22 00
00 call QWORD PTR [rax+8832] 00 call QWORD PTR [rax+8832]
; 37 : ; 36 :
; 38 : int success; ; 37 : int success;
; 39 : context->GetProgramiv(shaderProgram, GL_LINK_STATUS, &success); ; 38 : context->GetProgramiv(shaderProgram, GL_LINK_STATUS, &success);
00060 4c 8d 45 04 lea r8, QWORD PTR success$[rbp] 00060 4c 8d 45 04 lea r8, QWORD PTR success$[rbp]
00064 ba 82 8b 00 00 mov edx, 35714 ; 00008b82H 00064 ba 82 8b 00 00 mov edx, 35714 ; 00008b82H
@@ -697,13 +696,13 @@ $LN5:
00076 ff 90 48 1a 00 00076 ff 90 48 1a 00
00 call QWORD PTR [rax+6728] 00 call QWORD PTR [rax+6728]
; 40 : if (!success) ; 39 : if (!success)
0007c 83 7d 04 00 cmp DWORD PTR success$[rbp], 0 0007c 83 7d 04 00 cmp DWORD PTR success$[rbp], 0
00080 75 28 jne SHORT $LN2@linkShader 00080 75 28 jne SHORT $LN2@linkShader
; 41 : { ; 40 : {
; 42 : context->GetProgramInfoLog(shaderProgram, 512, NULL, infolog); ; 41 : context->GetProgramInfoLog(shaderProgram, 512, NULL, infolog);
00082 4c 8d 0d 00 00 00082 4c 8d 0d 00 00
00 00 lea r9, OFFSET FLAT:infolog 00 00 lea r9, OFFSET FLAT:infolog
@@ -716,27 +715,27 @@ $LN5:
0009e ff 90 98 19 00 0009e ff 90 98 19 00
00 call QWORD PTR [rax+6552] 00 call QWORD PTR [rax+6552]
; 43 : return 0; ; 42 : return 0;
000a4 33 c0 xor eax, eax 000a4 33 c0 xor eax, eax
000a6 eb 08 jmp SHORT $LN1@linkShader 000a6 eb 08 jmp SHORT $LN1@linkShader
; 44 : } ; 43 : }
000a8 eb 06 jmp SHORT $LN3@linkShader 000a8 eb 06 jmp SHORT $LN3@linkShader
$LN2@linkShader: $LN2@linkShader:
; 45 : else ; 44 : else
; 46 : { ; 45 : {
; 47 : return shaderProgram; ; 46 : return shaderProgram;
000aa 8b 85 08 01 00 000aa 8b 85 08 01 00
00 mov eax, DWORD PTR shaderProgram$[rbp] 00 mov eax, DWORD PTR shaderProgram$[rbp]
$LN3@linkShader: $LN3@linkShader:
$LN1@linkShader: $LN1@linkShader:
; 48 : } ; 47 : }
; 49 : } ; 48 : }
000b0 48 8b f8 mov rdi, rax 000b0 48 8b f8 mov rdi, rax
000b3 48 8d 4d e0 lea rcx, QWORD PTR [rbp-32] 000b3 48 8d 4d e0 lea rcx, QWORD PTR [rbp-32]
@@ -777,37 +776,33 @@ $LN3:
00 00 lea rcx, OFFSET FLAT:__59F96598_StgSharpC@c 00 00 lea rcx, OFFSET FLAT:__59F96598_StgSharpC@c
0001d e8 00 00 00 00 call __CheckForDebuggerJustMyCode 0001d e8 00 00 00 00 call __CheckForDebuggerJustMyCode
; 12 : glfwInit(); ; 12 : glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, majorVersion);
00022 e8 00 00 00 00 call glfwInit 00022 8b 95 e0 00 00
; 13 : glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, majorVersion);
00027 8b 95 e0 00 00
00 mov edx, DWORD PTR majorVersion$[rbp] 00 mov edx, DWORD PTR majorVersion$[rbp]
0002d b9 02 20 02 00 mov ecx, 139266 ; 00022002H 00028 b9 02 20 02 00 mov ecx, 139266 ; 00022002H
00032 e8 00 00 00 00 call glfwWindowHint 0002d e8 00 00 00 00 call glfwWindowHint
; 14 : glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, minorVersion); ; 13 : glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, minorVersion);
00037 8b 95 e8 00 00 00032 8b 95 e8 00 00
00 mov edx, DWORD PTR minorVersion$[rbp] 00 mov edx, DWORD PTR minorVersion$[rbp]
0003d b9 03 20 02 00 mov ecx, 139267 ; 00022003H 00038 b9 03 20 02 00 mov ecx, 139267 ; 00022003H
00042 e8 00 00 00 00 call glfwWindowHint 0003d e8 00 00 00 00 call glfwWindowHint
; 15 : glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); ; 14 : glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
00047 ba 01 20 03 00 mov edx, 204801 ; 00032001H 00042 ba 01 20 03 00 mov edx, 204801 ; 00032001H
0004c b9 08 20 02 00 mov ecx, 139272 ; 00022008H 00047 b9 08 20 02 00 mov ecx, 139272 ; 00022008H
00051 e8 00 00 00 00 call glfwWindowHint 0004c e8 00 00 00 00 call glfwWindowHint
; 16 : } ; 15 : }
00056 48 8d a5 c8 00 00051 48 8d a5 c8 00
00 00 lea rsp, QWORD PTR [rbp+200] 00 00 lea rsp, QWORD PTR [rbp+200]
0005d 5f pop rdi 00058 5f pop rdi
0005e 5d pop rbp 00059 5d pop rbp
0005f c3 ret 0 0005a c3 ret 0
initGL ENDP initGL ENDP
_TEXT ENDS _TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI ; Function compile flags: /Odtp /RTCsu /ZI
Binary file not shown.
+3 -2
View File
@@ -1,3 +1,4 @@
正在创建库 D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgSharpC.lib 和对象 D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgSharpC.exp StgSharpC.c
LINK : warning LNK4098: 默认库“MSVCRT”与其他库的使用冲突;请使用 /NODEFAULTLIB:library D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgSharpC\StgSharpC.c(23,18): warning C4047: “=”:“char”与“char [27]”的间接级别不同
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgSharpC\StgSharpC.c(67,5): warning C4047: “return”:“char *”与“char (*)[512]”的间接级别不同
StgSharpC.vcxproj -> D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgSharpC.dll StgSharpC.vcxproj -> D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgSharpC.dll
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -39,6 +39,7 @@ namespace StgSharp
{ {
public static unsafe partial class StgSharp public static unsafe partial class StgSharp
{ {
private static bool _inited;
/// <summary> /// <summary>
/// Init an instance of OpenGL program, /// Init an instance of OpenGL program,
@@ -78,6 +78,18 @@ namespace StgSharp
private static bool vsyncActivated; private static bool vsyncActivated;
internal static GraphicAPI API = default; 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) public static void Mark(bool needConsole)
{ {
markCount++; markCount++;
@@ -42,8 +42,11 @@ namespace StgSharp
public partial class StgSharp public partial class StgSharp
{ {
internal static StgSharpTime mainTimeProvider; internal static StgSharpTime mainTimeProvider;
internal static StgSharpTime MainTimeProvider=>mainTimeProvider;
} }
public sealed class StgSharpTime : TimeSourceProviderBase public sealed class StgSharpTime : TimeSourceProviderBase
@@ -58,8 +61,7 @@ namespace StgSharp
{ {
} }
public static StgSharpTime OnlyInstance public static StgSharpTime OnlyInstance => StgSharp.MainTimeProvider;
=> StgSharp.mainTimeProvider;
public override sealed void StartProvidingTime() public override sealed void StartProvidingTime()
{ {
@@ -90,10 +92,6 @@ namespace StgSharp
timeProvideThread.Start(); timeProvideThread.Start();
} }
[MethodImpl(MethodImplOptions.NoOptimization)]
public static void TimerActivate(int maxFrameUpdateSensitiveTimeProviderCount)
{
}
protected override sealed void AddSubscriberUnsynced(TimeSpanProvider subscriber) protected override sealed void AddSubscriberUnsynced(TimeSpanProvider subscriber)
{ {
@@ -115,6 +113,11 @@ namespace StgSharp
while (mainProvider.IsRunning) while (mainProvider.IsRunning)
{ {
totalMS = mainProvider.ElapsedTicks / (internalFrequncy / (1000L * 1000L)); totalMS = mainProvider.ElapsedTicks / (internalFrequncy / (1000L * 1000L));
if (subscriberList.Count==0)
{
continue;
}
CheckSubscriberSemaphore.Wait();
foreach (TimeSpanProvider subscriber in subscriberList) foreach (TimeSpanProvider subscriber in subscriberList)
{ {
if (subscriber.CheckTime(totalMS)) if (subscriber.CheckTime(totalMS))
@@ -122,6 +125,16 @@ namespace StgSharp
}; };
} }
CheckSubscriberSemaphore.Release();
}
int a = 0;
}
public void Terminate()
{
lock (mainProvider)
{
mainProvider.Stop();
} }
} }
+7 -5
View File
@@ -1,6 +1,7 @@
//using StgSharp.Envitronment.Win32; //using StgSharp.Envitronment.Win32;
using StgSharp.Geometries; using StgSharp.Geometries;
using StgSharp.Graphics; using StgSharp.Graphics;
using StgSharp.Math;
using System; using System;
@@ -46,7 +47,7 @@ namespace StgSharp
{ {
InternalIO.InternalWriteLog("\n\n\n", "Program start", LogType.Info); InternalIO.InternalWriteLog("\n\n\n", "Program start", LogType.Info);
SetRenderThreads(1); SetRenderThreads(2);
SetMetadata(800, 600, "Hello, STG#!", IntPtr.Zero, null); SetMetadata(800, 600, "Hello, STG#!", IntPtr.Zero, null);
MakeAsCurrentContext(); MakeAsCurrentContext();
@@ -134,7 +135,7 @@ namespace StgSharp
/**/ /**/
} }
public override void Main(params object[] args) public override void Main()
{ {
ProcessInput(WindowID); ProcessInput(WindowID);
@@ -155,8 +156,8 @@ namespace StgSharp
float time = (float)InternalIO.glfwGetTime(); float time = (float)InternalIO.glfwGetTime();
gl.SetValue(color, gl.SetValue(color,
0.5f + MathF.Sin(time), 0.5f + MathF.Cos(time),
0.5f + MathF.Sin(time * 0.1f), 0.5f + MathF.Sin(time * 0.8f + 2 * Scaler.Pi / 3),
0.5f + MathF.Sin(time/* - 0.667f * 3.14f/**/) 0.5f + MathF.Sin(time/* - 0.667f * 3.14f/**/)
); );
@@ -178,12 +179,13 @@ namespace StgSharp
//StgSharp.TryCreatWindow(); //StgSharp.TryCreatWindow();
/**/ /**/
StgSharp.Init();
StgSharp.InitGL(4, 6); StgSharp.InitGL(4, 6);
StgSharp.GlobalSetting.VSyncActivated = false; StgSharp.GlobalSetting.VSyncActivated = false;
StgSharpDemoForm demoForm = new StgSharpDemoForm(); StgSharpDemoForm demoForm = new StgSharpDemoForm();
demoForm.Init(); demoForm.Init();
demoForm.Show(); demoForm.Show();
StgSharp.Terminate();
/**/ /**/
/* /*
+1 -1
View File
@@ -11,7 +11,7 @@ uniform vec3 color;
void main() void main()
{ {
gl_Position = vec4(aPos.xyz,1.0); gl_Position = vec4(aPos.xyz,1.0) + vec4(color.xy-vec2(0.5,0.5),0.0,0.0);
TexColor = color; TexColor = color;
TexCoord = aTextCoord; TexCoord = aTextCoord;
} }
@@ -14,7 +14,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("StgSharpDebug")] [assembly: System.Reflection.AssemblyCompanyAttribute("StgSharpDebug")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] [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("StgSharpDebug")] [assembly: System.Reflection.AssemblyProductAttribute("StgSharpDebug")]
[assembly: System.Reflection.AssemblyTitleAttribute("StgSharpDebug")] [assembly: System.Reflection.AssemblyTitleAttribute("StgSharpDebug")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
@@ -1 +1 @@
3aa7da67b6813f3947d097a5f157a32e0cc91617596bb9e7a8770735ee78e02b 7d50eb808513f7c1246e38438c68619b8038ea6f40d8f0195814ea5f153c8520
@@ -1 +1 @@
c392364d0fdf9f80d34fdb655daec7662e4a9944698e668e912c170812c83950 89534d11606e9fa10416379029e46e1abd565a616f84922a93aa832564d2e51e
@@ -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"/> Width of this form, represent in <see cref="T:System.Int32"/>
</summary> </summary>
</member> </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"> <member name="M:StgSharp.Graphics.Form.MakeAsCurrentContext">
<summary> <summary>
Init an OpenGl context if current form has not been binded to any context. and set the context binded to 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="maxWidth">Maximum width of curent form</param>
<param name="maxHeight">Maximum height of current form</param> <param name="maxHeight">Maximum height of current form</param>
</member> </member>
<member name="M:StgSharp.Graphics.Form.Init(System.Object[])"> <member name="M:StgSharp.Graphics.Form.Show">
<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[])">
<summary> <summary>
Init this form and render it on screen, and respond with operation Init this form and render it on screen, and respond with operation
</summary> </summary>
@@ -137,13 +137,6 @@
<param name="count">Amount of EBO to be created.</param> <param name="count">Amount of EBO to be created.</param>
<returns></returns> <returns></returns>
</member> </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)"> <member name="M:StgSharp.Graphics.Form.CreateTexture(System.Int32)">
<summary> <summary>
Create a sets of <see cref="T:StgSharp.Graphics.Texture"/> Create a sets of <see cref="T:StgSharp.Graphics.Texture"/>
@@ -151,6 +144,13 @@
<param name="count">Amount of textures to be crated.</param> <param name="count">Amount of textures to be crated.</param>
<returns></returns> <returns></returns>
</member> </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)"> <member name="M:StgSharp.Graphics.Form.CreateVertexBuffer(System.Int32)">
<summary> <summary>
Create aset of <see cref="T:StgSharp.Graphics.VertexBuffer"/>. Create aset of <see cref="T:StgSharp.Graphics.VertexBuffer"/>.
@@ -273,11 +273,6 @@
Inti a shader with no program attached. Inti a shader with no program attached.
</summary> </summary>
</member> </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)"> <member name="M:StgSharp.Graphics.ShaderProgram.GetUniform``1(System.String)">
<summary> <summary>
Get a uniform form current shader, Get a uniform form current shader,
@@ -302,6 +297,11 @@
<param name="name">Name of the Uniform in shader code</param> <param name="name">Name of the Uniform in shader code</param>
<returns></returns> <returns></returns>
</member> </member>
<member name="M:StgSharp.Graphics.ShaderProgram.Link">
<summary>
Link the shader to current context.
</summary>
</member>
<member name="M:StgSharp.Graphics.ShaderProgram.Use"> <member name="M:StgSharp.Graphics.ShaderProgram.Use">
<summary> <summary>
Let the current context use this shader. Let the current context use this shader.
@@ -466,17 +466,6 @@
</summary> </summary>
<param name="form"></param> <param name="form"></param>
</member> </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)"> <member name="M:StgSharp.Graphics.IglFunc.SetValue(StgSharp.Graphics.Uniform{System.Single,System.Single,System.Single,System.Single},StgSharp.Math.Vec4d)">
<summary> <summary>
Set data value to a float <see cref="T:StgSharp.Graphics.Uniform`4"/>, 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="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> <param name="vec">A <see cref="T:StgSharp.Math.Vec4d"/> packing four parameters of the uniform </param>
</member> </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)"> <member name="M:StgSharp.Graphics.IglFunc.SetValue(StgSharp.Graphics.Uniform{System.Single},System.Single)">
<summary> <summary>
Set data value to a float <see cref="T:StgSharp.Graphics.Uniform`1"/>, 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="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> <param name="vec">A <see cref="T:StgSharp.Math.Vec4d"/> value of the uniform </param>
</member> </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)"> <member name="M:StgSharp.Graphics.IglFunc.SetVertexAttribute(System.UInt32,System.Int32,System.TypeCode,System.Boolean,System.UInt32,System.Int32)">
<summary> <summary>
Set how a shader parameter read data from a VBO. 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> <param name="tick">The game tick represent time passed by</param>
<returns>A 3d vector representing movement</returns> <returns>A 3d vector representing movement</returns>
</member> </member>
<member name="M:StgSharp.Geometries.Line.MoveBeginPoint(System.UInt32)"> <member name="M:StgSharp.Geometries.Line.MoveBeginPoint(System.Int32)">
<summary> <summary>
Move begin side of a line. Move begin side of a line.
It is recommended to override this function rather than It is recommended to override this function rather than
@@ -662,7 +662,7 @@
</summary> </summary>
<param name="tick">Time passed since current line was created.</param> <param name="tick">Time passed since current line was created.</param>
</member> </member>
<member name="M:StgSharp.Geometries.Line.MoveEndPoint(System.UInt32)"> <member name="M:StgSharp.Geometries.Line.MoveEndPoint(System.Int32)">
<summary> <summary>
Move end side of a line. Move end side of a line.
It is recommended to override this function rather than It is recommended to override this function rather than
@@ -671,7 +671,7 @@
<param name="tick">Time passed since current line was created.</param> <param name="tick">Time passed since current line was created.</param>
<returns></returns> <returns></returns>
</member> </member>
<member name="M:StgSharp.Geometries.Parallelogram.MoveVertex2(System.UInt32)"> <member name="M:StgSharp.Geometries.Parallelogram.MoveVertex2(System.Int32)">
<summary> <summary>
Move the third vertix. this is a useless method for Parallelograms. Move the third vertix. this is a useless method for Parallelograms.
</summary> </summary>
@@ -679,7 +679,7 @@
<returns></returns> <returns></returns>
<exception cref="T:StgSharp.Geometries.UnusedVertexException">Geometry overdefined</exception> <exception cref="T:StgSharp.Geometries.UnusedVertexException">Geometry overdefined</exception>
</member> </member>
<member name="M:StgSharp.Geometries.Parallelogram.MoveVertex3(System.UInt32)"> <member name="M:StgSharp.Geometries.Parallelogram.MoveVertex3(System.Int32)">
<summary> <summary>
Move the third vertix. This method is useless for Parallelograms. Move the third vertix. This method is useless for Parallelograms.
</summary> </summary>
@@ -692,6 +692,11 @@
平面几何体。包含三角形,对称四边形,自由多边形等。最多可由16个点参数定义。 平面几何体。包含三角形,对称四边形,自由多边形等。最多可由16个点参数定义。
</summary> </summary>
</member> </member>
<member name="P:StgSharp.Geometries.PlainGeometry.BornTime">
<summary>
Tick time this geometry eas crested
</summary>
</member>
<member name="M:StgSharp.Geometries.PlainGeometry.GetAllSides"> <member name="M:StgSharp.Geometries.PlainGeometry.GetAllSides">
<summary> <summary>
Get all sides of this <see cref="T:StgSharp.Geometries.PlainGeometry"/>. Get all sides of this <see cref="T:StgSharp.Geometries.PlainGeometry"/>.
@@ -704,11 +709,6 @@
</summary> </summary>
<returns></returns> <returns></returns>
</member> </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)"> <member name="M:StgSharp.Geometries.Point.Update(System.UInt32)">
<summary> <summary>
Update the coordinate of the point. If this is a moving point, Update the coordinate of the point. If this is a moving point,
@@ -778,25 +778,41 @@
The second <see cref="T:System.Boolean"/> value. The second <see cref="T:System.Boolean"/> value.
</summary> </summary>
</member> </member>
<member name="T:StgSharp.TimeProvider"> <member name="T:StgSharp.TimeSpanProvider">
<summary> <summary>
A microsecond-accuracy timer. It will refresh every a certain time span. A microsecond-accuracy timer. It will refresh every a certain time span.
</summary> </summary>
</member> </member>
<member name="M:StgSharp.TimeProvider.#ctor(System.Int64,StgSharp.TimeSourceProvider)"> <member name="M:StgSharp.TimeSpanProvider.#ctor(System.Int64,StgSharpDebug.Logic.TimeSourceProviderBase)">
<summary> <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> </summary>
<param name="spanLength"></param> <param name="spanLength"></param>
<parma name="provider"></parma>
</member> </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> <summary>
Time source provider provided in <see cref="T:StgSharp.StgSharp"/> internal framework. Time source provider provided in <see cref="T:StgSharp.StgSharp"/> internal framework.
</summary> </summary>
</member> </member>
<member name="P:StgSharp.TimeProvider.SpanRefreshCallback"> <member name="P:StgSharp.TimeSpanProvider.SpanRefreshCallback">
<summary> <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> </summary>
</member> </member>
<member name="T:StgSharp.Math.GLclampf"> <member name="T:StgSharp.Math.GLclampf">
@@ -849,18 +865,18 @@
<param name="y"></param> <param name="y"></param>
<returns>Returns the value of x^y</returns> <returns>Returns the value of x^y</returns>
</member> </member>
<member name="M:StgSharp.Math.Scaler.Random">
<summary>
</summary>
<returns></returns>
</member>
<member name="M:StgSharp.Math.Scaler.LowProceisionRandom"> <member name="M:StgSharp.Math.Scaler.LowProceisionRandom">
<summary> <summary>
returns a random float number between 0 and 1. returns a random float number between 0 and 1.
</summary> </summary>
<returns></returns> <returns></returns>
</member> </member>
<member name="M:StgSharp.Math.Scaler.Random">
<summary>
</summary>
<returns></returns>
</member>
<member name="M:StgSharp.Math.Scaler.RandomSeed"> <member name="M:StgSharp.Math.Scaler.RandomSeed">
<summary> <summary>
Generates a random seed in int value. Generates a random seed in int value.
+1 -1
View File
@@ -23,7 +23,7 @@ namespace StgsharpEnvDebug
throw new NotImplementedException(); throw new NotImplementedException();
} }
public override void Main(object[] args) public override void Main()
{ {
throw new NotImplementedException(); throw new NotImplementedException();
} }
@@ -14,7 +14,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("StgsharpEnvDebug")] [assembly: System.Reflection.AssemblyCompanyAttribute("StgsharpEnvDebug")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] [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("StgsharpEnvDebug")] [assembly: System.Reflection.AssemblyProductAttribute("StgsharpEnvDebug")]
[assembly: System.Reflection.AssemblyTitleAttribute("StgsharpEnvDebug")] [assembly: System.Reflection.AssemblyTitleAttribute("StgsharpEnvDebug")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
@@ -1 +1 @@
2ca7ccb7ba3e43bbfc557f46ee96e48e65cf1acb0d37efdf05e0fca553d8f3e3 11db6760a69171ede0767fbd4cdd0f5c73fec99a5c6d2c7a760bada5c7ae656f