예제 #1
0
        private static void Main(string[] args)
        {
            Log.Start(LogTypes.All);

            Assembly     = Assembly.GetExecutingAssembly();
            ExeDirectory = Path.GetDirectoryName(Assembly.Location);

            AppDomain.CurrentDomain.UnhandledException += async(sender, e) =>
            {
                string msg = e.ExceptionObject.ToString();

                Log.Message(LogTypes.Panic, msg);

                string path = Path.Combine(ExeDirectory, "Logs");

                if (!Directory.Exists(path))
                {
                    Directory.CreateDirectory(path);
                }

                using (LogFile crashfile = new LogFile(path, "crash.txt"))
                {
                    await crashfile.WriteAsync(msg);
                }
            };

            // We can use the mono's dllmap feature, but 99% of people use VS to compile.
            if (Environment.OSVersion.Platform == PlatformID.Win32NT)
            {
                string libsPath = Path.Combine(ExeDirectory, "libs", Environment.Is64BitProcess ? "x64" : "x86");
                SetDllDirectory(libsPath);
            }

            Environment.SetEnvironmentVariable("FNA_GRAPHICS_ENABLE_HIGHDPI", "1");
            Environment.SetEnvironmentVariable("FNA_OPENGL_BACKBUFFER_SCALE_NEAREST", "1");

            using (GameLoop game = new GameLoop())
            {
                Log.Message(LogTypes.Trace, $"Exe directory: {ExeDirectory}");
                game.Run();
            }
        }
예제 #2
0
        private static void Main(string[] args)
        {
            Log.Start(LogTypes.All);

            Assembly     = Assembly.GetExecutingAssembly();
            ExeDirectory = Path.GetDirectoryName(Assembly.Location);

            // We can use the mono's dllmap feature, but 99% of people use VS to compile.
            if (Environment.OSVersion.Platform == PlatformID.Win32NT)
            {
                string libsPath = Path.Combine(ExeDirectory, "libs", Environment.Is64BitProcess ? "x64" : "x86");
                SetDllDirectory(libsPath);
            }

            Environment.SetEnvironmentVariable("FNA_GRAPHICS_ENABLE_HIGHDPI", "1");
            Environment.SetEnvironmentVariable("FNA_OPENGL_BACKBUFFER_SCALE_NEAREST", "1");

            using (GameLoop game = new GameLoop())
            {
                Log.Message(LogTypes.Trace, $"Exe directory: {ExeDirectory}");
                game.Run();
            }
        }