Added model sample project
This commit is contained in:
parent
352903c836
commit
f96895d37c
BIN
Samples/ModelSample/ModelSample/Game.ico
Normal file
BIN
Samples/ModelSample/ModelSample/Game.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.2 KiB |
96
Samples/ModelSample/ModelSample/Game1.cs
Normal file
96
Samples/ModelSample/ModelSample/Game1.cs
Normal file
@ -0,0 +1,96 @@
|
||||
#region Using Statements
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using ANX.Framework;
|
||||
using ANX.Framework.Content;
|
||||
using ANX.Framework.GamerServices;
|
||||
using ANX.Framework.Graphics;
|
||||
using ANX.Framework.Input;
|
||||
using ANX.Framework.Media;
|
||||
#endregion
|
||||
|
||||
#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 ModelSample
|
||||
{
|
||||
public class Game1 : ANX.Framework.Game
|
||||
{
|
||||
GraphicsDeviceManager graphics;
|
||||
SpriteBatch spriteBatch;
|
||||
Model cubeModel;
|
||||
|
||||
public Game1()
|
||||
{
|
||||
graphics = new GraphicsDeviceManager(this);
|
||||
Content.RootDirectory = "SampleContent";
|
||||
}
|
||||
|
||||
protected override void LoadContent()
|
||||
{
|
||||
spriteBatch = new SpriteBatch(GraphicsDevice);
|
||||
cubeModel = Content.Load<Model>("Models/Cube");
|
||||
}
|
||||
|
||||
protected override void Update(GameTime gameTime)
|
||||
{
|
||||
if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed ||
|
||||
Keyboard.GetState().IsKeyDown(Keys.Escape))
|
||||
this.Exit();
|
||||
|
||||
base.Update(gameTime);
|
||||
}
|
||||
|
||||
protected override void Draw(GameTime gameTime)
|
||||
{
|
||||
GraphicsDevice.Clear(Color.CornflowerBlue);
|
||||
cubeModel.Draw(Matrix.Identity, Matrix.Identity, Matrix.Identity);
|
||||
base.Draw(gameTime);
|
||||
}
|
||||
}
|
||||
}
|
BIN
Samples/ModelSample/ModelSample/GameThumbnail.png
Normal file
BIN
Samples/ModelSample/ModelSample/GameThumbnail.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.6 KiB |
157
Samples/ModelSample/ModelSample/ModelSample.csproj
Normal file
157
Samples/ModelSample/ModelSample/ModelSample.csproj
Normal file
@ -0,0 +1,157 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<ProjectGuid>{ED081799-AB02-4793-96F8-F9EA7F3192E3}</ProjectGuid>
|
||||
<ProjectTypeGuids>{6D335F3A-9D43-41b4-9D22-F6F17C4BE596};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>ModelSample</RootNamespace>
|
||||
<AssemblyName>ModelSample</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||
<TargetFrameworkProfile>Client</TargetFrameworkProfile>
|
||||
<XnaFrameworkVersion>v4.0</XnaFrameworkVersion>
|
||||
<XnaPlatform>Windows</XnaPlatform>
|
||||
<XnaProfile>HiDef</XnaProfile>
|
||||
<XnaCrossPlatformGroupID>304a1159-e1e1-4c6e-90fa-0954105a0aee</XnaCrossPlatformGroupID>
|
||||
<XnaOutputType>Game</XnaOutputType>
|
||||
<ApplicationIcon>Game.ico</ApplicationIcon>
|
||||
<Thumbnail>GameThumbnail.png</Thumbnail>
|
||||
<PublishUrl>publish\</PublishUrl>
|
||||
<Install>true</Install>
|
||||
<InstallFrom>Disk</InstallFrom>
|
||||
<UpdateEnabled>false</UpdateEnabled>
|
||||
<UpdateMode>Foreground</UpdateMode>
|
||||
<UpdateInterval>7</UpdateInterval>
|
||||
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
|
||||
<UpdatePeriodically>false</UpdatePeriodically>
|
||||
<UpdateRequired>false</UpdateRequired>
|
||||
<MapFileExtensions>true</MapFileExtensions>
|
||||
<ApplicationRevision>0</ApplicationRevision>
|
||||
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
|
||||
<IsWebBootstrapper>false</IsWebBootstrapper>
|
||||
<UseApplicationTrust>false</UseApplicationTrust>
|
||||
<BootstrapperEnabled>true</BootstrapperEnabled>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\x86\Debug</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE;WINDOWS</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<NoStdLib>true</NoStdLib>
|
||||
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<XnaCompressContent>false</XnaCompressContent>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\x86\Release</OutputPath>
|
||||
<DefineConstants>TRACE;WINDOWS</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<NoStdLib>true</NoStdLib>
|
||||
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<XnaCompressContent>true</XnaCompressContent>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="mscorlib" />
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Net" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Game1.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Game.ico" />
|
||||
<Content Include="GameThumbnail.png">
|
||||
<XnaPlatformSpecific>true</XnaPlatformSpecific>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<BootstrapperPackage Include=".NETFramework,Version=v4.0,Profile=Client">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>Microsoft .NET Framework 4 Client Profile %28x86 and x64%29</ProductName>
|
||||
<Install>true</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
|
||||
<Install>false</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.5 SP1</ProductName>
|
||||
<Install>false</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>Windows Installer 3.1</ProductName>
|
||||
<Install>true</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Xna.Framework.4.0">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>Microsoft XNA Framework Redistributable 4.0</ProductName>
|
||||
<Install>true</Install>
|
||||
</BootstrapperPackage>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\ANX.Framework\ANX.Framework.csproj">
|
||||
<Project>{6899F0C9-70B9-4EB0-9DD3-E598D4BE3E35}</Project>
|
||||
<Name>ANX.Framework</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\InputSystems\ANX.InputDevices.Windows.XInput\ANX.InputDevices.Windows.XInput.csproj">
|
||||
<Project>{60D08399-244F-46A3-91F1-4CFD26D961A3}</Project>
|
||||
<Name>ANX.InputDevices.Windows.XInput</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\InputSystems\ANX.InputSystem.Standard\ANX.InputSystem.Standard.csproj">
|
||||
<Project>{49066074-3B7B-4A55-B122-6BD33AB73558}</Project>
|
||||
<Name>ANX.InputSystem.Standard</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\MediaSystems\ANX.MediaSystem.Windows.OpenAL\ANX.MediaSystem.Windows.OpenAL.csproj">
|
||||
<Project>{97185A92-077D-4498-8B6A-8BFF04079044}</Project>
|
||||
<Name>ANX.MediaSystem.Windows.OpenAL</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\RenderSystems\ANX.Framework.Windows.DX10\ANX.Framework.Windows.DX10.csproj">
|
||||
<Project>{5BE49183-2F6F-4527-AC90-D816911FCF90}</Project>
|
||||
<Name>ANX.Framework.Windows.DX10</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\RenderSystems\ANX.Framework.Windows.GL3\ANX.Framework.Windows.GL3.csproj">
|
||||
<Project>{EB8258E0-6741-4DB9-B756-1EBDF67B1ED6}</Project>
|
||||
<Name>ANX.Framework.Windows.GL3</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\RenderSystems\ANX.RenderSystem.Windows.DX11\ANX.RenderSystem.Windows.DX11.csproj">
|
||||
<Project>{B30DE9C2-0926-46B6-8351-9AF276C472D5}</Project>
|
||||
<Name>ANX.RenderSystem.Windows.DX11</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\SampleContent\SampleContent.contentproj">
|
||||
<Project>{FA6E229D-4504-47B1-8A23-2D3FCC13F778}</Project>
|
||||
<Name>SampleContent</Name>
|
||||
<XnaReferenceType>Content</XnaReferenceType>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\SoundSystems\ANX.SoundSystem.Windows.XAudio\ANX.SoundSystem.Windows.XAudio.csproj">
|
||||
<Project>{6A582788-C4D2-410C-96CD-177F75712D65}</Project>
|
||||
<Name>ANX.SoundSystem.Windows.XAudio</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\Microsoft.Xna.GameStudio.targets" />
|
||||
<!--
|
||||
To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
21
Samples/ModelSample/ModelSample/Program.cs
Normal file
21
Samples/ModelSample/ModelSample/Program.cs
Normal file
@ -0,0 +1,21 @@
|
||||
using System;
|
||||
|
||||
namespace ModelSample
|
||||
{
|
||||
#if WINDOWS || XBOX
|
||||
static class Program
|
||||
{
|
||||
/// <summary>
|
||||
/// The main entry point for the application.
|
||||
/// </summary>
|
||||
static void Main(string[] args)
|
||||
{
|
||||
using (Game1 game = new Game1())
|
||||
{
|
||||
game.Run();
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
34
Samples/ModelSample/ModelSample/Properties/AssemblyInfo.cs
Normal file
34
Samples/ModelSample/ModelSample/Properties/AssemblyInfo.cs
Normal file
@ -0,0 +1,34 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("ModelSample")]
|
||||
[assembly: AssemblyProduct("ModelSample")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2012")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type. Only Windows
|
||||
// assemblies support COM.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// On Windows, the following GUID is for the ID of the typelib if this
|
||||
// project is exposed to COM. On other platforms, it unique identifies the
|
||||
// title storage container when deploying this assembly to the device.
|
||||
[assembly: Guid("f6885860-904b-4576-b042-6ee1c0ab9a7b")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
Loading…
x
Reference in New Issue
Block a user