Tag Archives: C++

Windows 8

DirectX Tool Kit – native “XNA” for Windows 8

For all those who miss XNA in Metro applications, DirectX Tool Kit is a handy set of classes that mimic popular XNA classes such as SpriteBatch, SpriteFont and BasicEffect. Let’s see how easy it is to use it. For my first trick, I shall load a texture and render it on screen. Nothing fancy, but it will quickly establish the similarities between old and proven XNA code with new DX11 code. Just to be clear, the code in this blog post is written using C++.

Go and download DirectXTK from Codeplex/. Open the DirectXTK_11_Metro solution and you will see only one project inside. Build it and you will get a static library. Include files are located in the Inc folder. read more »

Windows 8

C++ and Metro: event handling and MessageBox

This entry is part of a series, C++ Metro applications»

In the previous post we have created simple Metro application using C++ as the language of choice. Now we are going to add some interactivity into it.

MessageDialog

Add a simple button and using the following XAML snippet:

<Button Content="Click me" Click="Button_Click_1" Margin="12,20" />

Right click on the Button_Click_1 attribute value and select the Navigate to Event Handler. You will be transferred to the cpp file and both header and source file will be properly updated. Add the following code inside:

using namespace Windows::UI::Popups;
auto msgDlg = ref new MessageDialog("We want to notify you that you have successfully handled this event", "Vexing information");
msgDlg->ShowAsync();

read more »

Entries in this series:
  1. C++ and Metro: basic application
  2. C++ and Metro: event handling and MessageBox
Powered by Hackadelic Sliding Notes 1.6.5
Windows 8

C++ and Metro: basic application

This entry is part of a series, C++ Metro applications»

Visual Studio 11 Consumer Preview enables creating Metro styled applications using C++ which is a great news for any native developer. Let’s create a simple Metro application. Start up Visual Studio and create new project using the Visual C++>Windows Metro Style>Blank Application template.
read more »