Esempio n. 1
0
        /// <summary>
        /// 渲染
        /// </summary>
        private void Render()
        {
            while (true)
            {
                var gl = openGLControl.OpenGL;
                gl.MakeCurrent();

                gl.Begin(OpenGL.GL_TRIANGLES);
                gl.Color(1.0f, 0, 0);
                gl.Vertex(-1.0f, -1, z);
                gl.Color(0, 1.0f, 0);
                gl.Vertex(1.0f, -1, z);
                gl.Color(0, 0, 1.0f);
                gl.Vertex(0, 1.0f, z);
                gl.End();
                openGLControl.Invoke(new MethodInvoker(() =>
                {
                    openGLControl.DoRender();
                }));

                Thread.Sleep(10);
            }
        }