daily uodate on 20231208 by nitload youmu, preparation for multi thread rendering

This commit is contained in:
Nitload
2023-12-08 05:36:04 +08:00
parent ae804553ce
commit ab85c1a9fe
297 changed files with 157896 additions and 5170 deletions
+13 -5
View File
@@ -22,9 +22,17 @@ namespace StgSharp.Graphics
private static string glExtensionList;
public static unsafe void LoadGLapi(Form form, GLfuncLoader loader)
/// <summary>
/// Load all aupportable OpenGL APIs and bind them to given <see cref="Form"/> context.
/// </summary>
/// <param name="form">The <see cref="Form"/> used as current OpenGL context</param>
/// <param name="loader">A delegate that can get o</param>
public static unsafe void LoadGLapi(this Form form, GLfuncLoader loader)
{
if (loader == null)
{
loader = LoadGLfunc;
}
if (form.contextID->GetString != IntPtr.Zero)
{
return;
@@ -775,14 +783,14 @@ namespace StgSharp.Graphics
}
internal unsafe static string GetExtensions()
internal unsafe static string GetExtensions(this Form form)
{
if (GL.gl == null)
if (form.glContext == null)
{
return "";
}
return Marshal.PtrToStringAnsi(
GL.gl.GetString(glExtension));
form.glContext.GetString(glExtension));
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]