Varjo Native SDK
Varjo_d3d11.h
Go to the documentation of this file.
1 // Copyright 2019-2023 Varjo Technologies Oy. All rights reserved.
2 
3 #ifndef VARJO_D3D11_H
4 #define VARJO_D3D11_H
5 
6 #include "Varjo.h"
7 #include "Varjo_types_d3d11.h"
8 
9 #if defined __cplusplus
10 extern "C" {
11 #endif
12 
16 VARJO_API struct varjo_Texture varjo_FromD3D11Texture(struct ID3D11Texture2D* texture);
17 
22 VARJO_DEPRECATED_API struct ID3D11Texture2D* varjo_ToD3D11texture(struct varjo_Texture texture);
23 
27 VARJO_API struct ID3D11Texture2D* varjo_ToD3D11Texture(struct varjo_Texture texture);
28 
37 VARJO_API struct varjo_Luid varjo_D3D11GetLuid(struct varjo_Session* session);
38 
39 #if defined __cplusplus
40 }
41 #endif
42 
43 #if defined DIRECTX_MATH_VERSION
44 
47 static DirectX::XMMATRIX varjo_DoubleArrayToXMMatrix(double* m)
48 {
49  return DirectX::XMMATRIX{
50  (float)m[0],
51  (float)m[1],
52  (float)m[2],
53  (float)m[3],
54  (float)m[4],
55  (float)m[5],
56  (float)m[6],
57  (float)m[7],
58  (float)m[8],
59  (float)m[9],
60  (float)m[10],
61  (float)m[11],
62  (float)m[12],
63  (float)m[13],
64  (float)m[14],
65  (float)m[15],
66  };
67 }
68 
72 static DirectX::XMMATRIX varjo_DoubleArray3x3ToXMMatrix(double* m)
73 {
74  return DirectX::XMMATRIX{
75  (float)m[0],
76  (float)m[1],
77  (float)m[2],
78  0.0f,
79  (float)m[3],
80  (float)m[4],
81  (float)m[5],
82  0.0f,
83  (float)m[6],
84  (float)m[7],
85  (float)m[8],
86  0.0f,
87  0.0f,
88  0.0f,
89  0.0f,
90  0.0f,
91  };
92 }
93 #endif
94 
95 #endif
Varjo.h
Varjo_types_d3d11.h
varjo_FromD3D11Texture
struct varjo_Texture varjo_FromD3D11Texture(struct ID3D11Texture2D *texture)
Converts a Direct3D 11 texture to varjo_Texture.
varjo_D3D11GetLuid
struct varjo_Luid varjo_D3D11GetLuid(struct varjo_Session *session)
Retrieves LUID of the device which is used by compositor.
varjo_ToD3D11texture
VARJO_DEPRECATED_API struct ID3D11Texture2D * varjo_ToD3D11texture(struct varjo_Texture texture)
Converts varjo_Texture to Direct3D 11 texture.
varjo_Texture
API-agnostic texture handle.
Definition: Varjo_types.h:512
varjo_ToD3D11Texture
struct ID3D11Texture2D * varjo_ToD3D11Texture(struct varjo_Texture texture)
Converts varjo_Texture to Direct3D 11 texture.
VARJO_DEPRECATED_API
#define VARJO_DEPRECATED_API
Definition: Varjo_export.h:46
varjo_Luid
Device Luid.
Definition: Varjo_types_d3d11.h:16