gtsam_points
Loading...
Searching...
No Matches
include
glk
frame_buffer.hpp
Go to the documentation of this file.
1
#ifndef GLK_FRAME_BUFFER_HPP
2
#define GLK_FRAME_BUFFER_HPP
3
4
#include <memory>
5
#include <GL/gl3w.h>
6
#include <Eigen/Core>
7
8
#include <
glk/texture.hpp
>
9
10
namespace
glk
{
11
12
class
FrameBuffer
{
13
public
:
14
FrameBuffer
(
const
Eigen::Vector2i&
size
,
int
num_color_buffers
= 1,
bool
use_depth =
true
);
15
16
~FrameBuffer
();
17
18
void
bind
();
19
void
unbind
()
const
;
20
21
int
num_color_buffers
()
const
;
22
glk::Texture
&
add_color_buffer
(
int
layout, GLuint internal_format, GLuint format, GLuint type);
23
glk::Texture
&
add_depth_buffer
(GLuint internal_format = GL_DEPTH_COMPONENT32F, GLuint format = GL_DEPTH_COMPONENT, GLuint type = GL_FLOAT);
24
25
void
bind_ext_depth_buffer
(
const
glk::Texture
& depth_texture);
26
27
Eigen::Vector2i
size
()
const
;
28
void
set_size
(
const
Eigen::Vector2i&
size
);
29
30
const
Texture
&
color
()
const
;
31
const
Texture
&
color
(
int
i)
const
;
32
const
Texture
&
depth
()
const
;
33
34
Texture
&
color
();
35
Texture
&
color
(
int
i);
36
Texture
&
depth
();
37
38
private
:
39
int
width;
40
int
height;
41
42
GLint viewport[4];
43
44
std::vector<GLenum> color_attachments;
45
std::vector<int> color_buffer_layouts;
46
std::vector<std::shared_ptr<Texture>> color_buffers;
47
std::shared_ptr<Texture> depth_buffer;
48
49
GLuint frame_buffer;
50
};
51
52
}
// namespace glk
53
54
#endif
glk::FrameBuffer
Definition
frame_buffer.hpp:12
glk::FrameBuffer::color
const Texture & color() const
glk::FrameBuffer::unbind
void unbind() const
glk::FrameBuffer::size
Eigen::Vector2i size() const
glk::FrameBuffer::add_depth_buffer
glk::Texture & add_depth_buffer(GLuint internal_format=GL_DEPTH_COMPONENT32F, GLuint format=GL_DEPTH_COMPONENT, GLuint type=GL_FLOAT)
glk::FrameBuffer::~FrameBuffer
~FrameBuffer()
glk::FrameBuffer::color
Texture & color(int i)
glk::FrameBuffer::depth
const Texture & depth() const
glk::FrameBuffer::color
Texture & color()
glk::FrameBuffer::FrameBuffer
FrameBuffer(const Eigen::Vector2i &size, int num_color_buffers=1, bool use_depth=true)
glk::FrameBuffer::bind
void bind()
glk::FrameBuffer::num_color_buffers
int num_color_buffers() const
glk::FrameBuffer::bind_ext_depth_buffer
void bind_ext_depth_buffer(const glk::Texture &depth_texture)
glk::FrameBuffer::set_size
void set_size(const Eigen::Vector2i &size)
glk::FrameBuffer::depth
Texture & depth()
glk::FrameBuffer::add_color_buffer
glk::Texture & add_color_buffer(int layout, GLuint internal_format, GLuint format, GLuint type)
glk::FrameBuffer::color
const Texture & color(int i) const
glk::Texture
Definition
texture.hpp:10
glk
Definition
async_buffer_copy.hpp:6
texture.hpp
Generated by
1.9.8