private void glControl_Paint(object sender, PaintEventArgs e) { int width = glControl.Width; int height = glControl.Height; try { int g = int.Parse(granularity.Text); width = glControl.Width / g; height = glControl.Height / g; } catch (Exception) { }; visual.update(sw.ElapsedMilliseconds / 1000.0f, mousePos.X, mousePos.Y, mouseDown, width, height); visual.draw(glControl.Width, glControl.Height); glControl.SwapBuffers(); }