Sunday, September 30, 2012

Pluralsight gets the ball rolling

I have been struggling to get this app written. Work has been busy and learning C++ is taking a bit of time. I am still in the sample app writing stage. However, I would be a lot further behind if it weren't for pluralsight. So I would like to put a plug in for them and their courses.

I watched the C course to freshen up on C programming (Kenny Kerr is my  favorite voice so far). Now I am jumping into the 7 hr long C++ course by Kate Gregory. I must say I have learned so much from pluralsight videos that if I need to research a new technology I go there before Google. Here are a few reasons I keep going back.

Content, content, content!
They have tons and tons of content. I mean 7 hrs just for an introduction to C++! I would challenge anyone to look on the web and see if you can find that kind of depth.  Combine that with the intermediate and advanced topics and you have about 16.5 hrs of video. That is just for C++ which is one of their less covered topics. I have a watch list about 24hrs long and just dont have the time to watch it.

Simple to advances courses
We all come at different topics with different levels of knowledge. Some topics I am an expert at and others I am just beginning. This is not an intelligence thing, there are just some things we havent learned yet and some things we deal with every day. pluralsight does a good job of providing both beginner level courses and intermediate or advanced ones as well.

Cutting edge videos
While Microsoft was speculating about SPA's Pluralsight and John Papa were making them!

As developers one of the best ways we learn is by reading code. I tell third party vendors to skip the documentation and send me a sample project (When they lack a sample project I make my own and email it to them to save other developers). At pluralsight, not only do you get a video explaining how to do something, you get all of the sample code to go along with the video. That in itself makes pluralsight worth it.

Dancing Developers
Need I say more?

Much more
There are lots more little things that makes being a pluralsight subscriber a good thing.

Note: pluralsight did not put me up to this. I am just a happy customer.

Now back to my walkthrough!

Friday, September 21, 2012

C++ Direct2D (XAML) App Walkthrough: Common

The common folder is (surprise) where you put common code and xaml files. In just about every project your first move should be to move this out to a library. I called this library Common just to keep the convention but I've seen it called "Core" or somethings that indicates this is where files should go that are to be shared between libraries and projects. There is only one file to basic template and that is the StandardStyles.xaml file.


This file is a resource dictionary. If you are new to xaml development you may not be familiar with resource dictionaries. They are kinda like a css file for xaml. They define global styles for all of your xaml files in the app. That is why this file has this comment at the top:
This file contains XAML styles that simplify application development.
    These are not merely convenient, but are required by most Visual Studio project and item templates. Removing, renaming, or otherwise modifying the content of these files may result in a project that does not build, or that will not build once additional pages are added.  If variations on these styles are desired it is recommended that you copy the content under a new name and modify your  private copy.
You dont really need to change this file. Simply create your own and reference it in the app.xaml. Like this resource has been.


                    Styles that define common aspects of the platform look and feel
                    Required by Visual Studio project and item templates
                <ResourceDictionary Source="Common/StandardStyles.xaml"/>


Another important thing to note is that if you move common out to a library you will need to update the ResourceDictionary.Souce to include the assembly name like this:

<ResourceDictionary Source="ms-appx:///Common/Files/Style.xaml" />
You can find the explanation for this here.

I am pretty bad at using resource dictionaries but I know when I should be doing it. The test is the same as code. If you are copy pasting xaml you should consider a resource dictionary. Don't forget to add the dictionaries to the app.xaml. I have wasted countless hours debugging styles that were not added to the app.xaml.

Thursday, September 20, 2012

C++ Direct2D (XAML) App Walkthrough: Assets

Assets in the vanilla app include 3 different logos and a splash screen. I know from Windows Phone development that there are lots of guidelines concerning tiles. Here is a link that describes what images are required and what sizes.


This image is 150x150 and is used to display you app on the start screen. This file is required according to the Windows 8 App Certification Requirements:

1.4 Each app must display only one tile after it is installed

The image on an app’s tile must be reasonably related to the content of the app.
I found this lengthy article about tile design. The article mentions that if you are not doing a live tile then you only need the square tile.
Use only a square tile if your app will not use tile notifications to send updates to the user. Wide tile content should always be fresh and regularly updated. If you aren't using a live tile, do not provide a wide logo in the manifest.
This means I will not be needing a wide tile for version one. I will have to blog later about live tiles since I think they are important to drawing users back into your app. But to make my deadline I think that I am going to have to forgo a live tile.


