コード例 #1
0
        private void DoInitialize()
        {
            AssertNotDisposed();

            SDL2_Platform.BeforeInitialize();
            RaiseAction(Initialize);
        }
コード例 #2
0
        public Game(string title, int width, int height)
        {
            SDL2_Platform.Init(this, title, width, height);
            Instance = this;

            AppDomain.CurrentDomain.UnhandledException += OnUnhandledException;

            // TODO: Audio
            //AudioDevice.Initialize();

            // Ready to run the loop!
            RunApplication = true;
        }
コード例 #3
0
        protected void Dispose(bool disposing)
        {
            if (!_isDisposed)
            {
                if (disposing)
                {
                    // TODO: Audio
                    //AudioDevice.Dispose();

                    SDL2_Platform.Dispose(this);
                    SDL2_MouseUtil.WindowHandle = IntPtr.Zero;
                }

                _isDisposed = true;
            }
        }
コード例 #4
0
        public void Run()
        {
            AssertNotDisposed();

            if (!_initialized)
            {
                DoInitialize();
                _initialized = true;
            }

            BeginRun();
            _gameTimer = Stopwatch.StartNew();

            SDL2_Platform.RunLoop(this);

            EndRun();
        }