コード例 #1
0
 /// <summary>
 /// エンジンを初期化する
 /// </summary>
 /// <param name="title">ウィンドウ左上に表示される文字列</param>
 /// <param name="width">ウィンドウの横幅</param>
 /// <param name="height">ウィンドウの縦幅</param>
 /// <param name="option">オプションのインスタンス</param>
 /// <returns>初期化に成功したらtrue,それ以外でfalse</returns>
 public static bool Initialize(string title, int width, int height, Configuration config = null)
 {
     if (Core.Initialize(title, width, height, config ?? new Configuration()))
     {
         Keyboard     = Keyboard.GetInstance();
         Mouse        = Mouse.GetInstance();
         File         = File.GetInstance();
         Graphics     = Graphics.GetInstance();
         Renderer     = Renderer.GetInstance();
         Sound        = SoundMixer.GetInstance();
         Resources    = Resources.GetInstance();
         CurrentScene = new Scene();
         return(true);
     }
     return(false);
 }
コード例 #2
0
        /// <summary>
        /// エンジンを初期化します。
        /// </summary>
        /// <param name="title">ウィンドウタイトル</param>
        /// <param name="width">ウィンドウの横幅</param>
        /// <param name="height">ウィンドウの縦幅</param>
        /// <param name="config">設定</param>
        /// <returns>初期化に成功したらtrue、それ以外でfalse</returns>
        public static bool Initialize(string title, int width, int height, Configuration config = null)
        {
            _Config = (config ??= new Configuration());
            if (Core.Initialize(title, width, height, config))
            {
                Core = Core.GetInstance();
                Log  = Log.GetInstance();

                Keyboard = Keyboard.GetInstance();
                Mouse    = Mouse.GetInstance();
                Joystick = Joystick.GetInstance();

                File      = File.GetInstance();
                Resources = Resources.GetInstance();

                Window        = Window.GetInstance();
                Graphics      = Graphics.GetInstance();
                Renderer      = Renderer.GetInstance();
                CullingSystem = CullingSystem.GetInstance();

                Context = new AltseedContext();
                System.Threading.SynchronizationContext.SetSynchronizationContext(Context);

                if (config.ToolEnabled)
                {
                    Tool = Tool.GetInstance();
                }

                Sound = SoundMixer.GetInstance();

                _RootNode    = new RootNode();
                _UpdatedNode = _RootNode;

                _DrawnNodes      = new DrawnNodeCollection();
                _PostEffectNodes = new PostEffectNodeCollection();
                _CameraNodes     = new CameraNodeCollection();
                _DefaultCamera   = RenderedCamera.Create();
                _DefaultCamera.RenderPassParameter = new RenderPassParameter(new Color(50, 50, 50, 255), true, true);

                _RenderTextureCache = new RenderTextureCache();

                PostEffectNode.InitializeCache();

                return(true);
            }
            return(false);
        }