I’m using XNA to visualize a 3D scene in a window (= not full-screen). The user can click and drag the mouse to move the camera:
Public Sub New()
...
Me.IsMouseVisible = True
Me.Window.AllowUserResizing = True
...
End Sub
Protected Overrides Sub Update(ByVal gameTime As Microsoft.Xna.Framework.GameTime)
Dim m = Mouse.GetState()
' Change camera position based on m
...
End Sub
This works. The problem is that this even works when the mouse is not inside the game window, which looks a bit strange (I move a mail in Outlook and the 3D scene in the other window starts turning).
I didn’t find a Mouse.IsInsideGameWindow() property. Is there anything else that I can (easily) do to avoid this?
1 Answer