- added samples to build file

- improved error handling and logging during AddIn loading
This commit is contained in:
Glatzemann 2012-08-29 18:29:57 +00:00
parent 67c9efa6cf
commit aa75450b34
17 changed files with 71 additions and 40 deletions

View File

@ -120,8 +120,7 @@ namespace ANX.Framework.Graphics
nativeDevice.Present(); nativeDevice.Present();
} }
public void Present(Nullable<Rectangle> sourceRectangle, public void Present(Nullable<Rectangle> sourceRectangle, Nullable<Rectangle> destinationRectangle, IntPtr overrideWindowHandle)
Nullable<Rectangle> destinationRectangle, IntPtr overrideWindowHandle)
{ {
//TODO: implement //TODO: implement
throw new NotImplementedException(); throw new NotImplementedException();

View File

@ -63,7 +63,14 @@ namespace ANX.Framework.NonXNA
{ {
get get
{ {
return Instance.Priority; if (Instance != null)
{
return Instance.Priority;
}
else
{
return int.MaxValue;
}
} }
} }
@ -113,16 +120,19 @@ namespace ANX.Framework.NonXNA
{ {
if (instance == null && IsSupported) if (instance == null && IsSupported)
{ {
try try
{ {
instance = Activator.CreateInstance(creatorType) as ICreator; instance = Activator.CreateInstance(creatorType) as ICreator;
} }
catch catch (Exception ex)
{ {
} Logger.Error("couldn't create instance of creator '" + creatorType.FullName + "'.", ex.InnerException);
}
if (instance != null) if (instance != null)
AddInSystemFactory.Instance.AddCreator(instance); {
AddInSystemFactory.Instance.AddCreator(instance);
}
} }
} }
#endregion #endregion

View File

@ -84,6 +84,11 @@ namespace ANX.Framework.NonXNA
#endregion #endregion
#region Error #region Error
public static void Error(string message, Exception ex)
{
Error(String.Format("{0} - Exception: {1}", message, ex.Message));
}
public static void Error(string message) public static void Error(string message)
{ {
string text = CurrentTimeStamp + "| Error: " + message + BuildStackTrace(); string text = CurrentTimeStamp + "| Error: " + message + BuildStackTrace();

View File

@ -61,6 +61,7 @@
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'DebugWin8|x86'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'DebugWin8|x86'">
<OutputPath>bin\x86\DebugWin8\</OutputPath> <OutputPath>bin\x86\DebugWin8\</OutputPath>
<PlatformTarget>x86</PlatformTarget>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'ReleaseWin8|x86'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'ReleaseWin8|x86'">
<OutputPath>bin\x86\ReleaseWin8\</OutputPath> <OutputPath>bin\x86\ReleaseWin8\</OutputPath>
@ -79,6 +80,9 @@
<CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories> <CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories>
<CodeAnalysisIgnoreBuiltInRules>true</CodeAnalysisIgnoreBuiltInRules> <CodeAnalysisIgnoreBuiltInRules>true</CodeAnalysisIgnoreBuiltInRules>
</PropertyGroup> </PropertyGroup>
<PropertyGroup>
<StartupObject>KeyboardSample.Program</StartupObject>
</PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="mscorlib" /> <Reference Include="mscorlib" />
<Reference Include="System" /> <Reference Include="System" />

View File

@ -2,7 +2,6 @@ using System;
namespace KeyboardSample namespace KeyboardSample
{ {
#if WINDOWS || XBOX
static class Program static class Program
{ {
/// <summary> /// <summary>
@ -16,6 +15,5 @@ namespace KeyboardSample
} }
} }
} }
#endif
} }

View File

@ -2,7 +2,6 @@ using System;
namespace ModelSample namespace ModelSample
{ {
#if WINDOWS || XBOX
static class Program static class Program
{ {
/// <summary> /// <summary>
@ -16,6 +15,5 @@ namespace ModelSample
} }
} }
} }
#endif
} }

View File

