Simulated Reality SDK 7500c78d v1.30.2.51085 2024-04-26T11:23:03Z
Stable
dx11weaver.h
Go to the documentation of this file.
1
10#pragma once
11#include <memory>
12#include <d3d11.h>
14#include "sr/weaver/Weaver.h"
15
16#ifdef WIN32
17# ifdef COMPILING_DLL_SimulatedRealityDirectX
18# define DIMENCOSR_API __declspec(dllexport)
19# else
20# define DIMENCOSR_API __declspec(dllimport)
21# endif
22#else
23# define DIMENCOSR_API
24#endif
25
31namespace SR
32{
33 class Screen;
34
36 protected:
37 class Impl;
43#pragma warning(suppress: 4251)
44 std::unique_ptr<Impl> pimpl;
45
46 public:
49
58 ID3D11RenderTargetView* getFrameBuffer();
59
64 void setInputFrameBuffer(ID3D11ShaderResourceView* frameBuffer);
65
70 void setContext(ID3D11DeviceContext* context);
71
76 void setWindowHandle(HWND handle);
77
83 [[deprecated("Use the canWeave(...) functions that accept parameters")]]
84 bool canWeave();
85
93 bool canWeave(unsigned int width, unsigned int height);
94
104 bool canWeave(unsigned int width, unsigned int height, unsigned int xOffset, unsigned int yOffset);
105
112 void weave(unsigned int width, unsigned int height);
113
122 void weave(unsigned int width, unsigned int height, unsigned int xOffset, unsigned int yOffset);
123 };
124
126 public:
136 [[deprecated("Use non-deprecated constructors")]]
137 DX11Weaver(SR::SRContext& context, ID3D11Device* device, ID3D11DeviceContext* deviceContext, unsigned int width, unsigned int height);
138
148 DX11Weaver(SR::SRContext& context, ID3D11Device* device, ID3D11DeviceContext* deviceContext, unsigned int width, unsigned int height, HWND window);
149
160 [[deprecated("Use non-deprecated constructors")]]
161 DX11Weaver(SR::SRContext& context, ID3D11Device* device, ID3D11DeviceContext* deviceContext, unsigned int width, unsigned int height, DXGI_FORMAT format);
162
174 [[deprecated("Use non-deprecated constructors")]]
175 DX11Weaver(SR::SRContext& context, ID3D11Device* device, ID3D11DeviceContext* deviceContext, unsigned int width, unsigned int height, DXGI_FORMAT format, HWND window);
176
181 };
182
184 public:
194 [[deprecated("Use non-deprecated constructors")]]
195 PredictingDX11Weaver(SR::SRContext& context, ID3D11Device* device, ID3D11DeviceContext* deviceContext, unsigned int width, unsigned int height);
196
206 PredictingDX11Weaver(SR::SRContext& context, ID3D11Device* device, ID3D11DeviceContext* deviceContext, unsigned int width, unsigned int height, HWND window);
207
218 [[deprecated("Use non-deprecated constructors")]]
219 PredictingDX11Weaver(SR::SRContext& context, ID3D11Device* device, ID3D11DeviceContext* deviceContext, unsigned int width, unsigned int height, DXGI_FORMAT format);
220
232 [[deprecated("Use non-deprecated constructors")]]
233 PredictingDX11Weaver(SR::SRContext& context, ID3D11Device* device, ID3D11DeviceContext* deviceContext, unsigned int width, unsigned int height, DXGI_FORMAT format, HWND window);
234
239
251 void setLatency(uint64_t latency);
252
265 void setLatencyInFrames(uint64_t latencyInFrames);
266 };
267}
268
269#undef DIMENCOSR_API
Definition: dx11weaver.h:35
ID3D11RenderTargetView * getFrameBuffer()
Returns the buffer that will be used to create a weaved image. This buffer expects a side-by-side ima...
void weave(unsigned int width, unsigned int height)
Can be called to render a weaved image of a certain size to the currently bound framebuffer A framebu...
void setInputFrameBuffer(ID3D11ShaderResourceView *frameBuffer)
Sets the buffer that will be used to create a weaved image. This will release the internally created ...
void setWindowHandle(HWND handle)
Sets the window handle of the application window. If the weaver was created using a deprecated constr...
void weave(unsigned int width, unsigned int height, unsigned int xOffset, unsigned int yOffset)
Can be called to render a weaved image of a certain size to the currently bound framebuffer A framebu...
void setContext(ID3D11DeviceContext *context)
Sets the device context for the weaver to use.
bool canWeave(unsigned int width, unsigned int height)
Used to determine if software weaving is possible for certain size and visibility to the currently bo...
bool canWeave(unsigned int width, unsigned int height, unsigned int xOffset, unsigned int yOffset)
Used to determine if software weaving is possible for certain size and visibility to the currently bo...
std::unique_ptr< Impl > pimpl
Definition: dx11weaver.h:37
bool canWeave()
Used to determine if software weaving is possible on this device.
Definition: dx11weaver.h:125
~DX11Weaver()
Handles proper destruction of all weaver related classes and buffers.
DX11Weaver(SR::SRContext &context, ID3D11Device *device, ID3D11DeviceContext *deviceContext, unsigned int width, unsigned int height, DXGI_FORMAT format)
Constructs a class to be used for weaving an input image of a certain size and format.
DX11Weaver(SR::SRContext &context, ID3D11Device *device, ID3D11DeviceContext *deviceContext, unsigned int width, unsigned int height)
Constructs a class to be used for weaving an input image of a certain size.
DX11Weaver(SR::SRContext &context, ID3D11Device *device, ID3D11DeviceContext *deviceContext, unsigned int width, unsigned int height, HWND window)
Constructs a class to be used for weaving an input image of a certain size.
DX11Weaver(SR::SRContext &context, ID3D11Device *device, ID3D11DeviceContext *deviceContext, unsigned int width, unsigned int height, DXGI_FORMAT format, HWND window)
Constructs a class to be used for weaving an input image of a certain size and format.
Definition: dx11weaver.h:183
void setLatencyInFrames(uint64_t latencyInFrames)
Set the latency to match the expected duration of the full rendering pipeline in number of frames....
void setLatency(uint64_t latency)
Set the latency to match the expected duration of the full rendering pipeline.
PredictingDX11Weaver(SR::SRContext &context, ID3D11Device *device, ID3D11DeviceContext *deviceContext, unsigned int width, unsigned int height, HWND window)
Constructs a class to be used for weaving an input image of a certain size.
PredictingDX11Weaver(SR::SRContext &context, ID3D11Device *device, ID3D11DeviceContext *deviceContext, unsigned int width, unsigned int height, DXGI_FORMAT format, HWND window)
Constructs a class to be used for weaving an input image of a certain size and format.
PredictingDX11Weaver(SR::SRContext &context, ID3D11Device *device, ID3D11DeviceContext *deviceContext, unsigned int width, unsigned int height, DXGI_FORMAT format)
Constructs a class to be used for weaving an input image of a certain size and format.
PredictingDX11Weaver(SR::SRContext &context, ID3D11Device *device, ID3D11DeviceContext *deviceContext, unsigned int width, unsigned int height)
Constructs a class to be used for weaving an input image of a certain size.
~PredictingDX11Weaver()
Handles proper destruction of all weaver related classes and buffers.
Maintains WorldObject and Sense objects during the application lifetime.
Definition: srcontext.h:80
#define DIMENCOSR_API
Definition: dx11weaver.h:23
Namespace containing all C++ Simulated Reality classes.
Definition: srconfiguration.h:25