cgv
Loading...
Searching...
No Matches
vr::gl_vr_display Class Reference

implements offscreen rendering More...

#include <gl_vr_display.h>

Inheritance diagram for vr::gl_vr_display:
vr::vr_kit vr_emulated_kit

Public Member Functions

 gl_vr_display (unsigned _width, unsigned _height, unsigned _nr_multi_samples)
 construct
 
virtual ~gl_vr_display ()
 declare virtual destructor
 
const std::string & get_last_error () const
 return last error of vr_kit
 
int get_width () const
 return width in pixel of view
 
int get_height () const
 return height in pixel of view
 
virtual void set_size (int new_width, int new_height)
 allow to set a different size
 
virtual bool init_fbos (EyeSelection es=ES_BOTH)
 initialize render targets and framebuffer objects in current opengl context
 
virtual bool blit_fbo (int eye, int x, int y, int w, int h)
 initialize render targets and framebuffer objects in current opengl context
 
virtual bool fbos_initialized (EyeSelection es=ES_BOTH) const
 check whether fbos have been initialized
 
virtual void destruct_fbos (EyeSelection es=ES_BOTH)
 destruct render targets and framebuffer objects in current opengl context
 
virtual void enable_fbo (int eye)
 enable the framebuffer object of given eye (0..left, 1..right)
 
virtual void disable_fbo (int eye)
 disable the framebuffer object of given eye
 
virtual void bind_texture (int eye)
 bind texture of given eye to current texture unit
 

Protected Attributes

unsigned width
 pixel dimensions of render targets
 
unsigned height
 
unsigned nr_multi_samples
 
unsigned multi_depth_buffer_id [2]
 ids of gl render objects
 
unsigned multi_tex_id [2]
 
unsigned multi_fbo_id [2]
 
unsigned tex_id [2]
 
unsigned fbo_id [2]
 
std::string last_error
 store last error message
 

Friends

class vr_wall_kit
 

Detailed Description

implements offscreen rendering

vr_kit derives from gl_vr_display to provide offscreen rendering vor openvr driver as well as for the vr_emulated_kit of the vr_emulator. Implements the init_fbos(), enable_fbos(), disable_fbos(), destruct_fbos() and blit_fbo() functions with opengl and glew only.

Definition at line 24 of file gl_vr_display.h.

Constructor & Destructor Documentation

◆ gl_vr_display()

vr::gl_vr_display::gl_vr_display ( unsigned  _width,
unsigned  _height,
unsigned  _nr_multi_samples 
)

construct

Definition at line 8 of file gl_vr_display.cxx.

References multi_depth_buffer_id.

◆ ~gl_vr_display()

vr::gl_vr_display::~gl_vr_display ( )
virtual

declare virtual destructor

Definition at line 21 of file gl_vr_display.cxx.

Member Function Documentation

◆ bind_texture()

void vr::gl_vr_display::bind_texture ( int  eye)
virtual

bind texture of given eye to current texture unit

Definition at line 144 of file gl_vr_display.cxx.

◆ blit_fbo()

bool vr::gl_vr_display::blit_fbo ( int  eye,
int  x,
int  y,
int  w,
int  h 
)
virtual

initialize render targets and framebuffer objects in current opengl context

Definition at line 162 of file gl_vr_display.cxx.

References width.

Referenced by vr_view_interactor::after_finish().

◆ destruct_fbos()

void vr::gl_vr_display::destruct_fbos ( EyeSelection  es = ES_BOTH)
virtual

destruct render targets and framebuffer objects in current opengl context

Definition at line 64 of file gl_vr_display.cxx.

References multi_depth_buffer_id.

Referenced by init_fbos().

◆ disable_fbo()

void vr::gl_vr_display::disable_fbo ( int  eye)
virtual

disable the framebuffer object of given eye

Definition at line 172 of file gl_vr_display.cxx.

References width.

Referenced by vr_view_interactor::after_finish().

◆ enable_fbo()

void vr::gl_vr_display::enable_fbo ( int  eye)
virtual

enable the framebuffer object of given eye (0..left, 1..right)

Definition at line 150 of file gl_vr_display.cxx.

References width.

◆ fbos_initialized()

bool vr::gl_vr_display::fbos_initialized ( EyeSelection  es = ES_BOTH) const
virtual

check whether fbos have been initialized

Definition at line 50 of file gl_vr_display.cxx.

◆ get_height()

int vr::gl_vr_display::get_height ( ) const

return height in pixel of view

Definition at line 44 of file gl_vr_display.cxx.

Referenced by vr_view_interactor::after_finish().

◆ get_last_error()

const std::string & vr::gl_vr_display::get_last_error ( ) const

return last error of vr_kit

Definition at line 26 of file gl_vr_display.cxx.

References last_error.

◆ get_width()

int vr::gl_vr_display::get_width ( ) const

return width in pixel of view

Definition at line 39 of file gl_vr_display.cxx.

References width.

Referenced by vr_view_interactor::after_finish().

◆ init_fbos()

bool vr::gl_vr_display::init_fbos ( EyeSelection  es = ES_BOTH)
virtual

initialize render targets and framebuffer objects in current opengl context

Definition at line 95 of file gl_vr_display.cxx.

References destruct_fbos(), last_error, multi_depth_buffer_id, and width.

◆ set_size()

void vr::gl_vr_display::set_size ( int  new_width,
int  new_height 
)
virtual

allow to set a different size

Definition at line 32 of file gl_vr_display.cxx.

References width.

Friends And Related Symbol Documentation

◆ vr_wall_kit

friend class vr_wall_kit
friend

Definition at line 39 of file gl_vr_display.h.

Member Data Documentation

◆ fbo_id

unsigned vr::gl_vr_display::fbo_id[2]
protected

Definition at line 37 of file gl_vr_display.h.

◆ height

unsigned vr::gl_vr_display::height
protected

Definition at line 31 of file gl_vr_display.h.

◆ last_error

std::string vr::gl_vr_display::last_error
protected

store last error message

Definition at line 41 of file gl_vr_display.h.

Referenced by get_last_error(), and init_fbos().

◆ multi_depth_buffer_id

unsigned vr::gl_vr_display::multi_depth_buffer_id[2]
protected

ids of gl render objects

Definition at line 33 of file gl_vr_display.h.

Referenced by destruct_fbos(), gl_vr_display(), and init_fbos().

◆ multi_fbo_id

unsigned vr::gl_vr_display::multi_fbo_id[2]
protected

Definition at line 35 of file gl_vr_display.h.

◆ multi_tex_id

unsigned vr::gl_vr_display::multi_tex_id[2]
protected

Definition at line 34 of file gl_vr_display.h.

◆ nr_multi_samples

unsigned vr::gl_vr_display::nr_multi_samples
protected

Definition at line 31 of file gl_vr_display.h.

◆ tex_id

unsigned vr::gl_vr_display::tex_id[2]
protected

Definition at line 36 of file gl_vr_display.h.

◆ width

unsigned vr::gl_vr_display::width
protected

pixel dimensions of render targets

Definition at line 31 of file gl_vr_display.h.

Referenced by blit_fbo(), disable_fbo(), enable_fbo(), get_width(), init_fbos(), vr_emulated_kit::put_projection_matrix(), and set_size().


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