cgv
Loading...
Searching...
No Matches
gl_vr_display.h
1#pragma once
2
3#include <vector>
4#include <string>
5
6#include "lib_begin.h"
7
10
11
13namespace vr {
16 ES_BOTH,
17 ES_LEFT,
18 ES_RIGHT
19 };
20
21
24 class CGV_API gl_vr_display
25 {
26 private:
27 int vp[4];
28 int old_msaa;
29 protected:
31 unsigned width, height, nr_multi_samples;
34 unsigned multi_tex_id[2];
35 unsigned multi_fbo_id[2];
36 unsigned tex_id[2];
37 unsigned fbo_id[2];
38
39 friend class vr_wall_kit;
41 std::string last_error;
42 public:
44 gl_vr_display(unsigned _width, unsigned _height, unsigned _nr_multi_samples);
46 virtual ~gl_vr_display();
48 const std::string& get_last_error() const;
50 int get_width() const;
52 int get_height() const;
54 virtual void set_size(int new_width, int new_height);
56 virtual bool init_fbos(EyeSelection es = ES_BOTH);
58 virtual bool blit_fbo(int eye, int x, int y, int w, int h);
60 virtual bool fbos_initialized(EyeSelection es = ES_BOTH) const;
62 virtual void destruct_fbos(EyeSelection es = ES_BOTH);
64 virtual void enable_fbo(int eye);
66 virtual void disable_fbo(int eye);
68 virtual void bind_texture(int eye);
69 };
70}
71
73
74#include <cgv/config/lib_end.h>
std::string last_error
store last error message
virtual bool blit_fbo(int eye, int x, int y, int w, int h)
initialize render targets and framebuffer objects in current opengl context
gl_vr_display(unsigned _width, unsigned _height, unsigned _nr_multi_samples)
construct
const std::string & get_last_error() const
return last error of vr_kit
virtual void disable_fbo(int eye)
disable the framebuffer object of given eye
int get_width() const
return width in pixel of view
virtual void bind_texture(int eye)
bind texture of given eye to current texture unit
virtual void enable_fbo(int eye)
enable the framebuffer object of given eye (0..left, 1..right)
int get_height() const
return height in pixel of view
unsigned width
pixel dimensions of render targets
virtual void set_size(int new_width, int new_height)
allow to set a different size
virtual void destruct_fbos(EyeSelection es=ES_BOTH)
destruct render targets and framebuffer objects in current opengl context
virtual bool init_fbos(EyeSelection es=ES_BOTH)
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
unsigned multi_depth_buffer_id[2]
ids of gl render objects
the vr namespace for virtual reality support
EyeSelection
enum to support restriction of eyes to a single eye