Beispiel #1
0
        public Form1()
        {
            InitializeComponent();

            CameraSelection cameraSelection = new CameraSelection();
            cameraSelection.ShowDialog();

            renderer = new Renderer(this.pictureBox1, cameraSelection.Fullscreen, cameraSelection.ShaderMethod);

            if (cameraSelection.StreamAddress != "")
            {
                capture = new Capture(cameraSelection.StreamAddress, cameraSelection.StereoStream, renderer.D3DDevice);
                capture.streamCamera.FrameComplete += new FrameCompleteEventHandler(renderer.OnLeftFrameComplete);
                if (cameraSelection.StereoStream)
                    capture.streamCamera.FrameComplete2 += new FrameCompleteEventHandler(renderer.OnRightFrameComplete);
            }
            else
            {
                capture = new Capture(cameraSelection.LeftDevice, cameraSelection.RightDevice, renderer.D3DDevice);
                capture.m_leftCamera.FrameComplete += new FrameCompleteEventHandler(renderer.OnLeftFrameComplete);
                if (capture.m_rightCamera != null)
                    capture.m_rightCamera.FrameComplete += new FrameCompleteEventHandler(renderer.OnRightFrameComplete);
            }

            MessagePump.Run(this, () =>
            {
                renderer.Render();
            });
        }
Beispiel #2
0
 private void Form1_FormClosing(object sender, FormClosingEventArgs e)
 {
     if (renderer != null)
     {
         renderer.Dispose();
         renderer = null;
     }
 }
Beispiel #3
0
        public Form1()
        {
            InitializeComponent();

            CameraSelection cameraSelection = new CameraSelection();
            cameraSelection.ShowDialog();

            renderer = new Renderer(this.pictureBox1, cameraSelection.Fullscreen);
            capture = new Capture(cameraSelection.LeftDevice, cameraSelection.RightDevice, renderer.D3DDevice);

            capture.m_leftCamera.FrameComplete += new FrameCompleteEventHandler(renderer.OnLeftFrameComplete);
            capture.m_rightCamera.FrameComplete += new FrameCompleteEventHandler(renderer.OnRightFrameComplete);

            MessagePump.Run(this, () =>
            {
                renderer.Render();
            });
        }