Browse Source

Added GamePadTest and fix MouseGetStateAnIsMouseVisible compile errors.

Kenneth Pouncey 13 years ago
parent
commit
0fa474cae3

BIN
Tests/GamePadTest/Content/UiCursor.xnb


BIN
Tests/GamePadTest/Content/fntStandard.xnb


+ 61 - 0
Tests/GamePadTest/Game1.cs

@@ -0,0 +1,61 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using Microsoft.Xna.Framework;
+using Microsoft.Xna.Framework.Audio;
+using Microsoft.Xna.Framework.Content;
+using Microsoft.Xna.Framework.GamerServices;
+using Microsoft.Xna.Framework.Graphics;
+using Microsoft.Xna.Framework.Input;
+using Microsoft.Xna.Framework.Media;
+
+namespace GamePadTest
+{
+	public class Game1 : Game
+	{
+		GraphicsDeviceManager graphics;
+		SpriteBatch spriteBatch;
+
+		public Game1 ()
+		{
+			graphics = new GraphicsDeviceManager (this);
+			Content.RootDirectory = "Content";
+
+		}
+
+		protected override void Initialize ()
+		{
+			// TODO: Add your initialization logic here
+
+			base.Initialize ();
+		}
+
+		protected override void LoadContent ()
+		{
+			// Create a new SpriteBatch, which can be used to draw textures.
+			spriteBatch = new SpriteBatch (GraphicsDevice);
+			Services.AddService (typeof(SpriteBatch), spriteBatch);
+		}
+
+		protected override void UnloadContent ()
+		{
+			// TODO: Unload any non ContentManager content here
+		}
+
+		protected override void Update (GameTime gameTime)
+		{
+
+			base.Update (gameTime);
+		}
+
+		protected override void Draw (GameTime gameTime)
+		{
+
+			GraphicsDevice.Clear (Color.CornflowerBlue);
+
+			base.Draw(gameTime);
+
+		}
+
+	}
+}

+ 61 - 0
Tests/GamePadTest/GamePadTest.csproj

@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
+    <ProductVersion>10.0.0</ProductVersion>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{E251B0C1-ED74-4210-A0D5-9E4710FEA61F}</ProjectGuid>
+    <ProjectTypeGuids>{948B3504-5B70-4649-8FE4-BDE1FB46EC69};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <OutputType>Exe</OutputType>
+    <RootNamespace>GamePadTest</RootNamespace>
+    <AssemblyName>GamePadTest</AssemblyName>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug</OutputPath>
+    <DefineConstants>DEBUG;</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <PlatformTarget>x86</PlatformTarget>
+    <ConsolePause>false</ConsolePause>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
+    <DebugType>none</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Release</OutputPath>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <PlatformTarget>x86</PlatformTarget>
+    <ConsolePause>false</ConsolePause>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="System" />
+    <Reference Include="System.Xml" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Xml.Linq" />
+    <Reference Include="System.Drawing" />
+    <Reference Include="MonoMac" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="Info.plist" />
+  </ItemGroup>
+  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+  <Import Project="$(MSBuildExtensionsPath)\Mono\MonoMac\v0.0\Mono.MonoMac.targets" />
+  <ItemGroup>
+    <ProjectReference Include="..\..\..\MonoGame\MonoGame.Framework\MonoGame.Framework.MacOS.csproj">
+      <Project>{36C538E6-C32A-4A8D-A39C-566173D7118E}</Project>
+      <Name>MonoGame.Framework.MacOS</Name>
+    </ProjectReference>
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="Program.cs" />
+    <Compile Include="Game1.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <Content Include="Content\fntStandard.xnb" />
+    <Content Include="Content\UiCursor.xnb" />
+  </ItemGroup>
+</Project>

+ 16 - 0
Tests/GamePadTest/Info.plist

@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+	<key>CFBundleIdentifier</key>
+	<string>com.yourcompany.GamePadTest</string>
+	<key>CFBundleName</key>
+	<string>GamePadTest</string>
+	<key>CFBundleVersion</key>
+	<string>1</string>
+	<key>LSMinimumSystemVersion</key>
+	<string>10.6</string>
+	<key>NSPrincipalClass</key>
+	<string>NSApplication</string>
+</dict>
+</plist>

+ 44 - 0
Tests/GamePadTest/Program.cs

@@ -0,0 +1,44 @@
+using System;
+
+namespace GamePadTest
+{
+	static class Program
+	{
+
+
+		private static Game1 game;
+
+		/// <summary>
+		/// The main entry point for the application.
+		/// </summary>
+		static void Main (string[] args)
+		{
+			MonoMac.AppKit.NSApplication.Init ();
+			
+			using (var p = new MonoMac.Foundation.NSAutoreleasePool ()) {
+				MonoMac.AppKit.NSApplication.SharedApplication.Delegate = new AppDelegate ();
+				MonoMac.AppKit.NSApplication.Main (args);
+			}
+		}
+
+	
+		class AppDelegate : MonoMac.AppKit.NSApplicationDelegate
+		{
+		
+			public override void FinishedLaunching (MonoMac.Foundation.NSObject notification)
+			{
+				using (game = new Game1()) {
+					game.Run ();
+				}
+			}
+		
+			public override bool ApplicationShouldTerminateAfterLastWindowClosed (MonoMac.AppKit.NSApplication sender)
+			{
+				return true;
+			}
+		}
+	}
+}
+
+
+

