private bool InitGlfw() { StoreCallbacks(); GLFW.SetErrorCallback(_errorCallback); if (!GLFW.Init()) { Logger.FatalS("clyde.win", "Failed to initialize GLFW!"); return(false); } _glfwInitialized = true; var version = GLFW.GetVersionString(); Logger.DebugS("clyde.win", "GLFW initialized, version: {0}.", version); return(true); }
private bool InitGlfw() { StoreCallbacks(); GLFW.SetErrorCallback(_errorCallback); if (!GLFW.Init()) { var err = GLFW.GetError(out var desc); _sawmill.Fatal($"Failed to initialize GLFW! [{err}] {desc}"); return(false); } _glfwInitialized = true; var version = GLFW.GetVersionString(); _sawmill.Debug("GLFW initialized, version: {0}.", version); return(true); }
private void InitGlfw() { var glfwLibFileName = Environment.OSVersion.Platform == PlatformID.Win32NT ? "glfw3-x64.dll" : "libglfw.so.3.3"; var glfwLibFileDest = Path.Combine(AssetManager.BinDir, glfwLibFileName); if (!File.Exists(glfwLibFileDest)) { var glfwLibFileSrc = Path.Combine(AssetManager.LibsDir, glfwLibFileName); Log.Verbose("glfwLibFileSrc: " + glfwLibFileSrc); if (!File.Exists(glfwLibFileSrc)) { glfwLibFileSrc = Path.Combine(AssetManager.NativeRuntimeDir, glfwLibFileName); } Log.Verbose("glfwLibFileSrc: " + glfwLibFileSrc); File.Copy(glfwLibFileSrc, glfwLibFileDest); } // On some unix systems, the we need to the major version, too. if (Environment.OSVersion.Platform == PlatformID.Unix) { // .so.x.x --> .so.x var glfwLibFilePathMajor = Path.Combine(AssetManager.BinDir, Path.GetFileNameWithoutExtension(glfwLibFileName)); // .so.x --> .so var glfwLibFilePathDefault = Path.Combine(AssetManager.BinDir, Path.GetFileNameWithoutExtension(glfwLibFilePathMajor)); if (!File.Exists(glfwLibFilePathMajor)) { File.Copy(glfwLibFileDest, glfwLibFilePathMajor); } if (!File.Exists(glfwLibFilePathDefault)) { File.Copy(glfwLibFileDest, glfwLibFilePathDefault); } } Log.Info("Init Glfw"); GLFW.Init(); Log.Info("GLFW Version: {Version}", GLFW.GetVersionString()); }