LeiaSR SDK 5a9e5e80 v1.34.7.24192 2025-10-22T20:48:31Z
Experimental
IWeaverBase.h
Go to the documentation of this file.
1
5#pragma once
6
7// Windows include files.
8#ifdef WIN32
9# define WIN32_LEAN_AND_MEAN
10# include <windows.h>
11#else
12# define HWND void*
13#endif
14#include <typeindex>
15
16namespace SR
17{
24 {
25 public:
29 virtual void destroy() = 0;
30 };
31
38 {
39 protected:
40 virtual void* queryInterface(std::type_index type) = 0;
41
42 public:
46 template<typename T>
47 inline T* query() { return static_cast<T*>(queryInterface(typeid(T))); }
48 };
49
50
57 {
58 public:
59
65 virtual void setWindowHandle(HWND handle) = 0;
66
71 virtual void weave() = 0;
72
79 virtual void enableLateLatching(bool enable) = 0;
80
85 virtual bool isLateLatchingEnabled() const = 0;
86
87
95 virtual void setShaderSRGBConversion(bool read, bool write) = 0;
96
109 virtual void setLatencyInFrames(uint64_t latencyInFrames) = 0;
110
122 virtual void setLatency(uint64_t latency) = 0;
123
132 virtual uint64_t getLatency() const = 0;
133
142 virtual void getPredictedEyePositions(float* left, float* right) = 0;
143
144 protected:
145 IWeaverBase1() = default;
146 virtual ~IWeaverBase1() = default;
147
148 IWeaverBase1(const IWeaverBase1&) = delete;
152 };
153
154
161 {
162 public:
167 virtual void getDefaultViewingPosition(float position_mm[3]) const = 0;
168
169 protected:
170 IWeaverBase2() = default;
171 virtual ~IWeaverBase2() = default;
172
173 IWeaverBase2(const IWeaverBase2&) = delete;
177 };
178
179
180
181
182}
#define HWND
Definition: IWeaverBase.h:12
Interface for objects that can be destroyed.
Definition: IWeaverBase.h:24
virtual void destroy()=0
Deletes this object. All future references will be invalid.
Interface for querying interfaces with a specific type.
Definition: IWeaverBase.h:38
T * query()
Query the interface from the running Runtime. Returns nullptr when this interface is not available.
Definition: IWeaverBase.h:47
virtual void * queryInterface(std::type_index type)=0
Weaver base class for all graphics APIs.
Definition: IWeaverBase.h:57
virtual void enableLateLatching(bool enable)=0
Enables late latching. Note that late latching requires applications to call weave() once per frame....
virtual void setLatency(uint64_t latency)=0
Set the latency to match the expected duration of the full rendering pipeline.
virtual void getPredictedEyePositions(float *left, float *right)=0
Gets the tracked eye positions. Intended to be used by virtual cameras Note: the latency set by setLa...
IWeaverBase1(IWeaverBase1 &&)=delete
IWeaverBase1 & operator=(IWeaverBase1 &&)=delete
virtual void setShaderSRGBConversion(bool read, bool write)=0
Sets whether to apply shader sRGB/Linear color space conversions during weaving. When input is alread...
virtual void weave()=0
Performs weaving from the provided stereo texture to the current render-target using currently setup ...
IWeaverBase1()=default
virtual uint64_t getLatency() const =0
Get the latency that is used by the weaver. If setLatency has been called, the value set by that func...
virtual void setLatencyInFrames(uint64_t latencyInFrames)=0
Set the latency to match the expected duration of the full rendering pipeline in number of frames....
IWeaverBase1 & operator=(const IWeaverBase1 &)=delete
IWeaverBase1(const IWeaverBase1 &)=delete
virtual void setWindowHandle(HWND handle)=0
Sets the new window handle of the window that will present the backbuffer. Note: the backbuffer size ...
virtual ~IWeaverBase1()=default
virtual bool isLateLatchingEnabled() const =0
Determines if late latching is currently enabled.
Weaver base class for all graphics APIs.
Definition: IWeaverBase.h:161
IWeaverBase2(IWeaverBase2 &&)=delete
IWeaverBase2(const IWeaverBase2 &)=delete
IWeaverBase2 & operator=(const IWeaverBase2 &)=delete
virtual void getDefaultViewingPosition(float position_mm[3]) const =0
Retrieves the default viewing position in 3D display coordinates.
virtual ~IWeaverBase2()=default
IWeaverBase2 & operator=(IWeaverBase2 &&)=delete
IWeaverBase2()=default
Namespace containing all C++ Simulated Reality classes.
Definition: srconfiguration.h:20