15 #include <osg/StateSet>
16 #include <osg/Geometry>
17 #include <osg/Texture2D>
63 virtual void acquireTextures() = 0;
72 virtual void releaseTextures() = 0;
75 bool isInitialized()
const;
78 unsigned int length()
const;
90 unsigned int width()
const;
93 unsigned int height()
const;
96 unsigned int layers()
const;
102 GLuint getFbo(
unsigned int index)
const;
105 virtual void copyTextures(osg::RenderInfo& renderInfo,
unsigned int srcColorId,
unsigned int srcDepthId,
unsigned int srcStencilId,
bool copySrcAlpha =
false,
bool srcIsArray =
true,
int mode = 0)
const;
109 virtual void blitTextureToScreen(
int swidth,
int sheight,
bool showleftEye,
int overrideIndex = -1);
118 virtual bool initaliseFbos()
const;
121 virtual bool initCopyProgram(
bool copyDepth,
bool copyStencil,
bool copySrcAlpha,
bool srcIsArray)
const;
124 virtual bool initBlendProgram()
const;
197 virtual osg::Object*
clone(
const osg::CopyOp& copyop)
const
201 virtual int compare(
const StateAttribute& sa)
const
208 virtual void apply(osg::State& state)
const
212 glBindTexture(GL_TEXTURE_2D, myTextureId);
228 virtual void drawImplementation(osg::RenderInfo& info)
const;
229 virtual void releaseGLObjects(osg::State* state)
const;
233 virtual void setOverlayTexture(osg::Texture2D* overlay);
234 virtual void setSceneTextureOffset(osg::Vec2 uvOffset);
238 virtual void initGlObjects()
const;
250 mutable std::map<vrvVirtualReality::DtEye, osg::ref_ptr<DtExternalTextureAttribute>>
myLayerTextures;
osg::ref_ptr< osg::StateSet > myStateSet
Definition: DtSwapChain.h:251
virtual void apply(osg::State &state) const
Definition: DtSwapChain.h:208
osg::ref_ptr< osg::StateSet > myCopyStateSet
state set to encapsulate state changes when doing swapchain fill
Definition: DtSwapChain.h:165
std::map< vrvVirtualReality::DtEye, osg::ref_ptr< DtExternalTextureAttribute > > myLayerTextures
Definition: DtSwapChain.h:250
virtual int compare(const StateAttribute &sa) const
Definition: DtSwapChain.h:201
double length(const dvec3 &theVec)
Definition: DtVecUtils.h:20
DtGlProgram * myCopyProgram
shader to copy sources texture into swapchain
Definition: DtSwapChain.h:159
Contains DLL export macros.
std::vector< DtGlImageType > myFormats
the format of the texture swap chain
Definition: DtSwapChain.h:141
int myCurrentSwapChainIndex
Definition: DtSwapChain.h:248
Definition: DtSwapChain.h:31
Definition: DtSwapChain.h:219
unsigned int GLuint
Definition: DtGlTextureBufferObject.h:18
unsigned int myLastStencilTexId
the current source depth texture id, tracked so we can recreate stencil view if it changes ...
Definition: DtSwapChain.h:171
DtGlProgram * myBlendProgram
shader to blend two swapchains into one (scene and overlay)
Definition: DtSwapChain.h:177
A convenience class to represent an OpenGL Shader Program.
Definition: DtGlProgram.h:66
A driver that manages virtual reality HMD and input devices.
Definition: DtVirtualRealityDriver.h:54
std::vector< DtSwapChainTextureType > myTextureTypes
the type of the texture swap chain
Definition: DtSwapChain.h:138
#define DT_DLL_VRVVR
Definition: vrvVirtualReality.h:19
DtEye
A virtual reality eye.
Definition: vrvVirtualReality.h:37
int myLastCopyProgramConfig
the bit mask for the last complied version of the copy program
Definition: DtSwapChain.h:162
DtVirtualRealityDriver & myDriver
Definition: DtSwapChain.h:243
DtSwapChain * mySwapChain
Definition: DtSwapChain.h:247
Definition: DtTemplatedModelInstanceCreator.h:28
Base implementation of a texture swapchain.
Definition: DtSwapChain.h:37
DtGlImageType
Definition: DtGlImageType.h:15
unsigned int myCopyQuadVbo
vbo for draw command used for swapchain fill
Definition: DtSwapChain.h:168
std::map< DtSwapChainTextureType, unsigned int > mySwapChainIndexes
active swapchain index for each format
Definition: DtSwapChain.h:153
unsigned int myWidth
the pixel width of the texture swap chain
Definition: DtSwapChain.h:144
DtDe & myDe
Definition: DtSwapChain.h:242
unsigned int mySrcStencilTexId
the current depth textures stencil view texture id
Definition: DtSwapChain.h:174
Definition: DtSwapChain.h:29
Definition: DtSwapChain.h:30
virtual osg::Object * cloneType() const
Definition: DtSwapChain.h:193
DtExternalTextureAttribute()
Definition: DtSwapChain.h:187
const char int mode
Definition: ioapi.h:38
virtual osg::Object * clone(const osg::CopyOp ©op) const
Definition: DtSwapChain.h:197
unsigned int myLength
the length/number of textures in the swapchain
Definition: DtSwapChain.h:135
The DtDe is the core component of any VR-Vantage application. It owns a DtRenderer, DtDeCommunicator, as well as a DtDisplay and other things.
Definition: DtDe.h:76
unsigned int myHeight
the pixel height of the texture swap chain
Definition: DtSwapChain.h:147
enum representing an OpenGL image type
unsigned int myLayers
the number of layers in the textures i.e. array layers
Definition: DtSwapChain.h:150
vrvVirtualReality::DtEye myEye
Definition: DtSwapChain.h:132
DtDe & myDe
Definition: DtSwapChain.h:179
DtSwapChainTextureType
Definition: DtSwapChain.h:27
bool myUseBlitMode
Definition: DtSwapChain.h:245
std::vector< GLuint > myFbos
fbo for swapchain copy operations
Definition: DtSwapChain.h:156
bool myIsInitialized
Definition: DtSwapChain.h:129
Definition: DtSwapChain.h:184
GLuint myTextureId
Definition: DtSwapChain.h:216