<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" media="screen" href="/styles/xslt/rss.xslt"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:c9="http://channel9.msdn.com">
<channel>
	<title>Channel 9</title>
    <atom:link rel="self" type="application/rss+xml" href="http://channel9.msdn.com/Niners/c4f.Glenn-Wilson/Posts/RSS"></atom:link>
    <itunes:summary></itunes:summary>
    <itunes:author>Microsoft</itunes:author>
    <itunes:subtitle></itunes:subtitle>
    <image>
      <url>http://mschnlnine.vo.llnwd.net/d1/Dev/App_Themes/C9/images/feedimage.png</url>
      <title>Channel 9</title>
      <link>http://channel9.msdn.com/Niners/c4f.Glenn-Wilson/Posts</link>
    </image>
    <itunes:image href=""></itunes:image>
    <itunes:category text="Technology"></itunes:category>
    <description>Channel 9 keeps you up to date with the latest news and behind the scenes info from Microsoft that developers love to keep up with. From LINQ to SilverLight – Watch videos and hear about all the cool technologies coming and the people behind them.</description>
    <link>http://channel9.msdn.com/Niners/c4f.Glenn-Wilson/Posts</link>
    <language>en</language>
    <pubDate>Sat, 18 May 2013 07:27:03 GMT</pubDate>
    <lastBuildDate>Sat, 18 May 2013 07:27:03 GMT</lastBuildDate>
    <generator>Rev9</generator>
    <c9:totalResults>1</c9:totalResults>
    <c9:pageCount>1</c9:pageCount>
    <c9:pageSize>25</c9:pageSize>
  <item>
      <title>Creating an Application Template</title>
      <description><![CDATA[ <p>This article will walk you through the steps needed to make your own project template. It uses the EmptyProject sample from the Microsoft DirectX SDK to make a Visual Studio template.</p><p>When you open Visual Studio Express Edition and create a new project, you get presented with a list of templates. But what if there is a kind of project that you use all the time that isn't in that list? You could start with the closest one and add your own code every time. Or you can take a project that has everything you want and turn it into a template that you can share with your friends and teammates. This article will walk you through the steps needed to make your own project template. </p><p>A project that I use all of the time when writing for <a href="http://www.ircomm.net">http://www.ircomm.net</a> is a managed DirectX template. There is a lot of code which is the same or similar in every project. The <a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=1C8DC451-2DBE-4ECC-8C57-C52EEA50C20A">Microsoft DirectX SDK</a> contains a project which is a good starting point, but it's not provided as a Visual Studio template. This article will use the EmptyProject sample from the Microsoft DirectX SDK to make a Visual Studio template. This template can then be used as a starting point for managed DirectX applications. </p><p>The principles in this article can be used to create any type of application template using Visual Studio 2005 or the Express editions. </p><h4>Set up the Project Files</h4><p>Start by creating a new Windows forms application and calling it &quot;DirectXApplication&quot; and then save the base project. </p><p><img src="http://ecn.channel9.msdn.com/o9/c4fcontent/migration/909261/apptemplate_1.gif" border="0" alt=""></p><p>Once saved, remove the &quot;Form1.cs&quot; and &quot;Program.cs&quot; files as these will not be needed in the application. </p><p>The next stage is to set up the folder structure that the application will use. In the Solution Explorer right-click the project name &quot;DirectXApplication&quot; and select Add &gt; New Folder. Add two folders and call them &quot;Common&quot; and &quot;Media,&quot; respectively. Inside the &quot;Media&quot; folder add another two folders and call them &quot;SharedFx&quot; and &quot;UI&quot;. </p><p><img src="http://ecn.channel9.msdn.com/o9/c4fcontent/migration/909261/apptemplate_2.gif" border="0" alt=""></p><h4>Add the Project References</h4><p>With all Managed DirectX applications you have to make sure that the correct references are added to the project. For the base application you will need to make sure that the standard references for DirectX are added. These standard references are as follows. </p><ul><li>Microsoft.DirectX </li><li>Microsoft.DirectX.Direct3D </li><li>Microsoft.DirectX.Direct3DX <p><strong>NOTE: </strong>I am basing the DirectX code in this sample on the October 2005 release of the <a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=1C8DC451-2DBE-4ECC-8C57-C52EEA50C20A">Microsoft DirectX SDK</a>. </p></li></ul><p>To add these references, right-click the References section in the Solution Explorer and select &quot;Add References&quot; from the menu. In the dialog that is presented, scroll down and highlight the references listed above, then click OK. </p><p><img src="http://ecn.channel9.msdn.com/o9/c4fcontent/migration/909261/apptemplate_3.gif" border="0" alt=""></p><p>Your references section should look like the above figure. </p><p>When using the sample framework, you have to make sure that you have your project set to &quot;Allow unsafe code.&quot; Right-click the &quot;DirectXApplication&quot; project in the Solution Explorer and select Properties. Next, on the Properties page go to the Build tab and make sure that the &quot;Allow unsafe code&quot; option is checked. </p><p><img src="http://ecn.channel9.msdn.com/o9/c4fcontent/migration/909261/apptemplate_4.gif" border="0" alt=""></p><p><strong>Setting up the Common Framework</strong> </p><p>Now that the folder structure is complete, it is time to add the Common Framework from the Microsoft DirectX SDK. In the Solution Explorer right-click on the &quot;Common&quot; folder and select Add &gt; Existing Item, browse to the location of the sample directory in the SDK (Generally this is going to be &quot;C:\Program Files\Microsoft DirectX 9.0 SDK (October 2005)\Samples\Managed\Common&quot;), and add all of the dxmut*.cs files. You don't need assembly.cs or any of the files that begin with <em>w</em> as those are for use with the .NET Framework 2.0. </p><p><img src="http://ecn.channel9.msdn.com/o9/c4fcontent/migration/909261/apptemplate_5.gif" border="0" alt=""></p><p>The next set of files to add are the media files that will be used by the common framework to display the GUI system. Highlight the &quot;UI&quot; directory in the Solution Explorer and add all of the files in the &quot;C:\Program Files\Microsoft DirectX 9.0 SDK (October 2005)\Samples\Media\UI&quot; directory. </p><p><img src="http://ecn.channel9.msdn.com/o9/c4fcontent/migration/909261/apptemplate_6.gif" border="0" alt=""></p><p>The last set of files required are the main programs files. Browse to the EmptyProject sample in the SDK (C:\Program Files\Microsoft DirectX 9.0 SDK (October 2005)\Samples\Managed\Direct3D\EmptyProject) and add EmptyProject.cs and EmptyProject.fx. </p><p><img src="http://ecn.channel9.msdn.com/o9/c4fcontent/migration/909261/apptemplate_7.gif" border="0" alt=""></p><p><strong>Including the Content Files in the Application.</strong> </p><p>One of the new features that are included in the new SDK is the ability to have content files copied to the output directory of the application. When this feature is enabled, the compiler will create the directory structure identical to the one inside the solution in the output directory. There are several choices of what you can do with content files. </p><ul><li>&quot;Do Not Copy&quot;: the file is not copied to the output directory. This could be used to add reference documents to the application that you would like to use while developing, but not when distributing. </li><li>&quot;Copy Always&quot;: the file is copied to the output directory every time you build the application. </li><li>&quot;Copy if newer&quot;, the file is copied to the output directory only if the file is newer then the file already in the output directory. If the file is not there, it will create a new file. Using this option for most of the content files will reduce the time taken during a compile, as VS will not have to transfer the files. </li></ul><p>In the current project we want the content to be copied each time if the files are newer then the ones in the output directory. To do this, go to the Solution Explorer and highlight the files as shown in the figure below. </p><p><img src="http://ecn.channel9.msdn.com/o9/c4fcontent/migration/909261/apptemplate_8.gif" border="0" alt=""></p><p>Next, in the Properties pane (press F4 if it's not visible) change the &quot;Copy to Output Directory&quot; to &quot;Copy if newer&quot; </p><p><img src="http://ecn.channel9.msdn.com/o9/c4fcontent/migration/909261/apptemplate_9.gif" border="0" alt=""></p><p>Save the application and execute it to test before we create the template. </p><p><strong>Converting the Application into a Template file</strong> </p><p>The next step, and the main point of this article, is to convert the project into a template. Both Visual Studio 2005 and Express systems can do this out of the box using the built-in functions and wizards. </p><p>The first step is to make sure that the application has been saved; once this is done select &quot;Export Template&quot; from the file menu. </p><p><img src="http://ecn.channel9.msdn.com/o9/c4fcontent/migration/909261/apptemplate_10.gif" border="0" alt=""></p><p>This will open up the Export Template Wizard. </p><p><img src="http://ecn.channel9.msdn.com/o9/c4fcontent/migration/909261/apptemplate_11.gif" border="0" alt="" width="500" height="471"></p><p>On the main dialog there is a choice of two different types of templates to create, &quot;Project Template&quot; and &quot;Item Template&quot;. Project template creates a template from the entire project. &quot;Item Template&quot; creates a template from a specific item in the project. An item template would be used for a Windows form or a class file that you would use in multiple projects; e.g., a splash form or a configuration class. </p><p>Leave the &quot;Project Template&quot; option selected, and then enter a name for the template. I will be leaving it as &quot;DirectXApplication&quot;. Press &quot;Next&quot; to continue. </p><p><img src="http://ecn.channel9.msdn.com/o9/c4fcontent/migration/909261/apptemplate_12.gif" border="0" alt="" width="500" height="471"></p><p>Enter in an easy-to-understand name and description for the application template. This will be the name and description that appears in the project selection dialog when you select the template in a new application. The application icon should represent the application. Select the browse button and browse to the directory where the SDK and Common Framework was first created (C:\Program Files\Microsoft DirectX 9.0 SDK (October 2005)\Samples\Managed\Common), change the selection to display all files, and select the DirectX icon. </p><p><strong>Testing the Template</strong> </p><p>Now that the template application is completed, it should be tested to make sure that the system is working correctly. To test the application template, close the current solution and create a new one. You should see up the following dialog box: </p><p><img src="http://ecn.channel9.msdn.com/o9/c4fcontent/migration/909261/apptemplate_13.gif" border="0" alt=""></p><p>Select the &quot;DirectX Application&quot; Template (or whatever you called it). Change the name of the application to what you would like your new project to be called (I chose to call mine &quot;GameEngine&quot;) and then press OK to continue. The Visual Studio IDE will create the project in a temporary space and set up all of the files needed. At the same time it will automatically change all of the references to &quot;DirectXApplication&quot; to &quot;GameEngine,&quot; including the root namespace for the application. The last step you need to do is to save the application. This will make sure that the project is saved to the disk and is ready for use. </p><p><strong>Resources and Links</strong> </p><ul><li><a href="http://msdn.microsoft.com/directx/">Microsoft DirectX Developer Center</a></li><li><a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=1C8DC451-2DBE-4ECC-8C57-C52EEA50C20A">Microsoft DirectX SDK October 2005 Release</a></li><li><a href="http://forums.microsoft.com/msdn/default.aspx?ForumGroupID=20">MSDN Windows Game development Forums</a>, </li><li>Managed DirectX Resource Sites <ul><li>Inner Realm, <a href="http://www.ircomm.net">http://www.ircomm.net</a> </li><li>The ZBuffer, <a href="http://www.thezbuffer.com">http://www.thezbuffer.com</a></li></ul></li><li>MSDN Documentation on Visual Studio Templates <ul><li><a href="http://msdn2.microsoft.com/en-us/library/ms247064.aspx">Visual Studio Template Reference</a></li><li><a href="http://msdn2.microsoft.com/en-us/library/eehb4faa.aspx">Template Parameters</a></li><li><a href="http://msdn2.microsoft.com/en-us/library/ms185318.aspx">Export Template Wizard</a></li></ul></li></ul> <img src="http://m.webtrends.com/dcs1wotjh10000w0irc493s0e_6x1g/njs.gif?dcssip=channel9.msdn.com&dcsuri=http://channel9.msdn.com/Niners/c4f.Glenn-Wilson/Posts/RSS&WT.dl=0&WT.entryid=Entry:RSSView:0a83b75caf034e41a74f9e7600dbc56d">]]></description>
      <comments>http://channel9.msdn.com/coding4fun/articles/Creating-an-Application-Template</comments>
      <itunes:summary> This article will walk you through the steps needed to make your own project template. It uses the EmptyProject sample from the Microsoft DirectX SDK to make a Visual Studio template. When you open Visual Studio Express Edition and create a new project, you get presented with a list of templates. But what if there is a kind of project that you use all the time that isn&#39;t in that list? You could start with the closest one and add your own code every time. Or you can take a project that has everything you want and turn it into a template that you can share with your friends and teammates. This article will walk you through the steps needed to make your own project template.  A project that I use all of the time when writing for http://www.ircomm.net is a managed DirectX template. There is a lot of code which is the same or similar in every project. The Microsoft DirectX SDK contains a project which is a good starting point, but it&#39;s not provided as a Visual Studio template. This article will use the EmptyProject sample from the Microsoft DirectX SDK to make a Visual Studio template. This template can then be used as a starting point for managed DirectX applications.  The principles in this article can be used to create any type of application template using Visual Studio 2005 or the Express editions.  Set up the Project FilesStart by creating a new Windows forms application and calling it &amp;quot;DirectXApplication&amp;quot; and then save the base project.   Once saved, remove the &amp;quot;Form1.cs&amp;quot; and &amp;quot;Program.cs&amp;quot; files as these will not be needed in the application.  The next stage is to set up the folder structure that the application will use. In the Solution Explorer right-click the project name &amp;quot;DirectXApplication&amp;quot; and select Add &amp;gt; New Folder. Add two folders and call them &amp;quot;Common&amp;quot; and &amp;quot;Media,&amp;quot; respectively. Inside the &amp;quot;Media&amp;quot; folder add another two folders and call them &amp;quot;SharedFx&amp;quot; and &amp;quot;UI&amp;quot;. </itunes:summary>
      <link>http://channel9.msdn.com/coding4fun/articles/Creating-an-Application-Template</link>
      <pubDate>Tue, 31 Oct 2006 10:48:00 GMT</pubDate>
      <guid isPermaLink="false">http://channel9.msdn.com/coding4fun/articles/Creating-an-Application-Template</guid>
      <media:thumbnail url="http://ecn.channel9.msdn.com/o9/c4f/images/909261_100.jpg" height="75" width="100"></media:thumbnail>
      <media:thumbnail url="http://ecn.channel9.msdn.com/o9/c4f/images/909261_220.jpg" height="165" width="220"></media:thumbnail>      
      <dc:creator>Glenn Wilson</dc:creator>
      <itunes:author>Glenn Wilson</itunes:author>
      <slash:comments>7</slash:comments>
      <wfw:commentRss>http://channel9.msdn.com/coding4fun/articles/Creating-an-Application-Template/RSS</wfw:commentRss>
    </item>    
</channel>
</rss>