Weathr, the C++, DirectX and XAML Windows Store App
- Posted: Jan 15, 2014 at 6:00 AM
- 9,138 Views
In today's Windows Wednesday project, we're highlighting a project from Thomas Petchel (and team) that is showing off how you can use DirectX, XAML and C++ to build a cool Windows Store App...
Weathr is a 3D weather app for Windows 8.1 using C++, DirectX, and XAML.
Why a weather app?
While working on the Hilo C++ project, I really wanted to further explore the intersection among C++, DirectX, and XAML in the context of a Windows Store app. A 3D weather app seemed novel (I've never seen one before) yet doable (arguably easier to implement than a game.) I'm publishing this sample as a way of sharing what I learned and getting your feedback.
Although you're free to use any of the code and patterns you see here in your own apps, remember this is a personal side project of mine -- there's surely room to improve the architecture and design patterns that are used. Please report any feedback you have on the code in the Issues or Discussions tab. If you find any parts to be particularly useful, or would like to see more discussion on, please let me know that as well!
Click the image below for a quick video tour of the app.
What's needed to run it?
- Windows 8.1
- Visual Studio 2013. Get Visual Studio Express 2013 here.
- A Bing Maps API key. Get a trial key here.
- A World Weather Online API key. Get a trial key here.
Add your API keys to ServiceKeys.h.
I know it's a bit of a pain, but it's pretty straight-forward to register for the API keys. You can still run the app without the API keys; you simply won't be able to access weather data or search for locations.
What's it demonstrate?
Here are some of the features to look for in this sample. Also see the Documentation tab for technical info about various parts of this project.
- How to use ISO C++ to implement the core logic and C++/CX along the "boundary" where you work Windows Runtime.
- How to use DirectX to manage 3D content and XAML to manage 2D content.
- Using PPL tasks to load assets asynchronously and to perform background work.
- Rendering shared 3D content across pages.
- Capturing 3D content for later use (such as on the live tile and location management page.)
- Displaying current weather info on the live tile.
- Using the secondary tile to bookmark to a specific experience.
- Rendering cloud and star effects in a way that works on both Intel and ARM-based devices.
- Using the C++ REST SDK to connect to the weather and Bing Maps services.
- Throttling HTTP requests to limit the number of requests made per second.
- Using app bars to browse the 5 day forecast and perform interesting commands.
- Using GestureRecognizer to read input events for manipulating the globe.
- Using Semantic Zoom to enable fast navigation.
- Using MessageDialog to confirm commands.
- Using the Search contract to search for locations from Bing Maps.
- Downloading and caching images for later use.
- Using app settings to set preferences.
- Using a basic logger to display diagnostic messages on the UI.
Make sure you don't miss the documentation...