using StgSharp.Controlling; using System; using System.Runtime.InteropServices; namespace StgSharp.Graphics { public static unsafe partial class Graphic { /// /// Init an instance of OpenGL program, /// This method should be called before other /// graphic methods, after LoadGL method. /// public static void InitGL(int majorVersion, int minorVersion) { if (InternalIO.glfw_Init == null) { GL.glfw = new GLFWapi(); IntPtr ret; fixed (GLFWapi* ptr = &GL.glfw) ret = InternalIO.InternalInitGL(majorVersion, minorVersion, ptr); InternalIO.InternalWriteLog(ret.ToString(), LogType.Info); } else { throw new Exception("Do not init GL twice"); } } } }