@ -2,7 +2,6 @@ using System;
namespace MultiRenderTarget namespace MultiRenderTarget
{ {
#if WINDOWS || XBOX
static class Program static class Program
{ {
/// <summary> /// <summary>
@ -16,6 +15,5 @@ namespace MultiRenderTarget
} }
} }
} }
#endif
} }

View File

@ -2,7 +2,6 @@ using System;
namespace Primitives namespace Primitives
{ {
#if WINDOWS || XBOX
static class Program static class Program
{ {
/// <summary> /// <summary>
@ -16,6 +15,5 @@ namespace Primitives
} }
} }
} }
#endif
} }

View File

@ -3,7 +3,6 @@ using ANX.Framework.NonXNA;
namespace RecordingSample namespace RecordingSample
{ {
#if WINDOWS || XBOX
static class Program static class Program
{ {
static void Main(string[] args) static void Main(string[] args)
@ -17,6 +16,5 @@ namespace RecordingSample
} }
} }
} }
#endif
} }

View File

@ -3,7 +3,6 @@ using ANX.Framework.NonXNA;
namespace RenderTarget namespace RenderTarget
{ {
#if WINDOWS || XBOX
static class Program static class Program
{ {
/// <summary> /// <summary>
@ -11,17 +10,11 @@ namespace RenderTarget
/// </summary> /// </summary>
static void Main(string[] args) static void Main(string[] args)
{ {
//AddInSystemFactory.Instance.SetPreferredSystem(
// AddInType.RenderSystem, "OpenGL3");
//AddInSystemFactory.Instance.SetPreferredSystem(
// AddInType.RenderSystem, "DirectX11");
using (Game1 game = new Game1()) using (Game1 game = new Game1())
{ {
game.Run(); game.Run();
} }
} }
} }
#endif
} }

View File

@ -107,6 +107,10 @@
<Project>{B30DE9C2-0926-46B6-8351-9AF276C472D5}</Project> <Project>{B30DE9C2-0926-46B6-8351-9AF276C472D5}</Project>
<Name>ANX.RenderSystem.Windows.DX11</Name> <Name>ANX.RenderSystem.Windows.DX11</Name>
</ProjectReference> </ProjectReference>
<ProjectReference Include="..\..\SoundSystems\ANX.SoundSystem.OpenAL\ANX.SoundSystem.OpenAL.csproj">
<Project>{14EF49AB-6D3F-458D-9D5C-D120B86EDD7A}</Project>
<Name>ANX.SoundSystem.OpenAL</Name>
</ProjectReference>
<ProjectReference Include="..\..\SoundSystems\ANX.SoundSystem.Windows.XAudio\ANX.SoundSystem.Windows.XAudio.csproj"> <ProjectReference Include="..\..\SoundSystems\ANX.SoundSystem.Windows.XAudio\ANX.SoundSystem.Windows.XAudio.csproj">
<Project>{6A582788-C4D2-410C-96CD-177F75712D65}</Project> <Project>{6A582788-C4D2-410C-96CD-177F75712D65}</Project>
<Name>ANX.SoundSystem.Windows.XAudio</Name> <Name>ANX.SoundSystem.Windows.XAudio</Name>

View File

@ -2,7 +2,6 @@ using System;
namespace StencilBuffer namespace StencilBuffer
{ {
#if WINDOWS || XBOX
static class Program static class Program
{ {
/// <summary> /// <summary>
@ -16,6 +15,5 @@ namespace StencilBuffer
} }
} }
} }
#endif
} }

View File

@ -3,7 +3,6 @@ using ANX.Framework.NonXNA;
namespace TextRendering namespace TextRendering
{ {
#if WINDOWS || XBOX
static class Program static class Program
{ {
/// <summary> /// <summary>
@ -22,6 +21,5 @@ namespace TextRendering
} }
} }
} }
#endif
} }

View File

