daily update on 20240203 by nitloadd youmu. New glhandle setup.
This commit is contained in:
@@ -34,7 +34,7 @@ namespace StgSharp.Graphics
|
||||
internal Form sharedForm;
|
||||
internal int width;
|
||||
internal IntPtr windowID;
|
||||
protected IglFunc gl;
|
||||
private IglFunc gl;
|
||||
private bool closed;
|
||||
#endregion
|
||||
|
||||
@@ -173,17 +173,17 @@ namespace StgSharp.Graphics
|
||||
}
|
||||
}
|
||||
|
||||
private void InternalRender()
|
||||
private unsafe void InternalRender()
|
||||
{
|
||||
#pragma warning disable CS8602
|
||||
ConcurrentQueue<Action> glActions = (gl as GLonUpdate).GLactionQueue;
|
||||
ConcurrentQueue<IntPtr> glActions = (gl as GLonUpdate).GLactionQueue;
|
||||
#pragma warning restore CS8602
|
||||
Action currentAction = new Action(() => { return; });
|
||||
IntPtr currentOperation;
|
||||
while (gl.GetWindowShouldClose(this))
|
||||
{
|
||||
if (glActions.TryDequeue(out currentAction))
|
||||
if (glActions.TryDequeue(out currentOperation))
|
||||
{
|
||||
currentAction();
|
||||
((delegate*<void>)currentOperation)();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -198,6 +198,23 @@ namespace StgSharp.Graphics
|
||||
Init((object[])args);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get OpenGL library of this form's context.
|
||||
/// </summary>
|
||||
/// <returns>A <see cref="IglFunc"/> package contains all opengl APIs </returns>
|
||||
protected IglFunc GetGL()
|
||||
{
|
||||
if (Platform.API == GraphicAPI.GL)
|
||||
{
|
||||
return this.GL;
|
||||
}
|
||||
else
|
||||
{
|
||||
InternalIO.InternalWriteLog("Attempt to get OpenGL API package in other graphic envitronment.", LogType.Error);
|
||||
throw new Exception();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Define how current form render in one frame.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user