Ejemplo n.º 1
0
        /// <summary>
        /// The entry point.
        /// </summary>
        public static void Main()
        {
            // Bind any unhandled exceptions in the main thread so that they are logged.
            AppDomain.CurrentDomain.UnhandledException += OnUnhandledException;

            // Set correct working directory for compatibility with double-clicking
            Directory.SetCurrentDirectory(DirectoryHelpers.GetLocalDir());

            if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
            {
                Environment.SetEnvironmentVariable("GSETTINGS_SCHEMA_DIR", "share\\glib-2.0\\schemas\\");
            }

            log4net.Config.XmlConfigurator.Configure();

            Log.Info("----------------");
            Log.Info("Initializing Everlook...");

            Log.Info("Initializing OpenTK...");

            // OpenGL
            var toolkitOptions = new ToolkitOptions
            {
                Backend = PlatformBackend.PreferNative,
                EnableHighResolution = true
            };

            using (Toolkit.Init(toolkitOptions))
            {
                Log.Info($"OpenTK initialized using the {GetOpenTKBackend()} backend.");

                Log.Info("Initializing GTK...");

                // Bind any unhandled exceptions in the GTK UI so that they are logged.
                ExceptionManager.UnhandledException += OnGLibUnhandledException;

                Log.Info("Registering treeview types with the native backend...");
                GType nodeType = (GType)typeof(SerializedNode);
                GType.Register(nodeType, typeof(SerializedNode));

                GType referenceType = (GType)typeof(FileReference);
                GType.Register(referenceType, typeof(FileReference));

                // GTK
                IconManager.LoadEmbeddedIcons();
                Application.Init();
                MainWindow win = MainWindow.Create();
                win.Show();
                Application.Run();
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// The entry point.
        /// </summary>
        public static void Main()
        {
            // Bind any unhandled exceptions in the main thread so that they are logged.
            AppDomain.CurrentDomain.UnhandledException += OnUnhandledException;

            // Set correct working directory for compatibility with double-clicking
            Directory.SetCurrentDirectory(DirectoryHelpers.GetLocalDir());

            log4net.Config.XmlConfigurator.Configure();

            Log.Info("----------------");
            Log.Info("Initializing Everlook...");

            Log.Info("Initializing OpenTK...");

            // OpenGL
            Toolkit.Init(new ToolkitOptions
            {
                Backend = PlatformBackend.PreferNative
            });

            Log.Info($"OpenTK initialized using the {GetOpenTKBackend()} backend.");

            Log.Info("Initializing GTK...");

            // Bind any unhandled exceptions in the GTK UI so that they are logged.
            ExceptionManager.UnhandledException += OnGLibUnhandledException;

            Log.Info("Registering treeview types with the native backend...");
            GType nodeType = (GType)typeof(FileNode);

            GType.Register(nodeType, typeof(FileNode));

            GType referenceType = (GType)typeof(FileReference);

            GType.Register(referenceType, typeof(FileReference));

            // GTK
            IconManager.LoadEmbeddedIcons();
            Application.Init();
            MainWindow win = MainWindow.Create();

            win.Show();
            Application.Run();
        }
Ejemplo n.º 3
0
        public static void Main()
        {
            // Bind any unhandled exceptions in the main thread so that they are logged.
            AppDomain.CurrentDomain.UnhandledException += OnUnhandledException;

            // Set correct working directory for compatibility with double-clicking
            Directory.SetCurrentDirectory(DirectoryHelpers.GetLocalDir());

            log4net.Config.XmlConfigurator.Configure();

            Log.Info("----------------");
            Log.Info("Initializing Everlook...");

            Log.Info("Initializing OpenGL...");

            // OpenGL
            Toolkit.Init(new ToolkitOptions
            {
                Backend = PlatformBackend.PreferNative,
                EnableHighResolution = true
            });

            Log.Info($"OpenGL initialized using the {(OpenTK.Configuration.RunningOnSdl2 ? "SDL2" : "native")} backend.");


            Log.Info("Initializing GTK...");

            // Bind any unhandled exceptions in the GTK UI so that they are logged.
            GLib.ExceptionManager.UnhandledException += OnGLibUnhandledException;

            // GTK
            IconManager.LoadEmbeddedIcons();
            Application.Init();
            MainWindow win = MainWindow.Create();

            win.Show();
            Application.Run();
        }