renamed CurrentCreator to DefaultCreator project wide

extended InputSystem selector in WindowsGame sample
fixed some interface issues in XInput InputSystem
added FormatConvert to InputSystem XInput to translate GamePadButtons from XInput to ANX
This commit is contained in:
Glatzemann 2011-11-11 15:21:41 +00:00
parent 9695acd2e3
commit 972f7121e8
23 changed files with 143 additions and 58 deletions

View File

@ -103,29 +103,29 @@ namespace ANX.Framework
AddInSystemFactory.Instance.Initialize();
AddInSystemFactory.Instance.SetCurrentCreator(inputSystemName);
IInputSystemCreator inputSystemCreator = AddInSystemFactory.Instance.GetCurrentCreator<IInputSystemCreator>();
AddInSystemFactory.Instance.SetDefaultCreator(inputSystemName);
IInputSystemCreator inputSystemCreator = AddInSystemFactory.Instance.GetDefaultCreator<IInputSystemCreator>();
if (inputSystemCreator != null)
{
this.gameServices.AddService(typeof(IInputSystemCreator), inputSystemCreator);
}
AddInSystemFactory.Instance.SetCurrentCreator(soundSystemName);
ISoundSystemCreator soundSystemCreator = AddInSystemFactory.Instance.GetCurrentCreator<ISoundSystemCreator>();
AddInSystemFactory.Instance.SetDefaultCreator(soundSystemName);
ISoundSystemCreator soundSystemCreator = AddInSystemFactory.Instance.GetDefaultCreator<ISoundSystemCreator>();
if (soundSystemCreator != null)
{
this.gameServices.AddService(typeof(ISoundSystemCreator), soundSystemCreator);
}
AddInSystemFactory.Instance.SetCurrentCreator(renderSystemName);
IRenderSystemCreator renderSystemCreator = AddInSystemFactory.Instance.GetCurrentCreator<IRenderSystemCreator>();
AddInSystemFactory.Instance.SetDefaultCreator(renderSystemName);
IRenderSystemCreator renderSystemCreator = AddInSystemFactory.Instance.GetDefaultCreator<IRenderSystemCreator>();
if (renderSystemCreator != null)
{
this.gameServices.AddService(typeof(IRenderSystemCreator), renderSystemCreator);
}
//TODO: error handling if creator is null
this.host = AddInSystemFactory.Instance.GetCurrentCreator<IRenderSystemCreator>().CreateGameHost(this);
this.host = AddInSystemFactory.Instance.GetDefaultCreator<IRenderSystemCreator>().CreateGameHost(this);
this.host.Activated += new EventHandler<EventArgs>(this.HostActivated);
this.host.Deactivated += new EventHandler<EventArgs>(this.HostDeactivated);

View File

