diff --git a/ANX.Framework.TestCenter/Strukturen/Input/GamePadTest.cs b/ANX.Framework.TestCenter/Strukturen/Input/GamePadTest.cs
index 19f282e8..eb9fc269 100644
--- a/ANX.Framework.TestCenter/Strukturen/Input/GamePadTest.cs
+++ b/ANX.Framework.TestCenter/Strukturen/Input/GamePadTest.cs
@@ -90,7 +90,8 @@ namespace ANX.Framework.TestCenter.Strukturen.Input
{
AddInSystemFactory.Instance.Initialize();
- AddInSystemFactory.Instance.PreferredInputSystem = "XInput";
+ AddInSystemFactory.Instance.SetPreferredSystem(
+ AddInType.InputSystem, "XInput");
XNAGamePadState xnastate = XNAGamePad.GetState(xnaplayer);
ANXGamePadState anxstate = ANXGamePad.GetState(anxplayer);
diff --git a/ANX.Framework.TestCenter/Strukturen/Input/MouseTest.cs b/ANX.Framework.TestCenter/Strukturen/Input/MouseTest.cs
index afe5dec7..d3bae980 100644
--- a/ANX.Framework.TestCenter/Strukturen/Input/MouseTest.cs
+++ b/ANX.Framework.TestCenter/Strukturen/Input/MouseTest.cs
@@ -76,7 +76,8 @@ namespace ANX.Framework.TestCenter.Strukturen.Input
public void Setup()
{
AddInSystemFactory.Instance.Initialize();
- AddInSystemFactory.Instance.PreferredInputSystem = "Test";
+ AddInSystemFactory.Instance.SetPreferredSystem(
+ AddInType.InputSystem, "Test");
}
diff --git a/ANX.Framework.sln b/ANX.Framework.sln
index fbb9b2eb..798ddd8b 100644
--- a/ANX.Framework.sln
+++ b/ANX.Framework.sln
@@ -134,11 +134,11 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ANX.InputDevices.Test", "In
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MultiRenderTarget", "Samples\MultiRenderTarget\MultiRenderTarget.csproj", "{9C9C6245-35C2-4230-8E17-9038A228227F}"
EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "MediaSystems", "MediaSystems", "{6EDED295-0F32-4D05-A8EA-02F4BF89CF35}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ANX.MediaSystem.Windows.OpenAL", "MediaSystems\ANX.MediaSystem.Windows.OpenAL\ANX.MediaSystem.Windows.OpenAL.csproj", "{97185A92-077D-4498-8B6A-8BFF04079044}"
+EndProject
Global
- GlobalSection(SubversionScc) = preSolution
- Svn-Managed = True
- Manager = AnkhSVN - Subversion Support for Visual Studio
- EndGlobalSection
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|Mixed Platforms = Debug|Mixed Platforms
@@ -456,6 +456,16 @@ Global
{9C9C6245-35C2-4230-8E17-9038A228227F}.Release|Mixed Platforms.Build.0 = Release|x86
{9C9C6245-35C2-4230-8E17-9038A228227F}.Release|x86.ActiveCfg = Release|x86
{9C9C6245-35C2-4230-8E17-9038A228227F}.Release|x86.Build.0 = Release|x86
+ {97185A92-077D-4498-8B6A-8BFF04079044}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {97185A92-077D-4498-8B6A-8BFF04079044}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {97185A92-077D-4498-8B6A-8BFF04079044}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
+ {97185A92-077D-4498-8B6A-8BFF04079044}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
+ {97185A92-077D-4498-8B6A-8BFF04079044}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {97185A92-077D-4498-8B6A-8BFF04079044}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {97185A92-077D-4498-8B6A-8BFF04079044}.Release|Any CPU.Build.0 = Release|Any CPU
+ {97185A92-077D-4498-8B6A-8BFF04079044}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
+ {97185A92-077D-4498-8B6A-8BFF04079044}.Release|Mixed Platforms.Build.0 = Release|Any CPU
+ {97185A92-077D-4498-8B6A-8BFF04079044}.Release|x86.ActiveCfg = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -493,5 +503,10 @@ Global
{E4FFD875-95FC-48F2-8B6D-8483D0B71666} = {60824BDB-AC8A-42ED-9B79-111FB44669FF}
{BD648BB8-EF28-453C-B4F5-EE3C93EB4DAF} = {60824BDB-AC8A-42ED-9B79-111FB44669FF}
{6285F3EF-07DB-49C9-8CDE-A9092789FE4F} = {60824BDB-AC8A-42ED-9B79-111FB44669FF}
+ {97185A92-077D-4498-8B6A-8BFF04079044} = {6EDED295-0F32-4D05-A8EA-02F4BF89CF35}
+ EndGlobalSection
+ GlobalSection(SubversionScc) = preSolution
+ Svn-Managed = True
+ Manager = AnkhSVN - Subversion Support for Visual Studio
EndGlobalSection
EndGlobal
diff --git a/ANX.Framework/ANX.Framework.csproj b/ANX.Framework/ANX.Framework.csproj
index ba108d5a..86f2f122 100644
--- a/ANX.Framework/ANX.Framework.csproj
+++ b/ANX.Framework/ANX.Framework.csproj
@@ -41,12 +41,6 @@
..\lib\NLog\NLog.dll
-
-
-
-
-
-
@@ -420,7 +414,9 @@
+
+
@@ -430,6 +426,7 @@
+
diff --git a/ANX.Framework/Game.cs b/ANX.Framework/Game.cs
index cd46cb63..4ed64e9f 100644
--- a/ANX.Framework/Game.cs
+++ b/ANX.Framework/Game.cs
@@ -108,36 +108,24 @@ namespace ANX.Framework
throw new AddInLoadingException("Error while initializing AddInSystem.", ex);
}
- IInputSystemCreator inputSystemCreator = AddInSystemFactory.Instance.GetDefaultCreator();
- if (inputSystemCreator != null)
- {
- this.gameServices.AddService(typeof(IInputSystemCreator), inputSystemCreator);
- }
-
- ISoundSystemCreator soundSystemCreator = AddInSystemFactory.Instance.GetDefaultCreator();
- if (soundSystemCreator != null)
- {
- this.gameServices.AddService(typeof(ISoundSystemCreator), soundSystemCreator);
- }
-
- IRenderSystemCreator renderSystemCreator = AddInSystemFactory.Instance.GetDefaultCreator();
- if (renderSystemCreator != null)
- {
- this.gameServices.AddService(typeof(IRenderSystemCreator), renderSystemCreator);
- }
-
+ AddSystemCreator();
+ AddSystemCreator();
+ AddSystemCreator();
+ IRenderSystemCreator renderSystemCreator =
+ AddSystemCreator();
+
logger.Info("creating GameHost");
if (renderSystemCreator != null)
{
this.host = renderSystemCreator.CreateGameHost(this);
- this.host.Activated += new EventHandler(this.HostActivated);
- this.host.Deactivated += new EventHandler(this.HostDeactivated);
- this.host.Suspend += new EventHandler(this.HostSuspend);
- this.host.Resume += new EventHandler(this.HostResume);
- this.host.Idle += new EventHandler(this.HostIdle);
- this.host.Exiting += new EventHandler(this.HostExiting);
+ this.host.Activated += HostActivated;
+ this.host.Deactivated += HostDeactivated;
+ this.host.Suspend += HostSuspend;
+ this.host.Resume += HostResume;
+ this.host.Idle += HostIdle;
+ this.host.Exiting += HostExiting;
}
else
{
@@ -163,7 +151,19 @@ namespace ANX.Framework
//TODO: implement
}
- protected virtual void Initialize()
+ #region AddSystemCreator
+ private T AddSystemCreator() where T : class, ICreator
+ {
+ T creator = AddInSystemFactory.Instance.GetDefaultCreator();
+ if (creator != null)
+ {
+ this.gameServices.AddService(typeof(T), creator);
+ }
+ return creator;
+ }
+ #endregion
+
+ protected virtual void Initialize()
{
//TODO: implement
diff --git a/ANX.Framework/GameTime.cs b/ANX.Framework/GameTime.cs
index ab938014..8ddec1dc 100644
--- a/ANX.Framework/GameTime.cs
+++ b/ANX.Framework/GameTime.cs
@@ -1,7 +1,5 @@
-#region Using Statements
-using System;
-
-#endregion // Using Statements
+using System;
+using ANX.Framework.NonXNA.Development;
#region License
@@ -52,64 +50,48 @@ using System;
namespace ANX.Framework
{
- public class GameTime
- {
- private TimeSpan elapsedGameTime;
- private bool isRunningSlowly;
- private TimeSpan totalGameTime;
+ [PercentageComplete(100)]
+ public class GameTime
+ {
+ #region Public
+ public TimeSpan ElapsedGameTime
+ {
+ get;
+ internal set;
+ }
- public GameTime()
- {
+ public TimeSpan TotalGameTime
+ {
+ get;
+ internal set;
+ }
- }
+ public bool IsRunningSlowly
+ {
+ get;
+ internal set;
+ }
+ #endregion
- public GameTime(TimeSpan totalGameTime, TimeSpan elapsedGameTime)
- {
- this.totalGameTime = totalGameTime;
- this.elapsedGameTime = elapsedGameTime;
- }
+ #region Constructor
+ public GameTime()
+ {
- public GameTime(TimeSpan totalGameTime, TimeSpan elapsedGameTime, bool isRunningSlowly)
- {
- this.totalGameTime = totalGameTime;
- this.elapsedGameTime = elapsedGameTime;
- this.isRunningSlowly = isRunningSlowly;
- }
+ }
- public TimeSpan ElapsedGameTime
- {
- get
- {
- return this.elapsedGameTime;
- }
- internal set
- {
- this.elapsedGameTime = value;
- }
- }
+ public GameTime(TimeSpan totalGameTime, TimeSpan elapsedGameTime)
+ {
+ this.TotalGameTime = totalGameTime;
+ this.ElapsedGameTime = elapsedGameTime;
+ }
- public TimeSpan TotalGameTime
- {
- get
- {
- return this.totalGameTime;
- }
- internal set
- {
- this.totalGameTime = value;
- }
- }
-
- public bool IsRunningSlowly
- {
- get
- {
- return this.isRunningSlowly;
- }
- internal set
- {
- this.isRunningSlowly = value;
- }
- }
- }
+ public GameTime(TimeSpan totalGameTime, TimeSpan elapsedGameTime,
+ bool isRunningSlowly)
+ {
+ this.TotalGameTime = totalGameTime;
+ this.ElapsedGameTime = elapsedGameTime;
+ this.IsRunningSlowly = isRunningSlowly;
+ }
+ #endregion
+ }
}
diff --git a/ANX.Framework/Media/MediaPlayer.cs b/ANX.Framework/Media/MediaPlayer.cs
index ea2e785d..da2d0a5d 100644
--- a/ANX.Framework/Media/MediaPlayer.cs
+++ b/ANX.Framework/Media/MediaPlayer.cs
@@ -51,6 +51,13 @@ namespace ANX.Framework.Media
{
public static class MediaPlayer
{
+ #region Events
+ public static event EventHandler ActiveSongChanged;
+ public static event EventHandler MediaStateChanged;
+ #endregion
+
+ #region Public
+ #region IsShuffled (TODO)
public static bool IsShuffled
{
get
@@ -62,7 +69,9 @@ namespace ANX.Framework.Media
throw new NotImplementedException();
}
}
+ #endregion
+ #region IsRepeating (TODO)
public static bool IsRepeating
{
get
@@ -74,7 +83,9 @@ namespace ANX.Framework.Media
throw new NotImplementedException();
}
}
+ #endregion
+ #region Volume (TODO)
public static float Volume
{
get
@@ -86,7 +97,9 @@ namespace ANX.Framework.Media
throw new NotImplementedException();
}
}
+ #endregion
+ #region IsMuted (TODO)
public static bool IsMuted
{
get
@@ -98,7 +111,9 @@ namespace ANX.Framework.Media
throw new NotImplementedException();
}
}
+ #endregion
+ #region IsVisualizationEnabled (TODO)
public static bool IsVisualizationEnabled
{
get
@@ -110,7 +125,9 @@ namespace ANX.Framework.Media
throw new NotImplementedException();
}
}
+ #endregion
+ #region Queue (TODO)
public static MediaQueue Queue
{
get
@@ -118,7 +135,9 @@ namespace ANX.Framework.Media
throw new NotImplementedException();
}
}
+ #endregion
+ #region State (TODO)
public static MediaState State
{
get
@@ -126,7 +145,9 @@ namespace ANX.Framework.Media
throw new NotImplementedException();
}
}
+ #endregion
+ #region PlayPosition (TODO)
public static TimeSpan PlayPosition
{
get
@@ -134,7 +155,9 @@ namespace ANX.Framework.Media
throw new NotImplementedException();
}
}
+ #endregion
+ #region GameHasControl (TODO)
public static bool GameHasControl
{
get
@@ -142,53 +165,76 @@ namespace ANX.Framework.Media
throw new NotImplementedException();
}
}
+ #endregion
+ #endregion
- public static event EventHandler ActiveSongChanged;
- public static event EventHandler MediaStateChanged;
+ #region Constructor
+ static MediaPlayer()
+ {
+ }
+ #endregion
+ #region Play (TODO)
public static void Play(Song song)
{
throw new NotImplementedException();
}
+ #endregion
+ #region Play (TODO)
public static void Play(SongCollection songCollection)
{
throw new NotImplementedException();
}
+ #endregion
+ #region Play (TODO)
public static void Play(SongCollection songCollection, int index)
{
throw new NotImplementedException();
}
+ #endregion
+ #region Pause (TODO)
public static void Pause()
{
throw new NotImplementedException();
}
+ #endregion
+ #region Resume (TODO)
public static void Resume()
{
throw new NotImplementedException();
}
+ #endregion
+ #region Stop (TODO)
public static void Stop()
{
throw new NotImplementedException();
}
+ #endregion
+ #region MoveNext (TODO)
public static void MoveNext()
{
throw new NotImplementedException();
}
+ #endregion
+ #region MovePrevious (TODO)
public static void MovePrevious()
{
throw new NotImplementedException();
}
+ #endregion
+ #region GetVisualizationData (TODO)
public static void GetVisualizationData(VisualizationData data)
{
throw new NotImplementedException();
}
+ #endregion
}
}
diff --git a/ANX.Framework/NonXNA/AddIn.cs b/ANX.Framework/NonXNA/AddIn.cs
index 8846e657..b6f7a9d5 100644
--- a/ANX.Framework/NonXNA/AddIn.cs
+++ b/ANX.Framework/NonXNA/AddIn.cs
@@ -76,14 +76,15 @@ namespace ANX.Framework.NonXNA
public AddIn(string fileName)
{
- if (string.IsNullOrEmpty(fileName))
+ if (String.IsNullOrEmpty(fileName))
{
throw new ArgumentNullException("fileName");
}
- if (!File.Exists(fileName))
+ if (File.Exists(fileName) == false)
{
- throw new InvalidOperationException(String.Format("The AddIn '{0}' does not exist.", fileName));
+ throw new InvalidOperationException(
+ String.Format("The AddIn '{0}' does not exist.", fileName));
}
this.fileName = fileName;
@@ -96,30 +97,14 @@ namespace ANX.Framework.NonXNA
if (this.assembly != null)
{
- foreach (Type t in this.assembly.GetTypes().Where(p => typeof(IInputSystemCreator).IsAssignableFrom(p) ||
- typeof(IRenderSystemCreator).IsAssignableFrom(p) ||
- typeof(ISoundSystemCreator).IsAssignableFrom(p)
- ))
+ foreach (Type t in this.assembly.GetTypes().Where(p =>
+ typeof(IInputSystemCreator).IsAssignableFrom(p) ||
+ typeof(IRenderSystemCreator).IsAssignableFrom(p) ||
+ typeof(ISoundSystemCreator).IsAssignableFrom(p) ||
+ typeof(IMediaSystemCreator).IsAssignableFrom(p)))
{
this.creatorType = t;
-
- if (typeof(IInputSystemCreator).IsAssignableFrom(t))
- {
- this.addInType = AddInType.InputSystem;
- }
- else if (typeof(IRenderSystemCreator).IsAssignableFrom(t))
- {
- this.addInType = AddInType.RenderSystem;
- }
- else if (typeof(ISoundSystemCreator).IsAssignableFrom(t))
- {
- this.addInType = AddInType.SoundSystem;
- }
- else
- {
- this.addInType = AddInType.Unknown;
- }
-
+ this.addInType = AddInSystemFactory.GetAddInType(t);
break;
}
@@ -136,23 +121,27 @@ namespace ANX.Framework.NonXNA
// Scan the addin for InputDeviceCreators and register them
//
- foreach (Type t in this.assembly.GetTypes().Where(p => typeof(IGamePadCreator).IsAssignableFrom(p)))
+ foreach (Type t in this.assembly.GetTypes().Where(p =>
+ typeof(IGamePadCreator).IsAssignableFrom(p)))
{
InputDeviceFactory.Instance.AddCreator(Activator.CreateInstance(t) as IGamePadCreator);
}
- foreach (Type t in this.assembly.GetTypes().Where(p => typeof(IKeyboardCreator).IsAssignableFrom(p)))
+ foreach (Type t in this.assembly.GetTypes().Where(p =>
+ typeof(IKeyboardCreator).IsAssignableFrom(p)))
{
InputDeviceFactory.Instance.AddCreator(Activator.CreateInstance(t) as IKeyboardCreator);
}
- foreach (Type t in this.assembly.GetTypes().Where(p => typeof(IMouseCreator).IsAssignableFrom(p)))
+ foreach (Type t in this.assembly.GetTypes().Where(p =>
+ typeof(IMouseCreator).IsAssignableFrom(p)))
{
InputDeviceFactory.Instance.AddCreator(Activator.CreateInstance(t) as IMouseCreator);
}
#if XNAEXT
- foreach (Type t in this.assembly.GetTypes().Where(p => typeof(IMotionSensingDeviceCreator).IsAssignableFrom(p)))
+ foreach (Type t in this.assembly.GetTypes().Where(p =>
+ typeof(IMotionSensingDeviceCreator).IsAssignableFrom(p)))
{
InputDeviceFactory.Instance.AddCreator(Activator.CreateInstance(t) as IMotionSensingDeviceCreator);
}
@@ -290,7 +279,9 @@ namespace ANX.Framework.NonXNA
#endregion // Properties
#region Private Helpers
- private string[] FetchSupportedPlattforms(Assembly assembly)
+
+ #region FetchSupportedPlattforms
+ private string[] FetchSupportedPlattforms(Assembly assembly)
{
string[] platforms = null;
string[] res = assembly.GetManifestResourceNames();
@@ -323,10 +314,11 @@ namespace ANX.Framework.NonXNA
return platforms;
}
+ #endregion
- #endregion // Private Helpers
+ #endregion // Private Helpers
- public int CompareTo(AddIn other)
+ public int CompareTo(AddIn other)
{
return this.Priority.CompareTo(other.Priority);
}
diff --git a/ANX.Framework/NonXNA/AddInSystemFactory.cs b/ANX.Framework/NonXNA/AddInSystemFactory.cs
index fd865c4b..23363f29 100644
--- a/ANX.Framework/NonXNA/AddInSystemFactory.cs
+++ b/ANX.Framework/NonXNA/AddInSystemFactory.cs
@@ -1,14 +1,10 @@
#region Using Statements
using System;
-using System.IO;
-using System.Reflection;
using System.Collections.Generic;
+using System.IO;
using System.Linq;
-using ANX.Framework.Input;
+using System.Reflection;
using NLog;
-using System.Collections;
-using System.Resources;
-using System.Xml.Linq;
#endregion // Using Statements
@@ -71,22 +67,14 @@ namespace ANX.Framework.NonXNA
private OperatingSystem operatingSystem;
private Version operatingSystemVersion;
- private string preferredRenderSystem;
- private bool preferredRenderSystemLocked;
- private string preferredInputSystem;
- private bool preferredInputSystemLocked;
- private string preferredSoundSystem;
- private bool preferredSoundSystemLocked;
-
- private List renderSystems;
- private List inputSystems;
- private List soundSystems;
+ private Dictionary addinSystems;
private static Logger logger = LogManager.GetCurrentClassLogger();
#endregion // Private Members
- public static AddInSystemFactory Instance
+ #region Public
+ public static AddInSystemFactory Instance
{
get
{
@@ -98,24 +86,46 @@ namespace ANX.Framework.NonXNA
return instance;
}
- }
+ }
- private AddInSystemFactory()
+ public OperatingSystem OperatingSystem
+ {
+ get
+ {
+ return this.operatingSystem;
+ }
+ }
+
+ public Version OperatingSystemVersion
+ {
+ get
+ {
+ return this.operatingSystemVersion;
+ }
+ }
+ #endregion
+
+ #region Constructor
+ private AddInSystemFactory()
{
- this.renderSystems = new List();
- this.inputSystems = new List();
- this.soundSystems = new List();
-
+ addinSystems = new Dictionary();
+ addinSystems.Add(AddInType.InputSystem, new AddInSystemInfo());
+ addinSystems.Add(AddInType.MediaSystem, new AddInSystemInfo());
+ addinSystems.Add(AddInType.RenderSystem, new AddInSystemInfo());
+ addinSystems.Add(AddInType.SoundSystem, new AddInSystemInfo());
+
this.creators = new Dictionary();
this.operatingSystem = Environment.OSVersion;
this.operatingSystemVersion = this.operatingSystem.Version;
logger.Info("Operating System: {0} ({1})", operatingSystem.VersionString, operatingSystemVersion.ToString());
}
+ #endregion
- public void Initialize()
+ #region Initialize
+ public void Initialize()
{
- if (!initialized)
+ if (initialized == false)
{
initialized = true;
@@ -125,25 +135,14 @@ namespace ANX.Framework.NonXNA
foreach (String file in Directory.EnumerateFiles(Path.GetDirectoryName(executingAssembly), "*.dll", SearchOption.TopDirectoryOnly))
{
- if (!file.Equals(executingAssembly))
+ if (file.Equals(executingAssembly) == false)
{
logger.Info("[ANX] trying to load '{0}'...", file);
AddIn addin = new AddIn(file);
if (addin.IsValid && addin.IsSupported)
{
- switch (addin.Type)
- {
- case AddInType.InputSystem:
- this.inputSystems.Add(addin);
- break;
- case AddInType.RenderSystem:
- this.renderSystems.Add(addin);
- break;
- case AddInType.SoundSystem:
- this.soundSystems.Add(addin);
- break;
- }
+ addinSystems[addin.Type].AvailableSystems.Add(addin);
logger.Info("[ANX] successfully loaded addin...");
}
else
@@ -156,8 +155,10 @@ namespace ANX.Framework.NonXNA
SortAddIns();
}
}
+ #endregion
- public void AddCreator(ICreator creator)
+ #region AddCreator
+ public void AddCreator(ICreator creator)
{
string creatorName = creator.Name.ToLowerInvariant();
@@ -170,13 +171,17 @@ namespace ANX.Framework.NonXNA
logger.Debug("added creator '{0}'. Total count of registered creators is now {1}.", creatorName, creators.Count);
}
+ #endregion
- public bool HasFramework(String name)
+ #region HasFramework
+ public bool HasFramework(String name)
{
return creators.ContainsKey(name.ToLowerInvariant());
- }
+ }
+ #endregion
- public T GetCreator(String name) where T : class, ICreator
+ #region GetCreator
+ public T GetCreator(String name) where T : class, ICreator
{
if (!initialized)
{
@@ -186,9 +191,11 @@ namespace ANX.Framework.NonXNA
ICreator creator = null;
creators.TryGetValue(name.ToLowerInvariant(), out creator);
return creator as T;
- }
+ }
+ #endregion
- public IEnumerable GetCreators() where T : class, ICreator
+ #region GetCreators
+ public IEnumerable GetCreators() where T : class, ICreator
{
if (!initialized)
{
@@ -197,18 +204,18 @@ namespace ANX.Framework.NonXNA
Type t = typeof(T);
- foreach (ICreator creator in this.creators.Values)
+ foreach (ICreator creator in this.creators.Values.Where(p =>
+ p.GetType().GetInterfaces()[0].Equals(t)))
{
- if (creator.GetType().GetInterfaces()[0].Equals(t))
- {
- yield return creator as T;
- }
+ yield return creator as T;
}
}
+ #endregion
- public T GetDefaultCreator() where T : class, ICreator
+ #region GetDefaultCreator
+ public T GetDefaultCreator() where T : class, ICreator
{
- if (!initialized)
+ if (initialized == false)
{
Initialize();
}
@@ -216,172 +223,80 @@ namespace ANX.Framework.NonXNA
Type type = typeof(T);
AddInType addInType = GetAddInType(type);
- switch (addInType)
- {
- case AddInType.InputSystem:
- if (string.IsNullOrEmpty(preferredInputSystem))
- {
- if (inputSystems.Count > 0)
- {
- return inputSystems[0].Instance as T;
- }
+ AddInSystemInfo info = addinSystems[addInType];
+ if (String.IsNullOrEmpty(info.PreferredName))
+ {
+ if (info.AvailableSystems.Count > 0)
+ {
+ return info.AvailableSystems[0].Instance as T;
+ }
- throw new AddInLoadingException("couldn't get default input system because there are no registered input systems available");
- }
- else
- {
- foreach (AddIn addin in this.inputSystems)
- {
- if (addin.Name.Equals(preferredInputSystem, StringComparison.InvariantCultureIgnoreCase))
- {
- return addin.Instance as T;
- }
- }
+ throw new AddInLoadingException(String.Format(
+ "Couldn't get default {0} because there are no " +
+ "registered {0}s available!", addInType));
+ }
+ else
+ {
+ foreach (AddIn addin in info.AvailableSystems)
+ {
+ if (addin.Name.Equals(info.PreferredName,
+ StringComparison.InvariantCultureIgnoreCase))
+ {
+ return addin.Instance as T;
+ }
+ }
- throw new AddInLoadingException(String.Format("couldn't get default input system '{0}' because it was not found in the list of registered creators", preferredInputSystem));
- }
- case AddInType.RenderSystem:
- if (string.IsNullOrEmpty(preferredRenderSystem))
- {
- if (renderSystems.Count > 0)
- {
- return renderSystems[0].Instance as T;
- }
+ throw new AddInLoadingException(String.Format(
+ "Couldn't get default {0} '{1}' because it was not found in the " +
+ "list of registered creators!", addInType, info.PreferredName));
+ }
- throw new AddInLoadingException("couldn't get default render system because there are no registered render systems available");
- }
- else
- {
- foreach (AddIn addin in this.renderSystems)
- {
- if (addin.Name.Equals(preferredRenderSystem, StringComparison.InvariantCultureIgnoreCase))
- {
- return addin.Instance as T;
- }
- }
-
- throw new AddInLoadingException(String.Format("couldn't get default render system '{0}' because it was not found in the list of registered creators", preferredRenderSystem));
- }
- case AddInType.SoundSystem:
- if (string.IsNullOrEmpty(preferredSoundSystem))
- {
- if (soundSystems.Count > 0)
- {
- return soundSystems[0].Instance as T;
- }
-
- throw new AddInLoadingException("couldn't get default sound system because there are no registered sound systems available");
- }
- else
- {
- foreach (AddIn addin in this.soundSystems)
- {
- if (addin.Name.Equals(preferredSoundSystem, StringComparison.InvariantCultureIgnoreCase))
- {
- return addin.Instance as T;
- }
- }
-
- throw new AddInLoadingException(String.Format("couldn't get default sound system '{0}' because it was not found in the list of registered creators", preferredSoundSystem));
- }
-
- }
-
- throw new AddInLoadingException(String.Format("couldn't find a DefaultCreator of type '{0}'", type.FullName));
+ throw new AddInLoadingException(String.Format(
+ "Couldn't find a DefaultCreator of type '{0}'!", type.FullName));
}
+ #endregion
- public void SortAddIns()
+ #region SortAddIns
+ public void SortAddIns()
{
- this.inputSystems.Sort();
- this.renderSystems.Sort();
- this.soundSystems.Sort();
+ foreach (AddInSystemInfo info in addinSystems.Values)
+ {
+ info.AvailableSystems.Sort();
+ }
this.creators = this.creators.OrderBy(x => x.Value.Priority).ToDictionary(x => x.Key, x => x.Value);
- }
+ }
+ #endregion
- public OperatingSystem OperatingSystem
+ #region GetPreferredSystem
+ public string GetPreferredSystem(AddInType addInType)
+ {
+ return addinSystems[addInType].PreferredName;
+ }
+ #endregion
+
+ #region SetPreferredSystem
+ public void SetPreferredSystem(AddInType addInType, string preferredName)
+ {
+ if (addinSystems[addInType].PreferredLocked)
+ {
+ throw new AddInLoadingException(String.Format(
+ "Can't set preferred {0} because a {0} is alread in use.", addInType));
+ }
+
+ addinSystems[addInType].PreferredName = preferredName;
+ }
+ #endregion
+
+ #region PreventSystemChange
+ public void PreventSystemChange(AddInType addInType)
{
- get
- {
- return this.operatingSystem;
- }
+ addinSystems[addInType].PreferredLocked = true;
}
+ #endregion
- public Version OperatingSystemVersion
- {
- get
- {
- return this.operatingSystemVersion;
- }
- }
-
- public string PreferredRenderSystem
- {
- get
- {
- return this.preferredRenderSystem;
- }
- set
- {
- if (this.preferredRenderSystemLocked)
- {
- throw new AddInLoadingException("can't set preferred RenderSystem because a RenderSystem is alread in use.");
- }
-
- this.preferredRenderSystem = value;
- }
- }
-
- public string PreferredInputSystem
- {
- get
- {
- return this.preferredInputSystem;
- }
- set
- {
- if (this.preferredInputSystemLocked)
- {
- throw new AddInLoadingException("can't set preferred InputSystem because a InputSystem is alread in use.");
- }
-
- this.preferredInputSystem = value;
- }
- }
-
- public string PreferredSoundSystem
- {
- get
- {
- return this.preferredSoundSystem;
- }
- set
- {
- if (this.preferredSoundSystemLocked)
- {
- throw new AddInLoadingException("can't set preferred SoundSystem because a SoundSystem is alread in use.");
- }
-
- this.preferredSoundSystem = value;
- }
- }
-
- public void PreventRenderSystemChange()
- {
- this.preferredRenderSystemLocked = true;
- }
-
- public void PreventInputSystemChange()
- {
- this.preferredInputSystemLocked = true;
- }
-
- public void PreventSoundSystemChange()
- {
- this.preferredSoundSystemLocked = true;
- }
-
- private AddInType GetAddInType(Type t)
+ #region GetAddInType
+ internal static AddInType GetAddInType(Type t)
{
if (typeof(IRenderSystemCreator).IsAssignableFrom(t))
{
@@ -394,11 +309,16 @@ namespace ANX.Framework.NonXNA
else if (typeof(ISoundSystemCreator).IsAssignableFrom(t))
{
return AddInType.SoundSystem;
- }
+ }
+ else if (typeof(IMediaSystemCreator).IsAssignableFrom(t))
+ {
+ return AddInType.MediaSystem;
+ }
else
{
return AddInType.Unknown;
}
- }
- }
+ }
+ #endregion
+ }
}
diff --git a/ANX.Framework/NonXNA/AddInSystemInfo.cs b/ANX.Framework/NonXNA/AddInSystemInfo.cs
new file mode 100644
index 00000000..5e55c518
--- /dev/null
+++ b/ANX.Framework/NonXNA/AddInSystemInfo.cs
@@ -0,0 +1,88 @@
+using System;
+using System.Collections.Generic;
+
+#region License
+
+//
+// This file is part of the ANX.Framework created by the "ANX.Framework developer group".
+//
+// This file is released under the Ms-PL license.
+//
+//
+//
+// Microsoft Public License (Ms-PL)
+//
+// This license governs use of the accompanying software. If you use the software, you accept this license.
+// If you do not accept the license, do not use the software.
+//
+// 1.Definitions
+// The terms "reproduce," "reproduction," "derivative works," and "distribution" have the same meaning
+// here as under U.S. copyright law.
+// A "contribution" is the original software, or any additions or changes to the software.
+// A "contributor" is any person that distributes its contribution under this license.
+// "Licensed patents" are a contributor's patent claims that read directly on its contribution.
+//
+// 2.Grant of Rights
+// (A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations
+// in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to
+// reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution
+// or any derivative works that you create.
+// (B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations in
+// section 3, each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed
+// patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution
+// in the software or derivative works of the contribution in the software.
+//
+// 3.Conditions and Limitations
+// (A) No Trademark License- This license does not grant you rights to use any contributors' name, logo, or trademarks.
+// (B) If you bring a patent claim against any contributor over patents that you claim are infringed by the software, your
+// patent license from such contributor to the software ends automatically.
+// (C) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution
+// notices that are present in the software.
+// (D) If you distribute any portion of the software in source code form, you may do so only under this license by including
+// a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or
+// object code form, you may only do so under a license that complies with this license.
+// (E) The software is licensed "as-is." You bear the risk of using it. The contributors give no express warranties, guarantees,
+// or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the
+// extent permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a
+// particular purpose and non-infringement.
+
+#endregion // License
+
+namespace ANX.Framework.NonXNA
+{
+ internal class AddInSystemInfo
+ {
+ #region Public
+ #region PreferredName
+ public string PreferredName
+ {
+ get;
+ set;
+ }
+ #endregion
+
+ #region PreferredLocked
+ public bool PreferredLocked
+ {
+ get;
+ set;
+ }
+ #endregion
+
+ #region AvailableSystems
+ public List AvailableSystems
+ {
+ get;
+ private set;
+ }
+ #endregion
+ #endregion
+
+ #region Constructor
+ public AddInSystemInfo()
+ {
+ AvailableSystems = new List();
+ }
+ #endregion
+ }
+}
diff --git a/ANX.Framework/NonXNA/AddInType.cs b/ANX.Framework/NonXNA/AddInType.cs
index d9dd491a..2b69a23b 100644
--- a/ANX.Framework/NonXNA/AddInType.cs
+++ b/ANX.Framework/NonXNA/AddInType.cs
@@ -1,9 +1,4 @@
-#region Using Statements
-using System;
-
-#endregion
-
-#region License
+#region License
//
// This file is part of the ANX.Framework created by the "ANX.Framework developer group".
@@ -57,6 +52,7 @@ namespace ANX.Framework.NonXNA
Unknown,
RenderSystem,
InputSystem,
- SoundSystem
+ SoundSystem,
+ MediaSystem
}
}
diff --git a/ANX.Framework/NonXNA/Development/PercentageCompleteAttribute.cs b/ANX.Framework/NonXNA/Development/PercentageCompleteAttribute.cs
new file mode 100644
index 00000000..d6125927
--- /dev/null
+++ b/ANX.Framework/NonXNA/Development/PercentageCompleteAttribute.cs
@@ -0,0 +1,74 @@
+using System;
+
+#region License
+
+//
+// This file is part of the ANX.Framework created by the "ANX.Framework developer group".
+//
+// This file is released under the Ms-PL license.
+//
+//
+//
+// Microsoft Public License (Ms-PL)
+//
+// This license governs use of the accompanying software. If you use the software, you accept this license.
+// If you do not accept the license, do not use the software.
+//
+// 1.Definitions
+// The terms "reproduce," "reproduction," "derivative works," and "distribution" have the same meaning
+// here as under U.S. copyright law.
+// A "contribution" is the original software, or any additions or changes to the software.
+// A "contributor" is any person that distributes its contribution under this license.
+// "Licensed patents" are a contributor's patent claims that read directly on its contribution.
+//
+// 2.Grant of Rights
+// (A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations
+// in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to
+// reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution
+// or any derivative works that you create.
+// (B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations in
+// section 3, each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed
+// patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution
+// in the software or derivative works of the contribution in the software.
+//
+// 3.Conditions and Limitations
+// (A) No Trademark License- This license does not grant you rights to use any contributors' name, logo, or trademarks.
+// (B) If you bring a patent claim against any contributor over patents that you claim are infringed by the software, your
+// patent license from such contributor to the software ends automatically.
+// (C) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution
+// notices that are present in the software.
+// (D) If you distribute any portion of the software in source code form, you may do so only under this license by including
+// a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or
+// object code form, you may only do so under a license that complies with this license.
+// (E) The software is licensed "as-is." You bear the risk of using it. The contributors give no express warranties, guarantees,
+// or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the
+// extent permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a
+// particular purpose and non-infringement.
+
+#endregion // License
+
+namespace ANX.Framework.NonXNA.Development
+{
+ public class PercentageCompleteAttribute : Attribute
+ {
+ #region Public
+ public int Percentage
+ {
+ get;
+ private set;
+ }
+ #endregion
+
+ #region Constructor
+ ///
+ /// Create a new percentage complete attribute.
+ ///
+ /// The percentage [0-100] value defining how
+ /// "complete" the class is.
+ public PercentageCompleteAttribute(int setPercentage)
+ {
+ Percentage = setPercentage;
+ }
+ #endregion
+ }
+}
diff --git a/ANX.Framework/NonXNA/ICreator.cs b/ANX.Framework/NonXNA/ICreator.cs
index 559d7ebf..d664729b 100644
--- a/ANX.Framework/NonXNA/ICreator.cs
+++ b/ANX.Framework/NonXNA/ICreator.cs
@@ -1,14 +1,4 @@
-#region Using Statements
-using System;
-using System.IO;
-using System.Reflection;
-using System.Collections.Generic;
-using System.Linq;
-using ANX.Framework.Input;
-
-#endregion // Using Statements
-
-#region License
+#region License
//
// This file is part of the ANX.Framework created by the "ANX.Framework developer group".
diff --git a/ANX.Framework/NonXNA/MediaSystem/IMediaSystemCreator.cs b/ANX.Framework/NonXNA/MediaSystem/IMediaSystemCreator.cs
new file mode 100644
index 00000000..ae96862b
--- /dev/null
+++ b/ANX.Framework/NonXNA/MediaSystem/IMediaSystemCreator.cs
@@ -0,0 +1,55 @@
+using System;
+
+#region License
+
+//
+// This file is part of the ANX.Framework created by the "ANX.Framework developer group".
+//
+// This file is released under the Ms-PL license.
+//
+//
+//
+// Microsoft Public License (Ms-PL)
+//
+// This license governs use of the accompanying software. If you use the software, you accept this license.
+// If you do not accept the license, do not use the software.
+//
+// 1.Definitions
+// The terms "reproduce," "reproduction," "derivative works," and "distribution" have the same meaning
+// here as under U.S. copyright law.
+// A "contribution" is the original software, or any additions or changes to the software.
+// A "contributor" is any person that distributes its contribution under this license.
+// "Licensed patents" are a contributor's patent claims that read directly on its contribution.
+//
+// 2.Grant of Rights
+// (A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations
+// in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to
+// reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution
+// or any derivative works that you create.
+// (B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations in
+// section 3, each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed
+// patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution
+// in the software or derivative works of the contribution in the software.
+//
+// 3.Conditions and Limitations
+// (A) No Trademark License- This license does not grant you rights to use any contributors' name, logo, or trademarks.
+// (B) If you bring a patent claim against any contributor over patents that you claim are infringed by the software, your
+// patent license from such contributor to the software ends automatically.
+// (C) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution
+// notices that are present in the software.
+// (D) If you distribute any portion of the software in source code form, you may do so only under this license by including
+// a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or
+// object code form, you may only do so under a license that complies with this license.
+// (E) The software is licensed "as-is." You bear the risk of using it. The contributors give no express warranties, guarantees,
+// or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the
+// extent permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a
+// particular purpose and non-infringement.
+
+#endregion // License
+
+namespace ANX.Framework.NonXNA
+{
+ public interface IMediaSystemCreator : ICreator
+ {
+ }
+}
diff --git a/InputSystems/ANX.InputDevices.Test/Creator.cs b/InputSystems/ANX.InputDevices.Test/Creator.cs
index 39bdc5cd..3f999a69 100644
--- a/InputSystems/ANX.InputDevices.Test/Creator.cs
+++ b/InputSystems/ANX.InputDevices.Test/Creator.cs
@@ -67,8 +67,9 @@ namespace ANX.InputDevices.Test
public IGamePad GamePad
{
get
- {
- AddInSystemFactory.Instance.PreventInputSystemChange();
+ {
+ AddInSystemFactory.Instance.PreventSystemChange(
+ AddInType.InputSystem);
if (_gamePad == null)
{
_gamePad = new GamePad();
@@ -80,8 +81,9 @@ namespace ANX.InputDevices.Test
public IMouse Mouse
{
get
- {
- AddInSystemFactory.Instance.PreventInputSystemChange();
+ {
+ AddInSystemFactory.Instance.PreventSystemChange(
+ AddInType.InputSystem);
if (_mouse == null)
{
_mouse = new Mouse();
@@ -93,8 +95,9 @@ namespace ANX.InputDevices.Test
public IKeyboard Keyboard
{
get
- {
- AddInSystemFactory.Instance.PreventInputSystemChange();
+ {
+ AddInSystemFactory.Instance.PreventSystemChange(
+ AddInType.InputSystem);
if (_keyboard == null)
{
_keyboard = new Keyboard();
diff --git a/InputSystems/ANX.InputSystem.Recording/Creator.cs b/InputSystems/ANX.InputSystem.Recording/Creator.cs
index ebd9e499..6c3908af 100644
--- a/InputSystems/ANX.InputSystem.Recording/Creator.cs
+++ b/InputSystems/ANX.InputSystem.Recording/Creator.cs
@@ -68,9 +68,10 @@ namespace ANX.InputSystem.Recording
public IGamePad GamePad
{
- get
- {
- AddInSystemFactory.Instance.PreventInputSystemChange();
+ get
+ {
+ AddInSystemFactory.Instance.PreventSystemChange(
+ AddInType.InputSystem);
if (gamePad == null)
gamePad = new RecordingGamePad();
return gamePad;
@@ -79,9 +80,10 @@ namespace ANX.InputSystem.Recording
public IMouse Mouse
{
- get
- {
- AddInSystemFactory.Instance.PreventInputSystemChange();
+ get
+ {
+ AddInSystemFactory.Instance.PreventSystemChange(
+ AddInType.InputSystem);
if (mouse == null)
mouse = new RecordingMouse();
return mouse;
@@ -90,9 +92,10 @@ namespace ANX.InputSystem.Recording
public IKeyboard Keyboard
{
- get
- {
- AddInSystemFactory.Instance.PreventInputSystemChange();
+ get
+ {
+ AddInSystemFactory.Instance.PreventSystemChange(
+ AddInType.InputSystem);
if (keyboard == null)
keyboard = new RecordingKeyboard();
return keyboard;
@@ -102,9 +105,10 @@ namespace ANX.InputSystem.Recording
#if XNAEXT
public IMotionSensingDevice MotionSensingDevice
{
- get
- {
- AddInSystemFactory.Instance.PreventInputSystemChange();
+ get
+ {
+ AddInSystemFactory.Instance.PreventSystemChange(
+ AddInType.InputSystem);
if (msd == null)
msd = new RecordingMotionSensingDevice();
return msd;
diff --git a/InputSystems/ANX.InputSystem.Standard/Creator.cs b/InputSystems/ANX.InputSystem.Standard/Creator.cs
index 0805d51c..3fae1835 100644
--- a/InputSystems/ANX.InputSystem.Standard/Creator.cs
+++ b/InputSystems/ANX.InputSystem.Standard/Creator.cs
@@ -98,7 +98,8 @@ namespace ANX.InputDevices.Windows.XInput
get
{
logger.Debug("returning a new GamePad device");
- AddInSystemFactory.Instance.PreventInputSystemChange();
+ AddInSystemFactory.Instance.PreventSystemChange(
+ AddInType.InputSystem);
return InputDeviceFactory.Instance.GetDefaultGamePad();
}
}
@@ -114,8 +115,9 @@ namespace ANX.InputDevices.Windows.XInput
{
throw new NoInputDeviceException("couldn't find a default mouse device creator. Unable to create a mouse instance.");
}
- logger.Debug("created a new Mouse device");
- AddInSystemFactory.Instance.PreventInputSystemChange();
+ logger.Debug("created a new Mouse device");
+ AddInSystemFactory.Instance.PreventSystemChange(
+ AddInType.InputSystem);
}
return this.mouse;
@@ -133,8 +135,9 @@ namespace ANX.InputDevices.Windows.XInput
{
throw new NoInputDeviceException("couldn't find a default keyboard device creator. Unable to create a keyboard instance.");
}
- logger.Debug("created a new Keyboard device");
- AddInSystemFactory.Instance.PreventInputSystemChange();
+ logger.Debug("created a new Keyboard device");
+ AddInSystemFactory.Instance.PreventSystemChange(
+ AddInType.InputSystem);
}
return this.keyboard;
@@ -146,8 +149,9 @@ namespace ANX.InputDevices.Windows.XInput
{
get
{
- logger.Debug("returning a new MotionSensingDevice device");
- AddInSystemFactory.Instance.PreventInputSystemChange();
+ logger.Debug("returning a new MotionSensingDevice device");
+ AddInSystemFactory.Instance.PreventSystemChange(
+ AddInType.InputSystem);
return InputDeviceFactory.Instance.GetDefaultMotionSensingDevice();
}
}
diff --git a/MediaSystems/ANX.MediaSystem.Windows.OpenAL/ANX.MediaSystem.Windows.OpenAL.csproj b/MediaSystems/ANX.MediaSystem.Windows.OpenAL/ANX.MediaSystem.Windows.OpenAL.csproj
new file mode 100644
index 00000000..e4aa6e04
--- /dev/null
+++ b/MediaSystems/ANX.MediaSystem.Windows.OpenAL/ANX.MediaSystem.Windows.OpenAL.csproj
@@ -0,0 +1,65 @@
+
+
+
+ Debug
+ AnyCPU
+ 8.0.30703
+ 2.0
+ {97185A92-077D-4498-8B6A-8BFF04079044}
+ Library
+ Properties
+ ANX.MediaSystem.Windows.OpenAL
+ ANX.MediaSystem.Windows.OpenAL
+ v4.0
+ 512
+
+
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+
+
+
+
+
+
+
+ Metadata.resx
+ True
+ True
+
+
+
+
+
+ {6899F0C9-70B9-4EB0-9DD3-E598D4BE3E35}
+ ANX.Framework
+
+
+
+
+ PublicResXFileCodeGenerator
+ Metadata.Designer.cs
+
+
+
+
+
\ No newline at end of file
diff --git a/MediaSystems/ANX.MediaSystem.Windows.OpenAL/Creator.cs b/MediaSystems/ANX.MediaSystem.Windows.OpenAL/Creator.cs
new file mode 100644
index 00000000..0fbf7606
--- /dev/null
+++ b/MediaSystems/ANX.MediaSystem.Windows.OpenAL/Creator.cs
@@ -0,0 +1,90 @@
+using System;
+using ANX.Framework.NonXNA;
+
+#region License
+
+//
+// This file is part of the ANX.Framework created by the "ANX.Framework developer group".
+//
+// This file is released under the Ms-PL license.
+//
+//
+//
+// Microsoft Public License (Ms-PL)
+//
+// This license governs use of the accompanying software. If you use the software, you accept this license.
+// If you do not accept the license, do not use the software.
+//
+// 1.Definitions
+// The terms "reproduce," "reproduction," "derivative works," and "distribution" have the same meaning
+// here as under U.S. copyright law.
+// A "contribution" is the original software, or any additions or changes to the software.
+// A "contributor" is any person that distributes its contribution under this license.
+// "Licensed patents" are a contributor's patent claims that read directly on its contribution.
+//
+// 2.Grant of Rights
+// (A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations
+// in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to
+// reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution
+// or any derivative works that you create.
+// (B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations in
+// section 3, each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed
+// patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution
+// in the software or derivative works of the contribution in the software.
+//
+// 3.Conditions and Limitations
+// (A) No Trademark License- This license does not grant you rights to use any contributors' name, logo, or trademarks.
+// (B) If you bring a patent claim against any contributor over patents that you claim are infringed by the software, your
+// patent license from such contributor to the software ends automatically.
+// (C) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution
+// notices that are present in the software.
+// (D) If you distribute any portion of the software in source code form, you may do so only under this license by including
+// a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or
+// object code form, you may only do so under a license that complies with this license.
+// (E) The software is licensed "as-is." You bear the risk of using it. The contributors give no express warranties, guarantees,
+// or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the
+// extent permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a
+// particular purpose and non-infringement.
+
+#endregion // License
+
+namespace ANX.MediaSystem.Windows.OpenAL
+{
+ public class Creator : IMediaSystemCreator
+ {
+ #region Public
+ #region Name
+ public string Name
+ {
+ get { return "OpenAL"; }
+ }
+ #endregion
+
+ #region Priority
+ public int Priority
+ {
+ get { return 10; }
+ }
+ #endregion
+
+ #region IsSupported
+ public bool IsSupported
+ {
+ get
+ {
+ //TODO: this is just a very basic version of test for support
+ return AddInSystemFactory.Instance.OperatingSystem.Platform ==
+ PlatformID.Win32NT;
+ }
+ }
+ #endregion
+ #endregion
+
+ #region RegisterCreator
+ public void RegisterCreator(AddInSystemFactory factory)
+ {
+ factory.AddCreator(this);
+ }
+ #endregion
+ }
+}
diff --git a/MediaSystems/ANX.MediaSystem.Windows.OpenAL/Metadata.Designer.cs b/MediaSystems/ANX.MediaSystem.Windows.OpenAL/Metadata.Designer.cs
new file mode 100644
index 00000000..e2c62f94
--- /dev/null
+++ b/MediaSystems/ANX.MediaSystem.Windows.OpenAL/Metadata.Designer.cs
@@ -0,0 +1,72 @@
+//------------------------------------------------------------------------------
+//
+// Dieser Code wurde von einem Tool generiert.
+// Laufzeitversion:4.0.30319.488
+//
+// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
+// der Code erneut generiert wird.
+//
+//------------------------------------------------------------------------------
+
+namespace ANX.MediaSystem.Windows.OpenAL {
+ using System;
+
+
+ ///
+ /// Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw.
+ ///
+ // Diese Klasse wurde von der StronglyTypedResourceBuilder automatisch generiert
+ // -Klasse über ein Tool wie ResGen oder Visual Studio automatisch generiert.
+ // Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen
+ // mit der /str-Option erneut aus, oder Sie erstellen Ihr VS-Projekt neu.
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ public class Metadata {
+
+ private static global::System.Resources.ResourceManager resourceMan;
+
+ private static global::System.Globalization.CultureInfo resourceCulture;
+
+ [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+ internal Metadata() {
+ }
+
+ ///
+ /// Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ public static global::System.Resources.ResourceManager ResourceManager {
+ get {
+ if (object.ReferenceEquals(resourceMan, null)) {
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ANX.MediaSystem.Windows.OpenAL.Metadata", typeof(Metadata).Assembly);
+ resourceMan = temp;
+ }
+ return resourceMan;
+ }
+ }
+
+ ///
+ /// Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle
+ /// Ressourcenzuordnungen, die diese stark typisierte Ressourcenklasse verwenden.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ public static global::System.Globalization.CultureInfo Culture {
+ get {
+ return resourceCulture;
+ }
+ set {
+ resourceCulture = value;
+ }
+ }
+
+ ///
+ /// Sucht eine lokalisierte Zeichenfolge, die Win32NT ähnelt.
+ ///
+ public static string SupportedPlatforms {
+ get {
+ return ResourceManager.GetString("SupportedPlatforms", resourceCulture);
+ }
+ }
+ }
+}
diff --git a/MediaSystems/ANX.MediaSystem.Windows.OpenAL/Metadata.resx b/MediaSystems/ANX.MediaSystem.Windows.OpenAL/Metadata.resx
new file mode 100644
index 00000000..c90f8c84
--- /dev/null
+++ b/MediaSystems/ANX.MediaSystem.Windows.OpenAL/Metadata.resx
@@ -0,0 +1,123 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ Win32NT
+
+
\ No newline at end of file
diff --git a/MediaSystems/ANX.MediaSystem.Windows.OpenAL/Properties/AssemblyInfo.cs b/MediaSystems/ANX.MediaSystem.Windows.OpenAL/Properties/AssemblyInfo.cs
new file mode 100644
index 00000000..0f5e9c1c
--- /dev/null
+++ b/MediaSystems/ANX.MediaSystem.Windows.OpenAL/Properties/AssemblyInfo.cs
@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// Allgemeine Informationen über eine Assembly werden über die folgenden
+// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern,
+// die mit einer Assembly verknüpft sind.
+[assembly: AssemblyTitle("ANX.MediaSystem.Windows.OpenAL")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("ANX.Framework Tea")]
+[assembly: AssemblyProduct("ANX.MediaSystem.Windows.OpenAL")]
+[assembly: AssemblyCopyright("Copyright © ANX.Framework Tea 2012")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Durch Festlegen von ComVisible auf "false" werden die Typen in dieser Assembly unsichtbar
+// für COM-Komponenten. Wenn Sie auf einen Typ in dieser Assembly von
+// COM zugreifen müssen, legen Sie das ComVisible-Attribut für diesen Typ auf "true" fest.
+[assembly: ComVisible(false)]
+
+// Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird
+[assembly: Guid("1395f0f5-84f8-4336-9c40-e9d80a3fef6b")]
+
+// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten:
+//
+// Hauptversion
+// Nebenversion
+// Buildnummer
+// Revision
+//
+// Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern
+// übernehmen, indem Sie "*" eingeben:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/RecordingSample/RecordingSample/Program.cs b/RecordingSample/RecordingSample/Program.cs
index 1532c0a9..bb02131e 100644
--- a/RecordingSample/RecordingSample/Program.cs
+++ b/RecordingSample/RecordingSample/Program.cs
@@ -9,7 +9,8 @@ namespace RecordingSample
static void Main(string[] args)
{
//This is technically unessasary, because there is only a reference to the RecordingSystem...
- AddInSystemFactory.Instance.PreferredInputSystem = "Recording";
+ AddInSystemFactory.Instance.SetPreferredSystem(
+ AddInType.InputSystem, "Recording");
using (Game1 game = new Game1())
{
diff --git a/RecordingSample/RecordingSample/RecordingSample.csproj b/RecordingSample/RecordingSample/RecordingSample.csproj
index 8b8a8fdc..bde58a6e 100644
--- a/RecordingSample/RecordingSample/RecordingSample.csproj
+++ b/RecordingSample/RecordingSample/RecordingSample.csproj
@@ -91,6 +91,10 @@
{DB88DDEB-7281-405D-8FCA-5681B6B2BD7A}
ANX.InputSystem.Recording
+
+ {97185A92-077D-4498-8B6A-8BFF04079044}
+ ANX.MediaSystem.Windows.OpenAL
+
{5BE49183-2F6F-4527-AC90-D816911FCF90}
ANX.Framework.Windows.DX10
diff --git a/RenderSystems/ANX.Framework.Windows.DX10/Creator.cs b/RenderSystems/ANX.Framework.Windows.DX10/Creator.cs
index e34fb9ba..e7b3512e 100644
--- a/RenderSystems/ANX.Framework.Windows.DX10/Creator.cs
+++ b/RenderSystems/ANX.Framework.Windows.DX10/Creator.cs
@@ -83,32 +83,37 @@ namespace ANX.Framework.Windows.DX10
}
public GameHost CreateGameHost(Game game)
- {
- AddInSystemFactory.Instance.PreventRenderSystemChange();
+ {
+ AddInSystemFactory.Instance.PreventSystemChange(
+ AddInType.RenderSystem);
return new WindowsGameHost(game);
}
public INativeGraphicsDevice CreateGraphicsDevice(PresentationParameters presentationParameters)
- {
- AddInSystemFactory.Instance.PreventRenderSystemChange();
+ {
+ AddInSystemFactory.Instance.PreventSystemChange(
+ AddInType.RenderSystem);
return new GraphicsDeviceWindowsDX10(presentationParameters);
}
public INativeBuffer CreateIndexBuffer(GraphicsDevice graphics, IndexElementSize size, int indexCount, BufferUsage usage)
- {
- AddInSystemFactory.Instance.PreventRenderSystemChange();
+ {
+ AddInSystemFactory.Instance.PreventSystemChange(
+ AddInType.RenderSystem);
return new IndexBuffer_DX10(graphics, size, indexCount, usage);
}
public INativeBuffer CreateVertexBuffer(GraphicsDevice graphics, VertexDeclaration vertexDeclaration, int vertexCount, BufferUsage usage)
- {
- AddInSystemFactory.Instance.PreventRenderSystemChange();
+ {
+ AddInSystemFactory.Instance.PreventSystemChange(
+ AddInType.RenderSystem);
return new VertexBuffer_DX10(graphics, vertexDeclaration, vertexCount, usage);
}
public INativeEffect CreateEffect(GraphicsDevice graphics, ANX.Framework.Graphics.Effect managedEffect, Stream vertexShaderByteCode, Stream pixelShaderByteCode)
- {
- AddInSystemFactory.Instance.PreventRenderSystemChange();
+ {
+ AddInSystemFactory.Instance.PreventSystemChange(
+ AddInType.RenderSystem);
Effect_DX10 effect = new Effect_DX10(graphics, managedEffect, vertexShaderByteCode, pixelShaderByteCode);
@@ -116,8 +121,9 @@ namespace ANX.Framework.Windows.DX10
}
public INativeEffect CreateEffect(GraphicsDevice graphics, ANX.Framework.Graphics.Effect managedEffect, System.IO.Stream byteCode)
- {
- AddInSystemFactory.Instance.PreventRenderSystemChange();
+ {
+ AddInSystemFactory.Instance.PreventSystemChange(
+ AddInType.RenderSystem);
Effect_DX10 effect = new Effect_DX10(graphics, managedEffect, byteCode);
@@ -125,8 +131,9 @@ namespace ANX.Framework.Windows.DX10
}
public Texture2D CreateTexture(GraphicsDevice graphics, string fileName)
- {
- AddInSystemFactory.Instance.PreventRenderSystemChange();
+ {
+ AddInSystemFactory.Instance.PreventSystemChange(
+ AddInType.RenderSystem);
//TODO: implement
throw new NotImplementedException();
@@ -140,32 +147,37 @@ namespace ANX.Framework.Windows.DX10
}
public INativeBlendState CreateBlendState()
- {
- AddInSystemFactory.Instance.PreventRenderSystemChange();
+ {
+ AddInSystemFactory.Instance.PreventSystemChange(
+ AddInType.RenderSystem);
return new BlendState_DX10();
}
public INativeRasterizerState CreateRasterizerState()
- {
- AddInSystemFactory.Instance.PreventRenderSystemChange();
+ {
+ AddInSystemFactory.Instance.PreventSystemChange(
+ AddInType.RenderSystem);
return new RasterizerState_DX10();
}
public INativeDepthStencilState CreateDepthStencilState()
- {
- AddInSystemFactory.Instance.PreventRenderSystemChange();
+ {
+ AddInSystemFactory.Instance.PreventSystemChange(
+ AddInType.RenderSystem);
return new DepthStencilState_DX10();
}
public INativeSamplerState CreateSamplerState()
- {
- AddInSystemFactory.Instance.PreventRenderSystemChange();
+ {
+ AddInSystemFactory.Instance.PreventSystemChange(
+ AddInType.RenderSystem);
return new SamplerState_DX10();
}
public byte[] GetShaderByteCode(PreDefinedShader type)
- {
- AddInSystemFactory.Instance.PreventRenderSystemChange();
+ {
+ AddInSystemFactory.Instance.PreventSystemChange(
+ AddInType.RenderSystem);
if (type == PreDefinedShader.SpriteBatch)
{
@@ -202,8 +214,9 @@ namespace ANX.Framework.Windows.DX10
public System.Collections.ObjectModel.ReadOnlyCollection GetAdapterList()
- {
- AddInSystemFactory.Instance.PreventRenderSystemChange();
+ {
+ AddInSystemFactory.Instance.PreventSystemChange(
+ AddInType.RenderSystem);
SharpDX.DXGI.Factory factory = new Factory();
@@ -256,15 +269,17 @@ namespace ANX.Framework.Windows.DX10
}
public INativeTexture2D CreateTexture(GraphicsDevice graphics, SurfaceFormat surfaceFormat, int width, int height, int mipCount)
- {
- AddInSystemFactory.Instance.PreventRenderSystemChange();
+ {
+ AddInSystemFactory.Instance.PreventSystemChange(
+ AddInType.RenderSystem);
return new Texture2D_DX10(graphics, width, height, surfaceFormat, mipCount);
}
public INativeRenderTarget2D CreateRenderTarget(GraphicsDevice graphics, int width, int height, bool mipMap, SurfaceFormat preferredFormat, DepthFormat preferredDepthFormat, int preferredMultiSampleCount, RenderTargetUsage usage)
- {
- AddInSystemFactory.Instance.PreventRenderSystemChange();
+ {
+ AddInSystemFactory.Instance.PreventSystemChange(
+ AddInType.RenderSystem);
return new RenderTarget2D_DX10(graphics, width, height, mipMap, preferredFormat, preferredDepthFormat, preferredMultiSampleCount, usage);
}
diff --git a/RenderSystems/ANX.Framework.Windows.GL3/Creator.cs b/RenderSystems/ANX.Framework.Windows.GL3/Creator.cs
index 484226d8..d4c07637 100644
--- a/RenderSystems/ANX.Framework.Windows.GL3/Creator.cs
+++ b/RenderSystems/ANX.Framework.Windows.GL3/Creator.cs
@@ -106,7 +106,8 @@ namespace ANX.Framework.Windows.GL3
public GameHost CreateGameHost(Game game)
{
logger.Info("creating OpenGL3 GameHost");
- AddInSystemFactory.Instance.PreventRenderSystemChange();
+ AddInSystemFactory.Instance.PreventSystemChange(
+ AddInType.RenderSystem);
return new WindowsGameHost(game);
}
#endregion
@@ -115,7 +116,8 @@ namespace ANX.Framework.Windows.GL3
public INativeEffect CreateEffect(GraphicsDevice graphics, Effect managedEffect,
Stream byteCode)
{
- AddInSystemFactory.Instance.PreventRenderSystemChange();
+ AddInSystemFactory.Instance.PreventSystemChange(
+ AddInType.RenderSystem);
return new EffectGL3(managedEffect, byteCode);
}
@@ -123,7 +125,8 @@ namespace ANX.Framework.Windows.GL3
public INativeEffect CreateEffect(GraphicsDevice graphics, Effect managedEffect,
Stream vertexShaderByteCode, Stream pixelShaderByteCode)
{
- AddInSystemFactory.Instance.PreventRenderSystemChange();
+ AddInSystemFactory.Instance.PreventSystemChange(
+ AddInType.RenderSystem);
return new EffectGL3(managedEffect, vertexShaderByteCode, pixelShaderByteCode);
}
@@ -133,7 +136,7 @@ namespace ANX.Framework.Windows.GL3
INativeGraphicsDevice IRenderSystemCreator.CreateGraphicsDevice(
PresentationParameters presentationParameters)
{
- AddInSystemFactory.Instance.PreventRenderSystemChange();
+ AddInSystemFactory.Instance.PreventSystemChange(AddInType.RenderSystem);
return new GraphicsDeviceWindowsGL3(presentationParameters);
}
#endregion
@@ -151,7 +154,7 @@ namespace ANX.Framework.Windows.GL3
public INativeTexture2D CreateTexture(GraphicsDevice graphics,
SurfaceFormat surfaceFormat, int width, int height, int mipCount)
{
- AddInSystemFactory.Instance.PreventRenderSystemChange();
+ AddInSystemFactory.Instance.PreventSystemChange(AddInType.RenderSystem);
return new Texture2DGL3(surfaceFormat, width, height, mipCount);
}
#endregion
@@ -169,7 +172,7 @@ namespace ANX.Framework.Windows.GL3
public INativeBuffer CreateIndexBuffer(GraphicsDevice graphics,
IndexElementSize size, int indexCount, BufferUsage usage)
{
- AddInSystemFactory.Instance.PreventRenderSystemChange();
+ AddInSystemFactory.Instance.PreventSystemChange(AddInType.RenderSystem);
return new IndexBufferGL3(size, indexCount, usage);
}
#endregion
@@ -188,7 +191,7 @@ namespace ANX.Framework.Windows.GL3
VertexDeclaration vertexDeclaration, int vertexCount,
BufferUsage usage)
{
- AddInSystemFactory.Instance.PreventRenderSystemChange();
+ AddInSystemFactory.Instance.PreventSystemChange(AddInType.RenderSystem);
return new VertexBufferGL3(vertexDeclaration, vertexCount, usage);
}
#endregion
@@ -200,7 +203,7 @@ namespace ANX.Framework.Windows.GL3
/// Native Blend State.
public INativeBlendState CreateBlendState()
{
- AddInSystemFactory.Instance.PreventRenderSystemChange();
+ AddInSystemFactory.Instance.PreventSystemChange(AddInType.RenderSystem);
return new BlendStateGL3();
}
#endregion
@@ -212,7 +215,7 @@ namespace ANX.Framework.Windows.GL3
/// Native Rasterizer State.
public INativeRasterizerState CreateRasterizerState()
{
- AddInSystemFactory.Instance.PreventRenderSystemChange();
+ AddInSystemFactory.Instance.PreventSystemChange(AddInType.RenderSystem);
return new RasterizerStateGL3();
}
#endregion
@@ -224,7 +227,7 @@ namespace ANX.Framework.Windows.GL3
/// Native Depth Stencil State.
public INativeDepthStencilState CreateDepthStencilState()
{
- AddInSystemFactory.Instance.PreventRenderSystemChange();
+ AddInSystemFactory.Instance.PreventSystemChange(AddInType.RenderSystem);
return new DepthStencilStateGL3();
}
#endregion
@@ -236,7 +239,7 @@ namespace ANX.Framework.Windows.GL3
/// Native Sampler State.
public INativeSamplerState CreateSamplerState()
{
- AddInSystemFactory.Instance.PreventRenderSystemChange();
+ AddInSystemFactory.Instance.PreventSystemChange(AddInType.RenderSystem);
return new SamplerStateGL3();
}
#endregion
@@ -249,7 +252,7 @@ namespace ANX.Framework.Windows.GL3
/// Byte code of the shader.
public byte[] GetShaderByteCode(PreDefinedShader type)
{
- AddInSystemFactory.Instance.PreventRenderSystemChange();
+ AddInSystemFactory.Instance.PreventSystemChange(AddInType.RenderSystem);
if (type == PreDefinedShader.SpriteBatch)
{
@@ -287,7 +290,7 @@ namespace ANX.Framework.Windows.GL3
/// List of graphics adapters.
public ReadOnlyCollection GetAdapterList()
{
- AddInSystemFactory.Instance.PreventRenderSystemChange();
+ AddInSystemFactory.Instance.PreventSystemChange(AddInType.RenderSystem);
var result = new List();
foreach (DisplayDevice device in DisplayDevice.AvailableDisplays)
@@ -348,7 +351,7 @@ namespace ANX.Framework.Windows.GL3
DepthFormat preferredDepthFormat, int preferredMultiSampleCount,
RenderTargetUsage usage)
{
- AddInSystemFactory.Instance.PreventRenderSystemChange();
+ AddInSystemFactory.Instance.PreventSystemChange(AddInType.RenderSystem);
return new RenderTarget2DGL3(width, height, mipMap, preferredFormat,
preferredDepthFormat, preferredMultiSampleCount, usage);
}
diff --git a/RenderSystems/ANX.Framework.Windows.GL3/WindowsGameWindow.cs b/RenderSystems/ANX.Framework.Windows.GL3/WindowsGameWindow.cs
index 3e2fcc0c..04c5ae53 100644
--- a/RenderSystems/ANX.Framework.Windows.GL3/WindowsGameWindow.cs
+++ b/RenderSystems/ANX.Framework.Windows.GL3/WindowsGameWindow.cs
@@ -55,12 +55,15 @@ namespace ANX.Framework.Windows.GL3
internal class WindowsGameWindow : ANX.Framework.GameWindow
{
#region Public
+ #region Form
internal static Form Form
{
get;
private set;
}
+ #endregion
+ #region Handle
public override IntPtr Handle
{
get
@@ -68,7 +71,9 @@ namespace ANX.Framework.Windows.GL3
return Form.Handle;
}
}
+ #endregion
+ #region IsMinimized
public override bool IsMinimized
{
get
@@ -76,6 +81,17 @@ namespace ANX.Framework.Windows.GL3
return Form.WindowState == FormWindowState.Minimized;
}
}
+ #endregion
+
+ #region ScreenDeviceName
+ public override string ScreenDeviceName
+ {
+ get
+ {
+ throw new NotImplementedException();
+ }
+ }
+ #endregion
#region AllowUserResizing
public override bool AllowUserResizing
@@ -147,23 +163,19 @@ namespace ANX.Framework.Windows.GL3
}
#endregion
+ #region BeginScreenDeviceChange
public override void BeginScreenDeviceChange(bool willBeFullScreen)
{
throw new NotImplementedException();
}
+ #endregion
+ #region EndScreenDeviceChange
public override void EndScreenDeviceChange(string screenDeviceName,
int clientWidth, int clientHeight)
{
throw new NotImplementedException();
}
-
- public override string ScreenDeviceName
- {
- get
- {
- throw new NotImplementedException();
- }
- }
+ #endregion
}
}
diff --git a/RenderSystems/ANX.RenderSystem.Windows.DX11/Creator.cs b/RenderSystems/ANX.RenderSystem.Windows.DX11/Creator.cs
index e7bc9d0a..44c9d541 100644
--- a/RenderSystems/ANX.RenderSystem.Windows.DX11/Creator.cs
+++ b/RenderSystems/ANX.RenderSystem.Windows.DX11/Creator.cs
@@ -84,32 +84,35 @@ namespace ANX.RenderSystem.Windows.DX11
}
public GameHost CreateGameHost(Game game)
- {
- AddInSystemFactory.Instance.PreventRenderSystemChange();
+ {
+ AddInSystemFactory.Instance.PreventSystemChange(
+ AddInType.RenderSystem);
return new WindowsGameHost(game);
}
public INativeGraphicsDevice CreateGraphicsDevice(PresentationParameters presentationParameters)
- {
- AddInSystemFactory.Instance.PreventRenderSystemChange();
+ {
+ AddInSystemFactory.Instance.PreventSystemChange(
+ AddInType.RenderSystem);
return new GraphicsDeviceWindowsDX11(presentationParameters);
}
public INativeBuffer CreateIndexBuffer(GraphicsDevice graphics, IndexElementSize size, int indexCount, BufferUsage usage)
- {
- AddInSystemFactory.Instance.PreventRenderSystemChange();
+ {
+ AddInSystemFactory.Instance.PreventSystemChange(
+ AddInType.RenderSystem);
return new IndexBuffer_DX11(graphics, size, indexCount, usage);
}
public INativeBuffer CreateVertexBuffer(GraphicsDevice graphics, VertexDeclaration vertexDeclaration, int vertexCount, BufferUsage usage)
- {
- AddInSystemFactory.Instance.PreventRenderSystemChange();
+ {
+ AddInSystemFactory.Instance.PreventSystemChange(AddInType.RenderSystem);
return new VertexBuffer_DX11(graphics, vertexDeclaration, vertexCount, usage);
}
public INativeEffect CreateEffect(GraphicsDevice graphics, ANX.Framework.Graphics.Effect managedEffect, Stream vertexShaderByteCode, Stream pixelShaderByteCode)
- {
- AddInSystemFactory.Instance.PreventRenderSystemChange();
+ {
+ AddInSystemFactory.Instance.PreventSystemChange(AddInType.RenderSystem);
Effect_DX11 effect = new Effect_DX11(graphics, managedEffect, vertexShaderByteCode, pixelShaderByteCode);
@@ -117,8 +120,8 @@ namespace ANX.RenderSystem.Windows.DX11
}
public INativeEffect CreateEffect(GraphicsDevice graphics, ANX.Framework.Graphics.Effect managedEffect, System.IO.Stream byteCode)
- {
- AddInSystemFactory.Instance.PreventRenderSystemChange();
+ {
+ AddInSystemFactory.Instance.PreventSystemChange(AddInType.RenderSystem);
Effect_DX11 effect = new Effect_DX11(graphics, managedEffect, byteCode);
@@ -126,8 +129,8 @@ namespace ANX.RenderSystem.Windows.DX11
}
public Texture2D CreateTexture(GraphicsDevice graphics, string fileName)
- {
- AddInSystemFactory.Instance.PreventRenderSystemChange();
+ {
+ AddInSystemFactory.Instance.PreventSystemChange(AddInType.RenderSystem);
//TODO: implement
throw new NotImplementedException();
@@ -141,32 +144,32 @@ namespace ANX.RenderSystem.Windows.DX11
}
public INativeBlendState CreateBlendState()
- {
- AddInSystemFactory.Instance.PreventRenderSystemChange();
+ {
+ AddInSystemFactory.Instance.PreventSystemChange(AddInType.RenderSystem);
return new BlendState_DX11();
}
public INativeRasterizerState CreateRasterizerState()
- {
- AddInSystemFactory.Instance.PreventRenderSystemChange();
+ {
+ AddInSystemFactory.Instance.PreventSystemChange(AddInType.RenderSystem);
return new RasterizerState_DX11();
}
public INativeDepthStencilState CreateDepthStencilState()
- {
- AddInSystemFactory.Instance.PreventRenderSystemChange();
+ {
+ AddInSystemFactory.Instance.PreventSystemChange(AddInType.RenderSystem);
return new DepthStencilState_DX11();
}
public INativeSamplerState CreateSamplerState()
- {
- AddInSystemFactory.Instance.PreventRenderSystemChange();
+ {
+ AddInSystemFactory.Instance.PreventSystemChange(AddInType.RenderSystem);
return new SamplerState_DX11();
}
public byte[] GetShaderByteCode(PreDefinedShader type)
- {
- AddInSystemFactory.Instance.PreventRenderSystemChange();
+ {
+ AddInSystemFactory.Instance.PreventSystemChange(AddInType.RenderSystem);
if (type == PreDefinedShader.SpriteBatch)
{
@@ -203,8 +206,8 @@ namespace ANX.RenderSystem.Windows.DX11
public System.Collections.ObjectModel.ReadOnlyCollection GetAdapterList()
- {
- AddInSystemFactory.Instance.PreventRenderSystemChange();
+ {
+ AddInSystemFactory.Instance.PreventSystemChange(AddInType.RenderSystem);
SharpDX.DXGI.Factory factory = new Factory();
@@ -257,15 +260,15 @@ namespace ANX.RenderSystem.Windows.DX11
}
public INativeTexture2D CreateTexture(GraphicsDevice graphics, SurfaceFormat surfaceFormat, int width, int height, int mipCount)
- {
- AddInSystemFactory.Instance.PreventRenderSystemChange();
+ {
+ AddInSystemFactory.Instance.PreventSystemChange(AddInType.RenderSystem);
return new Texture2D_DX11(graphics, width, height, surfaceFormat, mipCount);
}
public INativeRenderTarget2D CreateRenderTarget(GraphicsDevice graphics, int width, int height, bool mipMap, SurfaceFormat preferredFormat, DepthFormat preferredDepthFormat, int preferredMultiSampleCount, RenderTargetUsage usage)
- {
- AddInSystemFactory.Instance.PreventRenderSystemChange();
+ {
+ AddInSystemFactory.Instance.PreventSystemChange(AddInType.RenderSystem);
return new RenderTarget2D_DX11(graphics, width, height, mipMap, preferredFormat, preferredDepthFormat, preferredMultiSampleCount, usage);
}
diff --git a/Samples/KeyboardSample/KeyboardSample.csproj b/Samples/KeyboardSample/KeyboardSample.csproj
index c4dd0d70..216978fb 100644
--- a/Samples/KeyboardSample/KeyboardSample.csproj
+++ b/Samples/KeyboardSample/KeyboardSample.csproj
@@ -91,6 +91,10 @@
{49066074-3B7B-4A55-B122-6BD33AB73558}
ANX.InputSystem.Standard
+
+ {97185A92-077D-4498-8B6A-8BFF04079044}
+ ANX.MediaSystem.Windows.OpenAL
+
{5BE49183-2F6F-4527-AC90-D816911FCF90}
ANX.Framework.Windows.DX10
diff --git a/Samples/Kinect/Kinect.csproj b/Samples/Kinect/Kinect.csproj
index 7f0bba13..b558457e 100644
--- a/Samples/Kinect/Kinect.csproj
+++ b/Samples/Kinect/Kinect.csproj
@@ -122,6 +122,10 @@
{49066074-3B7B-4A55-B122-6BD33AB73558}
ANX.InputSystem.Standard
+
+ {97185A92-077D-4498-8B6A-8BFF04079044}
+ ANX.MediaSystem.Windows.OpenAL
+
{5BE49183-2F6F-4527-AC90-D816911FCF90}
ANX.Framework.Windows.DX10
diff --git a/Samples/MultiRenderTarget/MultiRenderTarget.csproj b/Samples/MultiRenderTarget/MultiRenderTarget.csproj
index f549ee2c..d322b4e9 100644
--- a/Samples/MultiRenderTarget/MultiRenderTarget.csproj
+++ b/Samples/MultiRenderTarget/MultiRenderTarget.csproj
@@ -106,6 +106,10 @@
+
+ {97185A92-077D-4498-8B6A-8BFF04079044}
+ ANX.MediaSystem.Windows.OpenAL
+
{FA6E229D-4504-47B1-8A23-2D3FCC13F778}
SampleContent
diff --git a/Samples/Primitives/Primitives.csproj b/Samples/Primitives/Primitives.csproj
index d18efe77..403a8059 100644
--- a/Samples/Primitives/Primitives.csproj
+++ b/Samples/Primitives/Primitives.csproj
@@ -91,6 +91,10 @@
{49066074-3B7B-4A55-B122-6BD33AB73558}
ANX.InputSystem.Standard
+
+ {97185A92-077D-4498-8B6A-8BFF04079044}
+ ANX.MediaSystem.Windows.OpenAL
+
{5BE49183-2F6F-4527-AC90-D816911FCF90}
ANX.Framework.Windows.DX10
diff --git a/Samples/RenderTarget/Program.cs b/Samples/RenderTarget/Program.cs
index dccb8ef1..9fb2021b 100644
--- a/Samples/RenderTarget/Program.cs
+++ b/Samples/RenderTarget/Program.cs
@@ -10,9 +10,11 @@ namespace RenderTarget
/// Der Haupteinstiegspunkt für die Anwendung.
///
static void Main(string[] args)
- {
- //AddInSystemFactory.Instance.PreferredRenderSystem = "OpenGL3";
- //AddInSystemFactory.Instance.PreferredRenderSystem = "DirectX11";
+ {
+ //AddInSystemFactory.Instance.SetPreferredSystem(
+ // AddInType.RenderSystem, "OpenGL3");
+ //AddInSystemFactory.Instance.SetPreferredSystem(
+ // AddInType.RenderSystem, "DirectX11");
using (Game1 game = new Game1())
{
diff --git a/Samples/RenderTarget/RenderTarget.csproj b/Samples/RenderTarget/RenderTarget.csproj
index 294d40c9..49ecfb48 100644
--- a/Samples/RenderTarget/RenderTarget.csproj
+++ b/Samples/RenderTarget/RenderTarget.csproj
@@ -91,6 +91,10 @@
{49066074-3B7B-4A55-B122-6BD33AB73558}
ANX.InputSystem.Standard
+
+ {97185A92-077D-4498-8B6A-8BFF04079044}
+ ANX.MediaSystem.Windows.OpenAL
+
{5BE49183-2F6F-4527-AC90-D816911FCF90}
ANX.Framework.Windows.DX10
diff --git a/Samples/SimpleSprite/Program.cs b/Samples/SimpleSprite/Program.cs
index 2c18149f..cc3e5ae8 100644
--- a/Samples/SimpleSprite/Program.cs
+++ b/Samples/SimpleSprite/Program.cs
@@ -10,9 +10,10 @@ namespace WindowsGame1
/// The main entry point for the application.
///
static void Main(string[] args)
- {
- //AddInSystemFactory.Instance.PreferredRenderSystem = "OpenGL3";
- //AddInSystemFactory.Instance.PreferredRenderSystem = "DirectX11";
+ {
+ AddInSystemFactory.Instance.SetPreferredSystem(
+ AddInType.RenderSystem, "OpenGL3");
+ //AddInType.RenderSystem, "DirectX11");
using (Game1 game = new Game1())
{
diff --git a/Samples/SimpleSprite/SimpleSprite.csproj b/Samples/SimpleSprite/SimpleSprite.csproj
index 3b0b65c4..ae5e59cd 100644
--- a/Samples/SimpleSprite/SimpleSprite.csproj
+++ b/Samples/SimpleSprite/SimpleSprite.csproj
@@ -91,6 +91,10 @@
{49066074-3B7B-4A55-B122-6BD33AB73558}
ANX.InputSystem.Standard
+
+ {97185A92-077D-4498-8B6A-8BFF04079044}
+ ANX.MediaSystem.Windows.OpenAL
+
{5BE49183-2F6F-4527-AC90-D816911FCF90}
ANX.Framework.Windows.DX10
diff --git a/Samples/StencilBuffer/StencilBuffer.csproj b/Samples/StencilBuffer/StencilBuffer.csproj
index 667735c5..f0629d71 100644
--- a/Samples/StencilBuffer/StencilBuffer.csproj
+++ b/Samples/StencilBuffer/StencilBuffer.csproj
@@ -128,6 +128,10 @@
{49066074-3B7B-4A55-B122-6BD33AB73558}
ANX.InputSystem.Standard
+
+ {97185A92-077D-4498-8B6A-8BFF04079044}
+ ANX.MediaSystem.Windows.OpenAL
+
{5BE49183-2F6F-4527-AC90-D816911FCF90}
ANX.Framework.Windows.DX10
diff --git a/Samples/TextRendering/Program.cs b/Samples/TextRendering/Program.cs
index bb3ce45d..701cf476 100644
--- a/Samples/TextRendering/Program.cs
+++ b/Samples/TextRendering/Program.cs
@@ -10,8 +10,11 @@ namespace TextRendering
/// Der Haupteinstiegspunkt für die Anwendung.
///
static void Main(string[] args)
- {
- AddInSystemFactory.Instance.PreferredRenderSystem = "OpenGL3";
+ {
+ //AddInSystemFactory.Instance.SetPreferredSystem(
+ // AddInType.RenderSystem, "OpenGL3");
+ //AddInSystemFactory.Instance.SetPreferredSystem(
+ // AddInType.RenderSystem, "DirectX11");
using (Game1 game = new Game1())
{
diff --git a/Samples/TextRendering/TextRendering.csproj b/Samples/TextRendering/TextRendering.csproj
index 7af88168..fdb91bb3 100644
--- a/Samples/TextRendering/TextRendering.csproj
+++ b/Samples/TextRendering/TextRendering.csproj
@@ -91,6 +91,10 @@
{49066074-3B7B-4A55-B122-6BD33AB73558}
ANX.InputSystem.Standard
+
+ {97185A92-077D-4498-8B6A-8BFF04079044}
+ ANX.MediaSystem.Windows.OpenAL
+
{5BE49183-2F6F-4527-AC90-D816911FCF90}
ANX.Framework.Windows.DX10
diff --git a/Samples/VertexIndexBuffer/VertexIndexBuffer.csproj b/Samples/VertexIndexBuffer/VertexIndexBuffer.csproj
index 59078490..f72ca2df 100644
--- a/Samples/VertexIndexBuffer/VertexIndexBuffer.csproj
+++ b/Samples/VertexIndexBuffer/VertexIndexBuffer.csproj
@@ -91,6 +91,10 @@
{49066074-3B7B-4A55-B122-6BD33AB73558}
ANX.InputSystem.Standard
+
+ {97185A92-077D-4498-8B6A-8BFF04079044}
+ ANX.MediaSystem.Windows.OpenAL
+
{5BE49183-2F6F-4527-AC90-D816911FCF90}
ANX.Framework.Windows.DX10
diff --git a/Samples/WindowsGame/Program.cs b/Samples/WindowsGame/Program.cs
index a7458281..487ac91b 100644
--- a/Samples/WindowsGame/Program.cs
+++ b/Samples/WindowsGame/Program.cs
@@ -18,10 +18,15 @@ namespace WindowsGame1
AddInSelector selector = new AddInSelector();
if (selector.ShowDialog() == System.Windows.Forms.DialogResult.OK)
- {
- AddInSystemFactory.Instance.PreferredRenderSystem = selector.cbRenderSystem.Text;
- AddInSystemFactory.Instance.PreferredSoundSystem = selector.cbAudioSystem.Text;
- AddInSystemFactory.Instance.PreferredInputSystem = selector.cbInputSystem.Text;
+ {
+ AddInSystemFactory.Instance.SetPreferredSystem(
+ AddInType.RenderSystem, selector.cbRenderSystem.Text);
+
+ AddInSystemFactory.Instance.SetPreferredSystem(
+ AddInType.SoundSystem, selector.cbAudioSystem.Text);
+
+ AddInSystemFactory.Instance.SetPreferredSystem(
+ AddInType.InputSystem, selector.cbInputSystem.Text);
using (Game1 game = new Game1())
{
diff --git a/Samples/WindowsGame/WindowsGame.csproj b/Samples/WindowsGame/WindowsGame.csproj
index 17e3d376..d87d73f0 100644
--- a/Samples/WindowsGame/WindowsGame.csproj
+++ b/Samples/WindowsGame/WindowsGame.csproj
@@ -119,6 +119,10 @@
{49066074-3B7B-4A55-B122-6BD33AB73558}
ANX.InputSystem.Standard
+
+ {97185A92-077D-4498-8B6A-8BFF04079044}
+ ANX.MediaSystem.Windows.OpenAL
+
{5BE49183-2F6F-4527-AC90-D816911FCF90}
ANX.Framework.Windows.DX10
diff --git a/SoundSystems/ANX.SoundSystem.OpenAL/Creator.cs b/SoundSystems/ANX.SoundSystem.OpenAL/Creator.cs
index c387d13b..9563e7fa 100644
--- a/SoundSystems/ANX.SoundSystem.OpenAL/Creator.cs
+++ b/SoundSystems/ANX.SoundSystem.OpenAL/Creator.cs
@@ -157,7 +157,7 @@ namespace ANX.SoundSystem.OpenAL
public ISoundEffectInstance CreateSoundEffectInstance(
ISoundEffect nativeSoundEffect)
{
- AddInSystemFactory.Instance.PreventSoundSystemChange();
+ AddInSystemFactory.Instance.PreventSystemChange(AddInType.SoundSystem);
return new OpenALSoundEffectInstance((OpenALSoundEffect)nativeSoundEffect);
}
#endregion
@@ -165,7 +165,7 @@ namespace ANX.SoundSystem.OpenAL
#region CreateSoundEffect
public ISoundEffect CreateSoundEffect(SoundEffect parent, Stream stream)
{
- AddInSystemFactory.Instance.PreventSoundSystemChange();
+ AddInSystemFactory.Instance.PreventSystemChange(AddInType.SoundSystem);
return new OpenALSoundEffect(parent, stream);
}
#endregion
@@ -175,7 +175,7 @@ namespace ANX.SoundSystem.OpenAL
int offset, int count, int sampleRate, AudioChannels channels,
int loopStart, int loopLength)
{
- AddInSystemFactory.Instance.PreventSoundSystemChange();
+ AddInSystemFactory.Instance.PreventSystemChange(AddInType.SoundSystem);
throw new NotImplementedException();
}
#endregion
@@ -183,7 +183,7 @@ namespace ANX.SoundSystem.OpenAL
#region CreateAudioListener (TODO)
public IAudioListener CreateAudioListener()
{
- AddInSystemFactory.Instance.PreventSoundSystemChange();
+ AddInSystemFactory.Instance.PreventSystemChange(AddInType.SoundSystem);
throw new NotImplementedException();
}
#endregion
@@ -191,7 +191,7 @@ namespace ANX.SoundSystem.OpenAL
#region CreateAudioEmitter (TODO)
public IAudioEmitter CreateAudioEmitter()
{
- AddInSystemFactory.Instance.PreventSoundSystemChange();
+ AddInSystemFactory.Instance.PreventSystemChange(AddInType.SoundSystem);
throw new NotImplementedException();
}
#endregion