private void OpenGLDrawFunc(object sender, RenderEventArgs e) { OpenGL gl = OpenGLControl.OpenGL; gl.ClearColor(1, 1, 1, 1); gl.MatrixMode(OpenGL.GL_PROJECTION); gl.LoadIdentity(); gl.Ortho(0, Width, 0, Height, -10, 10); gl.MatrixMode(OpenGL.GL_MODELVIEW); gl.LoadIdentity(); gl.Clear(OpenGL.GL_COLOR_BUFFER_BIT | OpenGL.GL_DEPTH_BUFFER_BIT); Trans.Enable(gl); foreach (var geom in Geoms) { geom.Render(gl); } foreach (var geom in OneTimeGeoms) { geom.Render(gl); } Trans.Disable(gl); OneTimeGeoms.Clear(); if (OutputRrbArray != null) { gl.ReadPixels(0, 0, Width, Height, OpenGL.GL_RGB, OpenGL.GL_UNSIGNED_BYTE, OutputRrbArray); } }