Exemplo n.º 1
0
        public static void Update()
        {
            /* Updates the status of various framework components
             * (such as power state and media), and raises related events.
             */
            if (FirstFrame)
            {
                FirstFrame = false;
                AudioDevice.Initialize();
            }
            else if (AudioDevice.ALDevice != null)
            {
                /* This has to be in an 'else', otherwise we hit
                 * NoAudioHardwareException in the wrong place.
                 * -flibit
                 */

                // Checks and cleans instances, fires events accordingly
                AudioDevice.Update();
            }
            if (ActiveSongChanged)
            {
                MediaPlayer.OnActiveSongChanged();
                ActiveSongChanged = false;
            }
            if (MediaStateChanged)
            {
                MediaPlayer.OnMediaStateChanged();
                MediaStateChanged = false;
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// InitInternal
        /// </summary>
        internal bool InitInternal()
        {
            Log.Message("");
            Log.Message("---------- Game Initializing ----------");

            GraphicsDevice.Initialize(Parameters);
            InputDevice.Initialize();
            AudioDevice.Initialize();

            GraphicsDevice.FullScreen = Parameters.FullScreen;

            //	init game :
            Log.Message("");


            lock ( serviceList ) {
                Initialize();
                initialized = true;
            }


            Log.Message("---------------------------------------");
            Log.Message("");

            return(true);
        }
Exemplo n.º 3
0
        public Game()
        {
            AppDomain.CurrentDomain.UnhandledException += OnUnhandledException;

            LaunchParameters = new LaunchParameters();
            _services        = new GameServiceContainer();
            _components      = new GameComponentCollection();
            _content         = new ContentManager(_services);

            Window = FNAPlatform.CreateWindow();

            AudioDevice.Initialize();

            // Ready to run the loop!
            RunApplication = true;
        }
Exemplo n.º 4
0
        public Game()
        {
            Instance = this;

            AppDomain.CurrentDomain.UnhandledException += OnUnhandledException;

            LaunchParameters = new LaunchParameters();
            _services        = new GameServiceContainer();
            _components      = new GameComponentCollection();
            _content         = new ContentManager(_services);

            Platform              = GamePlatform.Create(this);
            Platform.Activated   += OnActivated;
            Platform.Deactivated += OnDeactivated;
            _services.AddService(typeof(GamePlatform), Platform);

            AudioDevice.Initialize();
        }