daily update on 20240305 by nitload youmu
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
using StgSharp.Controlling;
|
||||
using StgSharp.Logic;
|
||||
using StgSharp.Math;
|
||||
|
||||
using System;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Collections.Generic;
|
||||
@@ -272,7 +273,7 @@ namespace StgSharp.Graphics
|
||||
else
|
||||
{
|
||||
M128 m = default;
|
||||
m.UInt64[0] = (ulong)windowID;
|
||||
m.Write<ulong>(0, (ulong)windowID);
|
||||
GLonUpdate glu = gl as GLonUpdate;
|
||||
glu.frameworkHandleEnqueue(
|
||||
(IntPtr)(delegate*<void>)&InternalSwapBuffer, m);
|
||||
@@ -405,13 +406,27 @@ namespace StgSharp.Graphics
|
||||
ConcurrentQueue<IntPtr> glActions = (gl as GLonUpdate).GLactionQueue;
|
||||
#pragma warning restore CS8602
|
||||
IntPtr currentOperation;
|
||||
while (gl.GetWindowShouldClose(this))
|
||||
TimeSpan span = new TimeSpan(100L);
|
||||
try
|
||||
{
|
||||
if (glActions.TryDequeue(out currentOperation))
|
||||
while (gl.GetWindowShouldClose(this))
|
||||
{
|
||||
((delegate*<void>)currentOperation)();
|
||||
if (glActions.TryDequeue(out currentOperation))
|
||||
{
|
||||
((delegate*<void>)currentOperation)();
|
||||
}
|
||||
else
|
||||
{
|
||||
Thread.Sleep(span);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
this.ShouldClose = true;
|
||||
(gl as GLonUpdate).ShowDequeueStream();
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion form main
|
||||
|
||||
Reference in New Issue
Block a user