Game technologies for UWP apps

In this guide, you'll learn about the technologies available for developing Universal Windows Platform (UWP) games.

Benefits of Windows 10 for game development

With the introduction of UWP in Windows 10, your Windows 10 titles will be able to span all of the Microsoft platforms. With free migration from previous versions of Windows, there is a steadily increasing number of Windows 10 clients. The combination of these two things means that your Windows 10 titles will be able to reach a huge number of customers through the Microsoft Store.

In addition, Windows 10 offers many new features that are particularly beneficial to games:

  • Reduced memory paging and reduced overall memory system size
  • Improved graphics memory management actively allocates and protects more memory for the foreground game

UWP Games with C++ and DirectX

Real-time games requiring high performance should make use of the DirectX APIs. DirectX is a collection of native APIs for creating games and multimedia applications that require high performance, such as 3D games.

Development Environment

To create games for UWP, you'll need to set up your development environment by installing Visual Studio 2015 or later. We recommend that you install the latest version of Visual Studio, giving you access to the latest development and security updates. Visual Studio allows you to create UWP apps and provides tools for game development:

  • Visual Studio tools for DX game programming - Visual Studio provides tools for creating, editing, previewing, and exporting image, model, and shader resources. There are also tools that you can use to convert resources at build time and debug DirectX graphics code. For more information, see Use Visual Studio tools for game programming.
  • Visual Studio graphics diagnostics features - Graphics diagnostic tools are now available from within Windows as an optional feature. The diagnostic tools allow you to do graphics debugging, graphics frame analysis, and monitor GPU usage in real time. For more information, see Use the DirectX runtime and Visual Studio graphics diagnostic features.

For more information, see Prepare your Universal Windows Platform and DirectX programming.

Getting Started with DirectX Game Project Templates

After setting up your development environment, you can use one of the DirectX related project templates to create your UWP DirectX game. Visual Studio 2015 has three templates available for creating new UWP DirectX projects, DirectX 11 App (Universal Windows), DirectX 12 App (Universal Windows), and DirectX 11 and XAML App (Universal Windows). For more information, see Create a Universal Windows Platform and DirectX game project from a template.

Windows 10 APIs

Windows 10 provides an extensive collection of APIs that are useful for game development. There are APIs for almost all aspects of games including, 3D Graphics, 2D Graphics, Audio, Input, Text Resources, User Interface, and networking.

There are many APIs related to game development, but not all games need to use all of the APIs. For example, some games will only use 3D graphics and only make use of Direct3D, some games may only use 2D graphics and only make use of Direct2D, and still other games may make use of both. The following diagram shows the game development related APIs grouped by functionality type.

