DXGI_SWAP_CHAIN_DESC1 is just used once to create the SwapChain
CreateSwapChainForCoreWindow is for UWP
In desktop apps, you use CreateSwapChainForHwnd or CreateSwapChainForComposition
The window handle is from the main window, created with CreateWindowEx
unknown variable Direct2D 1.1 device-dependent resource initialization
This tutorial describes how to create a device context in Direct2D 1.1 application.
Please refer to the Selecting a target section.
I have several questions from this tutorial:
- Is
DXGI_SWAP_CHAIN_DESC1a temporary usage or I must store it in my main window class? (for further usage) - Where did the
m_hwndin theCreateSwapChainForCoreWindowmethod come from?
The m_hwnd is the most frustating part from the tutorial. The tutorial did not mention anything about that. There are also many things that MSDN tutorials didn't mention, however I can know by just looking at the reference. The m_hwnd from nowhere, I looked at the reference fro CreateSwapChainForCoreWindow, it turns out that m_hwnd is a CoreWindow.
Where does the CoreWindow come from?
Edit: there is alternative, CreateSwapChainForHwnd, what is the difference between these two methods?
Windows development | Windows API - Win32
Developer technologies | C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
Answer accepted by question author