@ -2,7 +2,6 @@ using System;
namespace VertexIndexBuffer namespace VertexIndexBuffer
{ {
#if WINDOWS || XBOX
static class Program static class Program
{ {
/// <summary> /// <summary>
@ -16,6 +15,5 @@ namespace VertexIndexBuffer
} }
} }
} }
#endif
} }

View File

@ -4,7 +4,6 @@ using System.Windows.Forms;
namespace WindowsGame1 namespace WindowsGame1
{ {
#if WINDOWS || XBOX
static class Program static class Program
{ {
/// <summary> /// <summary>
@ -35,6 +34,5 @@ namespace WindowsGame1
} }
} }
} }
#endif
} }

View File

@ -125,10 +125,6 @@
<Project>{5CA3CDF5-4D2C-42AC-AD08-641BD3992B75}</Project> <Project>{5CA3CDF5-4D2C-42AC-AD08-641BD3992B75}</Project>
<Name>ANX.InputDevices.OpenTK</Name> <Name>ANX.InputDevices.OpenTK</Name>
</ProjectReference> </ProjectReference>
<ProjectReference Include="..\..\InputSystems\ANX.InputDevices.Windows.Kinect\ANX.InputDevices.Windows.Kinect.csproj">
<Project>{E5D69E75-D77C-493F-BBDA-6F9E73B82549}</Project>
<Name>ANX.InputDevices.Windows.Kinect</Name>
</ProjectReference>
<ProjectReference Include="..\..\InputSystems\ANX.InputDevices.Windows.XInput\ANX.InputDevices.Windows.XInput.csproj"> <ProjectReference Include="..\..\InputSystems\ANX.InputDevices.Windows.XInput\ANX.InputDevices.Windows.XInput.csproj">
<Project>{60D08399-244F-46A3-91F1-4CFD26D961A3}</Project> <Project>{60D08399-244F-46A3-91F1-4CFD26D961A3}</Project>
<Name>ANX.InputDevices.Windows.XInput</Name> <Name>ANX.InputDevices.Windows.XInput</Name>

View File

@ -105,6 +105,8 @@
<call target="soundsystem" /> <call target="soundsystem" />
<call target="rendersystem" /> <call target="rendersystem" />
<call target="platformsystem" /> <call target="platformsystem" />
<call target="samples" />
</target> </target>
<target name="anx" description="Build ANX.Framework core"> <target name="anx" description="Build ANX.Framework core">
@ -306,6 +308,42 @@
</foreach> </foreach>
</target> </target>
<target name="samples" description="Build ANX.Framework samples">
<!-- default windows fileset -->
<fileset id="sample_files" basedir="../Samples/">
<include name="**/*.csproj" />
<exclude name="**/*Kinect*.csproj" />
<exclude name="**/*PSVita*.csproj" />
<exclude name="**/*Metro*.csproj" />
<exclude name="**/*Linux*.csproj" />
</fileset>
<foreach item="File" property="projectFile">
<in>
<items refid="sample_files" />
</in>
<do>
<echo message="building: ${path::get-file-name-without-extension(projectFile)}" />
<exec program="msbuild.exe" >
<arg value="/t:Build"/>
<arg value="/p:Configuration=${build.configuration}"/>
<arg value='/p:Platform="${build.platform}"'/>
<arg value="/p:OutputPath=${build.dir}/samples/${build.configuration}" />
<arg value="/p:AllowUnsafeBlocks=true" />
<arg value="/p:SolutionDir=${build.solution_dir}" />
<arg value='/p:DefineConstants="${project.anx.directives}"' />
<arg value="/clp:ErrorsOnly" />
<arg value="/nologo" />
<arg value="${projectFile}" />
</exec>
</do>
</foreach>
</target>
<target name="platformsystem" description="Build ANX.Framework PlatformSystems"> <target name="platformsystem" description="Build ANX.Framework PlatformSystems">
<!-- default windows fileset --> <!-- default windows fileset -->
<fileset id="platformsystem_files" basedir="../PlatformSystems/"> <fileset id="platformsystem_files" basedir="../PlatformSystems/">