private void OnMouseMove(object sender, MouseEventArgs e) { if (GameWorld.GetWorldInstance().GetLevel() != null) { BaseCamera camera = GameWorld.GetWorldInstance().GetLevel().Camera; if (camera == null) { return; } if (camera.SwitchCamera) { camera.Rotate(e.X, e.Y, new Point(Width, GLControl.Height)); Cursor.Hide(); if ((EngineStatics.PrevCursorPosition.X != -1) && (EngineStatics.PrevCursorPosition.Y != -1)) // need to calculate delta of mouse position { Int32 xDelta = e.X - EngineStatics.PrevCursorPosition.X; Int32 yDelta = e.Y - EngineStatics.PrevCursorPosition.Y; } EngineStatics.PrevCursorPosition = e.Location; } else { Cursor.Show(); Cursor.Draw(this.CreateGraphics(), new Rectangle(this.Location.X, this.Location.Y, this.Size.Width, this.Size.Height)); } GLControl.Update(); // need to update frame after invalidation to redraw changes } }