Simulated Reality SDK 7500c78d v1.30.2.51085 2024-04-26T11:23:03Z
Stable
glweaver.h
Go to the documentation of this file.
1
10#pragma once
11
12#include<memory>
14#include "windows.h"
15#include "sr/weaver/Weaver.h"
16
17#ifdef WIN32
18# ifdef COMPILING_DLL_SimulatedRealityOpenGL
19# define DIMENCOSR_API __declspec(dllexport)
20# else
21# define DIMENCOSR_API __declspec(dllimport)
22# endif
23#else
24# define DIMENCOSR_API
25#endif
26
27// GL types
28typedef unsigned int GLuint;
29typedef int GLsizei;
30
31namespace SR {
38 protected:
39 class Impl;
45#pragma warning(suppress: 4251)
46 std::unique_ptr<Impl> pimpl;
47 public:
50
59
65 void setInputFrameBuffer(GLuint frameBufferID, GLuint renderedTextureID);
66
71 void setWindowHandle(HWND handle);
72
78 [[deprecated("Use the canWeave(...) functions that accept parameters")]]
79 bool canWeave();
80
88 bool canWeave(unsigned int width, unsigned int height);
89
99 bool canWeave(unsigned int width, unsigned int height, unsigned int xOffset, unsigned int yOffset);
100
108 void weave(unsigned int width, unsigned int height);
109
119 void weave(unsigned int width, unsigned int height, unsigned int xOffset, unsigned int yOffset);
120 };
121
123 public:
134 [[deprecated("use the constructor of GLWeaver directly")]]
135 static GLWeaver* create(SR::SRContext& context, unsigned int width, unsigned int height);
136
144 GLWeaver(SR::SRContext& context, unsigned int width, unsigned int height);
145
150 };
151
153 public:
162 [[deprecated("Use non-deprecated constructors")]]
163 PredictingGLWeaver(SR::SRContext& context, unsigned int width, unsigned int height);
164
173 PredictingGLWeaver(SR::SRContext& context, unsigned int width, unsigned int height, HWND window);
174
179
191 void setLatency(uint64_t latency);
192
205 void setLatencyInFrames(uint64_t latencyInFrames);
206
207 };
208}
209
210#undef DIMENCOSR_API
class to be used to add Weaving to OpenGL based SR applications
Definition: glweaver.h:37
GLuint getFrameBuffer()
Returns the buffer that will be used to create a weaved imaged. This buffer expects a side-by-side im...
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...
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.
bool canWeave()
Used to determine if software weaving is possible on this device.
void setInputFrameBuffer(GLuint frameBufferID, GLuint renderedTextureID)
Sets the buffer that will be used to create a weaved image.
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)
Can be called to render a weaved image of a certain size to the currently bound framebuffer.
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: glweaver.h:39
Definition: glweaver.h:122
static GLWeaver * create(SR::SRContext &context, unsigned int width, unsigned int height)
Constructs a class to be used for weaving an input image of a certain size.
~GLWeaver()
Handles proper destruction of all weaver related classes and buffers.
GLWeaver(SR::SRContext &context, unsigned int width, unsigned int height)
Constructs a class to be used for weaving an input image of a certain size.
Definition: glweaver.h:152
~PredictingGLWeaver()
Handles proper destruction of all weaver related classes and buffers.
PredictingGLWeaver(SR::SRContext &context, unsigned int width, unsigned int height)
Constructs a class to be used for weaving an input image of a certain size.
void setLatency(uint64_t latency)
Set the latency to match the expected duration of the full rendering pipeline.
PredictingGLWeaver(SR::SRContext &context, unsigned int width, unsigned int height, HWND window)
Constructs a class to be used for weaving an input image of a certain size.
void setLatencyInFrames(uint64_t latencyInFrames)
Set the latency to match the expected duration of the full rendering pipeline in number of frames....
Maintains WorldObject and Sense objects during the application lifetime.
Definition: srcontext.h:80
#define DIMENCOSR_API
Definition: glweaver.h:24
int GLsizei
Definition: glweaver.h:29
unsigned int GLuint
Definition: glweaver.h:28
Namespace containing all C++ Simulated Reality classes.
Definition: srconfiguration.h:25