SDK DOCUMENTATION
Varjo_d3d11.h
Go to the documentation of this file.
1 // Copyright 2019 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 
31 VARJO_API struct varjo_GraphicsInfo* varjo_D3D11Init(
32  struct varjo_Session* session, struct ID3D11Device* dev, varjo_TextureFormat format, struct varjo_SwapChainConfig* config);
33 
37 VARJO_API struct varjo_Texture varjo_FromD3D11Texture(ID3D11Texture2D* texture);
38 
43 VARJO_DEPRECATED_API struct ID3D11Texture2D* varjo_ToD3D11texture(varjo_Texture texture);
44 
48 VARJO_API struct ID3D11Texture2D* varjo_ToD3D11Texture(varjo_Texture texture);
49 
57 VARJO_API void varjo_D3D11ShutDown(struct varjo_Session* session);
58 
67 VARJO_API struct varjo_Luid varjo_D3D11GetLuid(struct varjo_Session* session);
68 
69 #if defined __cplusplus
70 }
71 #endif
72 
73 #if defined DIRECTX_MATH_VERSION
74 
77 static DirectX::XMMATRIX varjo_DoubleArrayToXMMatrix(double* m)
78 {
79  return DirectX::XMMATRIX{
80  (float)m[0],
81  (float)m[1],
82  (float)m[2],
83  (float)m[3],
84  (float)m[4],
85  (float)m[5],
86  (float)m[6],
87  (float)m[7],
88  (float)m[8],
89  (float)m[9],
90  (float)m[10],
91  (float)m[11],
92  (float)m[12],
93  (float)m[13],
94  (float)m[14],
95  (float)m[15],
96  };
97 }
98 #endif
99 
100 #endif
struct ID3D11Texture2D * varjo_ToD3D11Texture(varjo_Texture texture)
Converts a Varjo texture to Direct3D 11 texture.
void varjo_D3D11ShutDown(struct varjo_Session *session)
Closes the Direct3D connection.
Device Luid.
Definition: Varjo_types_d3d11.h:16
#define VARJO_DEPRECATED_API
Definition: Varjo_export.h:29
struct varjo_GraphicsInfo * varjo_D3D11Init(struct varjo_Session *session, struct ID3D11Device *dev, varjo_TextureFormat format, struct varjo_SwapChainConfig *config)
Sets up the Direct3D device that the SDK will use for texture communication.
struct varjo_Luid varjo_D3D11GetLuid(struct varjo_Session *session)
Retrieves LUID of the device which is used by compositor.
int64_t varjo_TextureFormat
Definition: Varjo_types.h:136
API-agnostic texture handle.
Definition: Varjo_types.h:334
General graphics information.
Definition: Varjo_types.h:320
VARJO_DEPRECATED_API struct ID3D11Texture2D * varjo_ToD3D11texture(varjo_Texture texture)
Converts a Varjo texture to Direct3D 11 texture.
struct varjo_Texture varjo_FromD3D11Texture(ID3D11Texture2D *texture)
Converts a Direct3D 11 texture to varjo_Texture.
Config for swap chain texture size and count.
Definition: Varjo_types.h:288