daily update on 20240312 by nitload youmu
This commit is contained in:
@@ -31,14 +31,13 @@ namespace StgSharp.Graphics
|
||||
internal Vector4 backgroundColor;
|
||||
internal unsafe GLcontext* contextID;
|
||||
internal DynamicArrayList<IntPtr> formBuffer;
|
||||
internal IglFunc gl;
|
||||
internal int height;
|
||||
internal IntPtr monitor;
|
||||
internal string name;
|
||||
internal Form sharedForm;
|
||||
internal int width;
|
||||
internal IntPtr windowID;
|
||||
private bool closed;
|
||||
internal IglFunc gl;
|
||||
|
||||
#endregion metadata
|
||||
|
||||
@@ -48,7 +47,6 @@ namespace StgSharp.Graphics
|
||||
private SemaphoreSlim _renderFinishSignal = new SemaphoreSlim(0, 1);
|
||||
private SemaphoreSlim _renderStartSignal = new SemaphoreSlim(1, 1);
|
||||
private bool isSingleThread = true;
|
||||
private Thread renderThread;
|
||||
|
||||
#endregion form thread setting
|
||||
|
||||
@@ -63,6 +61,11 @@ namespace StgSharp.Graphics
|
||||
{
|
||||
}
|
||||
|
||||
unsafe ~Form()
|
||||
{
|
||||
Marshal.FreeHGlobal((IntPtr)contextID);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// OpenGL package used by current form context.
|
||||
/// </summary>
|
||||
@@ -89,11 +92,20 @@ namespace StgSharp.Graphics
|
||||
get { return isSingleThread; }
|
||||
}
|
||||
|
||||
private int _shouldClose = 0;
|
||||
|
||||
public bool ShouldClose
|
||||
{
|
||||
get
|
||||
{
|
||||
Interlocked.Exchange(ref _shouldClose, InternalIO.glfwWindowShouldClose(windowID));
|
||||
return 0 != _shouldClose;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
InternalIO.glfwSetWindowShouldClose(windowID, value ? 1 : 0);
|
||||
Interlocked.Exchange(ref _shouldClose, value ? 1 : 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -136,11 +148,6 @@ namespace StgSharp.Graphics
|
||||
set { _renderStartSignal = value; }
|
||||
}
|
||||
|
||||
internal Thread RenderThread
|
||||
{
|
||||
get { return renderThread; }
|
||||
}
|
||||
|
||||
protected FrameBufferSizeHandler FrameBufferSizeCallback
|
||||
{
|
||||
set
|
||||
@@ -150,11 +157,6 @@ namespace StgSharp.Graphics
|
||||
}
|
||||
}
|
||||
|
||||
unsafe ~Form()
|
||||
{
|
||||
Marshal.FreeHGlobal((IntPtr)contextID);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Init an OpenGl context if current form has not been binded to any context.
|
||||
/// and set the context binded to current form as current OpenGL context.
|
||||
@@ -185,6 +187,12 @@ namespace StgSharp.Graphics
|
||||
{
|
||||
windowID = windowPtr;
|
||||
}
|
||||
|
||||
IntPtr ptr = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(GLcontext)));
|
||||
contextID = (GLcontext*)ptr;
|
||||
*contextID = new GLcontext();
|
||||
contextID->glGetString = (delegate*<uint, IntPtr>)IntPtr.Zero;
|
||||
gl = new GLonRender(contextID);
|
||||
}
|
||||
InternalIO.glfwMakeContextCurrent(windowID);
|
||||
gl.SwitchContext();
|
||||
@@ -259,37 +267,12 @@ namespace StgSharp.Graphics
|
||||
(int)minSize.X, (int)minSize.Y, (int)maxSize.X, (int)maxSize.Y);
|
||||
}
|
||||
|
||||
public unsafe void SwapAndPollEvent()
|
||||
{
|
||||
if (windowID == IntPtr.Zero)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (isSingleThread)
|
||||
{
|
||||
InternalIO.glfwSwapBuffers(windowID);
|
||||
InternalIO.glfwPollEvents();
|
||||
}
|
||||
else
|
||||
{
|
||||
M128 m = default;
|
||||
m.Write<ulong>(0, (ulong)windowID);
|
||||
GLonUpdate glu = gl as GLonUpdate;
|
||||
glu.frameworkHandleEnqueue(
|
||||
(IntPtr)(delegate*<void>)&InternalSwapBuffer, m);
|
||||
}
|
||||
}
|
||||
|
||||
internal static void InternalSwapBuffer()
|
||||
{
|
||||
IntPtr handle = default;
|
||||
GLonUpdate.ParamQueue.TryDequeue(out handle);
|
||||
InternalIO.glfwSwapBuffers(handle);
|
||||
InternalIO.glfwPollEvents();
|
||||
}
|
||||
|
||||
#region form main
|
||||
|
||||
private static unsafe delegate*<void> pollEventPtr = &InternalIO.glfwPollEvents;
|
||||
|
||||
private static unsafe delegate*<void> swapBufferPtr = &InternalSwapBuffers;
|
||||
|
||||
public abstract void Deinit(params object[] args);
|
||||
|
||||
/// <summary>
|
||||
@@ -305,10 +288,22 @@ namespace StgSharp.Graphics
|
||||
/// <param name="args"></param>
|
||||
public abstract void Main(params object[] args);
|
||||
|
||||
public unsafe void PollEvents()
|
||||
{
|
||||
if (isSingleThread)
|
||||
{
|
||||
InternalIO.glfwPollEvents();
|
||||
}
|
||||
else
|
||||
{
|
||||
gl.frameworkHandleEnqueue((IntPtr)pollEventPtr);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Init this form and render it on screen, and respond with operation
|
||||
/// </summary>
|
||||
public void Show(params object[] args)
|
||||
public unsafe void Show(params object[] args)
|
||||
{
|
||||
if (gl == null)
|
||||
{
|
||||
@@ -316,21 +311,53 @@ namespace StgSharp.Graphics
|
||||
}
|
||||
else if (isSingleThread)
|
||||
{
|
||||
while (gl.GetWindowShouldClose(this))
|
||||
while (!ShouldClose)
|
||||
{
|
||||
Main(args);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
while (gl.GetWindowShouldClose(this))
|
||||
gl = new GLonUpdate(contextID);
|
||||
Thread renderThread = new Thread(new ThreadStart(InternalRender));
|
||||
renderThread.Start();
|
||||
int a = 0;
|
||||
while (!ShouldClose)
|
||||
{
|
||||
Main(args);
|
||||
if (gl.FrameCanUpdate)
|
||||
{
|
||||
Main(args);
|
||||
}
|
||||
}
|
||||
//TODO 对逻辑线程和渲染线程进行同步,两种gl模式包需要改名字
|
||||
renderThread.Join();
|
||||
//Thread.Sleep(1000 * 20);
|
||||
//ShouldClose = true;
|
||||
//(gl as GLonUpdate).GLactionQueue.Clear();
|
||||
}
|
||||
}
|
||||
|
||||
public unsafe void SwapBuffers()
|
||||
{
|
||||
if (isSingleThread)
|
||||
{
|
||||
InternalIO.glfwSwapBuffers(windowID);
|
||||
}
|
||||
else
|
||||
{
|
||||
M128 m = new M128();
|
||||
m.Write<ulong>(0, (ulong)windowID);
|
||||
gl.frameworkHandleEnqueue((IntPtr)swapBufferPtr, m);
|
||||
}
|
||||
}
|
||||
|
||||
internal static unsafe void InternalSwapBuffers()
|
||||
{
|
||||
IntPtr winHandle = default;
|
||||
GLonUpdate.ParamQueue.TryDequeue(out winHandle);
|
||||
InternalIO.glfwSwapBuffers(winHandle);
|
||||
}
|
||||
|
||||
internal void InternalDeinit(params object[] args)
|
||||
{
|
||||
Deinit(args);
|
||||
@@ -338,7 +365,7 @@ namespace StgSharp.Graphics
|
||||
|
||||
internal void InternalInit(params object[] args)
|
||||
{
|
||||
Init((object[])args);
|
||||
Init(args);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -354,50 +381,38 @@ namespace StgSharp.Graphics
|
||||
else
|
||||
{
|
||||
InternalIO.InternalWriteLog("Attempt to get OpenGL API package in other graphic envitronment.", LogType.Error);
|
||||
throw new Exception();
|
||||
throw new InvalidOperationException("Attempt to get OpenGL API package in other graphic envitronment.");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Define how current form render in one frame.
|
||||
/// </summary>
|
||||
/// <param name="requireDoubleRendering">
|
||||
/// <param name="leastThreds">
|
||||
/// Please define this befor calling any OpenGL api and other graphic methods.
|
||||
/// </param>
|
||||
protected unsafe void SetRenderThreads(int requiredThreds)
|
||||
protected unsafe void SetRenderThreads(int leastThreds)
|
||||
{
|
||||
if (gl != default)
|
||||
{
|
||||
throw new InvalidOperationException("Cannot define threads after loading gl context.");
|
||||
}
|
||||
if (requiredThreds == 1)
|
||||
if (leastThreds == 1)
|
||||
{
|
||||
isSingleThread = true;
|
||||
}
|
||||
else if (requiredThreds == 2)
|
||||
else if (leastThreds >= 2)
|
||||
{
|
||||
isSingleThread = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Exception();
|
||||
throw new ArgumentException("Amount of threads should be bigger than 0");
|
||||
}
|
||||
IntPtr ptr = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(GLcontext)));
|
||||
contextID = (GLcontext*)ptr;
|
||||
*contextID = new GLcontext();
|
||||
contextID->glGetString = (delegate*<uint, IntPtr>)IntPtr.Zero;
|
||||
InternalIO.InternalWriteLog("Successfully create a context binded to current form. " +
|
||||
$"Its ID is {(ulong)ptr}", LogType.Info);
|
||||
if (isSingleThread)
|
||||
{
|
||||
gl = new GLonRender(contextID);
|
||||
}
|
||||
else
|
||||
{
|
||||
GLonUpdate pack = new GLonUpdate(contextID);
|
||||
gl = pack;
|
||||
renderThread = new Thread(new ThreadStart(InternalRender));
|
||||
}
|
||||
}
|
||||
|
||||
private unsafe void InternalRender()
|
||||
@@ -406,25 +421,19 @@ namespace StgSharp.Graphics
|
||||
ConcurrentQueue<IntPtr> glActions = (gl as GLonUpdate).GLactionQueue;
|
||||
#pragma warning restore CS8602
|
||||
IntPtr currentOperation;
|
||||
TimeSpan span = new TimeSpan(100L);
|
||||
try
|
||||
{
|
||||
while (gl.GetWindowShouldClose(this))
|
||||
while (_shouldClose == 0)
|
||||
{
|
||||
if (glActions.TryDequeue(out currentOperation))
|
||||
{
|
||||
((delegate*<void>)currentOperation)();
|
||||
}
|
||||
else
|
||||
{
|
||||
Thread.Sleep(span);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
this.ShouldClose = true;
|
||||
(gl as GLonUpdate).ShowDequeueStream();
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,469 @@
|
||||
using StgSharp.Logic;
|
||||
using StgSharp.Math;
|
||||
using System;
|
||||
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StgSharp.Graphics
|
||||
{
|
||||
internal sealed class FrameOperationBuffer
|
||||
{
|
||||
private IntPtr _func;
|
||||
private ConcurrentQueue<IntPtr> _funcQueue;
|
||||
private GLparamQueue _param;
|
||||
internal unsafe GLcontext* context;
|
||||
|
||||
public unsafe bool CallNext()
|
||||
{
|
||||
if (_funcQueue.TryDequeue(out _func))
|
||||
{
|
||||
((delegate*<void>)_func)();
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
#region gl param queue
|
||||
|
||||
private ConcurrentQueue<M128> paramQueue = new ConcurrentQueue<M128>();
|
||||
private ConcurrentQueue<glArrayHandle> streamQueue = new ConcurrentQueue<glArrayHandle>();
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void Enqueue(Vec4d v)
|
||||
{
|
||||
paramQueue.Enqueue(v);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void Enqueue(M128 m)
|
||||
{
|
||||
paramQueue.Enqueue(m);
|
||||
Console.WriteLine(paramQueue.Count + streamQueue.Count);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void Enqueue(uint u0)
|
||||
{
|
||||
M128 m = default;
|
||||
m.Write<uint>(0, u0);
|
||||
this.Enqueue(m);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void Enqueue(uint u0, uint u1)
|
||||
{
|
||||
M128 m = default;
|
||||
m.Write<uint>(0, u0);
|
||||
m.Write<uint>(1, u1);
|
||||
this.Enqueue(m);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void Enqueue(ulong u0, ulong u1)
|
||||
{
|
||||
M128 m = default;
|
||||
m.Write<ulong>(0, u0);
|
||||
m.Write<ulong>(1, u1);
|
||||
this.Enqueue(m);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void Enqueue(uint u0, uint u1, uint u2)
|
||||
{
|
||||
M128 m = default;
|
||||
m.Write<uint>(0, u0);
|
||||
m.Write<uint>(1, u1);
|
||||
m.Write<uint>(2, u2);
|
||||
this.Enqueue(m);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void Enqueue(float f0, float f1, float f2)
|
||||
{
|
||||
M128 m = default;
|
||||
m.Write<float>(0, f0);
|
||||
m.Write<float>(1, f1);
|
||||
this.Enqueue(m);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void Enqueue(float f0, float f1, float f2, float f3)
|
||||
{
|
||||
M128 m = default;
|
||||
m.Write<float>(0, f0);
|
||||
m.Write<float>(1, f1);
|
||||
m.Write<float>(2, f2);
|
||||
m.Write<float>(3, f3);
|
||||
this.Enqueue(m);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void Enqueue(IntPtr p0, IntPtr p1)
|
||||
{
|
||||
M128 m = default;
|
||||
m.Write<ulong>(0, (ulong)p0);
|
||||
m.Write<ulong>(1, (ulong)p1);
|
||||
this.Enqueue(m);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void Enqueue(IntPtr p)
|
||||
{
|
||||
M128 m = default;
|
||||
m.Write<ulong>(0, (ulong)p);
|
||||
this.Enqueue(m);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public unsafe void Enqueue(glHandle handle)
|
||||
{
|
||||
M128 m = default;
|
||||
m.Write<ulong>(0, (ulong)handle.valuePtr);
|
||||
this.Enqueue(m);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public unsafe void Enqueue(glHandle handle, glHandle handle1)
|
||||
{
|
||||
M128 m = default;
|
||||
m.Write<ulong>(0, (ulong)handle.valuePtr);
|
||||
m.Write<ulong>(1, (ulong)handle1.valuePtr);
|
||||
this.Enqueue(m);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void Enqueue(int i0)
|
||||
{
|
||||
M128 m = default;
|
||||
m.Write<int>(0, i0);
|
||||
this.Enqueue(m);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void Enqueue(int i0, int i1)
|
||||
{
|
||||
M128 m = default;
|
||||
m.Write<int>(0, i0);
|
||||
m.Write<int>(1, i1);
|
||||
this.Enqueue(m);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void Enqueue(int i0, int i1, int i2)
|
||||
{
|
||||
M128 m = default;
|
||||
m.Write<int>(0, i0);
|
||||
m.Write<int>(1, i1);
|
||||
m.Write<int>(2, i2);
|
||||
this.Enqueue(m);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void Enqueue(int i0, int i1, int i2, int i3)
|
||||
{
|
||||
M128 m = default;
|
||||
m.Write<int>(0, i0);
|
||||
m.Write<int>(1, i1);
|
||||
m.Write<int>(2, i2);
|
||||
m.Write<int>(3, i3);
|
||||
this.Enqueue(m);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void Enqueue(string str)
|
||||
{
|
||||
byte[] code = Encoding.UTF8.GetBytes(str);
|
||||
streamQueue.Enqueue(glArrayHandle.Alloc<byte>(code));
|
||||
Console.WriteLine(paramQueue.Count + streamQueue.Count);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void Enqueue<T>(T[] array) where T : struct
|
||||
{
|
||||
streamQueue.Enqueue(glArrayHandle.Alloc<T>(array));
|
||||
Console.WriteLine(paramQueue.Count + streamQueue.Count);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void TryDequeue(out glArrayHandle arrayHandle)
|
||||
{
|
||||
if (!streamQueue.TryDequeue(out arrayHandle))
|
||||
{
|
||||
InternalIO.InternalWriteLog("No param in buffer when calling gl function:", LogType.Error);
|
||||
throw new Exception();
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public bool TryDequeue(out M128 m)
|
||||
{
|
||||
bool ret = paramQueue.TryDequeue(out m);
|
||||
return ret;
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public unsafe void TryDequeue(out Vec4d v)
|
||||
{
|
||||
M128 m;
|
||||
if (this.TryDequeue(out m))
|
||||
{
|
||||
v = *(Vec4d*)&m;
|
||||
}
|
||||
else
|
||||
{
|
||||
InternalIO.InternalWriteLog("No param in buffer when calling gl function.", LogType.Error);
|
||||
throw new Exception();
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void TryDequeue<T>(out T[] array)
|
||||
{
|
||||
glArrayHandle output = default;
|
||||
if (streamQueue.TryDequeue(out output))
|
||||
{
|
||||
array = output.a as T[];
|
||||
}
|
||||
else
|
||||
{
|
||||
InternalIO.InternalWriteLog("No param in buffer when calling gl function.", LogType.Error);
|
||||
throw new Exception();
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void TryDequeue(out int i0)
|
||||
{
|
||||
M128 ret;
|
||||
if (this.TryDequeue(out ret))
|
||||
{
|
||||
i0 = ret.Read<int>(0);
|
||||
}
|
||||
else
|
||||
{
|
||||
InternalIO.InternalWriteLog("No param in buffer when calling gl function.", LogType.Error);
|
||||
throw new Exception();
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void TryDequeue(out int i0, out int i1)
|
||||
{
|
||||
M128 ret;
|
||||
if (this.TryDequeue(out ret))
|
||||
{
|
||||
i0 = ret.Read<int>(0);
|
||||
i1 = ret.Read<int>(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
InternalIO.InternalWriteLog("No param in buffer when calling gl function.", LogType.Error);
|
||||
throw new Exception();
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void TryDequeue(out int i0, out int i1, out int i2)
|
||||
{
|
||||
M128 ret;
|
||||
if (this.TryDequeue(out ret))
|
||||
{
|
||||
i0 = ret.Read<int>(0);
|
||||
i1 = ret.Read<int>(1);
|
||||
i2 = ret.Read<int>(2);
|
||||
}
|
||||
else
|
||||
{
|
||||
InternalIO.InternalWriteLog("No param in buffer when calling gl function.", LogType.Error);
|
||||
throw new Exception();
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void TryDequeue(out int i0, out int i1, out int i2, out int i3)
|
||||
{
|
||||
M128 ret;
|
||||
if (this.TryDequeue(out ret))
|
||||
{
|
||||
i0 = ret.Read<int>(0);
|
||||
i1 = ret.Read<int>(1);
|
||||
i2 = ret.Read<int>(2);
|
||||
i3 = ret.Read<int>(3);
|
||||
}
|
||||
else
|
||||
{
|
||||
InternalIO.InternalWriteLog("No param in buffer when calling gl function.", LogType.Error);
|
||||
throw new Exception();
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void TryDequeue(out IntPtr p)
|
||||
{
|
||||
M128 ret;
|
||||
if (this.TryDequeue(out ret))
|
||||
{
|
||||
p = (IntPtr)ret.Read<ulong>(0);
|
||||
}
|
||||
else
|
||||
{
|
||||
InternalIO.InternalWriteLog("No param in buffer when calling gl function.", LogType.Error);
|
||||
throw new Exception();
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void TryDequeue(out IntPtr p0, out IntPtr p1)
|
||||
{
|
||||
M128 ret;
|
||||
if (this.TryDequeue(out ret))
|
||||
{
|
||||
p0 = (IntPtr)ret.Read<ulong>(0);
|
||||
p1 = (IntPtr)ret.Read<ulong>(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
InternalIO.InternalWriteLog("No param in buffer when calling gl function.", LogType.Error);
|
||||
throw new Exception();
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void TryDequeue(out float f0, out float f1, out float f2, out float f3)
|
||||
{
|
||||
M128 ret;
|
||||
if (this.TryDequeue(out ret))
|
||||
{
|
||||
f0 = ret.Read<uint>(0);
|
||||
f1 = ret.Read<uint>(1);
|
||||
f2 = ret.Read<uint>(2);
|
||||
f3 = ret.Read<uint>(3);
|
||||
}
|
||||
else
|
||||
{
|
||||
InternalIO.InternalWriteLog("No param in buffer when calling gl function.", LogType.Error);
|
||||
throw new Exception();
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void TryDequeue(out float f0, out float f1, out float f2)
|
||||
{
|
||||
M128 ret;
|
||||
if (this.TryDequeue(out ret))
|
||||
{
|
||||
f0 = ret.Read<uint>(0);
|
||||
f1 = ret.Read<uint>(1);
|
||||
f2 = ret.Read<uint>(2);
|
||||
}
|
||||
else
|
||||
{
|
||||
InternalIO.InternalWriteLog("No param in buffer when calling gl function.", LogType.Error);
|
||||
throw new Exception();
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void TryDequeue(out uint u0)
|
||||
{
|
||||
M128 ret;
|
||||
if (this.TryDequeue(out ret))
|
||||
{
|
||||
u0 = ret.Read<uint>(0);
|
||||
}
|
||||
else
|
||||
{
|
||||
InternalIO.InternalWriteLog("No param in buffer when calling gl function.", LogType.Error);
|
||||
throw new Exception();
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void TryDequeue(out uint u0, out uint u1)
|
||||
{
|
||||
M128 ret;
|
||||
if (this.TryDequeue(out ret))
|
||||
{
|
||||
u0 = ret.Read<uint>(0);
|
||||
u1 = ret.Read<uint>(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
InternalIO.InternalWriteLog("No param in buffer when calling gl function.", LogType.Error);
|
||||
throw new Exception();
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void TryDequeue(out uint u0, out uint u1, out uint u2)
|
||||
{
|
||||
M128 ret;
|
||||
if (this.TryDequeue(out ret))
|
||||
{
|
||||
u0 = ret.Read<uint>(0);
|
||||
u1 = ret.Read<uint>(1);
|
||||
u2 = ret.Read<uint>(2);
|
||||
}
|
||||
else
|
||||
{
|
||||
InternalIO.InternalWriteLog("No param in buffer when calling gl function.", LogType.Error);
|
||||
throw new Exception();
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void TryDequeue(out uint u0, out uint u1, out uint u2, out uint u3)
|
||||
{
|
||||
M128 ret;
|
||||
if (this.TryDequeue(out ret))
|
||||
{
|
||||
u0 = ret.Read<uint>(0);
|
||||
u1 = ret.Read<uint>(1);
|
||||
u2 = ret.Read<uint>(2);
|
||||
u3 = ret.Read<uint>(3);
|
||||
}
|
||||
else
|
||||
{
|
||||
InternalIO.InternalWriteLog("No param in buffer when calling gl function.", LogType.Error);
|
||||
throw new Exception();
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
internal void SetContext(GLcontext* p)
|
||||
{
|
||||
context = p;
|
||||
}
|
||||
/**/
|
||||
|
||||
#endregion gl param queue
|
||||
}
|
||||
|
||||
internal sealed class FrameThread
|
||||
{
|
||||
private Thread _thread;
|
||||
private FrameOperationBuffer renderBuffer;
|
||||
private SemaphoreSlim renderCompleteSemaphore = new SemaphoreSlim(1, 1);
|
||||
private int terminateSignal;
|
||||
private FrameOperationBuffer updateBuffer;
|
||||
|
||||
public FrameThread(IglFunc gl)
|
||||
{
|
||||
}
|
||||
|
||||
private void PrivateMain()
|
||||
{
|
||||
while (renderBuffer.CallNext())
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -29,7 +29,6 @@ namespace StgSharp.Graphics
|
||||
public void SetValue<T>(int index, T[] bufferArray, BufferUsage usage)
|
||||
where T : struct, IConvertible
|
||||
{
|
||||
Console.WriteLine("Setting ebo data.");
|
||||
GL.BindBuffer(BufferType.ELEMENT_ARRAY_BUFFER, _bufferHandle[index]);
|
||||
GL.SetBufferData(BufferType.ELEMENT_ARRAY_BUFFER, bufferArray, usage);
|
||||
}
|
||||
|
||||
@@ -30,9 +30,8 @@ namespace StgSharp.Graphics
|
||||
/// <param name="index">Index to find certain VBO in this instance</param>
|
||||
/// <param name="bufferData">Data to write in</param>
|
||||
/// <param name="usage">How OpenGL use these data, defined by <see cref="BufferUsage"/></param>
|
||||
public void SetValue<T>(int index, T bufferData, BufferUsage usage) where T : IMat
|
||||
public void SetValue<T>(int index, T bufferData, BufferUsage usage) where T : struct, IMat
|
||||
{
|
||||
Console.WriteLine("Setting vbo data.");
|
||||
GL.BindBuffer(BufferType.ARRAY_BUFFER, _bufferHandle[index]);
|
||||
GL.SetBufferData(BufferType.ARRAY_BUFFER, bufferData, usage);
|
||||
}
|
||||
|
||||
@@ -11,33 +11,6 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace StgSharp.Graphics
|
||||
{
|
||||
//TODO 发现一个大问题,paramQueue大多数时候取出的是数组,不是数组句柄,也就是说其内存将被长期固定且不能回收,这是内存泄漏
|
||||
public unsafe class glArrayHandle
|
||||
{
|
||||
internal readonly Array copy;
|
||||
internal GCHandle handle;
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public IntPtr AddressOfArray()
|
||||
{
|
||||
return handle.AddrOfPinnedObject();
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static glArrayHandle Alloc<T>(T[] array) where T : struct
|
||||
{
|
||||
Array copy = new T[array.Length];
|
||||
array.CopyTo(copy, 0);
|
||||
return new glArrayHandle(copy);
|
||||
}
|
||||
|
||||
internal glArrayHandle(Array array)
|
||||
{
|
||||
copy = array;
|
||||
handle = GCHandle.Alloc(array, GCHandleType.Pinned);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A handle to an OpenGL object,
|
||||
/// must be indexed from a <see cref="glHandleSet"/>.
|
||||
@@ -139,7 +112,7 @@ namespace StgSharp.Graphics
|
||||
|
||||
public static glSHandle Zero
|
||||
{
|
||||
get { return Alloc(1); }
|
||||
get { return Alloc(0); }
|
||||
}
|
||||
|
||||
internal int DirectValue
|
||||
@@ -157,6 +130,52 @@ namespace StgSharp.Graphics
|
||||
}
|
||||
}
|
||||
|
||||
//TODO 发现一个大问题,paramQueue大多数时候取出的是数组,不是数组句柄,也就是说其内存将被长期固定且不能回收,这是内存泄漏
|
||||
public unsafe class glArrayHandle
|
||||
{
|
||||
internal readonly Array a;
|
||||
internal GCHandle handle;
|
||||
|
||||
internal glArrayHandle(Array array)
|
||||
{
|
||||
this.a = array;
|
||||
handle = GCHandle.Alloc(array, GCHandleType.Pinned);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static glArrayHandle CopyAlloc<T>(T[] array) where T : struct
|
||||
{
|
||||
Array copy = new T[array.Length];
|
||||
array.CopyTo(copy, 0);
|
||||
return new glArrayHandle(copy);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static glArrayHandle Alloc<T>(T[] array) where T : struct
|
||||
{
|
||||
return new glArrayHandle(array);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public IntPtr AddressOfArray()
|
||||
{
|
||||
if (handle != default)
|
||||
{
|
||||
return handle.AddrOfPinnedObject();
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new InvalidOperationException();
|
||||
}
|
||||
}
|
||||
|
||||
public void Release()
|
||||
{
|
||||
handle.Free();
|
||||
handle = default;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A handle to an OpenGL object.
|
||||
/// </summary>
|
||||
|
||||
@@ -336,5 +336,12 @@ namespace StgSharp.Graphics
|
||||
{
|
||||
api->glViewport(x, y, width, height);
|
||||
}
|
||||
|
||||
void IglFunc.frameworkHandleEnqueue(System.IntPtr handle, params StgSharp.Math.M128[] param)
|
||||
{
|
||||
throw new InvalidOperationException();
|
||||
}
|
||||
|
||||
bool IglFunc.FrameCanUpdate => true;
|
||||
}
|
||||
}
|
||||
@@ -1,121 +0,0 @@
|
||||
using StgSharp.Logic;
|
||||
using StgSharp.Math;
|
||||
|
||||
using System;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StgSharp.Graphics
|
||||
{
|
||||
internal class GLonTimeout : IglFunc
|
||||
{
|
||||
private static readonly GLonTimeout singleInstance
|
||||
= new GLonTimeout();
|
||||
|
||||
private FrameTimeoutException refreshSIgnal = new FrameTimeoutException();
|
||||
private FrameTimeoutException signal = new FrameTimeoutException("This frame is timeout");
|
||||
|
||||
private GLonTimeout()
|
||||
{ }
|
||||
|
||||
unsafe GLcontext* IglFunc.Context => throw signal;
|
||||
|
||||
void IglFunc.ActiveTexture(uint type) => throw signal;
|
||||
|
||||
void IglFunc.AfterAlign(Form form, Action action) => throw signal;
|
||||
|
||||
void IglFunc.AlignFrame(Form form) => throw signal;
|
||||
|
||||
void IglFunc.AttachShader(glHandle program, glHandle shader) => throw signal;
|
||||
|
||||
void IglFunc.BindBuffer(BufferType bufferType, glHandle handle) => throw signal;
|
||||
|
||||
void IglFunc.BindTexture(uint type, glHandle texture) => throw signal;
|
||||
|
||||
void IglFunc.BindVertexArray(glHandle handle) => throw signal;
|
||||
|
||||
void IglFunc.Clear(MaskBufferBit mask) => throw signal;
|
||||
|
||||
void IglFunc.ClearColor(float R, float G, float B, float A) => throw signal;
|
||||
|
||||
void IglFunc.ClearGraphicError() => throw signal;
|
||||
|
||||
public void CompileShader(glHandle shaderhandle)
|
||||
{
|
||||
throw signal;
|
||||
}
|
||||
|
||||
glHandle IglFunc.CreateProgram() => throw signal;
|
||||
|
||||
glHandleSet IglFunc.CreateProgram(int count) => throw signal;
|
||||
|
||||
glHandleSet IglFunc.CreateShaderSet(int count, StgSharp.Graphics.ShaderType type) => throw signal;
|
||||
|
||||
IntPtr IglFunc.CreateWindowHandle(int width, int height, string tittle, IntPtr monitor, Form share) => throw signal;
|
||||
|
||||
glHandle IglFunc.CreatGraphicProgram() => throw signal;
|
||||
|
||||
void IglFunc.DeleteBuffer(glHandle handle) => throw signal;
|
||||
|
||||
void IglFunc.DeleteBuffers(glHandleSet handle) => throw signal;
|
||||
|
||||
void IglFunc.DeleteVertexArrays(glHandleSet handle) => throw signal;
|
||||
|
||||
void IglFunc.DrawElements(GepmetryType mode, uint count, TypeCode type, IntPtr ptr) => throw signal;
|
||||
|
||||
glHandleSet IglFunc.GenBuffers(int count) => throw signal;
|
||||
|
||||
glHandleSet IglFunc.GenTextures(int count) => throw signal;
|
||||
|
||||
glHandleSet IglFunc.GenVertexArrays(int count) => throw signal;
|
||||
|
||||
unsafe glSHandle IglFunc.GetUniformLocation(glHandle program, string name) => throw signal;
|
||||
|
||||
bool IglFunc.GetWindowShouldClose(Form form) => throw signal;
|
||||
|
||||
void IglFunc.LoadShaderSource(glHandle shaderHandle, string codeStream)
|
||||
{
|
||||
throw signal;
|
||||
}
|
||||
|
||||
void IglFunc.MakeContexCurrent(Form form) => throw signal;
|
||||
|
||||
void IglFunc.SetBufferData<T>(BufferType bufferType, T bufferData, BufferUsage usage) => throw signal;
|
||||
|
||||
void IglFunc.SetBufferData<T>(BufferType bufferType, T[] bufferArray, BufferUsage usage) => throw signal;
|
||||
|
||||
void IglFunc.SetValue(Uniform<float, float, float, float> uniform, float v0, float v1, float v2, float v3) => throw signal;
|
||||
|
||||
void IglFunc.SetValue(Uniform<float, float, float, float> uniform, Vec4d vec) => throw signal;
|
||||
|
||||
void IglFunc.SetValue(Uniform<float, float, float> uniform, float v0, float v1, float v2) => throw signal;
|
||||
|
||||
void IglFunc.SetValue(Uniform<float, float> uniform, float v0, float v1) => throw signal;
|
||||
|
||||
void IglFunc.SetValue(Uniform<float> uniform, float v0) => throw signal;
|
||||
|
||||
void IglFunc.SetValue(Uniform<int> uniform, int i0) => throw signal;
|
||||
|
||||
void IglFunc.SetValue(Uniform<Vec4d> uniform, Vec4d vec) => throw signal;
|
||||
|
||||
void IglFunc.SetVertexAttribute(uint index, int size, TypeCode t, bool normalized, uint stride, int pointer) => throw signal;
|
||||
|
||||
void IglFunc.SwitchContext()
|
||||
{
|
||||
throw signal;
|
||||
}
|
||||
|
||||
unsafe void IglFunc.TextureImage2d<T>(int target, int level, uint internalformat, uint width, uint height, uint format, uint type, glHandle pixels) => throw signal;
|
||||
|
||||
void IglFunc.TextureParameter(int target, uint pname, int param) => throw signal;
|
||||
|
||||
void IglFunc.UseProgram(glHandle program) => throw signal;
|
||||
|
||||
void IglFunc.Viewport(int x, int y, uint width, uint height) => throw signal;
|
||||
|
||||
internal static GLonTimeout Set() => singleInstance;
|
||||
}
|
||||
}
|
||||
@@ -15,24 +15,17 @@ namespace StgSharp.Graphics
|
||||
{
|
||||
internal unsafe partial class GLonUpdate : IglFunc
|
||||
{
|
||||
private static ConcurrentQueue<IntPtr> glActionQueue;
|
||||
private static GLparamQueue paramQueue;
|
||||
private static FrameOperationBuffer frameOpBuffer;
|
||||
private GLcontext* api;
|
||||
private FrameTimeoutException refreshSignal = new();
|
||||
private IntPtr SwapBufferPtr = (IntPtr)(delegate*<IntPtr, void>)&InternalIO.glfwSwapBuffers;
|
||||
|
||||
internal void ShowDequeueStream()
|
||||
{
|
||||
paramQueue.ShowDequeueLog();
|
||||
}
|
||||
private glSHandle unupdatedFrame = glSHandle.Alloc(0);
|
||||
|
||||
internal GLonUpdate(GLcontext* context)
|
||||
{
|
||||
if (paramQueue == null)
|
||||
if (frameOpBuffer == null)
|
||||
{
|
||||
paramQueue = new GLparamQueue();
|
||||
frameOpBuffer = new FrameOperationBuffer();
|
||||
}
|
||||
glActionQueue = new ConcurrentQueue<IntPtr>();
|
||||
api = context;
|
||||
}
|
||||
|
||||
@@ -41,23 +34,16 @@ namespace StgSharp.Graphics
|
||||
get => api;
|
||||
}
|
||||
|
||||
internal static GLparamQueue ParamQueue
|
||||
public FrameOperationBuffer ActivatedOperationBuffer
|
||||
{
|
||||
get { return paramQueue; }
|
||||
}
|
||||
|
||||
internal ConcurrentQueue<IntPtr> GLactionQueue
|
||||
{
|
||||
get
|
||||
{
|
||||
return glActionQueue;
|
||||
}
|
||||
get { return frameOpBuffer; }
|
||||
set { frameOpBuffer = value; }
|
||||
}
|
||||
|
||||
void IglFunc.ActiveTexture(uint type)
|
||||
{
|
||||
paramQueue.Enqueue(type);
|
||||
glActionQueue.Enqueue(ActiveTexturePtr);
|
||||
frameOpBuffer.Enqueue(type);
|
||||
frameOpBuffer.Enqueue(ActiveTexturePtr);
|
||||
}
|
||||
|
||||
void IglFunc.AfterAlign(Form form, Action action)
|
||||
@@ -67,20 +53,14 @@ namespace StgSharp.Graphics
|
||||
|
||||
void IglFunc.AlignFrame(Form form)
|
||||
{
|
||||
if (form.timer.alignSign.byte0 > 0)
|
||||
{
|
||||
throw new InvalidOperationException();
|
||||
}
|
||||
form.timer.alignSign.byte0++;
|
||||
form.timer.WaitNextFrame();
|
||||
throw refreshSignal;
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
unsafe void IglFunc.AttachShader(glHandle program, glHandle shader)
|
||||
{
|
||||
paramQueue.Enqueue(program, shader);
|
||||
glActionQueue.Enqueue(AttachShaderPtr);
|
||||
frameOpBuffer.Enqueue(program, shader);
|
||||
frameOpBuffer.Enqueue(AttachShaderPtr);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
@@ -89,8 +69,8 @@ namespace StgSharp.Graphics
|
||||
M128 m = default;
|
||||
m.Write<uint>(0, (uint)bufferType);
|
||||
m.Write<ulong>(1, (ulong)handle.valuePtr);
|
||||
paramQueue.Enqueue(m);
|
||||
glActionQueue.Enqueue(BindBufferPtr);
|
||||
frameOpBuffer.Enqueue(m);
|
||||
frameOpBuffer.Enqueue(BindBufferPtr);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
@@ -99,53 +79,52 @@ namespace StgSharp.Graphics
|
||||
M128 m = default;
|
||||
m.Write<uint>(0, (uint)type);
|
||||
m.Write<ulong>(1, (ulong)texture.valuePtr);
|
||||
paramQueue.Enqueue(m);
|
||||
glActionQueue.Enqueue(BindTexturePtr);
|
||||
frameOpBuffer.Enqueue(m);
|
||||
frameOpBuffer.Enqueue(BindTexturePtr);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
void IglFunc.BindVertexArray(glHandle index)
|
||||
{
|
||||
paramQueue.Enqueue(index);
|
||||
glActionQueue.Enqueue(BindVertexArrayPtr);
|
||||
frameOpBuffer.Enqueue(index);
|
||||
frameOpBuffer.Enqueue(BindVertexArrayPtr);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
void IglFunc.Clear(MaskBufferBit mask)
|
||||
{
|
||||
paramQueue.Enqueue((int)mask);
|
||||
glActionQueue.Enqueue(ClearPtr);
|
||||
frameOpBuffer.Enqueue((int)mask);
|
||||
frameOpBuffer.Enqueue(ClearPtr);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
void IglFunc.ClearColor(float R, float G, float B, float A)
|
||||
{
|
||||
paramQueue.Enqueue(R, G, B, A);
|
||||
glActionQueue.Enqueue(ClearColorPtr);
|
||||
frameOpBuffer.Enqueue(R, G, B, A);
|
||||
frameOpBuffer.Enqueue(ClearColorPtr);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
void IglFunc.ClearGraphicError()
|
||||
{
|
||||
glActionQueue.Enqueue(ClearGraphicErrorPtr);
|
||||
frameOpBuffer.Enqueue(ClearGraphicErrorPtr);
|
||||
}
|
||||
|
||||
unsafe void IglFunc.CompileShader(glHandle shaderhandle)
|
||||
{
|
||||
paramQueue.Enqueue((IntPtr)shaderhandle.valuePtr);
|
||||
glActionQueue.Enqueue(CompileShaderPtr);
|
||||
frameOpBuffer.Enqueue((IntPtr)shaderhandle.valuePtr);
|
||||
frameOpBuffer.Enqueue(CompileShaderPtr);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
glHandle IglFunc.CreateProgram()
|
||||
{
|
||||
glHandle h = glHandle.Alloc(1);
|
||||
paramQueue.Enqueue(h);
|
||||
glActionQueue.Enqueue(CreateProgramPtr);
|
||||
frameOpBuffer.Enqueue(h);
|
||||
frameOpBuffer.Enqueue(CreateProgramPtr);
|
||||
return h;
|
||||
}
|
||||
|
||||
//TODO
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
glHandleSet IglFunc.CreateProgram(int count)
|
||||
{
|
||||
@@ -153,8 +132,8 @@ namespace StgSharp.Graphics
|
||||
glHandleSet h = new glHandleSet(count);
|
||||
m.Write<ulong>(0, (ulong)h.handle);
|
||||
m.Write<int>(2, count);
|
||||
paramQueue.Enqueue(m);
|
||||
glActionQueue.Enqueue(CreateProgramSetPtr);
|
||||
frameOpBuffer.Enqueue(m);
|
||||
frameOpBuffer.Enqueue(CreateProgramSetPtr);
|
||||
return h;
|
||||
}
|
||||
|
||||
@@ -165,8 +144,8 @@ namespace StgSharp.Graphics
|
||||
m.Write<int>(0, count);
|
||||
m.Write<uint>(1, (uint)type);
|
||||
m.Write<ulong>(1, (ulong)ret.handle);
|
||||
paramQueue.Enqueue(m);
|
||||
glActionQueue.Enqueue(CreateShaderPtr);
|
||||
frameOpBuffer.Enqueue(m);
|
||||
frameOpBuffer.Enqueue(CreateShaderPtr);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -199,8 +178,8 @@ namespace StgSharp.Graphics
|
||||
glHandle IglFunc.CreatGraphicProgram()
|
||||
{
|
||||
glHandle h = glHandle.Alloc(1);
|
||||
paramQueue.Enqueue(h);
|
||||
glActionQueue.Enqueue(CreateProgramPtr);
|
||||
frameOpBuffer.Enqueue(h);
|
||||
frameOpBuffer.Enqueue(CreateProgramPtr);
|
||||
return h;
|
||||
}
|
||||
|
||||
@@ -210,25 +189,25 @@ namespace StgSharp.Graphics
|
||||
M128 m = default;
|
||||
m.Write<ulong>(0, (ulong)handle.valuePtr);
|
||||
m.Write(2, 1);
|
||||
paramQueue.Enqueue(m);
|
||||
glActionQueue.Enqueue(DeleBufferPtr);
|
||||
frameOpBuffer.Enqueue(m);
|
||||
frameOpBuffer.Enqueue(DeleBufferPtr);
|
||||
}
|
||||
|
||||
unsafe void IglFunc.DeleteBuffers(glHandleSet handle)
|
||||
{
|
||||
M128 m = default;
|
||||
m.Write<uint>(2, (uint)handle.length);
|
||||
m.Write<ulong>(0, (ulong)handle.handle);
|
||||
paramQueue.Enqueue(m);
|
||||
glActionQueue.Enqueue(DeleBufferPtr);
|
||||
m.Write<uint>(2, (uint)handle.length);
|
||||
frameOpBuffer.Enqueue(m);
|
||||
frameOpBuffer.Enqueue(DeleBufferPtr);
|
||||
}
|
||||
|
||||
unsafe void IglFunc.DeleteVertexArrays(glHandleSet arrays)
|
||||
{
|
||||
M128 m = default; m.Write<ulong>(1, (ulong)arrays.handle);
|
||||
m.Write<int>(0, arrays.length);
|
||||
paramQueue.Enqueue(m);
|
||||
glActionQueue.Enqueue(DeleteVertexArrayPtr);
|
||||
frameOpBuffer.Enqueue(m);
|
||||
frameOpBuffer.Enqueue(DeleteVertexArrayPtr);
|
||||
}
|
||||
|
||||
void IglFunc.DrawElements(GepmetryType mode, uint count, TypeCode type, IntPtr ptr)
|
||||
@@ -255,17 +234,17 @@ namespace StgSharp.Graphics
|
||||
LogType.Error);
|
||||
return;
|
||||
}
|
||||
paramQueue.Enqueue((uint)mode, count, a);
|
||||
paramQueue.Enqueue(ptr);
|
||||
glActionQueue.Enqueue(DrawElementsPtr);
|
||||
frameOpBuffer.Enqueue((uint)mode, count, a);
|
||||
frameOpBuffer.Enqueue(ptr);
|
||||
frameOpBuffer.Enqueue(DrawElementsPtr);
|
||||
}
|
||||
|
||||
unsafe glHandleSet IglFunc.GenBuffers(int count)
|
||||
{
|
||||
glHandleSet h = new glHandleSet(count);
|
||||
M128 m = default; m.Write<uint>(2, (uint)count); m.Write<ulong>(0, (ulong)h.handle);
|
||||
paramQueue.Enqueue(m);
|
||||
glActionQueue.Enqueue(GenBufferPtr);
|
||||
frameOpBuffer.Enqueue(m);
|
||||
frameOpBuffer.Enqueue(GenBufferPtr);
|
||||
return h;
|
||||
}
|
||||
|
||||
@@ -273,8 +252,8 @@ namespace StgSharp.Graphics
|
||||
{
|
||||
glHandleSet h = new glHandleSet(count);
|
||||
M128 m = default; m.Write<uint>(2, (uint)count); m.Write<ulong>(0, (ulong)h.handle);
|
||||
paramQueue.Enqueue(m);
|
||||
glActionQueue.Enqueue(GenTexturesPtr);
|
||||
frameOpBuffer.Enqueue(m);
|
||||
frameOpBuffer.Enqueue(GenTexturesPtr);
|
||||
return h;
|
||||
}
|
||||
|
||||
@@ -282,8 +261,8 @@ namespace StgSharp.Graphics
|
||||
{
|
||||
glHandleSet h = new glHandleSet(count);
|
||||
M128 m = default; m.Write<uint>(2, (uint)count); m.Write<ulong>(0, (ulong)h.handle);
|
||||
paramQueue.Enqueue(m);
|
||||
glActionQueue.Enqueue(GenTexturesPtr);
|
||||
frameOpBuffer.Enqueue(m);
|
||||
frameOpBuffer.Enqueue(GenTexturesPtr);
|
||||
return h;
|
||||
}
|
||||
|
||||
@@ -293,10 +272,10 @@ namespace StgSharp.Graphics
|
||||
glSHandle h = glSHandle.Alloc(0);
|
||||
M128 m = default;
|
||||
m.Write<ulong>(0, (ulong)program.Handle);
|
||||
m.Write<ulong>(1, (ulong)GCHandle.Alloc(Encoding.UTF8.GetBytes(ptr)).AddrOfPinnedObject());
|
||||
paramQueue.Enqueue(m);
|
||||
paramQueue.Enqueue((IntPtr)h.valuePtr);
|
||||
glActionQueue.Enqueue(GetUniformLocationPtr);
|
||||
m.Write<ulong>(1, (ulong)GCHandle.Alloc(Encoding.UTF8.GetBytes(ptr), GCHandleType.Pinned).AddrOfPinnedObject());
|
||||
frameOpBuffer.Enqueue(m);
|
||||
frameOpBuffer.Enqueue((IntPtr)h.valuePtr);
|
||||
frameOpBuffer.Enqueue(GetUniformLocationPtr);
|
||||
return h;
|
||||
}
|
||||
|
||||
@@ -317,8 +296,9 @@ namespace StgSharp.Graphics
|
||||
|
||||
void IglFunc.LoadShaderSource(glHandle shaderHandle, string codeStream)
|
||||
{
|
||||
paramQueue.Enqueue(shaderHandle);
|
||||
paramQueue.Enqueue(codeStream);
|
||||
frameOpBuffer.Enqueue(shaderHandle);
|
||||
frameOpBuffer.Enqueue(codeStream);
|
||||
frameOpBuffer.Enqueue(ShaderSourcePtr);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
@@ -333,39 +313,40 @@ namespace StgSharp.Graphics
|
||||
|
||||
void IglFunc.SetBufferData<T>(BufferType bufferType, T bufferData, BufferUsage usage)
|
||||
{
|
||||
paramQueue.Enqueue((uint)bufferType, (uint)usage);
|
||||
paramQueue.Enqueue((IntPtr)sizeof(T), GCHandle.Alloc(bufferData).AddrOfPinnedObject());
|
||||
glActionQueue.Enqueue(BufferDataPtr);
|
||||
frameOpBuffer.Enqueue((uint)bufferType, (uint)usage);
|
||||
frameOpBuffer.Enqueue((IntPtr)sizeof(T));
|
||||
frameOpBuffer.Enqueue<T>(new T[] { bufferData });
|
||||
frameOpBuffer.Enqueue(BufferDataPtr);
|
||||
}
|
||||
|
||||
void IglFunc.SetBufferData<T>(BufferType bufferType, T[] bufferArray, BufferUsage usage)
|
||||
{
|
||||
paramQueue.Enqueue((uint)bufferType, (uint)usage);
|
||||
paramQueue.Enqueue((IntPtr)(Marshal.SizeOf<T>() * bufferArray.Length));
|
||||
paramQueue.Enqueue<T>(bufferArray);
|
||||
glActionQueue.Enqueue(BufferDataPtr);
|
||||
frameOpBuffer.Enqueue((uint)bufferType, (uint)usage);
|
||||
frameOpBuffer.Enqueue((IntPtr)(Marshal.SizeOf<T>() * bufferArray.Length));
|
||||
frameOpBuffer.Enqueue<T>(bufferArray);
|
||||
frameOpBuffer.Enqueue(BufferDataPtr);
|
||||
}
|
||||
|
||||
void IglFunc.SetVertexAttribute(uint index, int size, TypeCode t, bool normalized, uint stride, int pointer)
|
||||
{
|
||||
uint type = InternalIO.GLtype[t];
|
||||
paramQueue.Enqueue(index, type, stride);
|
||||
paramQueue.Enqueue(size, normalized ? 1 : 0, pointer);
|
||||
glActionQueue.Enqueue(SetVertexArrayPtr);
|
||||
frameOpBuffer.Enqueue(index, type, stride);
|
||||
frameOpBuffer.Enqueue(size, normalized ? 1 : 0, pointer);
|
||||
frameOpBuffer.Enqueue(SetVertexArrayPtr);
|
||||
}
|
||||
|
||||
//TODO:双线程,换运行环境
|
||||
void IglFunc.SwitchContext()
|
||||
{
|
||||
paramQueue.context = api;
|
||||
frameOpBuffer.context = api;
|
||||
}
|
||||
|
||||
unsafe void IglFunc.TextureImage2d<T>(int target, int level, uint internalformat, uint width, uint height, uint format, uint type, glHandle pixels)
|
||||
{
|
||||
paramQueue.Enqueue(pixels);
|
||||
paramQueue.Enqueue((uint)level, internalformat, width, height);
|
||||
paramQueue.Enqueue((uint)target, format, type);
|
||||
glActionQueue.Enqueue(textureImage2dPtr);
|
||||
frameOpBuffer.Enqueue(pixels);
|
||||
frameOpBuffer.Enqueue((uint)level, internalformat, width, height);
|
||||
frameOpBuffer.Enqueue((uint)target, format, type);
|
||||
frameOpBuffer.Enqueue(textureImage2dPtr);
|
||||
}
|
||||
|
||||
void IglFunc.TextureParameter(int target, uint pname, int param)
|
||||
@@ -374,31 +355,49 @@ namespace StgSharp.Graphics
|
||||
m.Write<int>(0, target);
|
||||
m.Write<uint>(2, pname);
|
||||
m.Write<int>(3, param);
|
||||
paramQueue.Enqueue(m);
|
||||
glActionQueue.Enqueue(TextureParameterPtr);
|
||||
frameOpBuffer.Enqueue(m);
|
||||
frameOpBuffer.Enqueue(TextureParameterPtr);
|
||||
}
|
||||
|
||||
void IglFunc.UseProgram(glHandle program)
|
||||
{
|
||||
paramQueue.Enqueue((IntPtr)program.valuePtr);
|
||||
glActionQueue.Enqueue(UseProgramPtr);
|
||||
frameOpBuffer.Enqueue((IntPtr)program.valuePtr);
|
||||
frameOpBuffer.Enqueue(UseProgramPtr);
|
||||
}
|
||||
|
||||
void IglFunc.Viewport(int x, int y, uint width, uint height)
|
||||
{
|
||||
Vec4d v = new Vec4d(x, y, (int)width, (int)height);
|
||||
paramQueue.Enqueue(v);
|
||||
glActionQueue.Enqueue(ViewPortPtr);
|
||||
frameOpBuffer.Enqueue(v);
|
||||
frameOpBuffer.Enqueue(ViewPortPtr);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
internal void frameworkHandleEnqueue(IntPtr methodHandle, params M128[] param)
|
||||
void IglFunc.frameworkHandleEnqueue(IntPtr methodHandle, params M128[] param)
|
||||
{
|
||||
foreach (M128 item in param)
|
||||
{
|
||||
paramQueue.Enqueue(item);
|
||||
frameOpBuffer.Enqueue(item);
|
||||
}
|
||||
frameOpBuffer.Enqueue(methodHandle);
|
||||
}
|
||||
|
||||
bool IglFunc.FrameCanUpdate
|
||||
{
|
||||
get
|
||||
{
|
||||
if (unupdatedFrame.DirectValue > 5)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
*unupdatedFrame.valuePtr += 1;
|
||||
frameOpBuffer.Enqueue((IntPtr)unupdatedFrame.valuePtr);
|
||||
frameOpBuffer.Enqueue(CanUpdatePtr);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
glActionQueue.Enqueue(methodHandle);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -9,6 +9,7 @@ using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StgSharp.Graphics
|
||||
@@ -21,6 +22,7 @@ namespace StgSharp.Graphics
|
||||
private IntPtr BindTexturePtr = (IntPtr)(delegate*<void>)&InternalBindTexture;
|
||||
private IntPtr BindVertexArrayPtr = (IntPtr)(delegate*<void>)&InternalBindVertexArray;
|
||||
private IntPtr BufferDataPtr = (IntPtr)(delegate*<void>)&InternalSetBufferData;
|
||||
private IntPtr CanUpdatePtr = (IntPtr)(delegate*<void>)&InternalFrameCanUpdate;
|
||||
private IntPtr ClearColorPtr = (IntPtr)(delegate*<void>)&InternalClearColor;
|
||||
private IntPtr ClearGraphicErrorPtr = (IntPtr)(delegate*<void>)&InternalClearGraphicError;
|
||||
private IntPtr ClearPtr = (IntPtr)(delegate*<void>)&InternalClear;
|
||||
@@ -108,7 +110,6 @@ namespace StgSharp.Graphics
|
||||
paramQueue.context->glCompileShader(*(uint*)handle);
|
||||
}
|
||||
|
||||
//TODO
|
||||
private static void InternalCreateProgram()
|
||||
{
|
||||
IntPtr programHandle = default;
|
||||
@@ -144,6 +145,10 @@ namespace StgSharp.Graphics
|
||||
M128 m = default;
|
||||
paramQueue.TryDequeue(out m);
|
||||
paramQueue.context->glDeleteBuffers(m.Read<uint>(2), (uint*)m.Read<ulong>(0));
|
||||
for (int i = 0; i < m.Read<uint>(2); i++)
|
||||
{
|
||||
*((uint*)m.Read<ulong>(0) + i) = 0;
|
||||
}
|
||||
}
|
||||
|
||||
private static void InternalDeleteVertexArrays()
|
||||
@@ -162,6 +167,13 @@ namespace StgSharp.Graphics
|
||||
paramQueue.context->glDrawElements(mode, count, type, (void*)ptr);
|
||||
}
|
||||
|
||||
private static void InternalFrameCanUpdate()
|
||||
{
|
||||
IntPtr ptr;
|
||||
paramQueue.TryDequeue(out ptr);
|
||||
Interlocked.Add(ref *(int*)ptr, -1);
|
||||
}
|
||||
|
||||
private static void InternalGenBuffers()
|
||||
{
|
||||
M128 m = default;
|
||||
@@ -215,13 +227,11 @@ namespace StgSharp.Graphics
|
||||
private static unsafe void InternalShaderSource()
|
||||
{
|
||||
IntPtr handle = default;
|
||||
byte[] stream = Array.Empty<byte>();
|
||||
glArrayHandle stream = default;
|
||||
paramQueue.TryDequeue(out handle);
|
||||
paramQueue.TryDequeue(out stream);
|
||||
fixed (byte* sPtr = stream)
|
||||
{
|
||||
paramQueue.context->glShaderSource(*(uint*)handle, 1, &sPtr, (void*)0);
|
||||
}
|
||||
IntPtr buffer = stream.AddressOfArray();
|
||||
paramQueue.context->glShaderSource(*(uint*)handle, 1, (byte**)&buffer, (void*)0);
|
||||
}
|
||||
|
||||
private static void InternalTextureImage2d()
|
||||
|
||||
@@ -7,7 +7,7 @@ using System.Runtime.Serialization;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StgSharpDebug.Graphics.GL.ShaderEdit
|
||||
namespace StgSharp.Graphics.GL.ShaderEdit
|
||||
{
|
||||
public class ShaderGenerator
|
||||
{
|
||||
|
||||
@@ -202,7 +202,7 @@ namespace StgSharp.Graphics
|
||||
{
|
||||
M128 m = default;
|
||||
paramQueue.TryDequeue(out m);
|
||||
paramQueue.context->glUniform1f(*(int*)m.Read<uint>(0), m.Read<uint>(2));
|
||||
paramQueue.context->glUniform1f(*(int*)m.Read<ulong>(0), m.Read<uint>(2));
|
||||
}
|
||||
|
||||
private static unsafe void UniformVal1fv()
|
||||
@@ -216,14 +216,14 @@ namespace StgSharp.Graphics
|
||||
{
|
||||
M128 m = default;
|
||||
paramQueue.TryDequeue(out m);
|
||||
paramQueue.context->glUniform1i(*(int*)m.Read<uint>(0), m.Read<int>(2));
|
||||
paramQueue.context->glUniform1i(*(int*)m.Read<ulong>(0), m.Read<int>(2));
|
||||
}
|
||||
|
||||
private static void UniformVal2f()
|
||||
{
|
||||
M128 m = default;
|
||||
paramQueue.TryDequeue(out m);
|
||||
paramQueue.context->glUniform2f(*(int*)m.Read<uint>(0), m.Read<float>(2), m.Read<float>(3));
|
||||
paramQueue.context->glUniform2f(*(int*)m.Read<ulong>(0), m.Read<float>(2), m.Read<float>(3));
|
||||
}
|
||||
|
||||
private static void UniformVal3f()
|
||||
|
||||
@@ -107,7 +107,7 @@ namespace StgSharp.Graphics
|
||||
if (strPtr == IntPtr.Zero)
|
||||
{
|
||||
InternalIO.InternalWriteLog("No supported OpenGL extensions are found.", LogType.Info);
|
||||
goto startThread;
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -742,14 +742,6 @@ namespace StgSharp.Graphics
|
||||
#endregion checkGLextensions
|
||||
|
||||
InternalIO.InternalWriteLog("Find OpenGL extensions.", LogType.Info);
|
||||
|
||||
startThread:
|
||||
{
|
||||
if (!form.IsSingleThread)
|
||||
{
|
||||
form.RenderThread.Start();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -180,7 +180,7 @@ namespace StgSharp.Graphics
|
||||
/// <param name="form"></param>
|
||||
void MakeContexCurrent(Form form);
|
||||
|
||||
void SetBufferData<T>(BufferType bufferType, T bufferData, BufferUsage usage) where T : IMat;
|
||||
void SetBufferData<T>(BufferType bufferType, T bufferData, BufferUsage usage) where T : struct, IMat;
|
||||
|
||||
void SetBufferData<T>(BufferType bufferType, T[] bufferArray, BufferUsage usage) where T : struct, IConvertible;
|
||||
|
||||
@@ -299,5 +299,12 @@ namespace StgSharp.Graphics
|
||||
{
|
||||
get;
|
||||
}
|
||||
|
||||
internal void frameworkHandleEnqueue(IntPtr handle, params M128[] param);
|
||||
|
||||
public bool FrameCanUpdate
|
||||
{
|
||||
get;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,7 @@ using StgSharp.Math;
|
||||
using System;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Numerics;
|
||||
using System.Runtime.CompilerServices;
|
||||
@@ -15,8 +16,6 @@ namespace StgSharp.Logic
|
||||
{
|
||||
internal unsafe class GLparamQueue
|
||||
{
|
||||
private string _dequeueLog = "\n";
|
||||
|
||||
internal GLcontext* context;
|
||||
private ConcurrentQueue<M128> paramQueue;
|
||||
private ConcurrentQueue<glArrayHandle> streamQueue;
|
||||
@@ -27,11 +26,6 @@ namespace StgSharp.Logic
|
||||
streamQueue = new ConcurrentQueue<glArrayHandle>();
|
||||
}
|
||||
|
||||
internal void ShowDequeueLog()
|
||||
{
|
||||
Console.WriteLine(_dequeueLog);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void Enqueue(Vec4d v)
|
||||
{
|
||||
@@ -41,8 +35,8 @@ namespace StgSharp.Logic
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void Enqueue(M128 m)
|
||||
{
|
||||
Console.WriteLine(m.ToString(10));
|
||||
paramQueue.Enqueue(m);
|
||||
Console.WriteLine(paramQueue.Count + streamQueue.Count);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
@@ -178,26 +172,22 @@ namespace StgSharp.Logic
|
||||
{
|
||||
byte[] code = Encoding.UTF8.GetBytes(str);
|
||||
streamQueue.Enqueue(glArrayHandle.Alloc<byte>(code));
|
||||
Console.WriteLine(paramQueue.Count + streamQueue.Count);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void Enqueue<T>(T[] array) where T : struct
|
||||
|
||||
{
|
||||
streamQueue.Enqueue(glArrayHandle.Alloc<T>(array));
|
||||
Console.WriteLine(paramQueue.Count + streamQueue.Count);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void TryDequeue(out glArrayHandle arrayHandle)
|
||||
{
|
||||
glArrayHandle handle = default;
|
||||
if (streamQueue.TryDequeue(out handle))
|
||||
if (!streamQueue.TryDequeue(out arrayHandle))
|
||||
{
|
||||
arrayHandle = handle;
|
||||
}
|
||||
else
|
||||
{
|
||||
InternalIO.InternalWriteLog("No param in buffer when calling gl function.", LogType.Error);
|
||||
InternalIO.InternalWriteLog("No param in buffer when calling gl function:", LogType.Error);
|
||||
throw new Exception();
|
||||
}
|
||||
}
|
||||
@@ -206,7 +196,6 @@ namespace StgSharp.Logic
|
||||
public bool TryDequeue(out M128 m)
|
||||
{
|
||||
bool ret = paramQueue.TryDequeue(out m);
|
||||
_dequeueLog += $"{m.ToString(10)}\n";
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -231,7 +220,7 @@ namespace StgSharp.Logic
|
||||
glArrayHandle output = default;
|
||||
if (streamQueue.TryDequeue(out output))
|
||||
{
|
||||
array = output.copy as T[];
|
||||
array = output.a as T[];
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -438,23 +427,11 @@ namespace StgSharp.Logic
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
internal void SetContext(GLcontext* p)
|
||||
{
|
||||
context = p;
|
||||
}
|
||||
|
||||
internal void TryDequeue(out Array array)
|
||||
{
|
||||
glArrayHandle output = default;
|
||||
if (streamQueue.TryDequeue(out output))
|
||||
{
|
||||
array = output.copy;
|
||||
}
|
||||
else
|
||||
{
|
||||
InternalIO.InternalWriteLog("No param in buffer when calling gl function.", LogType.Error);
|
||||
throw new Exception();
|
||||
}
|
||||
}
|
||||
/**/
|
||||
}
|
||||
}
|
||||
Binary file not shown.
@@ -125,7 +125,7 @@
|
||||
<summary>
|
||||
Define how current form render in one frame.
|
||||
</summary>
|
||||
<param name="requireDoubleRendering">
|
||||
<param name="leastThreds">
|
||||
Please define this befor calling any OpenGL api and other graphic methods.
|
||||
</param>
|
||||
</member>
|
||||
|
||||
@@ -14,7 +14,7 @@ using System.Reflection;
|
||||
[assembly: System.Reflection.AssemblyCompanyAttribute("StgSharp")]
|
||||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
||||
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+1f2fca4c8fe323daf9751677ccfdf0f7b04a9be8")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+6a0cccae795127fdb83793160f33597edcdd736b")]
|
||||
[assembly: System.Reflection.AssemblyProductAttribute("StgSharp")]
|
||||
[assembly: System.Reflection.AssemblyTitleAttribute("StgSharp")]
|
||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
||||
|
||||
@@ -1 +1 @@
|
||||
acdc10c0e1b1a3f1b82b38920dec1e26dd82a6bdfd91a17620bc677a983bc21d
|
||||
a249a1b1d40a3abbceec68e9d369d3856611858d100648d3446f8f62f277dc6b
|
||||
|
||||
Binary file not shown.
@@ -1 +1 @@
|
||||
{"documents":{"D:\\NitloadIndustry\\研究项目\\1-Flagship\\TH2020\\ProjectFile\\*":"https://raw.githubusercontent.com/Nitload-NSI/CCD_Github/1f2fca4c8fe323daf9751677ccfdf0f7b04a9be8/*"}}
|
||||
{"documents":{"D:\\NitloadIndustry\\研究项目\\1-Flagship\\TH2020\\ProjectFile\\*":"https://raw.githubusercontent.com/Nitload-NSI/CCD_Github/6a0cccae795127fdb83793160f33597edcdd736b/*"}}
|
||||
@@ -125,7 +125,7 @@
|
||||
<summary>
|
||||
Define how current form render in one frame.
|
||||
</summary>
|
||||
<param name="requireDoubleRendering">
|
||||
<param name="leastThreds">
|
||||
Please define this befor calling any OpenGL api and other graphic methods.
|
||||
</param>
|
||||
</member>
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user