All information for creating render context and device context.
Inheritance: IDisposable
示例#1
0
 private void DestroyRenderContext()
 {
     RenderContext renderContext = this.renderContext;
     if (renderContext != null)
     {
         this.renderContext = null;
         renderContext.Dispose();
     }
 }
示例#2
0
        /// <summary>
        ///
        /// </summary>
        protected virtual void CreateRenderContext()
        {
            // Initialises OpenGL.
            var renderContext = new FBORenderContext();

            //  Create the render context.
            renderContext.Create(Width, Height, 32, null);

            this.renderContext = renderContext;

            renderContext.MakeCurrent();

            //  Set the most basic OpenGL styles.
            OpenGL.ShadeModel(OpenGL.GL_SMOOTH);
            OpenGL.ClearDepth(1.0f);
            OpenGL.Enable(OpenGL.GL_DEPTH_TEST);
            OpenGL.DepthFunc(OpenGL.GL_LEQUAL);
            OpenGL.Hint(OpenGL.GL_PERSPECTIVE_CORRECTION_HINT, OpenGL.GL_NICEST);
            if (this.designMode)
            {
                GLCanvasHelper.ResizeGL(this.Width, this.Height);
            }
        }