示例#1
0
 private void CleanUp()
 {
     Leo.SetStereo(false);
     LGL.DeleteContext(context);
     OpenTK.Graphics.Glu.DeleteQuadric(sphere);
     OpenTK.Graphics.Glu.DeleteQuadric(cylinder);
 }
示例#2
0
        protected override void OnRenderFrame(FrameEventArgs e)
        {
            // Retrieve current bird state
            this.UpdateLeoInfo();

            // Get the number of views to render
            uint rc = LGL.GetRenderCount(context);

            // Iterate through the views
            for (uint i = 0; i < rc; ++i)
            {
                // Start render the ith view

                double[] projmat = new double[16];
                LGL.StartRender(context, i, projmat);

                // Set the projection matrix associated with the current view
                GL.MatrixMode(MatrixMode.Projection);
                GL.LoadMatrix(projmat);

                // Render the scene
                GL.MatrixMode(MatrixMode.Modelview);
                GL.LoadIdentity();

                this.DrawBird();
            }
            // Indicate that all rendering is finished
            LGL.FinishRender(context);
        }
示例#3
0
        private bool InitializeLeoSystem()
        {
            // Initialize and connect the application to Leonar3Do System Software
            if (!Leo.Initialize())
            {
                return(false);
            }

            // Initialize LGL
            LGL.Initialize();

            // Create an LGL context (with the currently active OpenGL rendering context and its device)
            this.context = LGL.CreateContext();

            if (LGL.GetLastLGLError() != LGLErrors.NoError)
            {
                return(false);
            }

            return(true);
        }