Simulated Reality SDK 7500c78d v1.30.2.51085 2024-04-26T11:23:03Z
Stable
dx9weaver.h
Go to the documentation of this file.
1
10#pragma once
11#include <memory>
12#include <d3d9.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{
34 protected:
35 class Impl;
41#pragma warning(suppress: 4251)
42 std::unique_ptr<Impl> pimpl;
43
44 public:
47
56 IDirect3DSurface9* getFrameBuffer();
57
62 void setInputFrameBuffer(IDirect3DTexture9* frameBuffer);
63
68 void setWindowHandle(HWND handle);
69
77 bool canWeave(unsigned int width, unsigned int height);
78
88 bool canWeave(unsigned int width, unsigned int height, unsigned int xOffset, unsigned int yOffset);
89
96 void weave(unsigned int width, unsigned int height);
97
106 void weave(unsigned int width, unsigned int height, unsigned int xOffset, unsigned int yOffset);
107
112
117 };
118
120 public:
129 DX9Weaver(SR::SRContext& context, IDirect3DDevice9* device, unsigned int width, unsigned int height, HWND window);
130
135 };
136
138 public:
147 PredictingDX9Weaver(SR::SRContext& context, IDirect3DDevice9* device, unsigned int width, unsigned int height, HWND window);
148
153
165 void setLatency(uint64_t latency);
166
179 void setLatencyInFrames(uint64_t latencyInFrames);
180 };
181}
182
183#undef DIMENCOSR_API
Definition: dx9weaver.h:33
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...
std::unique_ptr< Impl > pimpl
Definition: dx9weaver.h:35
void invalidateDeviceObjects()
Free all resources that were created in the default memory pool. This method should be called before ...
void restoreDeviceObjects()
Allocate all resources that are created in the default memory pool. This method should be called afte...
void setWindowHandle(HWND handle)
Sets the window handle of the application window.
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...
IDirect3DSurface9 * getFrameBuffer()
Returns the buffer that will be used to create a weaved image. This buffer expects a side-by-side ima...
void setInputFrameBuffer(IDirect3DTexture9 *frameBuffer)
Sets the buffer that will be used to create a weaved image. This will release the internally created ...
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...
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...
Definition: dx9weaver.h:119
DX9Weaver(SR::SRContext &context, IDirect3DDevice9 *device, unsigned int width, unsigned int height, HWND window)
Constructs a class to be used for weaving an input image of a certain size.
~DX9Weaver()
Handles proper destruction of all weaver related classes and buffers.
Definition: dx9weaver.h:137
PredictingDX9Weaver(SR::SRContext &context, IDirect3DDevice9 *device, unsigned int width, unsigned int height, HWND window)
Constructs a class to be used for weaving an input image of a certain size.
~PredictingDX9Weaver()
Handles proper destruction of all weaver related classes and buffers.
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.
Maintains WorldObject and Sense objects during the application lifetime.
Definition: srcontext.h:80
#define DIMENCOSR_API
Definition: dx9weaver.h:23
Namespace containing all C++ Simulated Reality classes.
Definition: srconfiguration.h:25