SLProject  4.2.000
A platform independent 3D computer graphics framework for desktop OS, Android, iOS and online in web browsers
SLGLOculusFB.h
Go to the documentation of this file.
1 /**
2  * \file SLGLOculusFB.h
3  * \brief OpenGL Frame Buffer Object for the Oculus Rift Display
4  * \date August 2014
5  * \authors Marc Wacker, Marcus Hudritsch
6  * \copyright http://opensource.org/licenses/GPL-3.0
7  * \remarks Please use clangformat to format the code. See more code style on
8  * https://github.com/cpvrlab/SLProject4/wiki/SLProject-Coding-Style
9 */
10 
11 #ifndef SLGLOCULUSFB_H
12 #define SLGLOCULUSFB_H
13 
14 #include <SLCamera.h>
15 #include <SLGLVertexArray.h>
16 
17 class SLGLProgram;
18 //-----------------------------------------------------------------------------
19 //! Wrapper around Oculus Rift and its Frame Buffer Objects
20 /*! This class is deprecated since the lib_ovr from Oculus completely changed
21 The lib_ovr that connects the Oculus hardware was removed since it only worked
22 for devkit2 under windows.
23 */
25 {
26 public:
27  SLGLOculusFB();
28  ~SLGLOculusFB();
29 
32  void drawFramebuffer(SLGLProgram* stereoOculusProgram);
35 
36  // Getters
37  SLint width() { return _width; }
38  SLint halfWidth() { return _halfWidth; }
39  SLint height() { return _height; }
40  SLuint texID() { return _texID; }
41 
42 private:
43  void dispose();
44  void generateFBO();
45 
46  SLint _width; //! Width of the buffer
47  SLint _height; //! Height of the buffer
48  SLint _halfWidth; //! Half the width of the buffer
49  SLint _halfHeight; //! Half the height of the buffer
50  SLuint _fbID; //! OpenGL id of frame buffer
51  SLuint _depthRbID; //! OpenGL id of depth render buffer
52  SLuint _texID; //! OpenGL id of
53  SLGLVertexArray _vao; //! Vertex array object for the rendering
54 };
55 //-----------------------------------------------------------------------------
56 
57 #endif
static SLint scrHeight
Window height at start up.
Definition: AppGLFW.cpp:38
static SLint scrWidth
Window width at start up.
Definition: AppGLFW.cpp:37
unsigned int SLuint
Definition: SL.h:171
int SLint
Definition: SL.h:170
Wrapper class around OpenGL Vertex Array Objects (VAO)
Wrapper around Oculus Rift and its Frame Buffer Objects.
Definition: SLGLOculusFB.h:25
SLint height()
Definition: SLGLOculusFB.h:39
void generateFBO()
void updateSize(SLint scrWidth, SLint scrHeight)
SLint _halfHeight
Half the width of the buffer.
Definition: SLGLOculusFB.h:49
SLuint texID()
Definition: SLGLOculusFB.h:40
SLint halfWidth()
Definition: SLGLOculusFB.h:38
SLuint _fbID
Half the height of the buffer.
Definition: SLGLOculusFB.h:50
SLint _height
Width of the buffer.
Definition: SLGLOculusFB.h:47
void bindFramebuffer(SLint scrWidth, SLint scrHeight)
void drawFramebuffer(SLGLProgram *stereoOculusProgram)
SLGLVertexArray _vao
OpenGL id of.
Definition: SLGLOculusFB.h:53
SLint width()
Definition: SLGLOculusFB.h:37
SLuint _depthRbID
OpenGL id of frame buffer.
Definition: SLGLOculusFB.h:51
SLint _halfWidth
Height of the buffer.
Definition: SLGLOculusFB.h:48
SLuint _texID
OpenGL id of depth render buffer.
Definition: SLGLOculusFB.h:52
Encapsulation of an OpenGL shader program object.
Definition: SLGLProgram.h:56
SLGLVertexArray encapsulates the core OpenGL drawing.