game platform technologies

  • 3D Graphics - Windows 10 supports two 3D graphics API sets, Direct3D 11, and Direct3D 12. Both of these APIs provide the capability to create 3D and 2D graphics. Direct3D 11 and Direct3D 12 are not used together, but either can be used with any of the APIs in the 2D Graphics and UI group. For more information about using the graphics APIs in your game, see Basic 3D graphics for DirectX games.

    API Description
    Direct3D 12

    Direct3D 12 introduces the next version of Direct3D, the 3D graphics API at the heart of DirectX. This version of Direct3D is designed to be faster and more efficient than previous versions of Direct3D. The tradeoff for Direct3D 12's increased speed is that it is lower level and requires you to manage your graphics resources yourself and have more extensive graphics programming experience to realize the increased speed.

    When to use

    Use Direct3D 12 when you need to maximize your game's performance and your game is CPU bound.

    For more information

    See the Direct3d 12 documentation.

    Direct3D 11

    Direct3D 11 is the previous version of Direct3D and allows you to create 3D graphics using a higher level of hardware abstraction than D3D 12.

    When to use

    Use Direct3D 11 if you have existing Direct3D 11 code, your game is not CPU bound, or you want the benefit of having resources managed for you.

    For more information

    See the Direct3D 11 documentation.

     

  • 2D Graphics and UI - APIs concerning 2D graphics such as text and user interfaces. All of the 2D graphics and UI APIs are optional.

    API Description
    Direct2D

    Direct2D is a hardware-accelerated, immediate-mode, 2-D graphics API that provides high performance and high-quality rendering for 2-D geometry, bitmaps, and text. The Direct2D API is built on Direct3D and is designed to interoperate well with GDI, GDI+, and Direct3D.

    When to use

    Direct2D can be used instead of Direct3D to provide graphics for pure 2D games such as a side-scroller or board game, or can be used with Direct3D to simplify creation of 2D graphics in a 3D game, such as a user interface or heads-up-display.

    For more information

    See the Direct2D documentation.

    DirectWrite

    DirectWrite provides extra capabilities for working with text and can be used with Direct3D or Direct2D to provide text output for user interfaces or other areas where text is required. DirectWrite supports measuring, drawing, and hit-testing of multi-format text. DirectWrite handles text in all supported languages for global and localized applications. DirectWrite also provides a low-level glyph rendering API for developers who want to perform their own layout and Unicode-to-glyph processing.

    When to use

    For more information

    See the DirectWrite documentation.

    DirectComposition

    DirectComposition is a Windows component that enables high-performance bitmap composition with transforms, effects, and animations. Application developers can use the DirectComposition API to create visually engaging user interfaces that feature rich and fluid animated transitions from one visual to another.

    When to use

    DirectComposition is designed to simplify the process of composing visuals and creating animated transitions. If your game requires complex user interfaces, you can use DirectComposition to simplify the creation and management of the UI.

    For more information

    See the DirectComposition documentation.

     

  • Audio - APIs concerning playing audio and applying audio effects. For information about using the audio APIs in your game, see Audio for games.

    API Description
    XAudio2

    XAudio2 is a low-level audio API that provides a foundation for signal processing and mixing. XAudio is designed to be very responsive for game audio engines while maintaining the ability to create custom audio effects and complex chains of audio effects and filters.

    When to use

    Use XAudio2 when your game needs to play sounds with minimal overhead and delay.

    For more information

    See the XAudio2 documentation.

    Media Foundation

    Microsoft Media Foundation is designed for the playback of media files and streams, both audio and video, but can also be used in games when higher level functionality than XAudio2 is required and some additional overhead is acceptable.

    When to use

    Media foundation is particularly useful for cinematic scenes or non-interactive components of your game. Media foundation is also useful for decoding audio files for playback using XAudio2.

    For more information

    See the Microsoft Media Foundation overview.

     

  • Input - APIs concerning input from the keyboard, mouse, gamepad, and other user input sources.

    API Description
    XInput

    The XInput Game Controller API enables applications to receive input from game controllers.

    When to use

    If your game needs to support gampad input and you have existing XInput code, you can continue to make use of XInput. XInput has been replaced by Windows.Gaming.Input for UWP, and if you're writing new input code, you should use Windows.Gaming.Input instead of XInput.

    For more information

    See the XInput documentation.

    Windows.Gaming.Input

    The Windows.Gaming.Input API replaces XInput and provides the same functionality with the following advantages over Xinput:

    • Lower resource usage
    • Lower API call latency for retrieving input
    • The ability to work with more than 4 gamepads at once
    • The ability to access additional Xbox One gamepad features, such as the trigger vibration motors
    • The ability to be notified when controllers connect/disconnect via event instead of polling
    • The ability to attribute input to a specific user (Windows.System.User)

    When to use

    If your game needs to support gamepad input and is not using existing XInput code or you need one of the benefits listed above, you should make use of Windows.Gaming.Input.

    For more information

    See the Windows.Gaming.Input documentation.

    Windows.UI.Core.CoreWindow

    The Windows.UI.Core.CoreWindow class provides events for tracking pointer presses and movement, and key down and key up events.

    When to use

    Use Windows.UI.Core.CoreWindows events when you need to track the mouse or key presses in your game.

    For more information

    See Move-look controls for games for more information about using the mouse or keyboard in your game.

     

  • Math - APIs concerning simplifying commonly used mathematical operations.

    API Description
    DirectXMath

    The DirectXMath API provides SIMD-friendly C++ types and functions for common linear algebra and graphics math operations common to games.

    When to use

    Use of DirectXMath is optional and simplifies common mathematical operations.

    For more information

    See the DirectXMath documentation.

     

  • Networking - APIs concerning communicating with other computers and devices over either the Internet or private networks.

    API Description
    Windows.Networking.Sockets

    The Windows.Networking.Sockets namespace provides TCP and UDP sockets that allow reliable or unreliable network communication.

    When to use

    Use Windows.Networking.Sockets if your game needs to communicate with other computers or devices over the network.

    For more information

    See Work with networking in your game.

    Windows.Web.HTTP

    The Windows.Web.HTTP namespace provides a reliable connection to HTTP servers that can be used to access a web site.

    When to use

    Use Windows.Web.HTTP when your game needs to access a web site to retrieve or store information.

    For more information

    See Work with networking in your game.

     

  • Support Utilities - Libraries that build on the Windows 10 APIs.

    Library Description
    DirectX Tool Kit

    The DirectX Tool Kit (DirectXTK) is a collection of helper classes for writing DirectX 11.x code in C++.

    When to use

    Use the DirectX Tool Kit if you're a C++ developer looking for a modern replacement to the legacy D3DX utility code or you're an XNA Game Studio developer transitioning to native C++.

    For more information

    See the DirectX Tool Kit project page, https://github.com/Microsoft/DirectXTK.

    Win2D

    Win2D is an easy-to-use Windows Runtime API for immediate mode 2D graphics rendering.

    When to use

    Use Win2D if you're a C++ developer and want an easier to use WinRT wrapper for Direct2D and DirectWrite, or you're a C# developer wanting to use Direct2D and DirectWrite.

    For more information

    See the Win2D project page, https://github.com/Microsoft/Win2D.

     

