- Visual Studio 2013
- MS-LPL
- Interop
- C#
- Native Code
- C++
- DirectX
- Direct3D
- XAML with C++
- Windows Store app
- Windows 8.1
- Windows Phone 8.1
- Interop
- Animation
- Graphics
- Games
- Graphics and 3D
- XAML
- Cross Platform Code Reuse
- Direct3D
- Pixel Shader
- Image
- 3D
- Multi-Sample Anti-Aliasing
- 3D Graphics
- double buffer
- 04/02/2014
This sample demonstrates several features of Visual Studio useful in game development. It contains the starting point for a basic Direct3D game that shares code between Windows 8.1 and Windows Phone 8.1 using the new Universal app model.
This sample requires Visual Studio 2013 Update 2 RC in order to be built.
This is the latest version of the Starter Kit, and it is only supported on Visual Studio 2013 Update 2 RC or higher.
You can get the latest version of the Starter Kit for VS2013 RTM/Windows 8.1 only at http://aka.ms/vs3dkitwin
If you have Visual Studio 2012 Professional or higher, we highly recommend updating to Visual Studio 2013 Express and getting the latest version on the link above. The previous VS2012/Windows 8.0 only version of the kit is still available here: http://aka.ms/vs3dkitwin80
If you have Visual Studio 2012 Express for Windows 8, the previous VS2012/Windows 8.0 only version of the kit is still available here: http://aka.ms/vs3dkitwin80
If you have Visual Studio 2012 Express for Windows Phone, get the Phone 8.0 only version of the kit here: http://aka.ms/vs3dkitphone
- Start Visual Studio 2013 Update 2 and select File >Open >Project/Solution.
- Go to the directory in which you unzipped the sample. Go to the directory named
for the sample, and double-click the Visual Studio 2013 Solution (.sln) file. - Press F6 or use Build > Build Solution to build the sample.
Description
This sample contains the starting point for a basic game.
It demonstrates using the Visual Studio Graphics tools for asset manipulation, along with using an MSBUILD task for converting the included assets to a format suitable for runtime consumption.
The sample contains a “Starter Kit” which provides basic support for consuming the runtime assets produced by the MSBUILD task. This includes loading and rendering assets (including animated meshes), along with other functionality to enabled developers to work with the assets at runtime.
The sample also demonstrates using XAML to implement a simple 2D HUD over the 3D scene, and how to implement support for ARM devices, Windows Phone and older graphics cards through the use of fallback shaders.
To view the included assets, open the Assets folder in Visual Studio 2013, under the StarterKit.Shared project. Double click on any of the assets included in the Assets folder.
The assets included with this sample have been set up to be converted by the MSBUILD task to a runtime format at build time. For an example on how this is set up, right click on the GameLevel.fbx file, and select “Properties” from the context menu. Select “General” from the Configuration properties on the left. Notice how the “Item Type” has been set to “Mesh Content Pipeline”. The Visual Studio Graphics tools contain 3 different build types related to assets: Mesh Content, Shader Content, and Image Content.
In this example, the mesh is converted at build time to a file named “GameLevel.cmo”.
The sample includes the header VSD3DStarter.h, which contains code for getting started with the content produced by the build task described above. It also contains the header Animation.h, which shows how to render meshes that contain bone animations.
An example of using the Starter Kit to load and render the GameLevel can be found in the Game.cpp file.
- StarterKit.Shared/ folder - Contains files that can be shared between Windows Store and Windows Phone apps
- Animation/Animation.h – Shows how to render an animated mesh exported through the Visual Studio Mesh Content Task
- Animation/SkinningVertexShader.hlsl – Vertex shader that demonstrates how to account for bone animations when rendering a mesh
- Assets/GlowEffect.hlsl - A fallback shader based on GlowEffect.dgsl for use in ARM devices and older graphics cards (D3D Feature Level 9.1/9.3)
- Common/DeviceResources.cpp/.h – Shows how to initialize and manage the DirectX resources for your app. This version of DeviceResources builds on top of the default VS2013 template by adding Multi-Sample Anti-Aliasing support
- Common/DirectXHelper.h – DirectX helper code
- Common/StepTimer.h – A basic implementation of a timer that comes with the VS2013 templates
- Content/SampleFPSTextRenderer.cpp/.h – Shows how to render a simple Direct2D FPS counter. This is part of the default DirectX templates that come with VS2013.
- DirectXTex/DDSTextureLoader.cpp/.h – Shows how to load textures from DDS files. This code is part of theDirectXTex library
- Game.cpp/.h – Game logic that demonstrates a use of the “Starter Kit”
- HitTestingHelpers.h – Contains static methods to execute hit testing on Starter Kit Mesh objects
- ppltasks_extra.h – Helper methods to create different types of asynchronous tasks. Adapted from the Windows 8 Asynchronous Operations in C++ with PPL sample
- StarterKitMain.cpp/.h – Main class for the DirectX code, included with the VS2013 templates. Initializes and updates the renderers.
- VSD3DStarter.h – “Starter Kit”. Provides runtime support for working with the assets in this
sample
- StarterKit.Windows project - Main project for the Windows Store, developed with C++
- App.xaml/.h/.cpp – Application file for XAML app
- DirectXPage.xaml/.h/.cpp – Used for hosting Direct3D content in a XAML app
- StarterKit.WindowsPhonePhone project - Main project for the Windows Phone, developed with C++
- App.xaml/.h/.cpp – Application file for XAML app
- DirectXPage.xaml/.h/.cpp – Used for hosting Direct3D content in a XAML app
Please submit bugs found in this sample via Microsoft Connect. Please use the Visual C++ Forum on MSDN for questions or discussion about this sample.
- 4/2/2014 - New version of the Starter Kit for Windows 8.1 and Windows Phone 8.1 using the new universal project.
- 10/28/2013 - Added link to new version of the Starter Kit for Windows 8.1 with many improvements and bug fixes.
- 2/12/2013 – Second major version of the Starter Kit with support for sharing code between Windows Phone and Windows Store apps. Improvements to the texture loader and code cleanup
- 12/20/2012 - Better device orientation support, correct MaxAnisotropy for devices with D3D_FEATURE_LEVEL_9_1
- 12/3/2012 - Includes full source for the default vertex shader in the comments; tile, splash and store images changed to RGBA format
- 11/20/2012 - Includes support for bone animations and support for ARM devices/older graphics cards through the use of fallback shaders
- 11/1/2012 - Initial release
