Ejemplo n.º 1
0
        /// <summary>
        /// Initializes Flax API. Called before everything else from native code.
        /// </summary>
        /// <param name="flags">The packed flags with small meta for the API.</param>
        /// <param name="platform">The runtime platform.</param>
        internal static void Init(int flags, PlatformType platform)
        {
#if DEBUG
            Debug.Logger.LogHandler.LogWrite(LogType.Log, "Using FlaxAPI in Debug");
#else
            Debug.Logger.LogHandler.LogWrite(LogType.Log, "Using FlaxAPI in Release");
#endif

            Application._is64Bit      = (flags & 0x01) != 0;
            Application._isEditor     = (flags & 0x02) != 0;
            Application._mainThreadId = Thread.CurrentThread.ManagedThreadId;
            Application._platform     = platform;

            AppDomain.CurrentDomain.UnhandledException += OnUnhandledException;
            TaskScheduler.UnobservedTaskException      += OnUnobservedTaskException;

            Globals.Init();

            if (!Application.IsEditor)
            {
                CreateGuiStyle();
            }

            MainRenderTask.Instance = RenderTask.Create <MainRenderTask>();
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Initializes Flax API. Called before everything else from native code.
        /// </summary>
        /// <param name="flags">The packed flags with small meta for the API.</param>
        /// <param name="platform">The runtime platform.</param>
        internal static void Init(int flags, PlatformType platform)
        {
            Application._is64Bit      = (flags & 0x01) != 0;
            Application._isEditor     = (flags & 0x02) != 0;
            Application._mainThreadId = Thread.CurrentThread.ManagedThreadId;
            Application._platform     = platform;

            UnhandledExceptionHandler.RegisterCatcher();
            Globals.Init();

            if (!Application.IsEditor)
            {
                CreateGuiStyle();
            }

            MainRenderTask.Instance = RenderTask.Create <MainRenderTask>();
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Initializes Flax API. Called before everything else from native code.
        /// </summary>
        /// <param name="flags">The packed flags with small meta for the API.</param>
        /// <param name="platform">The runtime platform.</param>
        internal static void Init(int flags, PlatformType platform)
        {
            Application._is64Bit  = (flags & 0x01) != 0;
            Application._isEditor = (flags & 0x02) != 0;
            Application._platform = platform;

            UnhandledExceptionHandler.RegisterCatcher();
            FlaxLogWriter.Init();
            Globals.Init();
            Input.Init();

            if (!Application.IsEditor)
            {
                CreateGuiStyle();
            }

            MainRenderTask.Instance = RenderTask.Create <MainRenderTask>();
        }