using StgSharp.Control; using StgSharp.Graphics; using StgSharp.Graphics.GL; using StgSharp.Math; using System; using System.Collections.Generic; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Text; namespace StgSharp { public static unsafe class Graphic { /// /// Init a form, attach its data to GLFW program, /// and return the pointer of the GLFW package of the form. /// /// The C# instance of the form /// Pointer of the GLFW package of this form /// The issue that form is not successfully initilized /// or GLAD program fail to init public static unsafe IntPtr InitWindow(Form form) { IntPtr a= internalIO.InternalInitWindow(form.info); if ((long)a == -1) { throw new Exception("Failed to init form."); } else if ((long)a == -2) { throw new Exception("Failed to load GLAD program."); } else { return a; } } public static unsafe void LoadForm(Form form) { ProgramTimeLine.allForm.Add(form); } } }