private void openGLControl_OpenGLDraw(object sender, OpenGLEventArgs args) { // Get the OpenGL object. //OpenGL gl = openGLControl.OpenGL; OpenGL gl = args.OpenGL as OpenGL; // Clear the color and depth buffer. gl.Clear(OpenGL.GL_COLOR_BUFFER_BIT | OpenGL.GL_DEPTH_BUFFER_BIT); // Load the identity matrix. gl.LoadIdentity(); // Rotate around the Y axis. gl.Rotate(rotation, 0.0f, 1.0f, 0.0f); if (SelectedObject != null) { SelectedObject.Draw(gl); } // Nudge the rotation. rotation += 3.0f; }