@ -78,7 +78,7 @@ namespace ANX.Framework.Graphics
public BlendState()
{
this.nativeBlendState = AddInSystemFactory.Instance.GetCurrentCreator<IRenderSystemCreator>().CreateBlendState();
this.nativeBlendState = AddInSystemFactory.Instance.GetDefaultCreator<IRenderSystemCreator>().CreateBlendState();
this.AlphaBlendFunction = BlendFunction.Add;
this.AlphaDestinationBlend = Blend.One;
@ -101,7 +101,7 @@ namespace ANX.Framework.Graphics
private BlendState(Blend sourceBlend, Blend destinationBlend, string name)
{
this.nativeBlendState = AddInSystemFactory.Instance.GetCurrentCreator<IRenderSystemCreator>().CreateBlendState();
this.nativeBlendState = AddInSystemFactory.Instance.GetDefaultCreator<IRenderSystemCreator>().CreateBlendState();
this.AlphaBlendFunction = BlendFunction.Add;
this.AlphaDestinationBlend = destinationBlend;

View File

@ -83,7 +83,7 @@ namespace ANX.Framework.Graphics
public DepthStencilState()
{
nativeDepthStencilState = AddInSystemFactory.Instance.GetCurrentCreator<IRenderSystemCreator>().CreateDepthStencilState();
nativeDepthStencilState = AddInSystemFactory.Instance.GetDefaultCreator<IRenderSystemCreator>().CreateDepthStencilState();
CounterClockwiseStencilDepthBufferFail = StencilOperation.Keep;
CounterClockwiseStencilFail = StencilOperation.Keep;
@ -104,7 +104,7 @@ namespace ANX.Framework.Graphics
private DepthStencilState(bool depthBufferEnabled, bool depthBufferWriteEnabled, string name)
{
nativeDepthStencilState = AddInSystemFactory.Instance.GetCurrentCreator<IRenderSystemCreator>().CreateDepthStencilState();
nativeDepthStencilState = AddInSystemFactory.Instance.GetDefaultCreator<IRenderSystemCreator>().CreateDepthStencilState();
CounterClockwiseStencilDepthBufferFail = StencilOperation.Keep;
CounterClockwiseStencilFail = StencilOperation.Keep;

View File

@ -76,7 +76,7 @@ namespace ANX.Framework.Graphics
public Effect(GraphicsDevice graphicsDevice, byte[] byteCode)
: base(graphicsDevice)
{
this.nativeEffect = AddInSystemFactory.Instance.GetCurrentCreator<IRenderSystemCreator>().CreateEffect(graphicsDevice, new MemoryStream(byteCode, false));
this.nativeEffect = AddInSystemFactory.Instance.GetDefaultCreator<IRenderSystemCreator>().CreateEffect(graphicsDevice, new MemoryStream(byteCode, false));
this.techniqueCollection = new EffectTechniqueCollection(this, this.nativeEffect);
this.currentTechnique = this.techniqueCollection[0];

View File

@ -66,7 +66,7 @@ namespace ANX.Framework.Graphics
{
adapters = new List<GraphicsAdapter>();
IRenderSystemCreator renderSystemCreator = AddInSystemFactory.Instance.GetCurrentCreator<IRenderSystemCreator>();
IRenderSystemCreator renderSystemCreator = AddInSystemFactory.Instance.GetDefaultCreator<IRenderSystemCreator>();
adapters.AddRange(renderSystemCreator.GetAdapterList());
}

View File

@ -98,7 +98,7 @@ namespace ANX.Framework.Graphics
this.viewport = new Viewport(0, 0, presentationParameters.BackBufferWidth, presentationParameters.BackBufferHeight);
nativeDevice = AddInSystemFactory.Instance.GetCurrentCreator<IRenderSystemCreator>().CreateGraphicsDevice(presentationParameters);
nativeDevice = AddInSystemFactory.Instance.GetDefaultCreator<IRenderSystemCreator>().CreateGraphicsDevice(presentationParameters);
this.samplerStateCollection = new SamplerStateCollection(this, 8); //TODO: get maximum number of sampler states from capabilities
this.textureCollection = new TextureCollection();

View File

@ -70,7 +70,7 @@ namespace ANX.Framework.Graphics
this.indexCount = indexCount;
this.bufferUsage = usage;
this.nativeIndexBuffer = AddInSystemFactory.Instance.GetCurrentCreator<IRenderSystemCreator>().CreateIndexBuffer(graphicsDevice, indexElementSize, indexCount, usage);
this.nativeIndexBuffer = AddInSystemFactory.Instance.GetDefaultCreator<IRenderSystemCreator>().CreateIndexBuffer(graphicsDevice, indexElementSize, indexCount, usage);
}
public IndexBuffer(GraphicsDevice graphicsDevice, Type indexType, int indexCount, BufferUsage usage)
@ -92,7 +92,7 @@ namespace ANX.Framework.Graphics
this.indexCount = indexCount;
this.bufferUsage = usage;
this.nativeIndexBuffer = AddInSystemFactory.Instance.GetCurrentCreator<IRenderSystemCreator>().CreateIndexBuffer(graphicsDevice, indexElementSize, indexCount, usage);
this.nativeIndexBuffer = AddInSystemFactory.Instance.GetDefaultCreator<IRenderSystemCreator>().CreateIndexBuffer(graphicsDevice, indexElementSize, indexCount, usage);
}
public void GetData<T>(int offsetInBytes, T[] data, int startIndex, int elementCount) where T : struct

View File

@ -73,7 +73,7 @@ namespace ANX.Framework.Graphics
public RasterizerState()
{
this.nativeRasterizerState = AddInSystemFactory.Instance.GetCurrentCreator<IRenderSystemCreator>().CreateRasterizerState();
this.nativeRasterizerState = AddInSystemFactory.Instance.GetDefaultCreator<IRenderSystemCreator>().CreateRasterizerState();
this.CullMode = CullMode.CullCounterClockwiseFace;
this.DepthBias = 0f;
@ -85,7 +85,7 @@ namespace ANX.Framework.Graphics
private RasterizerState(CullMode cullMode, string name)
{
this.nativeRasterizerState = AddInSystemFactory.Instance.GetCurrentCreator<IRenderSystemCreator>().CreateRasterizerState();
this.nativeRasterizerState = AddInSystemFactory.Instance.GetDefaultCreator<IRenderSystemCreator>().CreateRasterizerState();
this.CullMode = cullMode;
this.DepthBias = 0f;

View File

@ -77,7 +77,7 @@ namespace ANX.Framework.Graphics
public SamplerState()
{
this.nativeSamplerState = AddInSystemFactory.Instance.GetCurrentCreator<IRenderSystemCreator>().CreateSamplerState();
this.nativeSamplerState = AddInSystemFactory.Instance.GetDefaultCreator<IRenderSystemCreator>().CreateSamplerState();
this.AddressU = TextureAddressMode.Wrap;
this.AddressV = TextureAddressMode.Wrap;
@ -90,7 +90,7 @@ namespace ANX.Framework.Graphics
private SamplerState(TextureFilter filter, TextureAddressMode addressMode, string name)
{
this.nativeSamplerState = AddInSystemFactory.Instance.GetCurrentCreator<IRenderSystemCreator>().CreateSamplerState();
this.nativeSamplerState = AddInSystemFactory.Instance.GetDefaultCreator<IRenderSystemCreator>().CreateSamplerState();
this.AddressU = addressMode;
this.AddressV = addressMode;

View File

@ -99,7 +99,7 @@ namespace ANX.Framework.Graphics
base.GraphicsDevice = graphicsDevice;
this.spriteBatchEffect = new Effect(graphicsDevice, AddInSystemFactory.Instance.GetCurrentCreator<IRenderSystemCreator>().GetShaderByteCode(NonXNA.PreDefinedShader.SpriteBatch));
this.spriteBatchEffect = new Effect(graphicsDevice, AddInSystemFactory.Instance.GetDefaultCreator<IRenderSystemCreator>().GetShaderByteCode(NonXNA.PreDefinedShader.SpriteBatch));
this.spriteInfos = new SpriteInfo[InitialBatchSize];

View File

@ -173,7 +173,7 @@ namespace ANX.Framework.Graphics
private void CreateNativeTextureSurface()
{
base.nativeTexture = AddInSystemFactory.Instance.GetCurrentCreator<IRenderSystemCreator>().CreateTexture(GraphicsDevice, format, Width, Height, levelCount);
base.nativeTexture = AddInSystemFactory.Instance.GetDefaultCreator<IRenderSystemCreator>().CreateTexture(GraphicsDevice, format, Width, Height, levelCount);
}
}
}

View File

@ -75,7 +75,7 @@ namespace ANX.Framework.Graphics
this.vertexDeclaration = vertexDeclaration;
this.bufferUsage = usage;
this.nativeVertexBuffer = AddInSystemFactory.Instance.GetCurrentCreator<IRenderSystemCreator>().CreateVertexBuffer(graphicsDevice, vertexDeclaration, vertexCount, usage);
this.nativeVertexBuffer = AddInSystemFactory.Instance.GetDefaultCreator<IRenderSystemCreator>().CreateVertexBuffer(graphicsDevice, vertexDeclaration, vertexCount, usage);
}
public BufferUsage BufferUsage

View File

@ -60,7 +60,7 @@ namespace ANX.Framework.Input
static GamePad()
{
gamePad = AddInSystemFactory.Instance.GetCurrentCreator<IInputSystemCreator>().GamePad;
gamePad = AddInSystemFactory.Instance.GetDefaultCreator<IInputSystemCreator>().GamePad;
}
public static GamePadCapabilities GetCapabilities(PlayerIndex playerIndex)

View File

@ -62,7 +62,7 @@ namespace ANX.Framework.Input.MotionSensing
static MotionSensingDevice()
{
motionSensingDevice = AddInSystemFactory.Instance.GetCurrentCreator<IInputSystemCreator>().MotionSensingDevice;
motionSensingDevice = AddInSystemFactory.Instance.GetDefaultCreator<IInputSystemCreator>().MotionSensingDevice;
}
public static GraphicsDevice GraphicsDevice

View File

@ -59,7 +59,7 @@ namespace ANX.Framework.Input
static Mouse()
{
mouse = AddInSystemFactory.Instance.GetCurrentCreator<IInputSystemCreator>().Mouse;
mouse = AddInSystemFactory.Instance.GetDefaultCreator<IInputSystemCreator>().Mouse;
}
public static IntPtr WindowHandle

View File

@ -62,7 +62,7 @@ namespace ANX.Framework.NonXNA
private Dictionary<String, ICreator> creators;
private static AddInSystemFactory instance;
private bool initialized;
private Dictionary<Type, ICreator> currentCreators = new Dictionary<Type, ICreator>();
private Dictionary<Type, ICreator> defaultCreators = new Dictionary<Type, ICreator>();
public static AddInSystemFactory Instance
{
@ -158,28 +158,28 @@ namespace ANX.Framework.NonXNA
}
}
public T GetCurrentCreator<T>() where T : class, ICreator
public T GetDefaultCreator<T>() where T : class, ICreator
{
Type type = typeof(T);
if (currentCreators.ContainsKey(type))
if (defaultCreators.ContainsKey(type))
{
return currentCreators[type] as T;
return defaultCreators[type] as T;
}
return default(T);
}
public void SetCurrentCreator<T>(T creator) where T : class, ICreator
public void SetDefaultCreator<T>(T creator) where T : class, ICreator
{
currentCreators[typeof(T)] = creator;
defaultCreators[typeof(T)] = creator;
}
public void SetCurrentCreator(string creatorName)
public void SetDefaultCreator(string creatorName)
{
ICreator creator = null;
creators.TryGetValue(creatorName.ToLowerInvariant(), out creator);
currentCreators[creator.GetType().GetInterfaces()[0]] = creator;
defaultCreators[creator.GetType().GetInterfaces()[0]] = creator;
}
}

View File

@ -50,6 +50,7 @@
</ItemGroup>
<ItemGroup>
<Compile Include="Creator.cs" />
<Compile Include="FormatConverter.cs" />
<Compile Include="Mouse.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="GamePad.cs" />

View File

@ -0,0 +1,81 @@
#region Using Statements
using System;
using ANX.Framework.Input;
using SharpDX.XInput;
#endregion // Using Statements
#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.InputSystem.Windows.XInput
{
internal class FormatConverter
{
public static Buttons Translate(SharpDX.XInput.GamepadButtonFlags buttons)
{
Buttons tb = 0;
tb |= (buttons & GamepadButtonFlags.A) == GamepadButtonFlags.A ? Buttons.A : 0;
tb |= (buttons & GamepadButtonFlags.B) == GamepadButtonFlags.B ? Buttons.B : 0;
tb |= (buttons & GamepadButtonFlags.Back) == GamepadButtonFlags.Back ? Buttons.Back : 0;
tb |= (buttons & GamepadButtonFlags.DPadDown) == GamepadButtonFlags.DPadDown ? Buttons.DPadDown : 0;
tb |= (buttons & GamepadButtonFlags.DPadLeft) == GamepadButtonFlags.DPadLeft ? Buttons.DPadLeft : 0;
tb |= (buttons & GamepadButtonFlags.DPadRight) == GamepadButtonFlags.DPadRight ? Buttons.DPadRight : 0;
tb |= (buttons & GamepadButtonFlags.DPadUp) == GamepadButtonFlags.DPadUp ? Buttons.DPadUp : 0;
tb |= (buttons & GamepadButtonFlags.LeftShoulder) == GamepadButtonFlags.LeftShoulder ? Buttons.LeftShoulder : 0;
tb |= (buttons & GamepadButtonFlags.LeftThumb) == GamepadButtonFlags.LeftThumb ? Buttons.LeftTrigger : 0;
tb |= (buttons & GamepadButtonFlags.RightShoulder) == GamepadButtonFlags.RightShoulder ? Buttons.RightShoulder : 0;
tb |= (buttons & GamepadButtonFlags.RightThumb) == GamepadButtonFlags.RightThumb ? Buttons.RightTrigger : 0;
tb |= (buttons & GamepadButtonFlags.Start) == GamepadButtonFlags.Start ? Buttons.Start : 0;
tb |= (buttons & GamepadButtonFlags.X) == GamepadButtonFlags.X ? Buttons.X : 0;
tb |= (buttons & GamepadButtonFlags.Y) == GamepadButtonFlags.Y ? Buttons.Y : 0;
return tb;
}
}
}

View File

@ -99,7 +99,7 @@ namespace ANX.InputSystem.Windows.XInput
{
result = controller[(int)playerIndex].GetState();
//returnres = new GamePadCapabilities(result.Type,result.Gamepad.Buttons.)
returnres = new GamePadState((int)result.Gamepad.Buttons, true, result.PacketNumber, new Vector2(result.Gamepad.LeftThumbX, result.Gamepad.LeftThumbY), new Vector2(result.Gamepad.RightThumbX, result.Gamepad.RightThumbY), (float)result.Gamepad.LeftTrigger, (float)result.Gamepad.RightTrigger);
returnres = new GamePadState(new Vector2(result.Gamepad.LeftThumbX, result.Gamepad.LeftThumbY), new Vector2(result.Gamepad.RightThumbX, result.Gamepad.RightThumbY), (float)result.Gamepad.LeftTrigger, (float)result.Gamepad.RightTrigger, FormatConverter.Translate(result.Gamepad.Buttons));
}
else
{

View File

@ -32,17 +32,17 @@
this.button2 = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label();
this.cbRenderSystem = new System.Windows.Forms.ComboBox();
this.cbInputSystem = new System.Windows.Forms.ComboBox();
this.label2 = new System.Windows.Forms.Label();
this.cbAudioSystem = new System.Windows.Forms.ComboBox();
this.label3 = new System.Windows.Forms.Label();
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.cbInputSystems = new System.Windows.Forms.CheckedListBox();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
this.SuspendLayout();
//
// button1
//
this.button1.Location = new System.Drawing.Point(12, 283);
this.button1.Location = new System.Drawing.Point(12, 342);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(182, 23);
this.button1.TabIndex = 0;
@ -53,7 +53,7 @@
// button2
//
this.button2.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.button2.Location = new System.Drawing.Point(313, 283);
this.button2.Location = new System.Drawing.Point(313, 342);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(182, 23);
this.button2.TabIndex = 1;
@ -78,29 +78,20 @@
this.cbRenderSystem.Size = new System.Drawing.Size(277, 21);
this.cbRenderSystem.TabIndex = 3;
//
// cbInputSystem
//
this.cbInputSystem.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cbInputSystem.FormattingEnabled = true;
this.cbInputSystem.Location = new System.Drawing.Point(184, 211);
this.cbInputSystem.Name = "cbInputSystem";
this.cbInputSystem.Size = new System.Drawing.Size(277, 21);
this.cbInputSystem.TabIndex = 5;
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(52, 214);
this.label2.Location = new System.Drawing.Point(52, 236);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(68, 13);
this.label2.Size = new System.Drawing.Size(73, 13);
this.label2.TabIndex = 4;
this.label2.Text = "Input-System";
this.label2.Text = "Input-Systems";
//
// cbAudioSystem
//
this.cbAudioSystem.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cbAudioSystem.FormattingEnabled = true;
this.cbAudioSystem.Location = new System.Drawing.Point(184, 238);
this.cbAudioSystem.Location = new System.Drawing.Point(184, 209);
this.cbAudioSystem.Name = "cbAudioSystem";
this.cbAudioSystem.Size = new System.Drawing.Size(277, 21);
this.cbAudioSystem.TabIndex = 7;
@ -108,7 +99,7 @@
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(52, 241);
this.label3.Location = new System.Drawing.Point(52, 212);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(71, 13);
this.label3.TabIndex = 6;
@ -124,17 +115,25 @@
this.pictureBox1.TabIndex = 8;
this.pictureBox1.TabStop = false;
//
// cbInputSystems
//
this.cbInputSystems.FormattingEnabled = true;
this.cbInputSystems.Location = new System.Drawing.Point(184, 236);
this.cbInputSystems.Name = "cbInputSystems";
this.cbInputSystems.Size = new System.Drawing.Size(277, 94);
this.cbInputSystems.TabIndex = 9;
//
// AddInSelector
//
this.AcceptButton = this.button1;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.button2;
this.ClientSize = new System.Drawing.Size(507, 318);
this.ClientSize = new System.Drawing.Size(507, 371);
this.Controls.Add(this.cbInputSystems);
this.Controls.Add(this.pictureBox1);
this.Controls.Add(this.cbAudioSystem);
this.Controls.Add(this.label3);
this.Controls.Add(this.cbInputSystem);
this.Controls.Add(this.label2);
this.Controls.Add(this.cbRenderSystem);
this.Controls.Add(this.label1);
@ -158,10 +157,10 @@
private System.Windows.Forms.Button button2;
private System.Windows.Forms.Label label1;
public System.Windows.Forms.ComboBox cbRenderSystem;
public System.Windows.Forms.ComboBox cbInputSystem;
private System.Windows.Forms.Label label2;
public System.Windows.Forms.ComboBox cbAudioSystem;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.PictureBox pictureBox1;
internal System.Windows.Forms.CheckedListBox cbInputSystems;
}
}

View File

@ -30,9 +30,9 @@ namespace WindowsGame1
foreach (IInputSystemCreator inputSystemCreator in AddInSystemFactory.Instance.GetCreators<IInputSystemCreator>())
{
cbInputSystem.Items.Add(inputSystemCreator.Name);
cbInputSystems.Items.Add(inputSystemCreator.Name);
}
cbInputSystem.SelectedIndex = 0;
cbInputSystems.SetItemChecked(0, true);
foreach (ISoundSystemCreator soundSystemCreator in AddInSystemFactory.Instance.GetCreators<ISoundSystemCreator>())
{

View File

@ -19,7 +19,7 @@ namespace WindowsGame1
AddInSelector selector = new AddInSelector();
if (selector.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
using (Game1 game = new Game1(selector.cbRenderSystem.Text, selector.cbInputSystem.Text, selector.cbAudioSystem.Text))
using (Game1 game = new Game1(selector.cbRenderSystem.Text, selector.cbInputSystems.CheckedItems[0].ToString(), selector.cbAudioSystem.Text))
{
game.Run();
}

View File

@ -107,6 +107,10 @@
<Project>{6899F0C9-70B9-4EB0-9DD3-E598D4BE3E35}</Project>
<Name>ANX.Framework</Name>
</ProjectReference>
<ProjectReference Include="..\..\ANX.InputSystem.Windows.Kinect\ANX.InputSystem.Windows.Kinect.csproj">
<Project>{E5D69E75-D77C-493F-BBDA-6F9E73B82549}</Project>
<Name>ANX.InputSystem.Windows.Kinect</Name>
</ProjectReference>
<ProjectReference Include="..\..\ANX.InputSystem.Windows.XInput\ANX.InputSystem.Windows.XInput.csproj">
<Project>{60D08399-244F-46A3-91F1-4CFD26D961A3}</Project>
<Name>ANX.InputSystem.Windows.XInput</Name>