Permalink
Browse files

Add Windows XNA library

  • Loading branch information...
1 parent d6d1b0a commit 3c27d4606ad28433a4208e8db7529e9805378eb2 @ermau committed Jul 15, 2011
@@ -0,0 +1,34 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("Symphony.Xna")]
+[assembly: AssemblyProduct("Symphony.Xna")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyCompany("Microsoft")]
+[assembly: AssemblyCopyright("Copyright © Microsoft 2011")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type. Only Windows
+// assemblies support COM.
+[assembly: ComVisible(false)]
+
+// On Windows, the following GUID is for the ID of the typelib if this
+// project is exposed to COM. On other platforms, it unique identifies the
+// title storage container when deploying this assembly to the device.
+[assembly: Guid("ed3d13b2-5c72-452f-875a-63f910b2657b")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+[assembly: AssemblyVersion("1.0.0.0")]
@@ -0,0 +1,83 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <ProjectGuid>{0A6FB094-3B9C-4725-960E-D83182D6AD2E}</ProjectGuid>
+ <ProjectTypeGuids>{6D335F3A-9D43-41b4-9D22-F6F17C4BE596};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>Symphony.Xna</RootNamespace>
+ <AssemblyName>Symphony.Xna</AssemblyName>
+ <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+ <TargetFrameworkProfile>Client</TargetFrameworkProfile>
+ <XnaFrameworkVersion>v4.0</XnaFrameworkVersion>
+ <XnaPlatform>Windows</XnaPlatform>
+ <XnaProfile>Reach</XnaProfile>
+ <XnaCrossPlatformGroupID>89a1d934-86d4-42cd-b27d-08f4e411f730</XnaCrossPlatformGroupID>
+ <XnaOutputType>Library</XnaOutputType>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\x86\Debug</OutputPath>
+ <DefineConstants>DEBUG;TRACE;WINDOWS</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <NoStdLib>true</NoStdLib>
+ <UseVSHostingProcess>false</UseVSHostingProcess>
+ <PlatformTarget>x86</PlatformTarget>
+ <XnaCompressContent>false</XnaCompressContent>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\x86\Release</OutputPath>
+ <DefineConstants>TRACE;WINDOWS</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <NoStdLib>true</NoStdLib>
+ <UseVSHostingProcess>false</UseVSHostingProcess>
+ <PlatformTarget>x86</PlatformTarget>
+ <XnaCompressContent>true</XnaCompressContent>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="Microsoft.Xna.Framework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86" />
+ <Reference Include="Microsoft.Xna.Framework.Game, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86" />
+ <Reference Include="Microsoft.Xna.Framework.Graphics, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86" />
+ <Reference Include="Microsoft.Xna.Framework.GamerServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86" />
+ <Reference Include="mscorlib" />
+ <Reference Include="System" />
+ <Reference Include="System.Xml" />
+ <Reference Include="System.Core">
+ <RequiredTargetFramework>4.0</RequiredTargetFramework>
+ </Reference>
+ <Reference Include="System.Xml.Linq">
+ <RequiredTargetFramework>4.0</RequiredTargetFramework>
+ </Reference>
+ <Reference Include="System.Net" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="Vector3Extensions.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ <Compile Include="XnaAudioEngine.cs" />
+ <Compile Include="XnaAudioSource.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\Symphony\Symphony.csproj">
+ <Project>{D9FB7589-98B1-440C-8833-F135A2C2CCBA}</Project>
+ <Name>Symphony %28Desktop\Symphony%29</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+ <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\Microsoft.Xna.GameStudio.targets" />
+ <!--
+ To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+</Project>
@@ -0,0 +1,38 @@
+//
+// MIT License
+// Copyright ©2011 Eric Maupin
+// All rights reserved.
+
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included in all
+// copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+// SOFTWARE.
+
+namespace Symphony.Xna
+{
+ public static class Vector3Extensions
+ {
+ public static Symphony.Vector3 ToSymphonyVector3 (this Microsoft.Xna.Framework.Vector3 self)
+ {
+ return new Symphony.Vector3 (self.X, self.Y, self.Z);
+ }
+
+ public static Microsoft.Xna.Framework.Vector3 ToXnaVector3 (this Symphony.Vector3 self)
+ {
+ return new Microsoft.Xna.Framework.Vector3 (self.X, self.Y, self.Z);
+ }
+ }
+}
@@ -0,0 +1,63 @@
+//
+// MIT License
+// Copyright ©2011 Eric Maupin
+// All rights reserved.
+
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included in all
+// copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+// SOFTWARE.
+
+using System;
+using Symphony.Audio;
+
+namespace Symphony.Xna
+{
+ public class XnaAudioEngine
+ : IAudioPlaybackEngine
+ {
+ public bool Supports2DPositionalSound
+ {
+ get { return true; }
+ }
+
+ public bool Supports3DPositionalSound
+ {
+ get { return true; }
+ }
+
+ public void Dispose()
+ {
+ if (this.disposed)
+ throw new ObjectDisposedException ("XnaAudioEngine");
+
+ this.disposed = true;
+ }
+
+ public void MutePlayback()
+ {
+ this.muted = true;
+ }
+
+ public void UnmutePlayback()
+ {
+ this.muted = false;
+ }
+
+ private bool disposed;
+ private bool muted = false;
+ }
+}
@@ -0,0 +1,72 @@
+//
+// MIT License
+// Copyright ©2011 Eric Maupin
+// All rights reserved.
+
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+
+// The above copyright notice and this permission notice shall be included in all
+// copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+// SOFTWARE.
+
+using System;
+using Microsoft.Xna.Framework.Audio;
+using Symphony.Audio;
+
+namespace Symphony.Xna
+{
+ public class XnaAudioSource
+ : IAudioSource
+ {
+ public XnaAudioSource()
+ : this (new AudioEmitter())
+ {
+ }
+
+ public XnaAudioSource (AudioEmitter audioEmitter)
+ {
+ if (audioEmitter == null)
+ throw new ArgumentNullException ("audioEmitter");
+
+ this.audioEmitter = audioEmitter;
+ }
+
+ public Vector3 Position
+ {
+ get { return this.audioEmitter.Position.ToSymphonyVector3(); }
+ set { this.audioEmitter.Position = value.ToXnaVector3(); }
+ }
+
+ public Vector3 Velocity
+ {
+ get { return this.audioEmitter.Velocity.ToSymphonyVector3(); }
+ set { this.audioEmitter.Velocity = value.ToXnaVector3(); }
+ }
+
+ public Vector3 Forward
+ {
+ get { return this.audioEmitter.Forward.ToSymphonyVector3(); }
+ set { this.audioEmitter.Forward = value.ToXnaVector3(); }
+ }
+
+ public Vector3 Up
+ {
+ get { return this.audioEmitter.Up.ToSymphonyVector3(); }
+ set { this.audioEmitter.Up = value.ToXnaVector3(); }
+ }
+
+ private readonly AudioEmitter audioEmitter;
+ }
+}
View
@@ -13,6 +13,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Symphony.Xiph", "Desktop\Sy
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Symphony.Xiph", "Silverlight\Symphony.Xiph\Symphony.Xiph.csproj", "{439415FB-DB86-4820-8F52-165F8E823EDA}"
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Symphony.Xna", "Desktop\Symphony.Xna\Symphony.Xna.csproj", "{0A6FB094-3B9C-4725-960E-D83182D6AD2E}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -35,13 +37,17 @@ Global
{439415FB-DB86-4820-8F52-165F8E823EDA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{439415FB-DB86-4820-8F52-165F8E823EDA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{439415FB-DB86-4820-8F52-165F8E823EDA}.Release|Any CPU.Build.0 = Release|Any CPU
+ {0A6FB094-3B9C-4725-960E-D83182D6AD2E}.Debug|Any CPU.ActiveCfg = Debug|x86
+ {0A6FB094-3B9C-4725-960E-D83182D6AD2E}.Debug|Any CPU.Build.0 = Debug|x86
+ {0A6FB094-3B9C-4725-960E-D83182D6AD2E}.Release|Any CPU.ActiveCfg = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{D9FB7589-98B1-440C-8833-F135A2C2CCBA} = {FF5C8E71-4320-4644-A64E-07A2C6CBF3CD}
{5BDD2D5B-D8C4-4C05-847F-EDFAE00D096B} = {FF5C8E71-4320-4644-A64E-07A2C6CBF3CD}
+ {0A6FB094-3B9C-4725-960E-D83182D6AD2E} = {FF5C8E71-4320-4644-A64E-07A2C6CBF3CD}
{D8C8286D-33E9-47E2-B9FA-6AFD2103921D} = {7CB8156C-D787-4A79-AB13-4ACD35F1B1CB}
{439415FB-DB86-4820-8F52-165F8E823EDA} = {7CB8156C-D787-4A79-AB13-4ACD35F1B1CB}
EndGlobalSection

0 comments on commit 3c27d46

Please sign in to comment.