aboutsummaryrefslogtreecommitdiff
path: root/contrib/DirectX-Headers/test/test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/DirectX-Headers/test/test.cpp')
-rw-r--r--contrib/DirectX-Headers/test/test.cpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/contrib/DirectX-Headers/test/test.cpp b/contrib/DirectX-Headers/test/test.cpp
new file mode 100644
index 0000000..8f34d73
--- /dev/null
+++ b/contrib/DirectX-Headers/test/test.cpp
@@ -0,0 +1,32 @@
1// Copyright (c) Microsoft Corporation.
2// Licensed under the MIT License.
3
4#ifndef _WIN32
5#include <wsl/winadapter.h>
6#endif
7
8#include <directx/d3d12.h>
9#include <directx/dxcore.h>
10#include <directx/d3dx12.h>
11#include "dxguids/dxguids.h"
12
13int main()
14{
15 IDXCoreAdapter *adapter = nullptr;
16 ID3D12Device *device = nullptr;
17
18 {
19 IDXCoreAdapterFactory *factory = nullptr;
20 if (FAILED(DXCoreCreateAdapterFactory(&factory)))
21 return -1;
22
23 IDXCoreAdapterList *list = nullptr;
24 if (FAILED(factory->CreateAdapterList(1, &DXCORE_ADAPTER_ATTRIBUTE_D3D12_CORE_COMPUTE, &list)))
25 return -1;
26
27 if (FAILED(list->GetAdapter(0, &adapter)))
28 return -1;
29 }
30
31 return D3D12CreateDevice(adapter, D3D_FEATURE_LEVEL_11_0, IID_PPV_ARGS(&device));
32}