protected override void DrawBegin()
{
int w = ViewportWidth;
int h = ViewportHeight;
gl.glViewport(0, 0, w, h);
gl.glMatrixMode(gl.GL_PROJECTION);
gl.glLoadIdentity();
if (w <= (h * 2))
gl.glOrtho(-6.0, 6.0, -3.0 * ((float)h * 2) / (float)w,
3.0 * ((float)h * 2) / (float)w, -10.0, 10.0);
else
gl.glOrtho(-6.0 * (float)w / ((float)h * 2),
6.0 * (float)w / ((float)h * 2), -3.0, 3.0, -10.0, 10.0);
GI.Buffers.ColorBuffer.Clear();
GI.Buffers.DepthBuffer.Clear();
GI.ShadeModel(ShadingModel.Smooth);
}