Beispiel #1
0
 protected override void UnloadContent()
 {
     if (root != null)
     {
         root.Dispose();
         root = null;
     }
 }
 protected override void OnClosing(System.ComponentModel.CancelEventArgs e)
 {
     if (root != null)
     {
         root.Dispose();
         root = null;
     }
     base.OnClosing(e);
 }
 protected override void OnNavigatedFrom(NavigationEventArgs e)
 {
     if (root != null)
     {
         root.Dispose();
         root = null;
     }
     base.OnNavigatedFrom(e);
 }
Beispiel #4
0
        protected override void LoadContent()
        {
            spriteBatch = new SpriteBatch(GraphicsDevice);
            spriteFont = Content.Load<SpriteFont>("Data\\SpriteFont1");

            root = new Core.RootDisposable(Content);
            AudioTypes audioType;
            audio = Audio.Init(AudioTypes.XNA | AudioTypes.Dumby, out audioType, root);
            sound = SoundAPI.New(audio, "Data/Explo2.wav", 1, false, null);

            while (true)
            {
                var e = Core.Loader.UpdateLoad();
                if (e != null) throw e;
                if (Core.Loader.ItemsRemainingToLoad == 0) break;
            }
        }
        public MainWindow()
        {
            InitializeComponent();

            root = new Core.RootDisposable();
            AudioTypes audioType;
            audio = Audio.Init(AudioTypes.XAudio | AudioTypes.Dumby, out audioType, root);
            sound = SoundAPI.New(audio, "Data/Explo2.wav", 1, false, null);

            while (true)
            {
                var e = Core.Loader.UpdateLoad();
                if (e != null) throw e;
                if (Core.Loader.ItemsRemainingToLoad == 0) break;
            }

            System.Windows.Media.CompositionTarget.Rendering += render;
        }