Exemplo n.º 1
0
 private void btnStart_Click(object sender, EventArgs e)
 {
     if (m_Playback == null)
     {
         m_Playback = new DSFilePlaybackEVR(m_Scene.Direct3DDevice);
         m_Playback.OnPlaybackStop += new EventHandler(btnStart_Click);
         ((DSFilePlaybackEVR)m_Playback).OnSurfaceReady += new EVR.SurfaceReadyHandler(m_Scene.OnSurfaceReady);
         m_Playback.FileName = this.tbFileName.Text;
         if (m_Playback.Start().Succeeded)
         {
             btnStart.Text = "Stop";
             btnBrowse.Enabled = false;
         }
         else
         {
             btnStart_Click(sender, e);
         }
     }
     else
     {
         m_Playback.Dispose();
         m_Playback = null;
         btnStart.Text = "Start";
         btnBrowse.Enabled = true;
         this.pbView.Invalidate();
     }
 }
Exemplo n.º 2
0
 private void MainForm_FormClosing(object sender, FormClosingEventArgs e)
 {
     if (m_Playback != null)
     {
         m_Playback.Dispose();
         m_Playback = null;
     }
     if (m_Scene != null)
     {
         m_Scene.Dispose();
         m_Scene = null;
     }
 }