예제 #1
0
 public void InitGL(CapturePreview owner)
 {
     gm          = new GraphicsMode(new ColorFormat(32), 24, 8, 0);
     thisContext = new GraphicsContext(gm, WindowInfo);
     this.MakeCurrent();
     this.VSync = false;
     GL.Viewport(0, 0, Width, Height);
     GL.MatrixMode(MatrixMode.Projection);
     GL.LoadIdentity();
     GL.Ortho(-1.0, 1.0, -1.0, 1.0, -1.0, 1.0);
     GL.MatrixMode(MatrixMode.Modelview);
     GL.LoadIdentity();// Reset The View
     GL.ClearColor(Color.DimGray);
     GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit);
     m_previewHelper = new CDeckLinkGLScreenPreviewHelper();
     m_previewHelper.InitializeGL();
     glIsInitialized = true;
 }
예제 #2
0
        public Form1()
        {
            InitializeComponent();

            _Discovery = new CDeckLinkDiscovery();
            _GLHelper  = new CDeckLinkGLScreenPreviewHelper();

            if (_Discovery != null)
            {
                _Discovery.InstallDeviceNotifications(this);
            }

            find.Enabled       = false;
            stream.Enabled     = false;
            notifications.Text = "Please wait 2 seconds for the preview box to initialise...";

            _GLHack.Interval  = TimeSpan.FromSeconds(2).TotalMilliseconds;
            _GLHack.Elapsed  += DelayedLoad;
            _GLHack.AutoReset = false;
        }