![]() |
VR-Forces Developer's Guide
|
Base implementation of a texture swapchain.

Protected Member Functions | |
| virtual bool | initaliseFbos () const |
| virtual bool | initCopyProgram (bool copyDepth, bool copyStencil, bool copySrcAlpha, bool srcIsArray) const |
| virtual bool | initBlendProgram () const |
Protected Attributes | |
| bool | myIsInitialized |
| vrvVirtualReality::DtEye | myEye |
| unsigned int | myLength |
| std::vector < DtSwapChainTextureType > | myTextureTypes |
| std::vector< DtGlImageType > | myFormats |
| unsigned int | myWidth |
| unsigned int | myHeight |
| unsigned int | myLayers |
| std::map < DtSwapChainTextureType, unsigned int > | mySwapChainIndexes |
| std::vector< GLuint > | myFbos |
| DtGlProgram * | myCopyProgram |
| int | myLastCopyProgramConfig |
| osg::ref_ptr< osg::StateSet > | myCopyStateSet |
| unsigned int | myCopyQuadVbo |
| unsigned int | myLastStencilTexId |
| unsigned int | mySrcStencilTexId |
| DtGlProgram * | myBlendProgram |
| DtDe & | myDe |
Private Member Functions | |
| DtSwapChain () | |
| DtSwapChain (const DtSwapChain &orig) | |
| DtSwapChain & | operator= (const DtSwapChain &) |
|
private |
prevent default constructor
|
private |
prevent copy construction
| makVrv::DtSwapChain::DtSwapChain | ( | DtDe & | de, |
| vrvVirtualReality::DtEye | eye | ||
| ) |
CTOR takes the post processor, eye to submit for and the VR driver.
|
virtual |
DTOR.
|
private |
prevent assignment
|
virtual |
create our swap chain with the requested format, deleting any existing one
Reimplemented in makVrv::DtVarjoSwapChain, makVrv::DtOculusSwapChain, makVrv::DtOpenVRSwapChain, and makVrv::DtXtalSwapChain.
|
virtual |
add a swap chain of the specified format, initalise needs to have been called first to set dimensions
Reimplemented in makVrv::DtVarjoSwapChain, makVrv::DtOculusSwapChain, makVrv::DtOpenVRSwapChain, and makVrv::DtXtalSwapChain.
|
pure virtual |
acquire the textures from the swap chain for this frame, storing the index in mySwapChainIndexes
Implemented in makVrv::DtVarjoSwapChain, makVrv::DtOculusSwapChain, makVrv::DtOpenVRSwapChain, and makVrv::DtXtalSwapChain.
| unsigned int makVrv::DtSwapChain::getAcquiredIndex | ( | DtSwapChainTextureType | type | ) | const |
use basic texture type to get acquired index
|
pure virtual |
return the GL texture id of the color swapchain texture at index, pass -1 for currently aquired
Implemented in makVrv::DtVarjoSwapChain, makVrv::DtOculusSwapChain, makVrv::DtOpenVRSwapChain, and makVrv::DtXtalSwapChain.
|
pure virtual |
release the current swapchain texture
Implemented in makVrv::DtVarjoSwapChain, makVrv::DtOculusSwapChain, makVrv::DtOpenVRSwapChain, and makVrv::DtXtalSwapChain.
| bool makVrv::DtSwapChain::isInitialized | ( | ) | const |
has the swapchainb initalised properly
| DtSwapChainTextureType makVrv::DtSwapChain::type | ( | unsigned int | index | ) | const |
format of the swapchain textures
| DtGlImageType makVrv::DtSwapChain::format | ( | unsigned int | index | ) | const |
format of the swapchain textures
| DtGlImageType makVrv::DtSwapChain::format | ( | DtSwapChainTextureType | type | ) | const |
returns the format used by the texture type
| vrvVirtualReality::DtEye makVrv::DtSwapChain::eye | ( | ) | const |
return the eye this swapchain is handling
return fbo for the swap chain texture at index
|
virtual |
copy the color texture to the color swapchain using the stencil as the source for alpha
|
virtual |
blit the currently aquired texture to the default framebuffer, it's recommended you call this before aquiring a new textur essentially it's best to blit the last frames texture
Reimplemented in makVrv::DtOculusSwapChain.
|
virtual |
blend two swapchains into this one
|
protectedvirtual |
initalise the FBOs using the available swapchain types. An FBO will be created for each texture in the swapchain. If there are color and depth swap chains the swapchain will also bind the depth texture to the fbos
|
protectedvirtual |
compile copy shader program
|
protectedvirtual |
compile the blend shader program
|
protected |
|
protected |
the length/number of textures in the swapchain
|
protected |
the type of the texture swap chain
|
protected |
the format of the texture swap chain
the pixel width of the texture swap chain
the pixel height of the texture swap chain
the number of layers in the textures i.e. array layers
|
mutableprotected |
active swapchain index for each format
|
mutableprotected |
fbo for swapchain copy operations
|
mutableprotected |
shader to copy sources texture into swapchain
|
mutableprotected |
the bit mask for the last complied version of the copy program
|
mutableprotected |
state set to encapsulate state changes when doing swapchain fill
vbo for draw command used for swapchain fill
the current source depth texture id, tracked so we can recreate stencil view if it changes
the current depth textures stencil view texture id
|
mutableprotected |
shader to blend two swapchains into one (scene and overlay)
|
protected |