SLProject 4.0.000
SLGLOculusFB Class Reference

Wrapper around Oculus Rift and its Frame Buffer Objects. More...

#include <SLGLOculusFB.h>

Public Member Functions

 SLGLOculusFB ()
 
 ~SLGLOculusFB ()
 
void bindFramebuffer (SLint scrWidth, SLint scrHeight)
 
void drawFramebuffer (SLGLProgram *stereoOculusProgram)
 
void updateSize (SLint scrWidth, SLint scrHeight)
 
SLint width ()
 
SLint halfWidth ()
 
SLint height ()
 
SLuint texID ()
 

Private Member Functions

void dispose ()
 
void generateFBO ()
 

Private Attributes

SLint _width
 
SLint _height
 Width of the buffer. More...
 
SLint _halfWidth
 Height of the buffer. More...
 
SLint _halfHeight
 Half the width of the buffer. More...
 
SLuint _fbID
 Half the height of the buffer. More...
 
SLuint _depthRbID
 OpenGL id of frame buffer. More...
 
SLuint _texID
 OpenGL id of depth render buffer. More...
 
SLGLVertexArray _vao
 OpenGL id of. More...
 

Detailed Description

Wrapper around Oculus Rift and its Frame Buffer Objects.

This class is deprecated since the lib_ovr from Oculus completely changed The lib_ovr that connects the Oculus hardware was removed since it only worked for devkit2 under windows.

Constructor & Destructor Documentation

◆ SLGLOculusFB()

SLGLOculusFB::SLGLOculusFB ( )

Constructor initializing with default values

◆ ~SLGLOculusFB()

SLGLOculusFB::~SLGLOculusFB ( )

Destructor calling dispose

Member Function Documentation

◆ bindFramebuffer()

void SLGLOculusFB::bindFramebuffer ( SLint  scrWidth,
SLint  scrHeight 
)

Activates the frame buffer. On the first time it calls the updateSize to determine the size and then creates the FBO.

◆ dispose()

void SLGLOculusFB::dispose ( )
private

Deletes the buffer object

◆ drawFramebuffer()

void SLGLOculusFB::drawFramebuffer ( SLGLProgram stereoOculusProgram)

Draws the intermediate render target (the texture) into the real framebuffer.

◆ generateFBO()

void SLGLOculusFB::generateFBO ( )
private

Frame Buffer generation. This is called from within updateSize because the frame buffer size has to be calculated first

◆ halfWidth()

SLint SLGLOculusFB::halfWidth ( )
inline

◆ height()

SLint SLGLOculusFB::height ( )
inline

◆ texID()

SLuint SLGLOculusFB::texID ( )
inline

◆ updateSize()

void SLGLOculusFB::updateSize ( SLint  scrWidth,
SLint  scrHeight 
)

Updates everything when the screen gets resized:

  • Recalculates the stereo parameters
  • Creates or updates the FBO
  • Updates the shader uniforms

◆ width()

SLint SLGLOculusFB::width ( )
inline

Member Data Documentation

◆ _depthRbID

SLuint SLGLOculusFB::_depthRbID
private

OpenGL id of frame buffer.

◆ _fbID

SLuint SLGLOculusFB::_fbID
private

Half the height of the buffer.

◆ _halfHeight

SLint SLGLOculusFB::_halfHeight
private

Half the width of the buffer.

◆ _halfWidth

SLint SLGLOculusFB::_halfWidth
private

Height of the buffer.

◆ _height

SLint SLGLOculusFB::_height
private

Width of the buffer.

◆ _texID

SLuint SLGLOculusFB::_texID
private

OpenGL id of depth render buffer.

◆ _vao

SLGLVertexArray SLGLOculusFB::_vao
private

OpenGL id of.

◆ _width

SLint SLGLOculusFB::_width
private

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