daily uodate on 20231208 by nitload youmu, preparation for multi thread rendering
This commit is contained in:
@@ -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)]
|
||||
|
||||
Reference in New Issue
Block a user