Xbox Live Services

The Xbox Live Creators Program allows any developer to integrate Xbox Live into their UWP game and publish to Xbox One and Windows 10. Integrate Xbox Live social experiences such as sign-in, presence, leaderboards, and more into your title, with minimal development time. Xbox Live social features are designed to organically grow your audience, spreading awareness to over 55 million active gamers.

If you want access to even more Xbox Live capabilities, dedicated marketing and development support, and the chance to be featured in the main Xbox One store, apply to the ID@Xbox program. To see which features are available to the Xbox Live Creators Program and ID@Xbox program, see the Feature table.

For more info, go to Adding Xbox Live to your game.

Alternatives to writing games with DirectX and UWP

UWP Games without DirectX

Simpler games with minimal performance requirements, such as card games or board games, can be written without DirectX and don't necessarily need to be written in C++. These sort of games can make use of any of the languages supported by UWP such as C#, Visual Basic, C++, and HTML/JavaScript. If performance and intensive graphics are not a requirement for your game, checkout JavaScript and HTML5 touch game sample as an example.

Game Engines

As an alternative to writing your own game engine using the Windows game development APIs, many high quality game engines that build on the Windows game development APIs are available for developing games on Windows platforms. When considering a game engine or library, you have multiple options:

  • Full game engine - A full game engine encapsulates most or all of the Windows 10 APIs you would use when writing a game engine from scratch, such as graphics, audio, input, and networking. Full game engines may also provide game logic functionality such as artificial intelligence and pathfinding.
  • Graphics engine - Graphics engines encapsulate the Windows 10 graphics APIs, manage graphics resources, and support a variety of model and world formats.
  • Audio engine - Audio engines encapsulate the Windows 10 audio APIs, manage audio resources, and provide advanced audio processing and effects.
  • Network engine - Network engines encapsulate Windows 10 networking APIs for adding peer-to-peer or server-based multiplayer support to your game, and may include advanced networking functionality to support large numbers of players.
  • Artificial intelligence and pathfinding engine - AI and pathfinding engines provide a framework for controlling the behavior of agents in your game.
  • Special purpose engines - A variety of additional engines exist for handling almost any game development related task you might run into, such as creating inventory systems and dialog trees.

Submitting a game to the Store

Once you’re ready to publish your game, you’ll need to create a developer account and submit your game to the Microsoft Store.

For information about submitting your game to the Microsoft Store, see Submitting and publishing your game.