Varjo Native SDK
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 
35 VARJO_DEPRECATED_API struct varjo_GraphicsInfo* varjo_D3D11Init(
36  struct varjo_Session* session, struct ID3D11Device* dev, varjo_TextureFormat format, struct varjo_SwapChainConfig* config);
37 
41 VARJO_API struct varjo_Texture varjo_FromD3D11Texture(struct ID3D11Texture2D* texture);
42 
47 VARJO_DEPRECATED_API struct ID3D11Texture2D* varjo_ToD3D11texture(struct varjo_Texture texture);
48 
52 VARJO_API struct ID3D11Texture2D* varjo_ToD3D11Texture(struct varjo_Texture texture);
53 
64 VARJO_DEPRECATED_API void varjo_D3D11ShutDown(struct varjo_Session* session);
65 
74 VARJO_API struct varjo_Luid varjo_D3D11GetLuid(struct varjo_Session* session);
75 
76 #if defined __cplusplus
77 }
78 #endif
79 
80 #if defined DIRECTX_MATH_VERSION
81 
84 static DirectX::XMMATRIX varjo_DoubleArrayToXMMatrix(double* m)
85 {
86  return DirectX::XMMATRIX{
87  (float)m[0],
88  (float)m[1],
89  (float)m[2],
90  (float)m[3],
91  (float)m[4],
92  (float)m[5],
93  (float)m[6],
94  (float)m[7],
95  (float)m[8],
96  (float)m[9],
97  (float)m[10],
98  (float)m[11],
99  (float)m[12],
100  (float)m[13],
101  (float)m[14],
102  (float)m[15],
103  };
104 }
105 
109 static DirectX::XMMATRIX varjo_DoubleArray3x3ToXMMatrix(double* m)
110 {
111  return DirectX::XMMATRIX{
112  (float)m[0],
113  (float)m[1],
114  (float)m[2],
115  0.0f,
116  (float)m[3],
117  (float)m[4],
118  (float)m[5],
119  0.0f,
120  (float)m[6],
121  (float)m[7],
122  (float)m[8],
123  0.0f,
124  0.0f,
125  0.0f,
126  0.0f,
127  0.0f,
128  };
129 }
130 #endif
131 
132 #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_D3D11ShutDown
VARJO_DEPRECATED_API void varjo_D3D11ShutDown(struct varjo_Session *session)
Closes the Direct3D connection.
varjo_TextureFormat
int64_t varjo_TextureFormat
Definition: Varjo_types.h:209
varjo_D3D11GetLuid
struct varjo_Luid varjo_D3D11GetLuid(struct varjo_Session *session)
Retrieves LUID of the device which is used by compositor.
varjo_D3D11Init
VARJO_DEPRECATED_API 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.
varjo_ToD3D11texture
VARJO_DEPRECATED_API struct ID3D11Texture2D * varjo_ToD3D11texture(struct varjo_Texture texture)
Converts a Varjo texture to Direct3D 11 texture.
varjo_Texture
API-agnostic texture handle.
Definition: Varjo_types.h:459
varjo_ToD3D11Texture
struct ID3D11Texture2D * varjo_ToD3D11Texture(struct varjo_Texture texture)
Converts a Varjo texture to Direct3D 11 texture.
VARJO_DEPRECATED_API
#define VARJO_DEPRECATED_API
Definition: Varjo_export.h:30
varjo_Luid
Device Luid.
Definition: Varjo_types_d3d11.h:16