It took me a while to figure out exactly what this image did but I found this that describes it:
A small image shown in the corner of the tile to identify the app. For more info on how to specify the image in this attribute, see Remarks.
From what I have seen from other apps this image is one color with a white background so it can pick up the  tiles color since it is shown on the main tile.


The splashscreen is required and for a game a splash screen can double as a loading screen. When I ran the app the splash screen was really small (620x300). This is . I am going to have to make it bigger. The settings for the splash screen is in the package.manifest file and it gives you two settings: Image and BackgroundColor. This is the code behind. VS has a nice gui to walk you though setting up the splashscreens and logos.
<SplashScreen Image="Assets\splash-sdk.png" BackgroundColor="#00b2f0"/>
It also appears that the splash screen is static so to show a loading bar you have to switch out the image with an identical image on a xaml page. This trick is demoed in a sample app provided by Microsoft.


The store logo is required. The image is 50x50 so there is not a lot of pixels. Use them wisely.

That is the breakdown of the assets file. On to the Common folder.

Wednesday, September 19, 2012

C++ Direct2D (XAML) App Walkthrough

I learned a lot when I wrote my first windows phone app and I wish I would have written things down. One of the main things that I learned was that there is a lot more to getting your app into the store than just code. If you don't think about those things now you will be scrambling to get them together when it comes time to publish your app.

With that in mind I am going to walk through the Direct2D (XAML) App template and talk about the things that need to be addressed when writing an app that will be published in the store. Also show the basic structure of a C++ Windows 8 app. Here is a list based off of the vanilla sample project structure:

  1. Assets
  2. Common
  3. External Dependencies
  4. App.xaml
  5. BasicTimer
  6. DirectXBase, DirectXHelper, DirectXPage
  7. Package.appxmanifest
  8. pch.cpp
  9. SimpleTextRenderer.
I will update this post to link back through the series.

Tuesday, September 18, 2012

Source Control (Git vs Svn)

I will be writing my app mostly from my laptop but I am planning on the possibility of bringing on other people, particularly a designer. Source control is a must even if you are designing your app solo. As far as I am concerned there are two options Git or Svn.

There are tons of comparisons of these two forms of source control so I wont waste my keystrokes. Since I will be developing this app at home, in coffee shops, and for the most part on the go there is one feature that Git has that I feel I cant live without: local checkins. For that I am willing to pay $7 for a github micro account. I will be keeping my account private but watch my github account for sample projects and utilities. I am convinced that keeping things as open as possible is the way to go.

Monday, September 17, 2012

Boo on menus

I have had a windows phone for about a year and a half. I dont play games very often but I have downloaded tons of games for when my nieces and nephews want to use my phone. These kids are smart and at two they already know how to get around a phone menu and play the games they like.

I began to notice that some games were fun for them but just a little too hard. They were spending more than half of their time restarting the game. They just wanted to slice the fruit but they weren't old enough to distinguish the bombs. That's when I realized that there is a place for games that are simple and keep you out of the menus. I will talk more about this because I think that just like we have gotten ride of chrome to highlight content we will be getting ride of menus so people can get at the game and can move from level to level without pain.

I will be presenting my idea for a game pretty soon but first I need to write a few sample apps to get the hang of the C++ stuff.

Saturday, September 15, 2012

Starting Goal

I just upgraded my digital life. I reformatted my laptop, upgraded to 8GB of ram, and added an SSD drive. I also bought a 22 inch monitor for when I program at home and need the extra screen real-estate.  I did all of this to prepare myself for my own personal challenge.

I am planning on having a game in the windows 8 store before it launches on October 26th. I have lots of experience using C# since I am a full time Silverlight developer. I also am learning javascript as we prepare for the inevitable move away from Silverlight. Yet I want to make a game and the best way to make a game for Windows 8 is to use C++.

I haven't used C++ since college and so this is completely new to me. I am lucky that my brother is a professional C++ developer but for most of this I will be on my own. This is blog will be a record of my struggles going from zero to app. I have a terrible track record with blogs so I am crossing my fingers but I think that I can make this work.

Here we go...