File diff suppressed because it is too large
+ 0 - 181
Tests/MacOS/MouseGetStateAndIsMouseVisibleTester/MouseGetStateAndIsMouseVisibleTester/Game1.cs


+ 14 - 35
Tests/MacOS/MouseGetStateAndIsMouseVisibleTester/MouseGetStateAndIsMouseVisibleTester/Program.cs

@@ -2,25 +2,9 @@ using System;
 
 namespace MouseGetStateAndIsMouseVisibleTester
 {
-	
 	static class Program
 	{
 
-		private static Game1 game;	
-
-#if LINUX
-
-        /// <summary>
-        /// The main entry point for the application.
-        /// </summary>
-        [STAThread]
-        static void Main()
-        {
-            game = new Game1();
-            game.Run();
-        }
-#else
-
 		/// <summary>
 		/// The main entry point for the application.
 		/// </summary>
@@ -29,31 +13,26 @@ namespace MouseGetStateAndIsMouseVisibleTester
 			MonoMac.AppKit.NSApplication.Init ();
 			
 			using (var p = new MonoMac.Foundation.NSAutoreleasePool ()) {
-				MonoMac.AppKit.NSApplication.SharedApplication.Delegate = new AppDelegate();
-				MonoMac.AppKit.NSApplication.Main(args);
+				MonoMac.AppKit.NSApplication.SharedApplication.Delegate = new AppDelegate ();
+				MonoMac.AppKit.NSApplication.Main (args);
 			}
 		}
-	}
-	
-	class AppDelegate : MonoMac.AppKit.NSApplicationDelegate
-	{
-		
-		public override void FinishedLaunching (MonoMac.Foundation.NSObject notification)
+
+		class AppDelegate : MonoMac.AppKit.NSApplicationDelegate
 		{
-			using (game = new Game1()) {
-				game.Run ();
+
+			public override void FinishedLaunching (MonoMac.Foundation.NSObject notification)
+			{
+				using (Game1 game = new Game1()) {
+					game.Run ();
+				}
 			}
-		}
 		
-		public override bool ApplicationShouldTerminateAfterLastWindowClosed (MonoMac.AppKit.NSApplication sender)
-		{
-			return true;
+			public override bool ApplicationShouldTerminateAfterLastWindowClosed (MonoMac.AppKit.NSApplication sender)
+			{
+				return true;
+			}
 		}
 	}
-
-
-#endif
-}
-
 }
 

+ 9 - 1
Tests/MonoGame.Tests.MacOS.sln

@@ -7,6 +7,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MonoGame.Framework.MacOS",
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Lidgren.Network.MacOS", "..\..\MonoGame\ThirdParty\Lidgren.Network\Lidgren.Network.MacOS.csproj", "{AE483C29-042E-4226-BA52-D247CE7676DA}"
 EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GamePadTest", "GamePadTest\GamePadTest.csproj", "{E251B0C1-ED74-4210-A0D5-9E4710FEA61F}"
+EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|x86 = Debug|x86
@@ -32,8 +34,14 @@ Global
 		{AE483C29-042E-4226-BA52-D247CE7676DA}.Distribution|Any CPU.Build.0 = Debug|Any CPU
 		{AE483C29-042E-4226-BA52-D247CE7676DA}.Release|x86.ActiveCfg = Release|Any CPU
 		{AE483C29-042E-4226-BA52-D247CE7676DA}.Release|x86.Build.0 = Release|Any CPU
+		{E251B0C1-ED74-4210-A0D5-9E4710FEA61F}.Debug|x86.ActiveCfg = Debug|x86
+		{E251B0C1-ED74-4210-A0D5-9E4710FEA61F}.Debug|x86.Build.0 = Debug|x86
+		{E251B0C1-ED74-4210-A0D5-9E4710FEA61F}.Distribution|Any CPU.ActiveCfg = Debug|x86
+		{E251B0C1-ED74-4210-A0D5-9E4710FEA61F}.Distribution|Any CPU.Build.0 = Debug|x86
+		{E251B0C1-ED74-4210-A0D5-9E4710FEA61F}.Release|x86.ActiveCfg = Release|x86
+		{E251B0C1-ED74-4210-A0D5-9E4710FEA61F}.Release|x86.Build.0 = Release|x86
 	EndGlobalSection
 	GlobalSection(MonoDevelopProperties) = preSolution
-		StartupItem = MacOS\MouseGetStateAndIsMouseVisibleTester\MouseGetStateAndIsMouseVisibleTester\MouseGetStateAndIsMouseVisibleTester.csproj
+		StartupItem = GamePadTest\GamePadTest.csproj
 	EndGlobalSection
 EndGlobal

Some files were not shown because too many files changed in this diff