<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Xyzzer&#039;s Dev Blog</title>
	<atom:link href="http://blog.xyzzer.me/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.xyzzer.me</link>
	<description>Coding adventures of a Polish developer living in Microsoftland</description>
	<lastBuildDate>Fri, 25 May 2012 17:06:28 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='blog.xyzzer.me' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Xyzzer&#039;s Dev Blog</title>
		<link>http://blog.xyzzer.me</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://blog.xyzzer.me/osd.xml" title="Xyzzer&#039;s Dev Blog" />
	<atom:link rel='hub' href='http://blog.xyzzer.me/?pushpress=hub'/>
		<item>
		<title>Creating DirectX Interop Libraries for XAML Metro Style Apps &#8211; Part 1: Direct2D</title>
		<link>http://blog.xyzzer.me/2012/05/25/creating-directx-interop-libraries-for-xaml-metro-style-apps-part-1-direct2d/</link>
		<comments>http://blog.xyzzer.me/2012/05/25/creating-directx-interop-libraries-for-xaml-metro-style-apps-part-1-direct2d/#comments</comments>
		<pubDate>Fri, 25 May 2012 16:57:45 +0000</pubDate>
		<dc:creator>xyzzer</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.xyzzer.me/?p=606</guid>
		<description><![CDATA[The XAML-based UI stack for Metro Style Apps is quite rich for the youngest member of the XAML UI frameworks family, but sometimes the basic controls even with their rich APIs are not enough. That is where the most powerful &#8230; <a href="http://blog.xyzzer.me/2012/05/25/creating-directx-interop-libraries-for-xaml-metro-style-apps-part-1-direct2d/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.xyzzer.me&#038;blog=13393480&#038;post=606&#038;subd=xyzzer&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div style="font-family:Calibri;">
<a href="http://labs.vectorform.com/?attachment_id=2166" rel="attachment wp-att-2166"><img src="http://labs.vectorform.com/wp-content/uploads/2012/05/XIsForXAML.png" alt="" width="225" height="229" class="aligncenter size-full wp-image-2166" /></a></p>
<p>
The XAML-based UI stack for Metro Style Apps is quite rich for the youngest member of the XAML UI frameworks family, but sometimes the basic controls even with their rich APIs are not enough. That is where the most powerful point of extensibility of the XAML UI comes in &#8211; the DirectX integration.</p>
<p>With DirectX you can create the highest quality real time Direct3D graphics, high performance Direct2D drawings, apply stunning looking pixel shader effects,  read and write images of many different formats with WIC, play back video with the Media Framework and high quality audio with XAudio2. You can do all these things in a XAML-based app, so you can use all the rich UI APIs of the XAML framework to quickly create a beautiful looking application and add some special DirectX touch that will make it unique.</p>
<p>In this article I will show you how to create a libraries for drawing Direct2D or Direct3D scenes in the background of an otherwise  XAML-rendered UI.
</p>
<p><span id="more-606"></span></p>
<h2>Where to start</h2>
<p>
The <a href="http://msdn.microsoft.com/en-us/library/windows/apps/hh825871.aspx" title="The DirectX and XAML interop article" target="_blank">DirectX and XAML interop article</a> on MSDN talks about 3 different ways to mix XAML and DirectX in WinRT:</p>
<ol>
<li>SurfaceImageSource &#8211; which is good for mostly static scenes that get drawn into an Image control</li>
<li>VirtualSurfaceImageSource &#8211; which is similar to SurfaceImageSource, but allows to work with surfaces larger than the size of the screen &#8211; perhaps for working with high resolution photos or maps</li>
<li>SwapChainBackgroundPanel &#8211; which can be used for high performance graphics with almost the same level of control you would otherwise get if you created a solely DirectX-driven app or game</li>
</ol>
<p>The last option is what we&#8217;ll use to create a DirectX-based background for a XAML app. A lot of the things we will use are already available as part of the <a href="http://code.msdn.microsoft.com/windowsapps/Windows-8-Modern-Style-App-Samples" title="Metro style app samples" target="_blank">Metro style app samples</a> available from MSDN, but there is no sample where the DirectX stuff is packaged as a separate library so that you can use it in any C++, C# or VB application and have some reusable code that you don&#8217;t have to write repeatedly.
</p>
<h2>Anatomy of a Direct2D Application</h2>
<p>
To learn how to create a reusable library it helps to know what are the basics of a DirectX application. When you create a basic Direct2D Application from the template that ships with Visual Studio 11 for Windows 8 Consumer Preview you get this:
</p>
<p><a href="http://labs.vectorform.com/?attachment_id=2167" rel="attachment wp-att-2167"><img src="http://labs.vectorform.com/wp-content/uploads/2012/05/BasicD2DAppStructure.png" alt="" width="286" height="222" class="aligncenter size-full wp-image-2167" /></a></p>
<p>
The <strong>pch</strong> files are for the precompiled header with references to DirectX headers and <a href="http://msdn.microsoft.com/en-us/library/hh438466(v=vs.110).aspx" title="WRL" target="_blank">WRL</a> (Windows Runtime C++ Template Library), which is an ATL-inspired library that helps to work with COM in a WinRT app &#8211; quite useful since DirectX is built on COM.</br><br />
<strong>DirectXHelper.h</strong> contains a simple inline function that throws WinRT platform exceptions for failed HRESULTs. Useful since they get projected to CLR Exceptions if you are planning on consuming  the code with .NET.</br><br />
<strong>DirectXBase</strong> is an abstract base class that helps to build basic DirectX applications that use D2D, D3D, WIC or DirectWrite by providing basic access to the global class factories and shared resources. Its main entry point is the <strong>Initialize()</strong> method that takes an instance of the <a href="http://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.core.corewindow.aspx" title="CoreWindow" target="_blank">CoreWindow</a> class, which is the core UI piece of every WinRT app and makes that window into a DirectX-managed one. This is also the thing we&#8217;ll need to change when we use the SwapChainBackgroundPanel since we want to only associate that panel with DirectX and not the entire UI. Initialization code is divided into 3 methods:</p>
<ol>
<li>CreateDeviceIndependentResources that in the case of a Direct2D app creates D2D and DWrite factories,</li>
<li>CreateDeviceResources that creates so called D3D 11 device, its context, D2D device and sets the DPI</li>
<li>CreateWindowSizeDependentResources creates
<ol>
<li>the swap chain, which is a collection of bitmaps or textures that get presented on screen in quick succession to create an illusion of motion,</li>
<li>the render target view, which tells the GPU what to render to (the back buffer of the swap chain),</li>
<li>the depth stencil texture, which is used to control layering/z-ordering of pixels in the scene,</li>
<li>the view port, which controls the view of the swap chain that is shown on screen,</li>
<li>finally &#8211; it associates the D2D device with the back buffer and sets the text anti-aliasing mode</li>
</ol>
</li>
</ol>
<p><strong>UpdateForWindowSizeChange()</strong> is what you need to call whenever the screen resolution changes (e.g. when the app gets snapped, goes into portrait mode or back or when display monitor configuration changes). It basically clears out old window size dependent resources and calls CreateWindowSizeDependentResources to recreate these in different resolution.<br />
The <strong>Render()</strong> method is where you put all your scene rendering code calls and is what you call when you want to update the view.<br />
<strong>Present()</strong> should be called after Render() and it basically flips the buffers in the swap chain or reinitializes everything if something failed.<br />
<strong>BasicDirect2DApplication.cpp/.h</strong> is named after my application name. It is the main entry point of the application and inherits from DirectXBase, overriding its methods to actually render some content on the screen, so you end up with a simple text displayed in the middle of the screen when the app is run. It also has the code that wires up DirectX to the CoreWindow and controls the rendering events. If you are interested in how to do it for a purely DirectX-based application &#8211; you can read the <a href="http://msdn.microsoft.com/en-us/library/windows/apps/hh465077.aspx" title="How to set up your Metro style DirectX app to display a view" target="_blank">How to set up your Metro style DirectX app to display a view</a> on MSDN. For DirectX-XAML interop &#8211; we will do things differently.
</p>
<h2>Anatomy of a Direct3D Application</h2>
<p>
The Direct3D app is a bit similar, where Direct3DBase is analogue to the DirectXBase class of the Direct2D app, but has a few more files worth noting:
</p>
<p><a href="http://labs.vectorform.com/?attachment_id=2168" rel="attachment wp-att-2168"><img src="http://labs.vectorform.com/wp-content/uploads/2012/05/BasicD3DAppStructure.png" alt="" width="287" height="306" class="aligncenter size-full wp-image-2168" /></a></p>
<p>My <strong>BasicDirect3DApplication</strong> class in this case does not include any DirectX code except for calling out to <strong>CubeRenderer</strong> which is the subclass of the Direct3DBase class in this case. The Direct3DBase class in the template D3D app is a bit different from its D2D version. Obviously it does not do anything with D2D or DWrite, so it does not deal with these class factories.<br />
<strong>CubeRenderer</strong> defines the vertices of a cube and allows to render it animated based on system time.<br />
<strong>SimplePixel/VertexShader.hlsl</strong> are the pixel and vertex shader files that are used to process the cube vertices and turn them into a rasterized output on your screen.
</p>
<h2>Creating a DirectX WinRT Component Library</h2>
<p>
I could just share a complete library, which I will at the end, but I think it helps to know how it is done in the first place, so in case you disagree with something I have done or if something changes in the future versions of the tools which currently are in flux &#8211; you will be able to do it again yourself.
</p>
<p>
If you want to create the library &#8211; you start with an empty C++ WinRT Component Library project. You can remove the stub WinRTComponent.cpp/.h files. Next you should to copy the list of referenced project linker input files (static libraries) from the template DX application to the library. The screenshot below shows where to do it (note &#8211; you need to do it once per each solution configuration, so if you switch between Win32, x64 or ARM &#8211; you need to reenter these, so you should probably switch between all configurations and set these for all of them now.
</p>
<p>
d2d1.lib; d3d11.lib; dxgi.lib; ole32.lib; windowscodecs.lib; dwrite.lib; %(AdditionalDependencies)
</p>
<p><a href="http://labs.vectorform.com/?attachment_id=2169" rel="attachment wp-att-2169"><img src="http://labs.vectorform.com/wp-content/uploads/2012/05/BasicD2DAppProperties.png" alt="" width="600" height="426" class="alignleft size-full wp-image-2169" /></a></p>
<p>
The second step is to copy the header file includes from the template DX app pch into your project&#8217;s pch file.<br />
Finally, copy the Direct3DBase and DirectXHelper files into the library and we are ready to do some coding. <strong>Note</strong> that copying and pasting between C++ projects in the Solution Explorer works differently than with say C#. If you do it for files in a C# project &#8211; they get copied between projects. If you do it for C++ &#8211; they only get referenced in another project, so make sure you don&#8217;t do it and delete a temporary project! You can instead just copy the files in Windows Explorer and add them to the project after making the copy outside.</p>
<h2>Creating Direct2DBaseForComposition</h2>
<p>
Add a new class to the project called Direct2DBaseForComposition &#8211; you can do it by pressing Alt+Shift+C in the Solution Explorer. The class will derive from DirectXBase and will hook up to the SwapChainBackgroundPanel instead of the CoreWindow in the way described in the <a href="http://msdn.microsoft.com/en-us/library/windows/apps/hh825871.aspx" title="MSDN article" target="_blank">MSDN article</a>, so we&#8217;ll need to hide the version of the Initialize method that only takes a CoreWindow reference and add one that takes a SwapChainBackgroundPanel, save the native interface to the panel,  modify the swap chain initialization to set its dimensions based on panel size and set scaling to DXGI_SCALING_STRETCH,  replace the CreateSwapChainForCoreWindow call with one for CreateSwapChainForComposition, hook up the swap chain to the swap chain panel and finally override the Present() method to call the version of the Initialize() method that takes the swap chain panel when the device gets reset.
</p>
<p>
<pre class="brush: cpp;">
#pragma once
#include &quot;DirectXBase.h&quot;
#include &quot;windows.ui.xaml.media.dxinterop.h&quot;

ref class Direct2DBaseForComposition abstract
    : public DirectXBase
{
public:
    Direct2DBaseForComposition(void);
    ~Direct2DBaseForComposition(void);

public:
	virtual void CreateWindowSizeDependentResources() override;
	virtual void Initialize(Windows::UI::Core::CoreWindow^ window) override;
	void Initialize(
		_In_ Windows::UI::Core::CoreWindow^ window,
		_In_ Windows::UI::Xaml::Controls::SwapChainBackgroundPanel^ swapChainPanel);
	virtual void Present() override;

private:
	Microsoft::WRL::ComPtr&lt;ISwapChainBackgroundPanelNative&gt;   m_swapChainNative;
	Windows::UI::Xaml::Controls::SwapChainBackgroundPanel^    m_swapChainPanel;
};

</pre>
</p>
<p><strong>Direct2DBaseForComposition.cpp</strong></p>
<p>
<pre class="brush: cpp;">
#include &quot;pch.h&quot;
#include &quot;Direct2DBaseForComposition.h&quot;

using namespace Microsoft::WRL;
using namespace Windows::ApplicationModel;
using namespace Windows::ApplicationModel::Core;
using namespace Windows::ApplicationModel::Activation;
using namespace Windows::UI::Core;
using namespace Windows::System;
using namespace Windows::Foundation;
using namespace Windows::Graphics::Display;
using namespace D2D1;

Direct2DBaseForComposition::Direct2DBaseForComposition(void)
{
}


Direct2DBaseForComposition::~Direct2DBaseForComposition(void)
{
}

void Direct2DBaseForComposition::Initialize(
	_In_ Windows::UI::Core::CoreWindow^ window)
{
    // Can't reduce visibility of a ref class method in a subclass
	throw Platform::Exception::CreateException(
		1 &lt;&lt; 31 | FACILITY_ITF &lt;&lt; 16 | 1);
		//ref new Platform::String(L&quot;This method is not supported. Use the other overload.&quot;));
}

void Direct2DBaseForComposition::Initialize(
	_In_ Windows::UI::Core::CoreWindow^ window,
	_In_ Windows::UI::Xaml::Controls::SwapChainBackgroundPanel^ swapChainPanel)
{
	m_swapChainPanel = swapChainPanel;

	IInspectable* panelInspectable =
		(IInspectable*) reinterpret_cast&lt;IInspectable*&gt;(
			swapChainPanel);
	panelInspectable-&gt;QueryInterface(
		__uuidof(ISwapChainBackgroundPanelNative),
		(void **)&amp;m_swapChainNative);

	DirectXBase::Initialize(window);
}

// Allocate all memory resources that change on a window SizeChanged event.
void Direct2DBaseForComposition::CreateWindowSizeDependentResources()
{ 
    // Store the window bounds so the next time we get a SizeChanged event we can
    // avoid rebuilding everything if the size is identical.
    m_windowBounds = m_window-&gt;Bounds;

    // If the swap chain already exists, resize it.
    if(m_swapChain != nullptr)
    {
        DX::ThrowIfFailed(
            m_swapChain-&gt;ResizeBuffers(2, 0, 0, DXGI_FORMAT_B8G8R8A8_UNORM, 0)
            );
    }
    // Otherwise, create a new one.
    else
    {
        // Create a descriptor for the swap chain.
        DXGI_SWAP_CHAIN_DESC1 swapChainDesc = {0};
		swapChainDesc.Width = (UINT)m_windowBounds.Width;
		swapChainDesc.Height = (UINT)m_windowBounds.Height;
        swapChainDesc.Format = DXGI_FORMAT_B8G8R8A8_UNORM;           // this is the most common swapchain format
        swapChainDesc.Stereo = false; 
        swapChainDesc.SampleDesc.Count = 1;                          // don't use multi-sampling
        swapChainDesc.SampleDesc.Quality = 0;
        swapChainDesc.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT;
        swapChainDesc.BufferCount = 2;                               // use double buffering to enable flip
        swapChainDesc.Scaling = DXGI_SCALING_STRETCH;
        swapChainDesc.SwapEffect = DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL; // we recommend using this swap effect for all applications
        swapChainDesc.Flags = 0;

        // Once the desired swap chain description is configured, it must be created on the same adapter as our D3D Device

        // First, retrieve the underlying DXGI Device from the D3D Device.
        ComPtr&lt;IDXGIDevice1&gt; dxgiDevice;
        DX::ThrowIfFailed(
            m_d3dDevice.As(&amp;dxgiDevice)
            );

        // Identify the physical adapter (GPU or card) this device is running on.
        ComPtr&lt;IDXGIAdapter&gt; dxgiAdapter;
        DX::ThrowIfFailed(
            dxgiDevice-&gt;GetAdapter(&amp;dxgiAdapter)
            );

        // And obtain the factory object that created it.
        ComPtr&lt;IDXGIFactory2&gt; dxgiFactory;
        DX::ThrowIfFailed(
            dxgiAdapter-&gt;GetParent(
                __uuidof(IDXGIFactory2), 
                &amp;dxgiFactory
                )
            );

		// Create a swap chain for this window from the DXGI factory.
		DX::ThrowIfFailed(
			dxgiFactory-&gt;CreateSwapChainForComposition(
				m_d3dDevice.Get(),
				&amp;swapChainDesc,
				nullptr,    // allow on all displays
				&amp;m_swapChain
				)
			);

        m_swapChainNative-&gt;SetSwapChain(m_swapChain.Get());

        // Ensure that DXGI does not queue more than one frame at a time. This both reduces 
        // latency and ensures that the application will only render after each VSync, minimizing 
        // power consumption.
        DX::ThrowIfFailed(
            dxgiDevice-&gt;SetMaximumFrameLatency(1)
            );

    }

    // Obtain the backbuffer for this window which will be the final 3D rendertarget.
    ComPtr&lt;ID3D11Texture2D&gt; backBuffer;
    DX::ThrowIfFailed(
        m_swapChain-&gt;GetBuffer(
            0,
            __uuidof(ID3D11Texture2D),
            &amp;backBuffer
            )
        );

    // Create a view interface on the rendertarget to use on bind.
    DX::ThrowIfFailed(
        m_d3dDevice-&gt;CreateRenderTargetView(
            backBuffer.Get(),
            nullptr,
            &amp;m_renderTargetView
            )
        );

    // Cache the rendertarget dimensions in our helper class for convenient use.
    D3D11_TEXTURE2D_DESC backBufferDesc = {0};
    backBuffer-&gt;GetDesc(&amp;backBufferDesc);
    m_renderTargetSize.Width  = static_cast&lt;float&gt;(backBufferDesc.Width);
    m_renderTargetSize.Height = static_cast&lt;float&gt;(backBufferDesc.Height);

    // Create a descriptor for the depth/stencil buffer.
    CD3D11_TEXTURE2D_DESC depthStencilDesc(
        DXGI_FORMAT_D24_UNORM_S8_UINT, 
        backBufferDesc.Width,
        backBufferDesc.Height,
        1,
        1,
        D3D11_BIND_DEPTH_STENCIL
        );

    // Allocate a 2-D surface as the depth/stencil buffer.
    ComPtr&lt;ID3D11Texture2D&gt; depthStencil;
    DX::ThrowIfFailed(
        m_d3dDevice-&gt;CreateTexture2D(
            &amp;depthStencilDesc,
            nullptr,
            &amp;depthStencil
            )
        );

    // Create a DepthStencil view on this surface to use on bind.
    DX::ThrowIfFailed(
        m_d3dDevice-&gt;CreateDepthStencilView(
            depthStencil.Get(),
            &amp;CD3D11_DEPTH_STENCIL_VIEW_DESC(D3D11_DSV_DIMENSION_TEXTURE2D),
            &amp;m_depthStencilView
            )
        );

    // Create a viewport descriptor of the full window size.
    CD3D11_VIEWPORT viewport(
        0.0f,
        0.0f,
        static_cast&lt;float&gt;(backBufferDesc.Width),
        static_cast&lt;float&gt;(backBufferDesc.Height)
        );

    // Set the current viewport using the descriptor.
    m_d3dContext-&gt;RSSetViewports(1, &amp;viewport);

    // Now we set up the Direct2D render target bitmap linked to the swapchain. 
    // Whenever we render to this bitmap, it will be directly rendered to the 
    // swapchain associated with the window.
    D2D1_BITMAP_PROPERTIES1 bitmapProperties = 
        BitmapProperties1(
            D2D1_BITMAP_OPTIONS_TARGET | D2D1_BITMAP_OPTIONS_CANNOT_DRAW,
            PixelFormat(DXGI_FORMAT_B8G8R8A8_UNORM, D2D1_ALPHA_MODE_PREMULTIPLIED),
            m_dpi,
            m_dpi
            );

    // Direct2D needs the dxgi version of the backbuffer surface pointer.
    ComPtr&lt;IDXGISurface&gt; dxgiBackBuffer;
    DX::ThrowIfFailed(
        m_swapChain-&gt;GetBuffer(
            0,
            __uuidof(IDXGISurface),
            &amp;dxgiBackBuffer
            )
        );

    // Get a D2D surface from the DXGI back buffer to use as the D2D render target.
    DX::ThrowIfFailed(
        m_d2dContext-&gt;CreateBitmapFromDxgiSurface(
            dxgiBackBuffer.Get(),
            &amp;bitmapProperties,
            &amp;m_d2dTargetBitmap
            )
        );

    // So now we can set the Direct2D render target.
    m_d2dContext-&gt;SetTarget(m_d2dTargetBitmap.Get());

    // Set D2D text anti-alias mode to Grayscale to ensure proper rendering of text on intermediate surfaces.
    m_d2dContext-&gt;SetTextAntialiasMode(D2D1_TEXT_ANTIALIAS_MODE_GRAYSCALE);
}

// Method to deliver the final image to the display.
void Direct2DBaseForComposition::Present()
{
    // The first argument instructs DXGI to block until VSync, putting the application
    // to sleep until the next VSync. This ensures we don't waste any cycles rendering
    // frames that will never be displayed to the screen.
    HRESULT hr = m_swapChain-&gt;Present(1, 0);

    // If the device was removed either by a disconnect or a driver upgrade, we 
    // must completely reinitialize the renderer.
    if (hr == DXGI_ERROR_DEVICE_REMOVED || hr == DXGI_ERROR_DEVICE_RESET)
    {
        Initialize(m_window, m_swapChainPanel);
    }
    else
    {
        DX::ThrowIfFailed(hr);
    }
}
</pre>
</p>
<h2>Adding the Rendering Code</h2>
<p>
The BasicDirect2DApplication I created earlier has four overrides to DirectXBase class that call back to the base class and then create resources for rendering or do the rendering. We will create another class derived from Direct2DBaseForComposition that will do the same, but call back to Direct2DBaseForComposition in the overrides instead of  DirectXBase.
</p>
<p><strong>SampleD2DRenderer.h</strong></p>
<p>
<pre class="brush: cpp;">
#pragma once
#include &quot;Direct2DBaseForComposition.h&quot;

ref class SampleD2DRenderer
    : public Direct2DBaseForComposition
{
public:
    SampleD2DRenderer(void);
    ~SampleD2DRenderer(void);

    // DirectXBase Methods
    virtual void CreateDeviceIndependentResources() override;
    virtual void CreateDeviceResources() override;
    virtual void CreateWindowSizeDependentResources() override;
    virtual void Render() override;

private:
    Microsoft::WRL::ComPtr&lt;ID2D1SolidColorBrush&gt; m_solidBrush;
    Microsoft::WRL::ComPtr&lt;IDWriteTextFormat&gt; m_textFormat;
    Microsoft::WRL::ComPtr&lt;IDWriteTextLayout&gt; m_textLayout;
};
</pre>
</p>
<p><strong>SampleD2DRenderer.cpp</strong></p>
<p>
<pre class="brush: cpp;">
#include &quot;pch.h&quot;
#include &quot;SampleD2DRenderer.h&quot;


SampleD2DRenderer::SampleD2DRenderer(void)
{
}


SampleD2DRenderer::~SampleD2DRenderer(void)
{
}

void SampleD2DRenderer::CreateDeviceIndependentResources()
{
    Direct2DBaseForComposition::CreateDeviceIndependentResources();

    // Create a DirectWrite text format object.
    DX::ThrowIfFailed(
        m_dwriteFactory-&gt;CreateTextFormat(
            L&quot;Gabriola&quot;,
            NULL,
            DWRITE_FONT_WEIGHT_REGULAR,
            DWRITE_FONT_STYLE_NORMAL,
            DWRITE_FONT_STRETCH_NORMAL,
            64.0f,
            L&quot;en-US&quot;, // Locale
            &amp;m_textFormat
            )
        );

    // Center the text horizontally and vertically.
    m_textFormat-&gt;SetTextAlignment(DWRITE_TEXT_ALIGNMENT_CENTER);
    m_textFormat-&gt;SetParagraphAlignment(DWRITE_PARAGRAPH_ALIGNMENT_CENTER);
}

void SampleD2DRenderer::CreateDeviceResources()
{
    Direct2DBaseForComposition::CreateDeviceResources();

    DX::ThrowIfFailed(
        m_d2dContext-&gt;CreateSolidColorBrush(
            D2D1::ColorF(D2D1::ColorF::MidnightBlue),
            &amp;m_solidBrush
            )
        );
}

void SampleD2DRenderer::CreateWindowSizeDependentResources()
{
    Direct2DBaseForComposition::CreateWindowSizeDependentResources();

    const wchar_t* text = L&quot;Hello, Direct2D!&quot;;

    // Create a DirectWrite Text Layout object.
    DX::ThrowIfFailed(
        m_dwriteFactory-&gt;CreateTextLayout(
            text,                           // Text to be displayed
            wcslen(text),                   // Length of the text
            m_textFormat.Get(),             // DirectWrite Text Format object
            m_renderTargetSize.Width,       // Width of the Text Layout
            m_renderTargetSize.Height,      // Height of the Text Layout
            &amp;m_textLayout
            )
        );

    // Create a text range corresponding to the entire string.
    DWRITE_TEXT_RANGE textRange = {0};
    textRange.length = wcslen(text);
    textRange.startPosition = 0;

    // Set the font size and weight on the text range.
    m_textLayout-&gt;SetFontSize(100.f, textRange);
    m_textLayout-&gt;SetFontWeight(DWRITE_FONT_WEIGHT_BOLD, textRange);
}

void SampleD2DRenderer::Render()
{
    m_d2dContext-&gt;BeginDraw();

    m_d2dContext-&gt;Clear(D2D1::ColorF(D2D1::ColorF::CornflowerBlue));
    m_d2dContext-&gt;SetTransform(D2D1::Matrix3x2F::Identity());

    m_d2dContext-&gt;DrawTextLayout(
        D2D1::Point2F(0.0f, 0.0f),
        m_textLayout.Get(),
        m_solidBrush.Get()
        );

    HRESULT hr = m_d2dContext-&gt;EndDraw();

    if (hr == D2DERR_RECREATE_TARGET)
    {
        m_d2dContext-&gt;SetTarget(nullptr);
        m_d2dTargetBitmap = nullptr;
        CreateWindowSizeDependentResources();
    }
    else
    {
        DX::ThrowIfFailed(hr);
    }
}
</pre>
</p>
<h2>Interface For a Xaml App</h2>
<p>
I had problems exposing a SwapChainBackgroundPanel class implementation to a C#-based XAML app, so I leave that to be implemented in the app itself. WinRT components can&#8217;t expose derived ref classes across ABI boundaries, so a C++ library can&#8217;t have public derived classes for use in a C# application directly, but we can create a sort of proxy class that will simply relay the calls to our SampleD2DRenderer. The class needs to be a public ref sealed class defined in a namespace, like this:
</p>
<p><strong>SampleD2DRendererProxy.h</strong></p>
<p>
<pre class="brush: cpp;">
#pragma once
#include &quot;SampleD2DRenderer.h&quot;

namespace D2DRenderer
{
    public ref class SampleD2DRendererProxy sealed
    {
    public:
        SampleD2DRendererProxy(void);
        ~SampleD2DRendererProxy(void);
 
		void Initialize(
			_In_ Windows::UI::Core::CoreWindow^ window,
			_In_ Windows::UI::Xaml::Controls::SwapChainBackgroundPanel^ swapChainPanel);
		void Render();
		void Present();
		void UpdateForWindowSizeChange();

	private:
		SampleD2DRenderer^ m_renderer;
    };
}
</pre>
</p>
<p><strong>SampleD2DRendererProxy.cpp</strong></p>
<p>
<pre class="brush: cpp;">
#include &quot;pch.h&quot;
#include &quot;SampleD2DRendererProxy.h&quot;

namespace D2DRenderer
{
    SampleD2DRendererProxy::SampleD2DRendererProxy(void)
    {
    }


    SampleD2DRendererProxy::~SampleD2DRendererProxy(void)
    {
    }

	void SampleD2DRendererProxy::Initialize(
		_In_ Windows::UI::Core::CoreWindow^ window,
		_In_ Windows::UI::Xaml::Controls::SwapChainBackgroundPanel^ swapChainPanel)
	{
        this-&gt;m_renderer = ref new SampleD2DRenderer();
		this-&gt;m_renderer-&gt;Initialize(window, swapChainPanel);
	}

	void SampleD2DRendererProxy::Render()
	{
		this-&gt;m_renderer-&gt;Render();
	}

	void SampleD2DRendererProxy::Present()
	{
		this-&gt;m_renderer-&gt;Present();
	}

	void SampleD2DRendererProxy::UpdateForWindowSizeChange()
	{
		this-&gt;m_renderer-&gt;UpdateForWindowSizeChange();
	}
}
</pre>
</p>
<h2>Hooking It Up To The App</h2>
<p>
The last step is to just use all this in your XAML app.  Start by creating any type of C# XAML App. You need to add a class that will be your SwapChainBackgroundPanel implementation like this:
</p>
<p>
<pre class="brush: csharp;">
using D2DRenderer;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Media;

namespace SampleD2DXamlAppCSharp
{
    public class MyD2DSwapChainPanel
        : SwapChainBackgroundPanel
    {
        bool _isInitialized;
        SampleD2DRendererProxy _renderer;

        public MyD2DSwapChainPanel()
        {
            CompositionTarget.Rendering += CompositionTarget_Rendering;
            this.SizeChanged += OnSizeChanged;
        }

        private void OnSizeChanged(object sender, SizeChangedEventArgs e)
        {
            if (this.ActualWidth == 0 ||
                this.ActualHeight == 0)
            {
                return;
            }

            if (!_isInitialized)
            {
                _renderer = new SampleD2DRendererProxy();
                _renderer.Initialize(
                    Window.Current.CoreWindow,
                    this);

                _isInitialized = true;
            }
            else
            {
                _renderer.UpdateForWindowSizeChange();
            }
        }

        void CompositionTarget_Rendering(object sender, object e)
        {
            if (_isInitialized)
            {
                _renderer.Render();
                _renderer.Present();
            }
        }
    }
}
</pre>
</p>
<p>
The panel needs to be at the root of the visual tree of your application, and it is a subclass of the Grid class, so you can modify the OnLaunched() initialization code in your App.xaml.cs to make the navigation Frame class hosted in the panel:
</p>
<p>
<pre class="brush: csharp;">
var rootFrame = new Frame();
rootFrame.Navigate(typeof(GroupedItemsPage), sampleData.ItemGroups);

var dxPanel = new MyD2DSwapChainPanel();
dxPanel.Children.Add(rootFrame);
Window.Current.Content = dxPanel;
Window.Current.Activate();
</pre>
</p>
<p>
That&#8217;s about it, but if I run the app now&#8230;
</p>
<h2>I Can&#8217;t See Anything!</h2>
<p>
Well, by default the layout root grid of each page has a background set to {StaticResource ApplicationPageBackgroundBrush} which is opaque black &#8211; you need to change it to Transparent or remove it altogether and that will let you see what Direct2D renders underneath. It also helps to modify opacity of some foreground UI elements to be able to see more of our gorgeous Direc2D background.
</p>
<p>
<a href="http://labs.vectorform.com/?attachment_id=2198" rel="attachment wp-att-2198"><img src="http://labs.vectorform.com/wp-content/uploads/2012/05/SampleD2DXamlAppCSharp.png" alt="" width="600" height="480" class="aligncenter size-full wp-image-2198" /></a>
</p>
<h2>Give Me The Codez!</h2>
<p>
You can grab the full code from <a href="http://bit.ly/DirectXInterop" title="source code" target="_blank">here</a>.</p>
<h2>To Be Continued…</h2>
<p>
The next post will show how to do the same thing for Direct3D.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/xyzzer.wordpress.com/606/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/xyzzer.wordpress.com/606/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/xyzzer.wordpress.com/606/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/xyzzer.wordpress.com/606/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/xyzzer.wordpress.com/606/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/xyzzer.wordpress.com/606/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/xyzzer.wordpress.com/606/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/xyzzer.wordpress.com/606/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/xyzzer.wordpress.com/606/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/xyzzer.wordpress.com/606/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/xyzzer.wordpress.com/606/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/xyzzer.wordpress.com/606/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/xyzzer.wordpress.com/606/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/xyzzer.wordpress.com/606/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.xyzzer.me&#038;blog=13393480&#038;post=606&#038;subd=xyzzer&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.xyzzer.me/2012/05/25/creating-directx-interop-libraries-for-xaml-metro-style-apps-part-1-direct2d/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9f4153be2cf81e0b6656e2761898ecfa?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">xyzzer</media:title>
		</media:content>

		<media:content url="http://labs.vectorform.com/wp-content/uploads/2012/05/XIsForXAML.png" medium="image" />

		<media:content url="http://labs.vectorform.com/wp-content/uploads/2012/05/BasicD2DAppStructure.png" medium="image" />

		<media:content url="http://labs.vectorform.com/wp-content/uploads/2012/05/BasicD3DAppStructure.png" medium="image" />

		<media:content url="http://labs.vectorform.com/wp-content/uploads/2012/05/BasicD2DAppProperties.png" medium="image" />

		<media:content url="http://labs.vectorform.com/wp-content/uploads/2012/05/SampleD2DXamlAppCSharp.png" medium="image" />
	</item>
		<item>
		<title>WinRT XAML Toolkit is Growing</title>
		<link>http://blog.xyzzer.me/2012/04/27/winrt-xaml-toolkit-is-growing/</link>
		<comments>http://blog.xyzzer.me/2012/04/27/winrt-xaml-toolkit-is-growing/#comments</comments>
		<pubDate>Fri, 27 Apr 2012 16:12:48 +0000</pubDate>
		<dc:creator>xyzzer</dc:creator>
				<category><![CDATA[Computers and Internet]]></category>
		<category><![CDATA[async/await]]></category>
		<category><![CDATA[AsyncUI]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[WinRT]]></category>
		<category><![CDATA[WriteableBitmap]]></category>
		<category><![CDATA[WriteableBitmapEx]]></category>
		<category><![CDATA[XAML]]></category>

		<guid isPermaLink="false">http://blog.xyzzer.me/?p=594</guid>
		<description><![CDATA[Updated WinRT XAML Toolkit on CodePlex &#8211; a set of controls, extensions and helper classes for Windows Runtime XAML applications Features A copy of the AsyncUI library &#8211; a set of extension methods for UI classes that add support for &#8230; <a href="http://blog.xyzzer.me/2012/04/27/winrt-xaml-toolkit-is-growing/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.xyzzer.me&#038;blog=13393480&#038;post=594&#038;subd=xyzzer&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div style="font-family:Calibri;">
<p>Updated <a href="http://bit.ly/WinRTXamlToolkit" title="WinRT XAML Toolkit" target="_blank">WinRT XAML Toolkit</a> on CodePlex &#8211; a set of controls, extensions and helper classes for Windows Runtime XAML applications</p>
<p><strong>Features</strong></p>
<p><span id="more-594"></span></p>
<ul>
<li>A copy of the <strong><a href="http://asyncui.codeplex.com/">AsyncUI library</a></strong> &#8211; a set of extension methods for UI classes that add support for async/await to wait for events such as:
<ul>
<li>Wait for a BitmapImage to load</li>
<li>Wait for a Button or one of a list of buttons to be clicked</li>
<li>Wait for a FrameworkElement to load, unload or become non-zero-sized</li>
<li>Wait for a MediaElement to change state &#8211; eg. to start or finish playback</li>
<li>Wait for a Selector (e.g. ListBox) to change selected item</li>
<li>Wait for a Storyboard to complete</li>
</ul>
</li>
<li><strong>Controls</strong>
<ul>
<li><strong>AnimationHelper</strong> &#8211; two attached properties &#8211; Storyboard and IsPlaying. Allows to easily control Storyboard playback from a view model (note limitation &#8211; a single storyboard per control).</li>
<li><strong>AnimatingContainer</strong> &#8211; a container control that will animate its contents rotating or zooming in/out, eg. to make them feel more alive</li>
<li><strong>CameraCaptureControl</strong> &#8211; <em>under development</em> &#8211; currently supports displaying camera preview &#8211; ultimately it will look and work much like a regular CameraCaptureUI interface, but embeddable inside of your application UI layout</li>
<li><strong>CascadingTextBlock</strong> &#8211; a TextBlock replacement that animates the individual letters in a cascade &#8211; fading in while falling down into position, then optionally fading out while falling down from the standard position</li>
<li><strong>ControlExtensions.Cursor</strong> &#8211; enables setting a mouse cursor to show when hovering over a control</li>
<li><strong>CountdownControl</strong> &#8211; a movie-style control that animates a ring-slice shape while counting down seconds &#8211; e.g. to take a picture with a camera after a given number of seconds (supports async/await)</li>
<li><strong>CustomAppBar</strong> &#8211; a custom implementation of the AppBar that automatically handles the three gestures to switch IsOpen (WinKey+Z, Right-Click, EdgeGesture), adds a CanOpen property, so you can prevent it from opening and opens/hides with a sliding animation when placed anywhere in the app, so you can layer content on top of it</li>
<li><strong>CustomGridSplitter</strong> &#8211; a custom implementation of a GridSplitter</li>
<li><strong>DelayedLoadControl</strong> &#8211; given a content/DataTemplate &#8211; loads the contents after a given amount of time &#8211; e.g. to allow for staged loading of contents on screen</li>
<li><strong>InputDialog</strong> &#8211; a dialog control that takes text input</li>
<li><strong>ListBoxExtensions./ListViewExtensions.BindableSelection</strong> &#8211; allows a two-way binding of the SelectedItems collection on the Selector/list controls</li>
<li><strong>ListItemButton</strong> &#8211; a simple button control with Click event and Command property to be used inside of list controls (the standard button steals pointer capture from the List/Grid~Items so they can&#8217;t be selected</li>
<li><strong>PieSlice</strong> &#8211; a pie slice path/shape given StartAngle, EndAngle and Radius</li>
<li><strong>RingSlice</strong> &#8211; a pie slice path/shape given StartAngle, EndAngle, Radius and InnerRadius</li>
<li><strong>RichTextBlockExtensions.PlainText</strong> &#8211; attached property that allows to easily single-way-bind plain text to a RichTextBlock (not really that useful other than for visualizing RichTextBlock styles in the sample app provided)</li>
<li><strong>TextBlockExtensions/GetCharacterRect()</strong> &#8211; an extension method that returns a rectangle that holds a character at a given index in the TextBlock</li>
</ul>
</li>
<li><strong>Conterters</strong>
<ul>
<li><strong>BooleanToDataTemplateConverter</strong> &#8211; given two DataTemplates (TrueTemplate and FalseTemplate) &#8211; converts the input value to the given template. A different take on DataTemplateSelector.</li>
</ul>
</li>
<li><strong>Extensions</strong>
<ul>
<li><strong>WriteableBitmap</strong> &#8211; a set of extension methods for a WriteableBitmap
<ul>
<li><strong>ColorExtensions</strong> &#8211; Conversions between pixels and pixel buffer types of byte, int and Color</li>
<li><strong>IBufferExtensions</strong> &#8211; Adds a GetPixels() extension method to the PixelBuffer property of a WriteableBitmap that reads in the buffer to a byte array and exposes an indexer compatible to the one of the Pixels property in Silverlight&#8217;s WriteableBitmap</li>
<li><strong>WriteableBitmapSaveExtensions</strong> &#8211; support for loading and saving the bitmap to/from files</li>
<li><strong>WriteableBitmapBlitBlockExtensions</strong> &#8211; support for quick blitting of a full-width section of a bitmap to another bitmap of same width</li>
<li><strong>WriteableBitmapCopyExtensions</strong> &#8211; support creating a copy of a WriteableBitmap</li>
<li><strong>WriteableBitmapCropExtensions</strong> &#8211; support for creating a cropped version of a WriteableBitmap</li>
<li><strong>WriteableBitmapFloodFillExtensions</strong> &#8211; support for flood-filling a region of a WriteableBitmap &#8211; either limited by an outline color or by replacing a given color &#8211; usually a color at the starting position or colors similar to it</li>
</ul>
</li>
<li><strong>Serialization</strong>
<ul>
<li><strong>JsonSerialization</strong> &#8211; allows to serialize a properly DataContract-annotated object to a JSON string or file or deserialize an existing one.</li>
<li><strong>XmlSerialization</strong> &#8211; allows to serialize a properly DataContract- or XmlSerializer-annotated object to a XML string or file or deserialize an existing one.</li>
</ul>
</li>
<li><strong>StringIOExtensions</strong> &#8211; allows to easily read or write a string from/to file in a single call</li>
</ul>
</li>
<li><strong>VisualTree helpers</strong>
<ul>
<li><strong>VisualTreeDebugger</strong> &#8211; provides a trace of the visual tree structure when a control loads, its layout updates or it gets tapped as well as allowing the application to break in the debugger if one of these events occurs</li>
<li><strong>VisualTreeHelperExtensions</strong> &#8211; provides a set of extension methods that enumerate visual tree ascendants/descendants of a given control &#8211; making it easy to do these operations with LINQ as well as simple ways to list controls of a given type or find the first control of a given type searching up or down the visual tree</li>
</ul>
</li>
</ul>
<p><strong>Work in Progress</strong><br />The libraries are just a set of helper methods and controls that I found useful to fill the gaps in Windows Runtime XAML framework and continues to evolve.</p>
<p><strong>Likely Additions</strong></p>
<ul>
<li><strong>TransitionFrame</strong> &#8211; something similar to the one from the Silverlight Toolkit &#8211; to get nicer transitions when switching between pages.</li>
<li><strong>Pivot</strong> control &#8211; analogous to a Pivot control on Windows Phone or a TabControl in WPF.</li>
</ul>
<p><strong>Similar Projects</strong></p>
<ul>
<li><a href="https://twitter.com/#!/timheuer">Tim Heuer&#8217;s</a> and <a href="http://twitter.com/dotmorten">Morten Nielsen&#8217;s</a> <a href="https://github.com/timheuer/callisto/tree/master/src/Callisto">Callisto</a> &#8211; contains a host of controls (DateTimePicker, Flyout, LiveTile, Menu, SettingsFlyout), converters, Tilt Effect, OAuth helper, SQLite connection helper, etc.</li>
</ul>
</div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/xyzzer.wordpress.com/594/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/xyzzer.wordpress.com/594/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/xyzzer.wordpress.com/594/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/xyzzer.wordpress.com/594/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/xyzzer.wordpress.com/594/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/xyzzer.wordpress.com/594/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/xyzzer.wordpress.com/594/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/xyzzer.wordpress.com/594/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/xyzzer.wordpress.com/594/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/xyzzer.wordpress.com/594/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/xyzzer.wordpress.com/594/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/xyzzer.wordpress.com/594/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/xyzzer.wordpress.com/594/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/xyzzer.wordpress.com/594/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.xyzzer.me&#038;blog=13393480&#038;post=594&#038;subd=xyzzer&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.xyzzer.me/2012/04/27/winrt-xaml-toolkit-is-growing/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9f4153be2cf81e0b6656e2761898ecfa?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">xyzzer</media:title>
		</media:content>
	</item>
		<item>
		<title>XAML Spy</title>
		<link>http://blog.xyzzer.me/2012/04/20/xaml-spy-4/</link>
		<comments>http://blog.xyzzer.me/2012/04/20/xaml-spy-4/#comments</comments>
		<pubDate>Fri, 20 Apr 2012 16:27:17 +0000</pubDate>
		<dc:creator>xyzzer</dc:creator>
				<category><![CDATA[Computers and Internet]]></category>
		<category><![CDATA[Windows Phone;Silverlight;WinRT;XAML]]></category>

		<guid isPermaLink="false">http://blog.xyzzer.me/?p=587</guid>
		<description><![CDATA[A while back I blogged about Debugging visual tree/layout issues in Silverlight and on Windows Phone. My little helper library &#8211; the VisualTreeDebugger has been updated for WinRT and is available as part of the WinRT XAML Toolkit project that I have &#8230; <a href="http://blog.xyzzer.me/2012/04/20/xaml-spy-4/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.xyzzer.me&#038;blog=13393480&#038;post=587&#038;subd=xyzzer&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div style="font-family:Calibri;">
<p>A while back I blogged about <a title="Debugging visual tree/layout issues in Silverlight and on Windows Phone" href="http://blog.xyzzer.me/2011/10/30/debugging-visual-treelayout-issues-in-silverlight-and-on-windows-phone/" target="_blank">Debugging visual tree/layout issues in Silverlight and on Windows Phone</a>. My little helper library &#8211; the VisualTreeDebugger has been updated for WinRT and is available as part of the <a title="WinRT XAML Toolkit" href="http://winrtxamltoolkit.codeplex.com/" target="_blank">WinRT XAML Toolkit</a> project that I have been working on recently. I also mentioned that you could use <a title="Silverlight Spy" href="http://firstfloorsoftware.com/silverlightspy" target="_blank">Silverlight Spy</a> to debug your Windows Phone app, but it was not free. Well, now it seems like <a title="Koen Zwikstra" href="https://twitter.com/#!/kozw" target="_blank">Koen Zwikstra</a> has come up with a new version that, for a limited time, is free and it is called <a title="XAML Spy" href="http://xamlspy.com/" target="_blank">XAML Spy</a>. Grab it while you can!</p>
</div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/xyzzer.wordpress.com/587/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/xyzzer.wordpress.com/587/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/xyzzer.wordpress.com/587/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/xyzzer.wordpress.com/587/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/xyzzer.wordpress.com/587/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/xyzzer.wordpress.com/587/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/xyzzer.wordpress.com/587/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/xyzzer.wordpress.com/587/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/xyzzer.wordpress.com/587/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/xyzzer.wordpress.com/587/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/xyzzer.wordpress.com/587/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/xyzzer.wordpress.com/587/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/xyzzer.wordpress.com/587/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/xyzzer.wordpress.com/587/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.xyzzer.me&#038;blog=13393480&#038;post=587&#038;subd=xyzzer&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.xyzzer.me/2012/04/20/xaml-spy-4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9f4153be2cf81e0b6656e2761898ecfa?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">xyzzer</media:title>
		</media:content>
	</item>
		<item>
		<title>Microsoft Dev Camps &#8211; Free Events</title>
		<link>http://blog.xyzzer.me/2012/04/10/microsoft-dev-camps-free-events/</link>
		<comments>http://blog.xyzzer.me/2012/04/10/microsoft-dev-camps-free-events/#comments</comments>
		<pubDate>Tue, 10 Apr 2012 16:29:51 +0000</pubDate>
		<dc:creator>xyzzer</dc:creator>
				<category><![CDATA[Computers and Internet]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[Windows Phone]]></category>

		<guid isPermaLink="false">http://blog.xyzzer.me/?p=570</guid>
		<description><![CDATA[Got this E-Mail. Looks like an interesting addition to the Windows 8 Developer Camps I mentioned earlier.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.xyzzer.me&#038;blog=13393480&#038;post=570&#038;subd=xyzzer&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div style="font-family:Calibri;">Got this <a href="http://view.email.microsoftemail.com/?j=fe8f157672640d7f72&amp;m=fef41d767d6606&amp;ls=fe2c17757564037a7d1772&amp;l=fec21c767365017e&amp;s=fe221177706c0d79771475&amp;jb=ff69157070&amp;ju=fe5517707d61037e721d&amp;qstr=CR_CC=200090168&amp;CR_ID=169647049&amp;r=0" title="View E-Mail">E-Mail</a>. Looks like an interesting addition to the Windows 8 Developer Camps I <a href="http://blog.xyzzer.me/2012/03/03/windows-developer-camp-march-june-2012-usa-multiple-locations/">mentioned</a> earlier.</p>
<p><a href="http://xyzzer.files.wordpress.com/2012/04/devcamps.png"><img src="http://xyzzer.files.wordpress.com/2012/04/devcamps.png?w=640&h=1109" alt="" title="DevCamps" width="640" height="1109" class="alignnone size-full wp-image-572" /></a>
</div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/xyzzer.wordpress.com/570/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/xyzzer.wordpress.com/570/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/xyzzer.wordpress.com/570/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/xyzzer.wordpress.com/570/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/xyzzer.wordpress.com/570/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/xyzzer.wordpress.com/570/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/xyzzer.wordpress.com/570/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/xyzzer.wordpress.com/570/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/xyzzer.wordpress.com/570/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/xyzzer.wordpress.com/570/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/xyzzer.wordpress.com/570/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/xyzzer.wordpress.com/570/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/xyzzer.wordpress.com/570/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/xyzzer.wordpress.com/570/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.xyzzer.me&#038;blog=13393480&#038;post=570&#038;subd=xyzzer&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.xyzzer.me/2012/04/10/microsoft-dev-camps-free-events/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9f4153be2cf81e0b6656e2761898ecfa?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">xyzzer</media:title>
		</media:content>

		<media:content url="http://xyzzer.files.wordpress.com/2012/04/devcamps.png" medium="image">
			<media:title type="html">DevCamps</media:title>
		</media:content>
	</item>
		<item>
		<title>WinRT XAML Toolkit</title>
		<link>http://blog.xyzzer.me/2012/04/10/winrt-xaml-toolkit/</link>
		<comments>http://blog.xyzzer.me/2012/04/10/winrt-xaml-toolkit/#comments</comments>
		<pubDate>Tue, 10 Apr 2012 15:37:21 +0000</pubDate>
		<dc:creator>xyzzer</dc:creator>
				<category><![CDATA[Computers and Internet]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[WinRT]]></category>
		<category><![CDATA[XAML]]></category>

		<guid isPermaLink="false">http://blog.xyzzer.me/?p=568</guid>
		<description><![CDATA[There it is. No time to write about it or make it pretty, but you forced me to publish it, CodePlex, so there it is&#8230;. http://bit.ly/WinRTXamlToolkit<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.xyzzer.me&#038;blog=13393480&#038;post=568&#038;subd=xyzzer&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>There it is. No time to write about it or make it pretty, but you forced me to publish it, CodePlex, so there it is&#8230;.</p>
<p>http://bit.ly/WinRTXamlToolkit</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/xyzzer.wordpress.com/568/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/xyzzer.wordpress.com/568/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/xyzzer.wordpress.com/568/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/xyzzer.wordpress.com/568/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/xyzzer.wordpress.com/568/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/xyzzer.wordpress.com/568/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/xyzzer.wordpress.com/568/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/xyzzer.wordpress.com/568/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/xyzzer.wordpress.com/568/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/xyzzer.wordpress.com/568/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/xyzzer.wordpress.com/568/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/xyzzer.wordpress.com/568/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/xyzzer.wordpress.com/568/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/xyzzer.wordpress.com/568/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.xyzzer.me&#038;blog=13393480&#038;post=568&#038;subd=xyzzer&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.xyzzer.me/2012/04/10/winrt-xaml-toolkit/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9f4153be2cf81e0b6656e2761898ecfa?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">xyzzer</media:title>
		</media:content>
	</item>
		<item>
		<title>Impressions of Windows 8 Part 2 of 2</title>
		<link>http://blog.xyzzer.me/2012/04/03/impressions-of-windows-8-part-2-of-2/</link>
		<comments>http://blog.xyzzer.me/2012/04/03/impressions-of-windows-8-part-2-of-2/#comments</comments>
		<pubDate>Tue, 03 Apr 2012 11:30:04 +0000</pubDate>
		<dc:creator>xyzzer</dc:creator>
				<category><![CDATA[Computers and Internet]]></category>
		<category><![CDATA[Metro]]></category>
		<category><![CDATA[Metro Style Apps]]></category>
		<category><![CDATA[Opinion]]></category>
		<category><![CDATA[Speculation]]></category>
		<category><![CDATA[Tiles]]></category>
		<category><![CDATA[UI]]></category>
		<category><![CDATA[User Experience]]></category>
		<category><![CDATA[UX]]></category>
		<category><![CDATA[Windows 8]]></category>

		<guid isPermaLink="false">http://blog.xyzzer.me/?p=550</guid>
		<description><![CDATA[This is the second part of my impressions of Windows 8. You can read the previous part here. The Impressions Windows 8 and the Cloud Using Windows 8 on a Slate Using Windows 8 on a Laptop Using Windows 8 &#8230; <a href="http://blog.xyzzer.me/2012/04/03/impressions-of-windows-8-part-2-of-2/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.xyzzer.me&#038;blog=13393480&#038;post=550&#038;subd=xyzzer&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div style="font-family:Calibri;">
<a href="http://blog.xyzzer.me/?attachment_id=1962" rel="attachment wp-att-1962"><img src="http://labs.vectorform.com/wp-content/uploads/2012/04/Windows_8_logo.png" alt="" width="605" height="128" class="alignnone size-full wp-image-1962" /></a></p>
<p>This is the second part of my impressions of Windows 8. You can read the previous part <a href="http://labs.vectorform.com/2012/04/impressions-of-windows-8-part-1-of-2/">here</a>.</p>
<p><span id="more-550"></span></p>
<h2>The Impressions</h2>
<ol>
<li><a href="#cloud">Windows 8 and the Cloud</a></li>
<li><a href="#win8onslate">Using Windows 8 on a Slate</a></li>
<li><a href="#win8onlaptop">Using Windows 8 on a Laptop</a></li>
<li><a href="#win8ondesktop">Using Windows 8 on a Desktop</a></li>
<li><a href="#twoies">Desktop IE vs. Metro IE</a></li>
<li><a href="#frustrations">Frustrations of Being an Early Adopter</a></li>
</ol>
<p><em>Continue reading on <a href="http://labs.vectorform.com/2012/04/impressions-of-windows-8-part-2-of-2">http://labs.vectorform.com</a>&#8230;</em></p>
<p><!--more--></p>
<div style="display:none;">
<a href="http://blog.xyzzer.me/?attachment_id=1962" rel="attachment wp-att-1962"><img src="http://labs.vectorform.com/wp-content/uploads/2012/04/Windows_8_logo.png" alt="" width="605" height="128" class="alignnone size-full wp-image-1962" /></a></p>
<p>This is the second part of my impressions of Windows 8. You can read the previous part <a href="http://labs.vectorform.com/2012/04/impressions-of-windows-8-part-1-of-2/">here</a>.</p>
<p><!--more--></p>
<h2>The Impressions</h2>
<ol>
<li><a href="#cloud">Windows 8 and the Cloud</a></li>
<li><a href="#win8onslate">Using Windows 8 on a Slate</a></li>
<li><a href="#win8onlaptop">Using Windows 8 on a Laptop</a></li>
<li><a href="#win8ondesktop">Using Windows 8 on a Desktop</a></li>
<li><a href="#twoies">Desktop IE vs. Metro IE</a></li>
<li><a href="#frustrations">Frustrations of Being an Early Adopter</a></li>
</ol>
<p><a name="cloud"></a></p>
<h2>Windows 8 and the Cloud</h2>
<p><a href="http://www.flickr.com/photos/37567720@N05/7039000349/" title="Windows 8 in the Cloud by Filip Skakun, on Flickr"><img src="http://farm8.staticflickr.com/7137/7039000349_a3b5fd79d4.jpg" width="352" height="279" alt="Windows 8 in the Cloud"></a><br />&copy; <a href="http://twitter.com/xyzzer">Filip Skakun</a> 2012</p>
<p>Metro style apps are limited in their ability to access system resources such as files in arbitrary locations on the disk. This though has been mostly true for a while now, since Windows Vista introduced user access control. This is a good thing and makes managing your files easier, but it is also a stepping stone to the future in which we will increasingly rely on the cloud to store our files. Local disks will be used as application storage and local cache of the data we currently use or might need when offline, but what we already see in online backup and file sharing solutions like <a href="http://www.carbonite.com/en/">Carbonite</a>, <a href="http://www.apple.com/icloud/">iCloud</a>, the <a href="http://www.pcworld.com/article/252676/is_google_drive_coming_soon.html">rumored Google Drive</a>, <a href="http://www.dropbox.com">Dropbox</a> and <a href="http://www.skydrive.com">SkyDrive</a> — is bound to slowly become the primary copy of our data — secured from accidents, hardware failures and hackers better than our own devices while allowing to conveniently access our data from any device.</p>
<p>Windows 8 adds built-in user and developer support for SkyDrive integration. You can sign into Windows with your (Windows) Live account, which then automatically syncs your profile settings across all Windows 8 devices. Apps can easily use roaming settings that are synchronized between all the devices. Internet Explorer shows the same bookmarks for — again — all your devices. Your data travels with you everywhere taking away the pain of having to micromanage your documents, settings and any other data, and copying it back and forth. I can&#8217;t wait to dump all my backup drives, thumb drives and stop worrying about backing up and creating many copies of the same data on my phone, slate, laptop, desktop and XBOX, at home, in the office and on the road.</p>
<p><a name="win8onslate"></a></p>
<h2>Using Windows 8 on a Slate</h2>
<p><a href="http://www.flickr.com/photos/37567720@N05/7039000139/" title="My Windows 8 Workstation Setup - a Laptop and a Slate with Full-Size Keyboard, Mouse and HD Display by Filip Skakun, on Flickr"><img src="http://farm8.staticflickr.com/7214/7039000139_2252dd5c31_b.jpg" width="620" height="317" alt="My Windows 8 Workstation Setup - a Laptop and a Slate with Full-Size Keyboard, Mouse and HD Display"></a><br />&copy; <a href="http://twitter.com/xyzzer">Filip Skakun</a> 2012</p>
<p>The tablet I use is a custom version of the <a href="http://www.amazon.com/Samsung-XE700T1A-A03US-11-6-Inch-Slate-128/dp/B005OUQ9WO">Samsung Series 7 Slate</a> that was given out to developers by Microsoft at the <a href="http://www.buildwindows.com/">Build conference</a>. This is my work machine and I mostly use it with an external 24-inch monitor and a basic full size keyboard. It is slightly bigger than the iPad — at 11.6-inch vs. 9.7-inch and also a bit heavier and featuring a built-in fan. Not exactly an iPad competitor since it is about twice the price, but with my setup I can use it for developing apps on a big screen with all the peripherals I want to connect to it, and when needed I can just pick it up from the dock and use it the same way I would use an iPad. With smaller devices getting more powerful while the computing tasks have not become much more demanding since the popularization of video or HD video especially — I can easily imagine many people in the future might choose to use a Windows tablet that they can carry with them to do some lightweight computing or consumption and dock it anywhere when they need to do something more demanding like programming. This is not something that you can do today with an iPad and <a href="http://www.wp7connect.com/2011/09/15/reason-4585671-why-windows-8-is-better-than-the-ipad/">this popular photo</a> shows best how an iPad relates to a PC — being just an accessory. Windows tablets might get a lot better appeal as something that is not only a cool expensive gadget, but also a tool to be used for more serious tasks such as making money.</p>
<p>I have not had a chance to use the tablet much in slate scenarios that iPad rules today — mostly because this is a work machine and it sees majority of its use in developing and prototyping new Windows 8 apps but also because I am not a heavy iPad user. I really prefer to have a mouse and keyboard, ideally a full-sized one to use a computer comfortably. I use an iPad occasionally to play a game, check mail, or look at some other app when I am lying in bed or sitting on a couch and the iPad happens to be within reach. My iPad is mostly used by my kids and I can see great educational potential of such devices having seen my daughter who is beginning to read before turning four year old. I do not think the iPad is the main reason she is doing well, but I am sure it helps and similar devices will continue to help kids learn more quickly than was common when I was a kid. Windows 8 has great potential here. I think the user experience on the Windows tablet is better. The current selection of apps available is limited compared to iPad which had a head start, but this will change very quickly. There are thousands of apps available on iOS, but not so many of them are great and it is certain that most of the great apps will also come out for Windows 8 soon, possibly with improvements over their iOS or Android counterparts while new great apps will often start appearing on Windows first, since this is reportedly also an easier platform to develop for.</p>
<p>One area where Apple has ruled without much successful competition is hardware design. The iPad at prices starting at $399 and being most fashionable gadget today seems hard to beat having resisted the offensive of various crops of Android slates and only losing in lack of a cheap version under $200 where Android-based devices rule, but just as the iPhone seeing strong competition from Android-based phones, the iPad will not last forever as the only contender in the slate game. Just as we are beginning to see emergence of great Windows Phone devices such as the <a href="http://news.cnet.com/8301-1035_3-57404464-94/htc-titan-ii-officially-coming-to-at-t-april-8/">HTC Titan II</a> or the ($99!) <a href="http://news.cnet.com/8301-1035_3-57404235-94/at-t-to-sell-nokia-lumia-900-for-$100-on-april-8/?tag=mncol;txt">Nokia Lumia 900</a>, I think we might see competitive Windows 8 slate devices from Samsung or Nokia that might compete in price as well as design with the iPad while potentially also being full-featured desktop PC replacements, which cannot be said of the iPad.</p>
<p><a name="win8onlaptop"></a></p>
<h2>Using Windows 8 on a Laptop</h2>
<p><a href="http://www.flickr.com/photos/37567720@N05/6892904928/" title="Windows 8 on a Laptop by Filip Skakun, on Flickr"><img src="http://farm8.staticflickr.com/7253/6892904928_173be2a507_b.jpg" width="620" height="466" alt="Windows 8 on a Laptop"></a><br />&copy; <a href="http://twitter.com/xyzzer">Filip Skakun</a> 2012</p>
<p>My laptop is a now 1.5 year old Lenovo T410s with multi-touch screen, a 160GB SSD drive and 8GB RAM. Perhaps not a typical laptop due to the touch support, although possibly a much more common setup in the future when the touch-friendly Windows 8 gets released (I am keeping an eye out for the <a href="http://www.theverge.com/2012/1/9/2693650/lenovo-ideapad-yoga-a-windows-8-laptop-that-bends-backwards-into-a">Lenovo Yoga</a>, an ultrabook with a touchscreen that also converts to a tablet!). Installation of Windows 8 Consumer Preview on the laptop took around 10-15 minutes, so does upgrade from an older version which I am happy to see also kept all my installed applications and settings, which is great, since it usually takes me hours if not days to install all the software I use on a fresh install of Windows and I believe older versions of Windows were not able to port these over during upgrade.</p>
<p>Except for the previously mentioned 8s cold boot time, the system also resumes from sleep in under 2s, seems to manage battery better and run more quietly. There are no driver problems except for the missing touch input driver I talk about <a href="#frustrations">later</a> that should not be common since this is an uncommon type of device. Also, I expect Windows 8 to mostly be used on new devices while I also recommend trying to install it on older ones, since it brings so many improvements over Windows 7. Have I forgotten to mention Windows 8 also uses less memory? This means leaving more of it to applications, and practically lower hardware requirements than Windows 8 or Vista.</p>
<p>I do not use the touch screen much right now since without the proper driver it does not work too well, although I can vouch for the convenience of having a touch screen on a laptop. Any time I can&#8217;t find a mouse I can just touch the screen. Scrolling web pages with fingers is much more natural than scrolling with a mouse, so is browsing and consuming a lot of other types of documents and content. Drawing is easier with a finger than a mouse, so is navigating maps and&#8230; well, developing multi-touch software. It might also help reduce the risk of repetitive stress injuries if you often switch between different input devices depending on which one feels most comfortable at a particular time. With Windows 8 using the OS with touch is also easier than with any other OS out there.</p>
<p><a name="win8ondesktop"></a></p>
<h2>Using Windows 8 on a Desktop</h2>
<p><a href="http://www.flickr.com/photos/37567720@N05/6892904952/" title="Windows 8 on Desktop by Filip Skakun, on Flickr"><img src="http://farm8.staticflickr.com/7185/6892904952_36a7570406_b.jpg" width="800" height="600" alt="Windows 8 on Desktop"></a><br />&copy; <a href="http://twitter.com/xyzzer">Filip Skakun</a> 2012</p>
<p>For some reason installing Windows 8 on my desktop was quite a bit harder than on my laptop or the tablet. Possibly a driver issue caused the screen to go black during the installation multiple times and while I believe it was only a problem of display — I had to restart installing the OS multiple times before I managed to reach the point where the installation would progress without my input, so even when the screen went black, restarting half an hour later showed it booting to Windows 8.</p>
<p>I have no touch screen display on my desktop, although I cannot wait to start seeing affordable 24&#8243; or bigger true multi-touch screens which I hope will start showing up soon when Windows 8 comes out. Using touch on a desktop screen is not as natural as on a slate and not even as convenient as on a laptop, but I keep getting into situations when I touch the screen and I am surprised it does not work. Touch input really becomes a natural (even if only alternative) way to interact with a computer once you have used it for a while. It is not the best way to input text or event to play most types of games I like, but it is as natural as mouse and keyboard in some scenarios.</p>
<p>Overall having installed all the applications I used to use in Windows 7 to Windows 8 — my desktop is now mostly used from Windows 8, although I have it installed in dual boot mode just in case. The machine was put together with my very own hands and as far as I remember is an Intel Core i5-powered, 4GB RAM, 2+2+1+1TB HDD with 3-4 year old AMD/ATI Radeon graphics and since installation functions mostly without issues. It does sometimes refuse to shut down when I tell it too, but on the other hand, it has leverage over Windows 7 in that it turns of unused hard drives reducing the jet-like noise that the machine used to continuously generate before turning it into a <a href="http://en.wikipedia.org/wiki/Silent_PC">quiet PC</a>.</p>
<p><a name="twoies"></a></p>
<h2>Desktop IE vs. Metro IE</h2>
<p><a href="http://www.flickr.com/photos/37567720@N05/7039000499/" title="Metro Internet Explorer vs. Desktop Internet Explorer by Filip Skakun, on Flickr"><img src="http://farm8.staticflickr.com/7259/7039000499_323549a5c7_z.jpg" width="620" height="232" alt="Metro Internet Explorer vs. Desktop Internet Explorer"></a><br />&copy; <a href="http://twitter.com/xyzzer">Filip Skakun</a> 2012</p>
<p>I see a good reason for having two different browsing experiences. Web applications look beautiful in a browser without chrome. Using a computer without a keyboard and mouse is very limiting in the number of things you can do at a time, so looking at one website at a time makes most sense and seeing all the tabs that are open at the same time is not as useful. In desktop view I expect more power, a HUD of sorts that will allow me to orient myself better in the dozens of tabs that I tend to keep open in a browser at the same time, switching between different apps and so on. The Metro experience is more focused on one thing. Not allowing for browser plugins in the metro experience makes sense if it saves battery and helps push the web technologies forward, although might be annoying sometimes if you know there is a version of IE that can run on desktop that does run both Flash and Silverlight. I really do like the sharing of bookmarks between all my machines. Perhaps the desktop version could actually look and work more like the Metro version does and I believe it was left alone mostly so that the team could focus on the Metro version. I think maybe by the time Windows 8 is released or soon after — we might see the desktop version of IE modified to show no chrome by default until the user right clicks needing to type in a new address or switch a tab with a mouse. The web truly looks better with no chrome.</p>
<p>In fact the web looks so good without chrome that future web applications will likely become more powerful not unlike today&#8217;s desktop applications and will replace them in many scenarios while users will not see a difference. Currently you can develop applications for Windows 8 using HTML and JavaScript which are the same tools you use for developing web pages and web apps. Microsoft augments the framework allowing developers to create good looking and nicely animated Metro style apps with full access to the OS fairly easily but it also means that these applications will not run on any other platform and will not be easy to port either — it merely uses some of the familiar skills that today&#8217;s web developers can use to develop Windows 8 applications. As the tools continue to improve, doing similar applications should become as feasible for other platforms too. This in turn will allow for creation of a single application for all platforms having to only take into account the screen size, resolution, input methods and system features when creating different versions of the experience, but that I believe is still in the future farther off.</p>
<p><a name="frustrations"></a></p>
<h2>Frustrations of Being an Early Adopter</h2>
<p><a href="http://www.flickr.com/photos/37567720@N05/7039000517/" title="Frustration of an Early Adopter by Filip Skakun, on Flickr"><img src="http://farm8.staticflickr.com/7248/7039000517_3d5121bc98.jpg" width="90" height="161" alt="Frustration of an Early Adopter"></a><br />&copy; <a href="http://twitter.com/xyzzer">Filip Skakun</a> 2012</p>
<p>Not everything is rosy if you are trying out a new operating system early. The list of things I had to suffer contains the following:</p>
<ol>
<li>The old N-Trig touch input drivers for my laptop do not work on the current build of Windows 8. There was a workaround to use them in Developer Preview, but it does not work anymore. Windows 8 class drivers for touch seem to work at first — I can see touch input visualizations for my fingers, but they are very shaky and I can&#8217;t tap on buttons, etc. Using touch to scroll or unlock the screen still works though. The new <a>drivers</a> only showed up on N-Trig&#8217;s website moments ago today.</li>
<li>TurboTax complained for a moment that my operating system was not supported even when I used it in Chrome. It seems to have accepted it now though.</li>
<li>The VPN client I use does not work with Windows 8 yet and it seems like there might be a workaround using a generic VPN client application, but I have not been able to get it to work yet, so when I need to work from home — I am a bit disconnected since I can&#8217;t access some internal company resources, although I am sure if I really had to, I could get it to work even now with the workaround.</li>
<li>The WinKey+S shortcut that used to work with OneNote to grab a screenshot of a selected piece of the screen did not work at first. I used to use it quite a lot, so I was unhappy when I saw it not working. Fortunately it came back &#8211; possibly after a reboot which is an uncommon event in Windows 8&#8230;</li>
</ol>
<p>These problems and a few others have been minor annoyances, but I am sure they will be resolved by the time Windows 8 is released and overall even now are outweighed by the improvements you get from the new OS.</p>
</div>
</div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/xyzzer.wordpress.com/550/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/xyzzer.wordpress.com/550/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/xyzzer.wordpress.com/550/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/xyzzer.wordpress.com/550/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/xyzzer.wordpress.com/550/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/xyzzer.wordpress.com/550/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/xyzzer.wordpress.com/550/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/xyzzer.wordpress.com/550/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/xyzzer.wordpress.com/550/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/xyzzer.wordpress.com/550/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/xyzzer.wordpress.com/550/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/xyzzer.wordpress.com/550/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/xyzzer.wordpress.com/550/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/xyzzer.wordpress.com/550/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.xyzzer.me&#038;blog=13393480&#038;post=550&#038;subd=xyzzer&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.xyzzer.me/2012/04/03/impressions-of-windows-8-part-2-of-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9f4153be2cf81e0b6656e2761898ecfa?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">xyzzer</media:title>
		</media:content>

		<media:content url="http://labs.vectorform.com/wp-content/uploads/2012/04/Windows_8_logo.png" medium="image" />

		<media:content url="http://labs.vectorform.com/wp-content/uploads/2012/04/Windows_8_logo.png" medium="image" />

		<media:content url="http://farm8.staticflickr.com/7137/7039000349_a3b5fd79d4.jpg" medium="image">
			<media:title type="html">Windows 8 in the Cloud</media:title>
		</media:content>

		<media:content url="http://farm8.staticflickr.com/7214/7039000139_2252dd5c31_b.jpg" medium="image">
			<media:title type="html">My Windows 8 Workstation Setup - a Laptop and a Slate with Full-Size Keyboard, Mouse and HD Display</media:title>
		</media:content>

		<media:content url="http://farm8.staticflickr.com/7253/6892904928_173be2a507_b.jpg" medium="image">
			<media:title type="html">Windows 8 on a Laptop</media:title>
		</media:content>

		<media:content url="http://farm8.staticflickr.com/7185/6892904952_36a7570406_b.jpg" medium="image">
			<media:title type="html">Windows 8 on Desktop</media:title>
		</media:content>

		<media:content url="http://farm8.staticflickr.com/7259/7039000499_323549a5c7_z.jpg" medium="image">
			<media:title type="html">Metro Internet Explorer vs. Desktop Internet Explorer</media:title>
		</media:content>

		<media:content url="http://farm8.staticflickr.com/7248/7039000517_3d5121bc98.jpg" medium="image">
			<media:title type="html">Frustration of an Early Adopter</media:title>
		</media:content>
	</item>
		<item>
		<title>Impressions of Windows 8 Part 1 of 2</title>
		<link>http://blog.xyzzer.me/2012/04/02/impressions-of-windows-8-part-1-of-2/</link>
		<comments>http://blog.xyzzer.me/2012/04/02/impressions-of-windows-8-part-1-of-2/#comments</comments>
		<pubDate>Mon, 02 Apr 2012 18:37:02 +0000</pubDate>
		<dc:creator>xyzzer</dc:creator>
				<category><![CDATA[Computers and Internet]]></category>
		<category><![CDATA[Metro]]></category>
		<category><![CDATA[Metro Style Apps]]></category>
		<category><![CDATA[Opinion]]></category>
		<category><![CDATA[Speculation]]></category>
		<category><![CDATA[Tiles]]></category>
		<category><![CDATA[UI]]></category>
		<category><![CDATA[User Experience]]></category>
		<category><![CDATA[UX]]></category>
		<category><![CDATA[Windows 8]]></category>

		<guid isPermaLink="false">http://blog.xyzzer.me/?p=532</guid>
		<description><![CDATA[I have been using the Windows 8 Preview For six months now &#8211; the Developer Preview since its public release in September and more recently, the Consumer Preview that was made available in February. I have used Windows 8 on &#8230; <a href="http://blog.xyzzer.me/2012/04/02/impressions-of-windows-8-part-1-of-2/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.xyzzer.me&#038;blog=13393480&#038;post=532&#038;subd=xyzzer&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div style="font-family:Calibri;">
<a href="http://blog.xyzzer.me/?attachment_id=1962" rel="attachment wp-att-1962"><img src="http://labs.vectorform.com/wp-content/uploads/2012/04/Windows_8_logo.png" alt="" width="605" height="128" class="alignnone size-full wp-image-1962" /></a></p>
<p>I have been using the Windows 8 Preview For six months now &#8211; the Developer Preview since its public release in September and more recently, the Consumer Preview that was made available in February. </p>
<p>I have used Windows 8 on a tablet, a touch screen laptop and an old desktop and the experience has been good on all of these platforms. I have used it for anything from developing Windows 8 Metro style apps, through typical Office applications scenarios, browsing the internet, playing games, listening to Spotify, instant messaging etc. What I have not used it much for actually is to run Metro style apps, except for the ones I was developing myself, since there are not so many available yet (around 100) and the ones available do not fit into my daily use of a tablet or computer.</p>
<p>I have been using most versions of Windows available in the past 20 years or so. I have also been using an iPad for a few months now. <em>I think Windows 8 is going to be huge&#8230;</em></p>
<p><span id="more-532"></span></p>
<h2>The Impressions</h2>
<ol>
<li><a href="http://labs.vectorform.com/2012/04/impressions-of-windows-8-part-1-of-2/#desktop">The Desktop</a></li>
<li><a href="http://labs.vectorform.com/2012/04/impressions-of-windows-8-part-1-of-2/#startbutton">The (Missing) Start Button</a></li>
<li><a href="http://labs.vectorform.com/2012/04/impressions-of-windows-8-part-1-of-2/#startscreen">The Start Screen</a></li>
<li><a href="http://labs.vectorform.com/2012/04/impressions-of-windows-8-part-1-of-2/#metroapps">Metro Style Apps</a></li>
<li><a href="http://labs.vectorform.com/2012/04/impressions-of-windows-8-part-1-of-2/#appstore">Windows Marketplace</a></li>
<li><a href="http://labs.vectorform.com/2012/04/impressions-of-windows-8-part-1-of-2/#nextup">Next Up</a></li>
</ol>
<p><em>Continue reading on <a href="http://labs.vectorform.com/2012/04/impressions-of-windows-8-part-1-of-2">http://labs.vectorform.com</a>&#8230;</em></p>
<p><!--more--></p>
<div style="display:none;">
<a href="http://blog.xyzzer.me/?attachment_id=1962" rel="attachment wp-att-1962"><img src="http://labs.vectorform.com/wp-content/uploads/2012/04/Windows_8_logo.png" alt="" width="605" height="128" class="alignnone size-full wp-image-1962" /></a></p>
<p>I have been using the Windows 8 Preview For six months now &#8211; the Developer Preview since its public release in September and more recently, the Consumer Preview that was made available in February. </p>
<p>I have used Windows 8 on a tablet, a touch screen laptop and an old desktop and the experience has been good on all of these platforms. I have used it for anything from developing Windows 8 Metro style apps, through typical Office applications scenarios, browsing the internet, playing games, listening to Spotify, instant messaging etc. What I have not used it much for actually is to run Metro style apps, except for the ones I was developing myself, since there are not so many available yet (around 100) and the ones available do not fit into my daily use of a tablet or computer.</p>
<p>I have been using most versions of Windows available in the past 20 years or so. I have also been using an iPad for a few months now. <em>I think Windows 8 is going to be huge&#8230;</em></p>
<p><!--more--></p>
<h2>The Impressions</h2>
<ol>
<li><a href="#desktop">The Desktop</a></li>
<li><a href="#startbutton">The (Missing) Start Button</a></li>
<li><a href="#startscreen">The Start Screen</a></li>
<li><a href="#metroapps">Metro Style Apps</a></li>
<li><a href="#appstore">Windows Marketplace</a></li>
<li><a href="#nextup">Next Up</a></li>
</ol>
<p><a name="desktop"></a></p>
<h2>The Desktop</h2>
<p><a href="http://www.flickr.com/photos/37567720@N05/6892904866/" title="Desktop by Filip Skakun, on Flickr"><img src="http://farm8.staticflickr.com/7078/6892904866_c190ecfcef.jpg" width="500" height="313" alt="Desktop"></a><br />&copy; Screenshot by <a href="http://twitter.com/xyzzer">Filip Skakun</a> 2012</p>
<p>I am a developer and I spend most of my time using keyboard Visual Studio, Chrome &amp; Internet Explorer, Paint, <a href="http://www.ghisler.com/">Total Commander</a>, Notepad, Windows Explorer, etc. <em>Desktop is my world. It has not changed&#8230;</em></p>
<p>Well, it has changed in some ways — now Windows boots up in eight seconds instead of 8 minutes, the Start button is a lot smaller and completely transparent and all the corners of the desktop are now buttons of sort even though they are invisible. The Windows Explorer uses a Ribbon interface now, if you use two or more monitors — you now get the taskbar on all of them without the need for third party add-ons, the file copy menu looks nicer now and so does the task manager. There are some more advanced features I have not used yet, and I am sure thousands of imperceptible minor changes  but overall, nothing has changed in the way I use Windows since I switched from Windows 7 to Windows 8. I only get a feeling like here and there, this thing or the other works better — IE 10 is a bit better than IE 9, Windows installs in like 10 minutes. Opening an ISO file in Windows Explorer displays its contents as if it was a folder while also mounting it as a virtual drive — possibly opening us up to the future with no CDs or DVDs required to install any (even legacy) desktop applications or games with no need for third-party tools. There is a built-in viewer for PDF files, so you don&#8217;t need to install the 50MB beast from Adobe that requires a new update every day. There are things like these scattered all over the place.</p>
<p>One very minor issue that sometimes hits me in the desktop is that Chrome displays tabs starting from the top left corner of the screen, so sometimes instead of switching to the first tab, I switch to another app. Maybe one more reason to switch back to IE?</p>
<p><a name="startbutton"></a></p>
<h2>The (Missing) Start Button</h2>
<p><a href="http://www.flickr.com/photos/37567720@N05/7039000021/" title="Windows 8 Start Button by Filip Skakun, on Flickr"><img src="http://farm8.staticflickr.com/7130/7039000021_516f5f3e4f.jpg" width="255" height="176" alt="Windows 8 Start Button"></a><br />&copy; Screenshot by <a href="http://twitter.com/xyzzer">Filip Skakun</a> 2012</p>
<p>There is no visible start button now. There is a <a href="http://www.youtube.com/watch?v=v4boTbv9_nU">popular video</a> that is making rounds on the internet that is trying to prove that this is a big usability problem, but is it a problem really? When I first saw the desktop without the button I felt like there was a disconcerting void where something familiar used to exist for almost 20 years now. Personally, I see no benefit in getting rid of the button — the space savings are really minor compared to potential problems with usability, but once you start using it — you get used to it missing really quickly. You can still click the bottom left corner to bring up the Start Menu — the difference being you now have to move your mouse cursor to the very corner of the screen. In terms of everyday usability, it is just as easy if not marginally easier than what you might have been doing before — if you were like me, trying to point at somewhere near the center of the old start button before clicking. The problem might be if you are one of the few people who move their taskbar somewhere else than the bottom of the screen, which in previous versions of Windows also moved the start button. (I would argue though that in these cases you moved the taskbar to rearrange your space and having the start button move with it was not as crucial for you.)</p>
<p>Coming back to casual Windows users confused about the lack of the button — I am sure Microsoft will at least introduce some cues to indicate where to move the mouse when you first switch to desktop, the same way they have done before to educate users on the Start button in Windows or the glowing Microsoft Office Button that was introduced with the Ribbon in Office 2007 to open the Backstage. I am sure people will first be surprised when they do not see the button there, but many will be happy to get rid of an unnecessary ornament on the screen, especially if they are like me and already use the start button on their keyboards instead of fiddling with the mouse.</p>
<p>I would speculate that Microsoft might give in and bring back the start button to address the critical comments. Perhaps the only reason it is gone now is as an experiment and due to lack of time to switch to a design with a new logo. It is also possible that they will get rid of Aero Glass and make the desktop chrome more flat and Metro when they finally release Windows 8. Also — since they make corners and borders of the screen such important UI elements — they could also make the taskbar auto-hide by default to reduce unnecessary chrome.</p>
<p><a name="startscreen"></a></p>
<h2>The Start Screen</h2>
<p><a href="http://www.flickr.com/photos/37567720@N05/7039000185/" title="Windows 8 Start Screen Tiles and Windows Phone 8 Start Screen Tiles by Filip Skakun, on Flickr"><img src="http://farm8.staticflickr.com/7225/7039000185_4179132c76.jpg" width="500" height="269" alt="Windows 8 Start Screen Tiles and Windows Phone 8 Start Screen Tiles"></a><br />&copy; <a href="http://twitter.com/xyzzer">Filip Skakun</a> 2012</p>
<p>There is no Start Menu as we know it in Windows 8. It was replaced with the Start Screen, which is the most visible change in Windows 8. It takes design ideas from Windows Phone, introducing large active tiles instead of a grid of dead small icons with tiny labels seen on other phones or desktop UIs. Instead of a small menu in the corner of the screen that you had to squint at, you have the whole screen to fill with easily readable tiles that serve the same purpose — to launch applications, but also display additional information that allows you to get information you might be looking for without even starting an app. I think this is a good idea. Gone is a multi-level-nested hierarchy of app folders that made things discoverable if you went on exploring the menu, but not really useful for starting applications. You can still access all installed applications in the Start Screen by searching or clicking on the &#8220;All apps&#8221; menu.</p>
<p>Since Windows 7 I would usually only start applications I pinned to the taskbar or less frequently used ones that I had pinned inside of the Start Menu. This still works, but now instead of having them pinned in the Start Menu, I have them pinned on the Start Screen with some more options to rearrange them. If I had to launch an application only once — I used to just type its name in the Start Menu and a link would show up. It still works on the Start Screen, only it is easier to read. There is no important scenario where having a Start Menu showing up in a corner of the screen would work better than having the big Start Screen that grabs your entire attention on the task of finding an application to run.</p>
<p>Will the old Start Menu be available as an option? I think it is possible but not likely. It seems like the Start Screen has already made it to Windows Server 8 too now, so although its design was possibly driven by the consumer version of Windows, it works just as well on the server. The often repeated comment that this could be an option for enterprise deployments to save on the costs of user education does have some sense, but I do not think it is correct. Changing an OS is always a change and users will always need to learn something new. If you let enterprises upgrade to Windows 8 while keeping the old Start Menu — how about users who get into Windows 8 at home, use the Start Screen and then go to work and see the Start Menu? That would also require education I am sure. Also — live tiles would not work inside of the start menu, so how about disabling Metro style apps altogether? Well, but about the case when some applications start becoming available only in Metro Style? Also — I am sure it is Microsoft&#8217;s goal to have as many people using Metro style apps as possible, since it brings Microsoft money, so they would not pass on that. Then there is also the problem of maintaining two parallel versions of an interface serving the same purpose. It has been historically possible to switch some things in Windows to how they were — e.g. in Windows 7 you can disable combining the tab buttons in the taskbar and switch to small buttons &amp; labels — the same way it had worked since Windows 95. I do not really recommend doing that though since the new Windows 7 version is better. I am sure few people know about it being possible and I believe it has happened under different management. Now with Windows being ruled by Steven Sinofsky and his team who forced the world to use Office with the Ribbon and did away with the old toolbars — I don&#8217;t think it is likely to leave two competing versions of quite complicated UI — that would be just too difficult to maintain.</p>
<p>There is one valid criticism I have heard about the Start Screen — if you press spacebar once — you select a tile, if you press it again — you unpin it. This seems like a dangerously simple way to accidentally get rid of your pinned tiles and for millions of support calls to Microsoft if this does not change before release.</p>
<p><a name="metroapps"></a></p>
<h2>Metro Style Apps</h2>
<p><a href="http://www.flickr.com/photos/37567720@N05/6892904824/" title="Windows 8 Metro Style App sample - Flixster showing the Expendables 2 page by Filip Skakun, on Flickr"><img src="http://farm8.staticflickr.com/7182/6892904824_67d3d830cb.jpg" width="500" height="313" alt="Windows 8 Metro Style App sample - Flixster showing the Expendables 2 page"></a><br />&copy; Screenshot by <a href="http://twitter.com/xyzzer">Filip Skakun</a> 2012</p>
<p>With Windows 8 Microsoft is adding a completely new technology for developing software. The new framework is called Windows Runtime and while the old WinAPI and related technologies layered on top of it are still available for developing desktop applications, Windows Runtime (or WinRT in short) is required for developing the new Metro style apps. The new framework and applications are sandboxed which means they have limited access to system resources and other applications installed on the computer which is a requirement to allow for a trustworthy app store where developers can easily publish apps and users can easily buy them at very reasonable prices.</p>
<p>The new technology limits applications developed for Windows from causing harm, but it does not really limit them from using the full processing power of the machine and Microsoft has learned their lesson from Windows Phone where — especially initially — developers had very limited access to the features of the devices making a lot of the more interesting applications that were available for iOS or Android devices impossible to implement on Windows Phone. Developers can create these new applications using lowest level, close-to-the-metal native technologies like DirectX while also having access to very popular and productive languages like C#, Visual Basic and JavaScript. The more liberal access to the features of the device compared to Windows Phone allows for a wide range of new classes of applications to be developed. Based on the rumors of the next Windows Phone sharing the core components with Windows 8, I am also expecting the next crop of Windows Phone applications to have access to many of these features and languages giving Windows Phone a bigger chance at growth and competitiveness against iOS and Android ecosystems.</p>
<p>Metro style apps on Windows 8 can be developed using C# and XAML, the same technologies used in most Windows Phone applications — the difference being that they use WinRT instead of Silverlight. Although from a developer&#8217;s view there is very little difference between these two platforms and WinRT being a lower level platform than Silverlight has potential for better performance as was shown in <a href="http://advertboy.wordpress.com/2012/01/15/a-shimmering-wall-of-sequins-to-compare-winrt-xaml-silverlight-5/">an article by Jose Fajardo</a> (who is one of the more known experts writing about WinRT).</p>
<p>Metro style apps have features that are already familiar to Windows Phone users — such as live tiles and Metro design language. These things are evolving though, and becoming more powerful in Windows 8. Live tiles can be made even richer than in Windows Phone 7 and controls in the Metro user interface are evolving to be more usable in both mouse &amp; keyboard and touch scenarios. Implementation of fluid transitions is now easier than ever before with built-in animation and transition libraries making it a lot easier to create a Metro style app that shines.</p>
<p>The XAML Disciples – a group of expert XAML developers that is made up of the early adopters and experts of WPF and Silverlight — seem to have mostly negative thoughts or no interest (<a href="http://groups.google.com/group/wpf-disciples/browse_thread/thread/641b1643913936a3">[1]</a>, <a href="http://joshsmithonwpf.wordpress.com/2012/03/20/does-anyone-actually-care-about-winrt/">[2]</a>) in the new technology. It seems like this comes mostly from lack of trust in the future of Windows or lack of applicability for the typical types of enterprise projects they are used to working on, or weariness after having experienced small changes between a series of similar frameworks coupled with limited interest expressed from Microsoft&#8217;s side in further development of WPF and Silverlight. Microsoft instead seems to focus on developing a new development framework for every new scenario that comes up, i.e. WPF &#8211; being the first framework for developing rich applications for Windows, Silverlight being its version with a promise of being cross platform compatible or a Flash killer, Silverlight for Windows Phone being its yet another flavor and WinRT&#8217;s XAML framework being yet another take on it that is being rewritten for Windows 8.</p>
<p>While I understand these pains, I disagree with the criticism. Each new platform is a bit different and requires a different approach, i.e. sandboxed environment required for running apps on the web or hosting in app stores is not really available in WPF. WPF is also too heavy to run on the web. The interoperability of WinRT and improvements in implementation in Silverlight and then WinRT are also important reasons for rewriting the framework. Also you have to appreciate how little you need to learn to switch to a new XAML-based technology after you have already mastered one. WPF and Silverlight are also in most ways feature complete and Microsoft has likely reached diminished returns on investments in these technologies, while a new one will benefit its customers more. The fact that WinRT might not be applicable for many enterprise applications might hold true for a while, but as with Windows Phone — the main target of Windows 8 is not enterprise customers. Microsoft is trying to fight a battle for minds of consumers already learning to live with Apple&#8217;s and Google&#8217;s competing technologies — the fact that could cost Microsoft its dominance in OS in the future if not addressed with <em>something exciting and superior. I believe Windows 8 is such thing</em>. Enterprises are now used to switching the OS every two years and have mostly last done so with Windows 7, so it won&#8217;t harm Microsoft much if they wait till Windows 9 before getting ready and realizing WinRT is already a very valid platform for many scenarios and will surely improve to become a great one for developing business software too.</p>
<p><a name="appstore"></a></p>
<h2>The Store</h2>
<p><a href="http://www.flickr.com/photos/37567720@N05/7039000079/" title="Windows Store by Filip Skakun, on Flickr"><img src="http://farm8.staticflickr.com/7179/7039000079_cda85b56e8.jpg" width="500" height="313" alt="Windows Store"></a><br />&copy; Screenshot by <a href="http://twitter.com/xyzzer">Filip Skakun</a> 2012</p>
<p><em>A billion Windows users, even if only slowly upgrading to Windows 8, make Windows Store a very attractive platform for growing an app development business</em>. Most of the excitement and business opportunities for developers in recent years have been in web development with a switch to mobile development in recent years. Microsoft is far behind in this game, but I would not ignore the sleeping dragon. Windows will continue to be the most popular platform for desktops and laptops and Windows Store will fill a void finally enabling Windows developers to easily access the wallets of its gigantic user base. It will compete in the mobile space with established platforms from Apple and Google, but PC users have not had access to such a store until Windows 8. This is bound to breed a lot of innovation and rejuvenate the Windows ecosystem. Big development houses and brands like Adobe or Electronic Arts have achieved a level of familiarity and trustworthiness to be able to sell their software through their own online storefronts or could sell games through Steam, but Windows Store will allow millions of individual developers and small companies to share their ideas with hundreds of millions of users willing to pay for them or sell their attention to ad networks. I can easily see all future Windows games becoming available through the Windows Store. Is it the end of software on DVDs and GameStop? Not in the immediate future, since desktop applications will not be sold in the store except for perhaps one coming from the big software houses and it will take some years for most users to upgrade to Windows 8 and later versions of Windows, but especially for games — it is bound to happen soon. PC games are already increasingly being sold online through existing channels and another major one will surely accelerate this process.</p>
<p><a name="nextup"></a></p>
<h2>Next Up</h2>
<p>This was the first part of my impressions of Windows 8. The second part comes tomorrow and I will talk about the following:</p>
<ol>
<li>Windows 8 and the Cloud</li>
<li>Using Windows 8 on a Slate</li>
<li>Using Windows 8 on a Laptop</li>
<li>Using Windows 8 on a Desktop</li>
<li>Desktop IE vs. Metro IE</li>
<li>Frustrations of Being an Early Adopter</li>
</ol>
</div>
</div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/xyzzer.wordpress.com/532/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/xyzzer.wordpress.com/532/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/xyzzer.wordpress.com/532/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/xyzzer.wordpress.com/532/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/xyzzer.wordpress.com/532/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/xyzzer.wordpress.com/532/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/xyzzer.wordpress.com/532/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/xyzzer.wordpress.com/532/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/xyzzer.wordpress.com/532/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/xyzzer.wordpress.com/532/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/xyzzer.wordpress.com/532/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/xyzzer.wordpress.com/532/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/xyzzer.wordpress.com/532/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/xyzzer.wordpress.com/532/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.xyzzer.me&#038;blog=13393480&#038;post=532&#038;subd=xyzzer&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.xyzzer.me/2012/04/02/impressions-of-windows-8-part-1-of-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9f4153be2cf81e0b6656e2761898ecfa?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">xyzzer</media:title>
		</media:content>

		<media:content url="http://labs.vectorform.com/wp-content/uploads/2012/04/Windows_8_logo.png" medium="image" />

		<media:content url="http://labs.vectorform.com/wp-content/uploads/2012/04/Windows_8_logo.png" medium="image" />

		<media:content url="http://farm8.staticflickr.com/7078/6892904866_c190ecfcef.jpg" medium="image">
			<media:title type="html">Desktop</media:title>
		</media:content>

		<media:content url="http://farm8.staticflickr.com/7130/7039000021_516f5f3e4f.jpg" medium="image">
			<media:title type="html">Windows 8 Start Button</media:title>
		</media:content>

		<media:content url="http://farm8.staticflickr.com/7225/7039000185_4179132c76.jpg" medium="image">
			<media:title type="html">Windows 8 Start Screen Tiles and Windows Phone 8 Start Screen Tiles</media:title>
		</media:content>

		<media:content url="http://farm8.staticflickr.com/7182/6892904824_67d3d830cb.jpg" medium="image">
			<media:title type="html">Windows 8 Metro Style App sample - Flixster showing the Expendables 2 page</media:title>
		</media:content>

		<media:content url="http://farm8.staticflickr.com/7179/7039000079_cda85b56e8.jpg" medium="image">
			<media:title type="html">Windows Store</media:title>
		</media:content>
	</item>
		<item>
		<title>WinRT/Metro Style App Data</title>
		<link>http://blog.xyzzer.me/2012/04/01/winrtmetro-style-app-data/</link>
		<comments>http://blog.xyzzer.me/2012/04/01/winrtmetro-style-app-data/#comments</comments>
		<pubDate>Sun, 01 Apr 2012 22:22:00 +0000</pubDate>
		<dc:creator>xyzzer</dc:creator>
				<category><![CDATA[Computers and Internet]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Windows 8]]></category>
		<category><![CDATA[WinRT]]></category>

		<guid isPermaLink="false">http://blog.xyzzer.me/?p=517</guid>
		<description><![CDATA[I was trying to find out where the WinRT apps files are stored and found 3 locations. Not sure how much benefit would be in digging deeper, but this could help in debugging your or reverse engineering someone else&#8217;s applications&#8230; &#8230; <a href="http://blog.xyzzer.me/2012/04/01/winrtmetro-style-app-data/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.xyzzer.me&#038;blog=13393480&#038;post=517&#038;subd=xyzzer&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div style="font-family:Calibri;">
I was trying to find out where the WinRT apps files are stored and found 3 locations. Not sure how much benefit would be in digging deeper, but this could help in debugging your or reverse engineering someone else&#8217;s applications&#8230;</p>
<p><span id="more-517"></span></p>
<h2>Application Manifests and a database of installed applications</h2>
<p>
%ProgramData%\Microsoft\Windows\AppRepository<br />
e.g.<br />
c:\ProgramData\Microsoft\Windows\AppRepository\89006A2E.SketchBookExpress_1.0.0.2013_x64__tf1gferkr813w.xml
</p>
<h2>Application code and content/resource files</h2>
<p>
%ProgramFiles%\WindowsApps<br />
e.g.<br />
c:\Program Files\WindowsApps\89006A2E.SketchBookExpress_1.0.0.2013_x64__tf1gferkr813w\SketchBook.exe<br />
c:\Program Files\WindowsApps\89006A2E.SketchBookExpress_1.0.0.2013_x64__tf1gferkr813w\AboutPage.xaml
</p>
<h2>Application settings and data storage (settings, saved documents, web cache, temporary data storage)</h2>
<p>
%LOCALAPPDATA%\Packages<br />
e.g.<br />
c:\Users\Filip\AppData\Local\Packages\89006A2E.SketchBookExpress_tf1gferkr813w\Settings\settings.dat<br />
c:\Users\Filip\AppData\Local\Packages\89006A2E.SketchBookExpress_tf1gferkr813w\LocalState\SketchBook.tiff<br />
c:\Users\Filip\AppData\Local\Packages\WinStore_cw5n1h2txyewy\AC\INetCookies\IY2KIDUJ.txt<br />
c:\Users\Filip\AppData\Local\Packages\WinStore_cw5n1h2txyewy\AC\INetCacheY7EQF5Z\Frame[1].htm
</p>
</div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/xyzzer.wordpress.com/517/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/xyzzer.wordpress.com/517/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/xyzzer.wordpress.com/517/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/xyzzer.wordpress.com/517/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/xyzzer.wordpress.com/517/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/xyzzer.wordpress.com/517/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/xyzzer.wordpress.com/517/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/xyzzer.wordpress.com/517/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/xyzzer.wordpress.com/517/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/xyzzer.wordpress.com/517/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/xyzzer.wordpress.com/517/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/xyzzer.wordpress.com/517/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/xyzzer.wordpress.com/517/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/xyzzer.wordpress.com/517/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.xyzzer.me&#038;blog=13393480&#038;post=517&#038;subd=xyzzer&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.xyzzer.me/2012/04/01/winrtmetro-style-app-data/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9f4153be2cf81e0b6656e2761898ecfa?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">xyzzer</media:title>
		</media:content>
	</item>
		<item>
		<title>Windows Developer Camp &#8211; March-June 2012, USA, Multiple locations</title>
		<link>http://blog.xyzzer.me/2012/03/03/windows-developer-camp-march-june-2012-usa-multiple-locations/</link>
		<comments>http://blog.xyzzer.me/2012/03/03/windows-developer-camp-march-june-2012-usa-multiple-locations/#comments</comments>
		<pubDate>Sat, 03 Mar 2012 22:18:12 +0000</pubDate>
		<dc:creator>xyzzer</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.xyzzer.me/?p=507</guid>
		<description><![CDATA[I found multiple (21) free full day training sessions for Windows 8 developers &#8211; here.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.xyzzer.me&#038;blog=13393480&#038;post=507&#038;subd=xyzzer&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div style="font-family:Calibri;">
<p>I found multiple (21) free full day training sessions for Windows 8 developers &#8211; <a href="https://msevents.microsoft.com/cui/SearchDisplay.aspx?culture=en-us#culture=en-us;pageNumber=1;sortKey=relevance;sortOrder=;pageEvent=true;hdnInitialCount=1;kwdAny=%22Windows%20Developer%20Camp%22;eventType=0;searchcontrol=yes;s=1">here</a>.</p>
</div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/xyzzer.wordpress.com/507/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/xyzzer.wordpress.com/507/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/xyzzer.wordpress.com/507/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/xyzzer.wordpress.com/507/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/xyzzer.wordpress.com/507/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/xyzzer.wordpress.com/507/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/xyzzer.wordpress.com/507/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/xyzzer.wordpress.com/507/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/xyzzer.wordpress.com/507/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/xyzzer.wordpress.com/507/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/xyzzer.wordpress.com/507/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/xyzzer.wordpress.com/507/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/xyzzer.wordpress.com/507/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/xyzzer.wordpress.com/507/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.xyzzer.me&#038;blog=13393480&#038;post=507&#038;subd=xyzzer&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.xyzzer.me/2012/03/03/windows-developer-camp-march-june-2012-usa-multiple-locations/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9f4153be2cf81e0b6656e2761898ecfa?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">xyzzer</media:title>
		</media:content>
	</item>
		<item>
		<title>A path from C/C++ to C# and back to C++</title>
		<link>http://blog.xyzzer.me/2012/02/26/a-path-from-cc-to-c-and-back-to-c/</link>
		<comments>http://blog.xyzzer.me/2012/02/26/a-path-from-cc-to-c-and-back-to-c/#comments</comments>
		<pubDate>Mon, 27 Feb 2012 06:33:48 +0000</pubDate>
		<dc:creator>xyzzer</dc:creator>
				<category><![CDATA[Computers and Internet]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[C++/CLI]]></category>
		<category><![CDATA[C++/CX]]></category>
		<category><![CDATA[DirectX]]></category>
		<category><![CDATA[Windows 8]]></category>
		<category><![CDATA[WinRT]]></category>

		<guid isPermaLink="false">http://blog.xyzzer.me/?p=476</guid>
		<description><![CDATA[About ten years ago I started my first full time programming job. I was working on some business software written in C/C++. I say C/C++ instead of just C++ because it was written mostly in C with classes &#8211; with &#8230; <a href="http://blog.xyzzer.me/2012/02/26/a-path-from-cc-to-c-and-back-to-c/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.xyzzer.me&#038;blog=13393480&#038;post=476&#038;subd=xyzzer&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div style="font-family:Calibri;">
<p>About ten years ago I started my first full time programming job. I was working on <a href="www.favourite.pl">some business software</a> written in C/C++. I say C/C++ instead of just C++ because it was written mostly in C with classes &#8211; with perhaps a few cases of inheritance or actually even only few classes &#8211; it used structs in many places to group some methods together the same way you would use classes today. The code was fairly complicated and it was just aging. The standard C libraries it used were not very rich, so if you wanted to code up something fairly straightforward &#8211; you had to dig through a lot of documentation looking for something basic only to end up implementing that list class yourself. We were using a <a href="http://www.openwatcom.org/index.php/Main_Page">Watcom</a> compiler at that time and trying out <a href="http://www.embarcadero.com/products/cbuilder">Borland C++ Builder</a> for some side projects showed it was a great improvement in that VCL provided a lot of great wrapper classes for Windows APIs making things easier. Two years later we were looking into rewriting our application or at least starting a new version and considering which tools to use &#8211; basically trying to choose between Borland C++ and C#. I was on the C++ side &#8211; it was a fairly known language, more predictable and providing intuitively higher performance, while C# was at version 1.1 and had lots of great libraries, but a bit foreign and why would anyone want to go away from the fun of using pointers, managing object lifetimes and relying on some garbage (collector)? Well, I lost &#8211; Microsoft seemed to be focusing on supporting C# and in the end it turned out to be a lot more productive than C++.</p>
<p>Fast forward 8 years and Microsoft says &#8211; in Windows 8 you can code using C#/VB, JavaScript or C++. Well, the word on the street is that it is so that programmers fluent in any of these languages will be able to code applications for Windows, so I guess I will stick with C#. Maybe I will look at HTML5, JS and CSS, since these seem to be getting most traction, I thought. Now, having found some limitations in the .NET/WinRT stack I have a feeling like the C++/DirectX route is the most attractive. The .NET stack might make you more productive than the JS or C++ &#8211; especially if you have been coding in C# for the last eight years and perhaps HTML5 has better graphics performance or some other interesting features, but it feels like learning C++/DirectX on top of C#/WinRT is what would allow me to cover most scenarios for writing Metro Style Apps™, so especially with some experience working on the test team for the DirectX wrappers in the <a href="http://archive.msdn.microsoft.com/WindowsAPICodePack">Windows API Code Pack</a> &#8211; I am hoping to have an easier start in diversifying my skills.
</p>
<p><span id="more-476"></span></p>
<p><strong>C++ (Re)Learning Resources</strong></p>
<p>Right now I have two resources I am using to relearn C++:</p>
<ul>
<li>The Pluralsight C++ <a href="http://www.pluralsight-training.net/microsoft/Courses#cpp">trainings</a> by <a href="https://twitter.com/#!/gregcons">Kate Gregory</a> &#8211; it is 10 hours of videos which is a bit painful, especially that the 7 hours of the beginner part is mosly familiar stuff targeted at the very beginners indeed, so that makes me a bit sleepy after a weekend day with the kids, but it is very high quality and I like to get solid basics before I start working with a technology, so I will make it through somehow! <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </li>
<li>The <a href="http://www.bobtacoindustries.com/Content/Devs/CsToCpp-ASomewhatShortGuide.pdf">C# to C++–A Somewhat Short Guide</a> by <a href="https://twitter.com/#!/mikebmcl">Michael McLaughlin</a> &#8211; which I plan on going through when I am done with the Pluralsight videos as a review of sort, the subject seems to be just what I need after all! <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </li>
</ul>
<p><strong>DirectX Resources</strong></p>
<p>Meanwhile I am slowly starting to look at DirectX, so I installed the last <a href="http://www.microsoft.com/download/en/details.aspx?displaylang=en&amp;id=6812">DirectX SDK from 2010</a>. I think it is now part of the <a href="http://www.microsoft.com/download/en/details.aspx?displaylang=en&amp;id=8279">Windows SDK</a>, but my Windows SDK install failed for some reason and it seems like the latest one for Windows 7 is actually older than the standalone one. It should also work OK with the Windows API Code Pack that I will review as a reference, since it has a lot of my C# code for the Direct2D samples which I will need to rewrite for Windows 8 in C++ to code a few things I have been thinking about. MSDN has some interesting samples worth looking at too.<br />
I also installed <a href="http://nshader.codeplex.com/">NShader</a> for HLSL syntax highlighting in Visual Studio, the <a href="http://shazzam-tool.com/">Shazzam tool</a> for HLSL coding. That&#8217;s it for learning on my Windows 7 box. On the Windows 8 boxes I will be limited to VS11 anyway until tool support happens and there &#8211; the Windows SDK should already be integrated with the DirectX one.</p>
<p><strong>_codingStyle</strong></p>
<p>After 10 years in the industry I am probably at my peak of caring about the coding style &#8211; having my own preferred style in C# &#8211; based on ReSharper and StyleCop, but with one parameter/condition per line if all don&#8217;t fit in a line. Since C++ <a href="https://twitter.com/#!/jmorrill/status/173682503960367104">does not seem to have a leading style, at least according to <a href="http://groups.google.com/group/wpf-disciples">WPF Disciples&#8217;</a> resident DirectX expert &#8211; <a href="https://twitter.com/#!/jmorrill">Jeremiah Morrill</a>, I am going to try to adopt my C# style to the C++ code and see what comes out. While C# has a few controversial best style options in a couple areas &#8211; it is mostly Pascal/camelCased. C++ on the other hand seems to be all over the place, so at least having my own code based in the familiar style might help me orient myself in the world of double colons and pointer arrows&#8230;</p>
<p>Having mentioned ReSharper &#8211; I really feel like the C++ editor could do more in terms of IntelliSense even if it is not a managed language with all the metadata available. It seems like there are tools that enhance the VS C++ editing experience too. ReSharper is not one of them, but I picked up a trial of <a href="http://www.wholetomato.com/purchase/default.asp">Active Assist X</a> and it seems to improve things quite a bit.</p>
<p><strong>C# -&gt; C++/CLI -&gt; Native C++</strong></p>
<p>As the first piece of coding I thought I&#8217;d do some comparison between C# and C++ as well as between the managed C++/CLI and the native C++. How long might it take to go through a long loop of integer increments in each of these? Well, it seems like it is rather quick these days with 2 billion iterations taking only 6s in C# and 5s in C++ or C++/CLI to execute the below loop!</p>
<p><pre class="brush: csharp;">for (int i = 0; i &lt; 2000000000; i++);</pre></p>
<p>While this is not a representative piece of code at all &#8211; it just shows how closer to the metal C++ is (probably having each iteration take 5 cycles as opposed to 6 cycles for C#). See the measurement code and output samples.</p>
<p><strong>C#</strong></p>
<p><pre class="brush: csharp;">for (;;)
{
    var start = DateTime.Now;
    Console.WriteLine(&quot;Start&quot;);
    for (int i = 0; i &lt; 2000000000; i++);
    Console.WriteLine(&quot;End&quot;);
    var duration = DateTime.Now - start;
    Console.WriteLine(&quot;{0:F3}s&quot;, duration.TotalSeconds);
}</pre></p>
<p>Output</p>
<p><img src="http://xyzzer.files.wordpress.com/2012/02/c.png?w=640" alt="C# sample output" /></p>
<p><strong>C++/CLI</strong></p>
<p><pre class="brush: cpp;">for (;;)
{
    {
        DateTime&amp; start = DateTime::Now;
        Console::WriteLine(&quot;Start&quot;);
        for (int i = 0; i &lt; 2000000000; i++);
        Console::WriteLine(&quot;End&quot;);
        TimeSpan&amp; duration = DateTime::Now - start;
        Console::WriteLine(&quot;{0:F3}s&quot;, duration.TotalSeconds);
    }

    {
        clock_t start = clock(), diff;
        std::cout &lt;&lt; &quot;Start&quot; &lt;&lt; std::endl;
        for (int i = 0; i &lt; 2000000000; i++);
        std::cout &lt;&lt; &quot;End&quot; &lt;&lt; std::endl;
        diff = clock() - start;
        float sec = (float)diff / CLOCKS_PER_SEC;
        std::cout &lt;&lt; sec &lt;&lt; &quot;s&quot; &lt;&lt; std::endl;
    }
}</pre></p>
<p>I have used C++/CLI to a very limited degree before. Looking at the sample above you can see how easy it is to port some basic C# code to C++/CLI which allows you to keep using the so convenient .NET Base Class Library (BCL) while also being able to use the native libraries.</p>
<p>Output</p>
<p><img src="http://xyzzer.files.wordpress.com/2012/02/c-cli.png?w=640" alt="C++/CLI sample output" /></p>
<p><strong>Native C++</strong></p>
<p><pre class="brush: cpp;">for (;;)
{
    clock_t start = clock(), diff;
    std::cout &lt;&lt; &quot;Start&quot; &lt;&lt; std::endl;
    for (int i = 0; i &lt; 2000000000; i++);
    std::cout &lt;&lt; &quot;End&quot; &lt;&lt; std::endl;
    diff = clock() - start;
    float sec = (float)diff / CLOCKS_PER_SEC;
    std::cout &lt;&lt; sec &lt;&lt; &quot;s&quot; &lt;&lt; std::endl;
}</pre></p>
<p>Output</p>
<p><img src="http://xyzzer.files.wordpress.com/2012/02/c1.png?w=640" alt="Native C++ sample output" /></p>
<p><strong>Summary</strong></p>
<p>C# is the most productive and best looking language I have ever used and sure &#8211; it is a general purpose language in that you can use it to do all sorts of things, but you can&#8217;t do everything in C#, at least not if you want to do some types of Metro Style Applications for Windows 8. Native C++ and DirectX is supported for use in Metro Style Applications, but C++/CLI is not and I don&#8217;t believe you can use managed wrappers with DirectX to make them, so if you want to make games for Windows 8 &#8211; forget Managed DirectX, XNA, SlimDX, Code Pack and SharpDX. It&#8217;s back to C++ baby! <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><strong>(EDIT) Notes on C++/CX</strong></p>
<p>MSDN has a <a href="http://msdn.microsoft.com/en-us/library/windows/apps/br212455(v=vs.110).aspx">Quick Reference page</a>, that shows how C++/CX types map to Standard C++ types.</p>
<p>Other interesting articles:</p>
<ul>
<li><a href="http://msdn.microsoft.com/en-us/library/windows/apps/hh700132(v=vs.110).aspx">Interoperating with Other Languages (C++/CX)</a></li>
<li><a href="http://msdn.microsoft.com/en-us/library/windows/apps/hh699899(v=vs.110).aspx">CLR integration (C++/CX)</a></li>
<li><a href="http://msdn.microsoft.com/en-us/library/windows/apps/hh700115(v=vs.110).aspx">Built-in types (C++/CX)</a></li>
<li><a href="http://msdn.microsoft.com/en-us/library/windows/apps/hh700103(v=vs.110).aspx">Collections (C++/CX)</a></li>
</ul>
</div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/xyzzer.wordpress.com/476/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/xyzzer.wordpress.com/476/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/xyzzer.wordpress.com/476/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/xyzzer.wordpress.com/476/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/xyzzer.wordpress.com/476/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/xyzzer.wordpress.com/476/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/xyzzer.wordpress.com/476/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/xyzzer.wordpress.com/476/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/xyzzer.wordpress.com/476/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/xyzzer.wordpress.com/476/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/xyzzer.wordpress.com/476/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/xyzzer.wordpress.com/476/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/xyzzer.wordpress.com/476/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/xyzzer.wordpress.com/476/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.xyzzer.me&#038;blog=13393480&#038;post=476&#038;subd=xyzzer&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.xyzzer.me/2012/02/26/a-path-from-cc-to-c-and-back-to-c/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9f4153be2cf81e0b6656e2761898ecfa?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">xyzzer</media:title>
		</media:content>

		<media:content url="http://xyzzer.files.wordpress.com/2012/02/c.png" medium="image">
			<media:title type="html">C# sample output</media:title>
		</media:content>

		<media:content url="http://xyzzer.files.wordpress.com/2012/02/c-cli.png" medium="image">
			<media:title type="html">C++/CLI sample output</media:title>
		</media:content>

		<media:content url="http://xyzzer.files.wordpress.com/2012/02/c1.png" medium="image">
			<media:title type="html">Native C++ sample output</media:title>
		</media:content>
	</item>
	</channel>
</rss>
