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 };
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;
33 unsigned multi_depth_buffer_id[2];
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>
implements offscreen rendering
std::string last_error
store last error message
unsigned width
pixel dimensions of render targets
the vr namespace for virtual reality support
EyeSelection
enum to support restriction of eyes to a single eye