Entries:
Comments:
Posts:

Loading User Information from Channel 9

Something went wrong getting user information from Channel 9

Latest Achievement:

Loading User Information from MSDN

Something went wrong getting user information from MSDN

Visual Studio Achievements

Latest Achievement:

Loading Visual Studio Achievements

Something went wrong getting the Visual Studio Achievements

Getting started with C++/3D/WinStore Game Dev with the "Visual Studio 3D Starter Kit"

Today's project by JP Duplessis, Scott Marison, Mohsen Agsen, Jacob Meyer, Justin Goshi and Roberto Sonnino was something Brian Peek suggested you all might find interesting, cool and fun. I mean what's more fun than a VS2012, C++ with XAML, DirectX, Direct3D, Windows Store...

Update: This is a pretty hot topic and the team has been releasing additional information, projects and video's. Scroll down to see the latest...

Visual Studio 3D Starter Kit

This sample contains the starting point for a basic game. The sample contains a “Starter Kit” which provides support for consuming runtime assets produced by the VS tools. This includes loading and rendering assets (meshes, textures and shaders).

image

This sample demonstrates several features of Visual Studio useful in game development. It contains the starting point for a basic Direct3D game for the Windows Store.

Building the Sample

  1. Start Visual Studio 2012 and select File >Open >Project/Solution.
  2. Go to the directory in which you unzipped the sample. Go to the directory named
    for the sample, and double-click the Visual Studio 2012 Solution (.sln) file.
  3. 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, 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.

Viewing Assets

To view the included assets, open the Assets folder in Visual Studio 2012, under the StarterKit project. Double click on any of the assets included in the Assets folder.

Including the Assets in the Build

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”.

Using the Starter Kit

The sample includes the header VSD3DStarter.h, which contains code for getting started with the content produced by the build task described above. 

An example of using the starter kit to load and render the GameLevel can be found in the
Game.cpp file.

Source Code Files

  • App.xaml/App.xaml.cpp – Application file for XAML app.
  • DirectXBase.cpp/.h – Base class for Direct3D rendering
  • DirectXHelper.h – DirectX helper code
  • DirectXPage.xaml.cpp/.h – Used for hosting Direct3D content in a XAML app
  • Game.cpp/.h – Game logic use to demonstrate use of the “Starter Kit”
  • VSD3DStarter.h – “Starter Kit”. Provides runtime support for working with the assets in this sample.

...

While it's important you learn the basis and basics for what you are writing, it's also important to ship and to focus on your game logic and not worry too much about foundational/grunt code. This starter kit will can help you with both (learning and avoiding the grunt'ness)...

Just in: Looking for another example of using the Visual Studio 3D Starter Kit? Here's a project by Roberto Sonnino and Xiaoji Chen.

Towers of Hanoi 3D

A simple Towers of Hanoi 3D game for the Windows Store.

Developed with the Visual Studio 3D Starter Kit - http://aka.ms/vs3dkit

 

Update: Want to see it in action? Here's a hot off the press video from the team...

Visual Studio 3D StarterKit [Video]

Want to write a 3D game for Windows 8, but not sure where to start? 

In this video, we'll show you the Visual Studio 3D Starter Kit, which is now available on the Visual Studio Developer Code Samples site for all editions of Visual Studio 2012 that support writing Windows Store apps, including Visual Studio 2012 Express for Windows 8.  JP and Roberto walk you through this C++ code sample which shows you how to use common capabilities in 3D apps and games for the Windows Store, such as:

  • Loading textures, models, shaders
  • Working with a Camera class
  • Creating a 3D Scene
  • Using XAML with DirectX

We'll also show you how to use the Model and Image Viewers and Shader Designer which are included in retail editions of Visual Studio 2012.

...

 

Tags:

Follow the Discussion

  • JP DuplessisJP Duplessis

    Very smooth introduction to writing your first Windows 8 Store App using C++ DirectX and XAML

  • andrewandrew

    I would like to see more development on the DX toolkit http://directxtk.codeplex.com/
    What's especially needed are lower level classes for managing shaders (vertex,pixel,geometry,compute... etc), vertex layouts, resources and mesh loading.

  • williamwilliam

    sorry to say that it does not open successfully with Visual Studio 2012 Professional if I try to open StarterKit.sln. VS2012 then tells me it is an "incompatible" project and says

    D:\VS_Projects\Visual Studio 3D Starter Kit\C++\StarterKit\StarterKit.vcxproj : error : Exception from HRESULT: 0x80042003

    Do you know what is wrong here?

    Thanks and best regards
    William

  • Greg Duncangduncan411 It's amazing what a professional photographer can do...

    @william: I just downloaded it again and it opened fine for me (Win8 Pro x64, VS 2012 Ultimate) and compiled and ran, so I'm not sure why you're running into that issue. Silly question, but you are running your VS2012 on Windows 8?

    Roberto may not be monitoring the comments on this post, so the best way to connect with him so see if there are other requirements is probably via the Visual Studio Gallery post, in the Q&A section, http://code.msdn.microsoft.com/Visual-Studio-3D-Starter-455a15f1/view/Discussions#content

  • williamwilliam

    Re-download did the trick. Thanks a lot for your support...

    Best regards
    William

  • JesseJesse

    Very helpful code, thank you guys. Especially the importing mesh code was a life saver! Having a little trouble with selecting the effect in the mesh builder though. Is it possible to use an FX or format other than dgsl or is that the only format supported for the tool?

Remove this comment

Remove this thread

close

Comments Closed

Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation, please create a new thread in our Forums,
or Contact Us and let us know.