Skip to content
Browse files

Merge pull request #332 from StygianTraveler/develop

Game.IsMouseVisible implementation for Windows
  • Loading branch information...
2 parents 9c3c69b + d272e06 commit e134bf9318b55d285c13542a3b8bc966f55211e5 @dellis1972 dellis1972 committed Mar 1, 2012
Showing with 17 additions and 1 deletion.
  1. +17 −1 MonoGame.Framework/Windows/WindowsGamePlatform.cs
View
18 MonoGame.Framework/Windows/WindowsGamePlatform.cs
@@ -72,6 +72,8 @@ 1. Definitions
using System.Text;
using Microsoft.Xna.Framework.Audio;
+using System.Windows.Forms;
+using System.IO;
namespace Microsoft.Xna.Framework
{
@@ -89,7 +91,9 @@ public WindowsGamePlatform(Game game)
// Setup our OpenALSoundController to handle our SoundBuffer pools
soundControllerInstance = OpenALSoundController.GetInstance;
-
+
+ //Initialize cursor visibility based on default value
+ OnIsMouseVisibleChanged();
}
public override GameRunBehavior DefaultRunBehavior
@@ -157,6 +161,18 @@ public override void BeginScreenDeviceChange(bool willBeFullScreen)
}
+ protected override void OnIsMouseVisibleChanged()
+ {
+ if (IsMouseVisible)
+ {
+ Cursor.Show();
+ }
+ else
+ {
+ Cursor.Hide();
+ }
+ }
+
public override void Log(string Message)
{
Console.WriteLine(Message);

0 comments on commit e134bf9

Please sign in to comment.
Something went wrong with that request. Please try again.