O'Reilly logo

DirectX 11.1 Game Programming by Pooya Eimandar

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Initializing the device

In the final section of this chapter, we are going to initialize and configure our device. As the window has been created and the time has been added to our framework, the next step is to obtain a reference to the device. Open the Initialize the device project from the source code.

Let's check the new headers and classes of this project step-by-step. First, open DXHelper.h from the Framework folder. The DXHelper.h file is shown in the following code:

#pragma once #include "pch.h" using namespace Platform; namespace DXHelper { inline void OutputDebug(Platform::String^ Msg) { auto data = std::wstring(Msg->Data()); OutputDebugString(data.c_str()); } inline void ThrowIfFailed(HRESULT hr) { if (FAILED(hr)) throw Exception::CreateException(hr); ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required