Simulated Reality SDK 7500c78d v1.30.2.51085 2024-04-26T11:23:03Z
Stable
Public Member Functions | List of all members
SR::PredictingDX9Weaver Class Reference

#include <dx9weaver.h>

Inheritance diagram for SR::PredictingDX9Weaver:
[legend]
Collaboration diagram for SR::PredictingDX9Weaver:
[legend]

Public Member Functions

 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. More...
 
 ~PredictingDX9Weaver ()
 Handles proper destruction of all weaver related classes and buffers. More...
 
void setLatency (uint64_t latency)
 Set the latency to match the expected duration of the full rendering pipeline. More...
 
void setLatencyInFrames (uint64_t latencyInFrames)
 Set the latency to match the expected duration of the full rendering pipeline in number of frames. The latency in time is calculated using these number of frames based on the refresh rate of the monitor that the application is running on, this will be dynamically updated when the window changes monitor. For this it requires the weaver to be given a valid window handle of the running application. More...
 
- Public Member Functions inherited from SR::DX9WeaverBase
 DX9WeaverBase ()
 
 ~DX9WeaverBase ()
 
IDirect3DSurface9 * getFrameBuffer ()
 Returns the buffer that will be used to create a weaved image. This buffer expects a side-by-side image. When a frame buffer is provided by calling setInputFrameBuffer(), the internally created buffer will be released. More...
 
void setInputFrameBuffer (IDirect3DTexture9 *frameBuffer)
 Sets the buffer that will be used to create a weaved image. This will release the internally created frame buffer. More...
 
void setWindowHandle (HWND handle)
 Sets the window handle of the application window. More...
 
bool canWeave (unsigned int width, unsigned int height)
 Used to determine if software weaving is possible for certain size and visibility to the currently bound framebuffer. More...
 
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 bound framebuffer. More...
 
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 framebuffer must be set before calling this function. More...
 
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 framebuffer must be set before calling this function. More...
 
void invalidateDeviceObjects ()
 Free all resources that were created in the default memory pool. This method should be called before IDirect3DDevice9::Reset(). More...
 
void restoreDeviceObjects ()
 Allocate all resources that are created in the default memory pool. This method should be called after IDirect3DDevice9::Reset(). More...
 

Additional Inherited Members

- Protected Attributes inherited from SR::DX9WeaverBase
std::unique_ptr< Impl > pimpl
 

Constructor & Destructor Documentation

◆ PredictingDX9Weaver()

SR::PredictingDX9Weaver::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.

Parameters
contextto connect to
deviceinterface used to create resources
widthof the side-by-side image to be weaved together
heightof the side-by-side image to be weaved together
windowHandle of the application window

◆ ~PredictingDX9Weaver()

SR::PredictingDX9Weaver::~PredictingDX9Weaver ( )

Handles proper destruction of all weaver related classes and buffers.

Member Function Documentation

◆ setLatency()

void SR::PredictingDX9Weaver::setLatency ( uint64_t  latency)

Set the latency to match the expected duration of the full rendering pipeline.

The eye positions should be predicted to the timepoint at which the frame is visible to the user Internally the prediction is already taking care of all other latency, only the rendering pipeline latency is application dependent A low latency app would have 1 framebuffer latency, so 16666 microseconds (the generated frame will be presented at next v-sync) When using v-sync, the driver adds at least 1 buffer latency, and maybe the windows display manager also adds a buffer latency. Typically, the latency is n * 1000*1000/framerate microseconds

Parameters
latencyThe latency from the moment when weave() is called until presenting the current frame to the user, in microseconds

◆ setLatencyInFrames()

void SR::PredictingDX9Weaver::setLatencyInFrames ( uint64_t  latencyInFrames)

Set the latency to match the expected duration of the full rendering pipeline in number of frames. The latency in time is calculated using these number of frames based on the refresh rate of the monitor that the application is running on, this will be dynamically updated when the window changes monitor. For this it requires the weaver to be given a valid window handle of the running application.

The eye positions should be predicted to the timepoint at which the frame is visible to the user Internally the prediction is already taking care of all other latency, only the rendering pipeline latency is application dependent A low latency app would have 1 framebuffer latency, the generated frame will be presented at next v-sync) When using v-sync, the driver adds at least 1 buffer latency, and maybe the windows display manager also adds a buffer latency.

Parameters
latencyInFramesThe expected number of frames before presenting the current generated frame to the user.

The documentation for this class was generated from the following file: